From 407539763ac39e0dc28ba5cffeb57253c2be1b76 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 19:14:46 +0000 Subject: libgtop2-2.38.0 base --- diff --git a/ABOUT-NLS b/ABOUT-NLS new file mode 100644 index 0000000..b1de1b6 --- /dev/null +++ b/ABOUT-NLS @@ -0,0 +1,1282 @@ +1 Notes 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 free software 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 on translations can contact the appropriate team. + +1.1 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. Installers may use special +options at configuration time for changing the default behaviour. The +command: + + ./configure --disable-nls + +will _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' library +and will decide to use it. If not, you may have to to use the +`--with-libintl-prefix' option to tell `configure' where to look for it. + + Internationalized packages usually have 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. + +1.2 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. If you happen to have the `LC_ALL' or some other +`LC_xxx' environment variables set, you should unset them before +setting `LANG', otherwise the setting of `LANG' will not have the +desired effect. 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 language 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'. + + Special advice for Norwegian users: The language code for Norwegian +bokma*l changed from `no' to `nb' recently (in 2003). During the +transition period, while some message catalogs for this language are +installed under `nb' and some older ones under `no', it's recommended +for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and +older translations are used. + + 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. + +1.3 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://translationproject.org/', in the "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 `coordinator@translationproject.org' 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 skills are praised more than +programming skills, here. + +1.4 Available Packages +====================== + +Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of June +2010. 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 af am an ar as ast az be be@latin bg bn_IN bs ca + +--------------------------------------------------+ + a2ps | [] [] | + aegis | | + ant-phone | | + anubis | | + aspell | [] [] | + bash | | + bfd | | + bibshelf | [] | + binutils | | + bison | | + bison-runtime | [] | + bluez-pin | [] [] | + bombono-dvd | | + buzztard | | + cflow | | + clisp | | + coreutils | [] [] | + cpio | | + cppi | | + cpplib | [] | + cryptsetup | | + dfarc | | + dialog | [] [] | + dico | | + diffutils | [] | + dink | | + doodle | | + e2fsprogs | [] | + enscript | [] | + exif | | + fetchmail | [] | + findutils | [] | + flex | [] | + freedink | | + gas | | + gawk | [] [] | + gcal | [] | + gcc | | + gettext-examples | [] [] [] [] | + gettext-runtime | [] [] | + gettext-tools | [] [] | + gip | [] | + gjay | | + gliv | [] | + glunarclock | [] [] | + gnubiff | | + gnucash | [] | + gnuedu | | + gnulib | | + gnunet | | + gnunet-gtk | | + gnutls | | + gold | | + gpe-aerial | | + gpe-beam | | + gpe-bluetooth | | + gpe-calendar | | + gpe-clock | [] | + gpe-conf | | + gpe-contacts | | + gpe-edit | | + gpe-filemanager | | + gpe-go | | + gpe-login | | + gpe-ownerinfo | [] | + gpe-package | | + gpe-sketchbook | | + gpe-su | [] | + gpe-taskmanager | [] | + gpe-timesheet | [] | + gpe-today | [] | + gpe-todo | | + gphoto2 | | + gprof | [] | + gpsdrive | | + gramadoir | | + grep | | + grub | [] [] | + gsasl | | + gss | | + gst-plugins-bad | [] | + gst-plugins-base | [] | + gst-plugins-good | [] | + gst-plugins-ugly | [] | + gstreamer | [] [] [] | + gtick | | + gtkam | [] | + gtkorphan | [] | + gtkspell | [] [] [] | + gutenprint | | + hello | [] | + help2man | | + hylafax | | + idutils | | + indent | [] [] | + iso_15924 | | + iso_3166 | [] [] [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | | + iso_639 | [] [] [] [] | + iso_639_3 | | + jwhois | | + kbd | | + keytouch | [] | + keytouch-editor | | + keytouch-keyboa... | [] | + klavaro | [] | + latrine | | + ld | [] | + leafpad | [] [] | + libc | [] [] | + libexif | () | + libextractor | | + libgnutls | | + libgpewidget | | + libgpg-error | | + libgphoto2 | | + libgphoto2_port | | + libgsasl | | + libiconv | [] | + libidn | | + lifelines | | + liferea | [] [] | + lilypond | | + linkdr | [] | + lordsawar | | + lprng | | + lynx | [] | + m4 | | + mailfromd | | + mailutils | | + make | | + man-db | | + man-db-manpages | | + minicom | | + mkisofs | | + myserver | | + nano | [] [] | + opcodes | | + parted | | + pies | | + popt | | + psmisc | | + pspp | [] | + pwdutils | | + radius | [] | + recode | [] [] | + rosegarden | | + rpm | | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] [] | + sed | [] [] | + sharutils | [] [] | + shishi | | + skencil | | + solfege | | + solfege-manual | | + soundtracker | | + sp | | + sysstat | | + tar | [] | + texinfo | | + tin | | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] | + vice | | + vmm | | + vorbis-tools | | + wastesedge | | + wdiff | | + wget | [] [] | + wyslij-po | | + xchat | [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] | + +--------------------------------------------------+ + af am an ar as ast az be be@latin bg bn_IN bs ca + 6 0 1 2 3 19 1 10 3 28 3 1 38 + + crh cs da de el en en_GB en_ZA eo es et eu fa + +-------------------------------------------------+ + a2ps | [] [] [] [] [] [] [] | + aegis | [] [] [] | + ant-phone | [] () | + anubis | [] [] | + aspell | [] [] [] [] [] | + bash | [] [] [] | + bfd | [] | + bibshelf | [] [] [] | + binutils | [] | + bison | [] [] | + bison-runtime | [] [] [] [] | + bluez-pin | [] [] [] [] [] [] | + bombono-dvd | [] | + buzztard | [] [] [] | + cflow | [] [] | + clisp | [] [] [] [] | + coreutils | [] [] [] [] | + cpio | | + cppi | | + cpplib | [] [] [] | + cryptsetup | [] | + dfarc | [] [] [] | + dialog | [] [] [] [] [] | + dico | | + diffutils | [] [] [] [] [] [] | + dink | [] [] [] | + doodle | [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] | + exif | () [] [] | + fetchmail | [] [] () [] [] [] | + findutils | [] [] [] | + flex | [] [] | + freedink | [] [] [] | + gas | [] | + gawk | [] [] [] | + gcal | [] | + gcc | [] [] | + gettext-examples | [] [] [] [] | + gettext-runtime | [] [] [] [] | + gettext-tools | [] [] [] | + gip | [] [] [] [] | + gjay | [] | + gliv | [] [] [] | + glunarclock | [] [] | + gnubiff | () | + gnucash | [] () () () () | + gnuedu | [] [] | + gnulib | [] [] | + gnunet | | + gnunet-gtk | [] | + gnutls | [] [] | + gold | [] | + gpe-aerial | [] [] [] [] | + gpe-beam | [] [] [] [] | + gpe-bluetooth | [] [] | + gpe-calendar | [] | + gpe-clock | [] [] [] [] | + gpe-conf | [] [] [] | + gpe-contacts | [] [] [] | + gpe-edit | [] [] | + gpe-filemanager | [] [] [] | + gpe-go | [] [] [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] [] [] | + gpe-package | [] [] [] | + gpe-sketchbook | [] [] [] [] | + gpe-su | [] [] [] [] | + gpe-taskmanager | [] [] [] [] | + gpe-timesheet | [] [] [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] [] [] | + gphoto2 | [] [] () [] [] [] | + gprof | [] [] [] | + gpsdrive | [] [] [] | + gramadoir | [] [] [] | + grep | [] | + grub | [] [] | + gsasl | [] | + gss | | + gst-plugins-bad | [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] () [] | + gtkam | [] [] () [] [] | + gtkorphan | [] [] [] [] | + gtkspell | [] [] [] [] [] [] [] | + gutenprint | [] [] [] | + hello | [] [] [] [] | + help2man | [] | + hylafax | [] [] | + idutils | [] [] | + indent | [] [] [] [] [] [] [] | + iso_15924 | [] () [] [] | + iso_3166 | [] [] [] [] () [] [] [] () | + iso_3166_2 | () | + iso_4217 | [] [] [] () [] [] | + iso_639 | [] [] [] [] () [] [] | + iso_639_3 | [] | + jwhois | [] | + kbd | [] [] [] [] [] | + keytouch | [] [] | + keytouch-editor | [] [] | + keytouch-keyboa... | [] | + klavaro | [] [] [] [] | + latrine | [] () | + ld | [] [] | + leafpad | [] [] [] [] [] [] | + libc | [] [] [] [] | + libexif | [] [] () | + libextractor | | + libgnutls | [] | + libgpewidget | [] [] | + libgpg-error | [] [] | + libgphoto2 | [] () | + libgphoto2_port | [] () [] | + libgsasl | | + libiconv | [] [] [] [] [] | + libidn | [] [] [] | + lifelines | [] () | + liferea | [] [] [] [] [] | + lilypond | [] [] [] | + linkdr | [] [] [] | + lordsawar | [] | + lprng | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailfromd | | + mailutils | [] | + make | [] [] [] | + man-db | | + man-db-manpages | | + minicom | [] [] [] [] | + mkisofs | | + myserver | | + nano | [] [] [] | + opcodes | [] [] | + parted | [] [] | + pies | | + popt | [] [] [] [] [] | + psmisc | [] [] [] | + pspp | [] | + pwdutils | [] | + radius | [] | + recode | [] [] [] [] [] [] | + rosegarden | () () () | + rpm | [] [] [] | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] [] [] [] | + sed | [] [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | | + skencil | [] () [] | + solfege | [] [] [] | + solfege-manual | [] [] | + soundtracker | [] [] [] | + sp | [] | + sysstat | [] [] [] | + tar | [] [] [] [] | + texinfo | [] [] [] | + tin | [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] [] [] [] | + vice | () () | + vmm | [] | + vorbis-tools | [] [] | + wastesedge | [] | + wdiff | [] [] | + wget | [] [] [] | + wyslij-po | | + xchat | [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] [] | + +-------------------------------------------------+ + crh cs da de el en en_GB en_ZA eo es et eu fa + 5 64 105 117 18 1 8 0 28 89 18 19 0 + + fi fr ga gl gu he hi hr hu hy id is it ja ka kn + +----------------------------------------------------+ + a2ps | [] [] [] [] | + aegis | [] [] | + ant-phone | [] [] | + anubis | [] [] [] [] | + aspell | [] [] [] [] | + bash | [] [] [] [] | + bfd | [] [] [] | + bibshelf | [] [] [] [] [] | + binutils | [] [] [] | + bison | [] [] [] [] | + bison-runtime | [] [] [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] [] | + bombono-dvd | [] | + buzztard | [] | + cflow | [] [] [] | + clisp | [] | + coreutils | [] [] [] [] [] | + cpio | [] [] [] [] | + cppi | [] [] | + cpplib | [] [] [] | + cryptsetup | [] [] [] | + dfarc | [] [] [] | + dialog | [] [] [] [] [] [] [] | + dico | | + diffutils | [] [] [] [] [] [] [] [] [] | + dink | [] | + doodle | [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] | + exif | [] [] [] [] [] [] | + fetchmail | [] [] [] [] | + findutils | [] [] [] [] [] [] | + flex | [] [] [] | + freedink | [] [] [] | + gas | [] [] | + gawk | [] [] [] [] () [] | + gcal | [] | + gcc | [] | + gettext-examples | [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] | + gettext-tools | [] [] [] [] | + gip | [] [] [] [] [] [] | + gjay | [] | + gliv | [] () | + glunarclock | [] [] [] [] | + gnubiff | () [] () | + gnucash | () () () () () [] | + gnuedu | [] [] | + gnulib | [] [] [] [] [] [] | + gnunet | | + gnunet-gtk | [] | + gnutls | [] [] | + gold | [] [] | + gpe-aerial | [] [] [] | + gpe-beam | [] [] [] [] | + gpe-bluetooth | [] [] [] [] | + gpe-calendar | [] [] | + gpe-clock | [] [] [] [] [] | + gpe-conf | [] [] [] [] | + gpe-contacts | [] [] [] [] | + gpe-edit | [] [] [] | + gpe-filemanager | [] [] [] [] | + gpe-go | [] [] [] [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] [] [] [] | + gpe-package | [] [] [] | + gpe-sketchbook | [] [] [] [] | + gpe-su | [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] | + gpe-today | [] [] [] [] [] [] [] | + gpe-todo | [] [] [] | + gphoto2 | [] [] [] [] [] [] | + gprof | [] [] [] [] | + gpsdrive | [] [] [] | + gramadoir | [] [] [] | + grep | [] [] | + grub | [] [] [] [] | + gsasl | [] [] [] [] [] | + gss | [] [] [] [] [] | + gst-plugins-bad | [] [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] [] [] [] [] | + gtkam | [] [] [] [] [] | + gtkorphan | [] [] [] | + gtkspell | [] [] [] [] [] [] [] [] [] | + gutenprint | [] [] [] [] | + hello | [] [] [] | + help2man | [] [] | + hylafax | [] | + idutils | [] [] [] [] [] [] | + indent | [] [] [] [] [] [] [] [] | + iso_15924 | [] () [] [] | + iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] | + iso_3166_2 | () [] [] [] | + iso_4217 | [] () [] [] [] [] | + iso_639 | [] () [] [] [] [] [] [] [] | + iso_639_3 | () [] [] | + jwhois | [] [] [] [] [] | + kbd | [] [] | + keytouch | [] [] [] [] [] [] | + keytouch-editor | [] [] [] [] [] | + keytouch-keyboa... | [] [] [] [] [] | + klavaro | [] [] | + latrine | [] [] [] | + ld | [] [] [] [] | + leafpad | [] [] [] [] [] [] [] () | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | | + libgnutls | [] [] | + libgpewidget | [] [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] [] [] | + libgphoto2_port | [] [] [] | + libgsasl | [] [] [] [] [] | + libiconv | [] [] [] [] [] [] | + libidn | [] [] [] [] | + lifelines | () | + liferea | [] [] [] [] | + lilypond | [] [] | + linkdr | [] [] [] [] [] | + lordsawar | | + lprng | [] | + lynx | [] [] [] [] [] | + m4 | [] [] [] [] [] [] | + mailfromd | | + mailutils | [] [] | + make | [] [] [] [] [] [] [] [] [] | + man-db | [] [] | + man-db-manpages | [] | + minicom | [] [] [] [] [] | + mkisofs | [] [] [] [] | + myserver | | + nano | [] [] [] [] [] [] | + opcodes | [] [] [] [] | + parted | [] [] [] [] | + pies | | + popt | [] [] [] [] [] [] [] [] [] | + psmisc | [] [] [] | + pspp | | + pwdutils | [] [] | + radius | [] [] | + recode | [] [] [] [] [] [] [] [] | + rosegarden | () () () () () | + rpm | [] [] | + rush | | + sarg | [] | + screem | [] [] | + scrollkeeper | [] [] [] [] | + sed | [] [] [] [] [] [] [] [] | + sharutils | [] [] [] [] [] [] [] | + shishi | [] | + skencil | [] | + solfege | [] [] [] [] | + solfege-manual | [] [] | + soundtracker | [] [] | + sp | [] () | + sysstat | [] [] [] [] [] | + tar | [] [] [] [] [] [] [] | + texinfo | [] [] [] [] | + tin | [] | + unicode-han-tra... | | + unicode-transla... | [] [] | + util-linux-ng | [] [] [] [] [] [] | + vice | () () () | + vmm | [] | + vorbis-tools | [] | + wastesedge | () () | + wdiff | [] | + wget | [] [] [] [] [] [] [] [] | + wyslij-po | [] [] [] | + xchat | [] [] [] [] [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] | + +----------------------------------------------------+ + fi fr ga gl gu he hi hr hu hy id is it ja ka kn + 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4 + + ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne + +-----------------------------------------------+ + a2ps | [] | + aegis | | + ant-phone | | + anubis | [] [] | + aspell | [] | + bash | | + bfd | | + bibshelf | [] [] | + binutils | | + bison | [] | + bison-runtime | [] [] [] [] [] | + bluez-pin | [] [] [] [] [] | + bombono-dvd | | + buzztard | | + cflow | | + clisp | | + coreutils | [] | + cpio | | + cppi | | + cpplib | | + cryptsetup | | + dfarc | [] | + dialog | [] [] [] [] [] | + dico | | + diffutils | [] [] | + dink | | + doodle | | + e2fsprogs | | + enscript | | + exif | [] | + fetchmail | | + findutils | | + flex | | + freedink | [] | + gas | | + gawk | | + gcal | | + gcc | | + gettext-examples | [] [] [] [] | + gettext-runtime | [] | + gettext-tools | [] | + gip | [] [] | + gjay | | + gliv | | + glunarclock | [] | + gnubiff | | + gnucash | () () () () | + gnuedu | | + gnulib | | + gnunet | | + gnunet-gtk | | + gnutls | [] | + gold | | + gpe-aerial | [] | + gpe-beam | [] | + gpe-bluetooth | [] [] | + gpe-calendar | [] | + gpe-clock | [] [] [] [] [] | + gpe-conf | [] [] | + gpe-contacts | [] [] | + gpe-edit | [] | + gpe-filemanager | [] [] | + gpe-go | [] [] [] | + gpe-login | [] | + gpe-ownerinfo | [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] [] | + gpe-timesheet | [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] [] | + gphoto2 | | + gprof | [] | + gpsdrive | | + gramadoir | | + grep | | + grub | | + gsasl | | + gss | | + gst-plugins-bad | [] [] [] [] | + gst-plugins-base | [] [] | + gst-plugins-good | [] [] | + gst-plugins-ugly | [] [] [] [] [] | + gstreamer | | + gtick | | + gtkam | [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] [] [] [] | + gutenprint | | + hello | [] [] [] | + help2man | | + hylafax | | + idutils | | + indent | | + iso_15924 | [] [] | + iso_3166 | [] [] () [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | [] [] | + iso_639 | [] [] | + iso_639_3 | [] | + jwhois | [] | + kbd | | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | + klavaro | [] | + latrine | [] | + ld | | + leafpad | [] [] [] | + libc | [] | + libexif | | + libextractor | | + libgnutls | [] | + libgpewidget | [] [] | + libgpg-error | | + libgphoto2 | | + libgphoto2_port | | + libgsasl | | + libiconv | | + libidn | | + lifelines | | + liferea | | + lilypond | | + linkdr | | + lordsawar | | + lprng | | + lynx | | + m4 | | + mailfromd | | + mailutils | | + make | [] | + man-db | | + man-db-manpages | | + minicom | [] | + mkisofs | | + myserver | | + nano | [] [] | + opcodes | | + parted | | + pies | | + popt | [] [] [] | + psmisc | | + pspp | | + pwdutils | | + radius | | + recode | | + rosegarden | | + rpm | | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] | + sed | | + sharutils | | + shishi | | + skencil | | + solfege | [] | + solfege-manual | | + soundtracker | | + sp | | + sysstat | [] | + tar | [] | + texinfo | [] | + tin | | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | | + vice | | + vmm | | + vorbis-tools | | + wastesedge | | + wdiff | | + wget | [] | + wyslij-po | | + xchat | [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] | + +-----------------------------------------------+ + ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne + 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1 + + nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr + +---------------------------------------------------+ + a2ps | [] [] [] [] [] [] [] [] | + aegis | [] [] [] | + ant-phone | [] [] | + anubis | [] [] [] | + aspell | [] [] [] [] [] | + bash | [] [] | + bfd | [] | + bibshelf | [] [] | + binutils | [] [] | + bison | [] [] [] | + bison-runtime | [] [] [] [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] [] | + bombono-dvd | [] () | + buzztard | [] [] | + cflow | [] | + clisp | [] [] | + coreutils | [] [] [] [] [] [] | + cpio | [] [] [] | + cppi | [] | + cpplib | [] | + cryptsetup | [] | + dfarc | [] | + dialog | [] [] [] [] | + dico | [] | + diffutils | [] [] [] [] [] [] | + dink | () | + doodle | [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] [] | + exif | [] [] [] () [] | + fetchmail | [] [] [] [] | + findutils | [] [] [] [] [] | + flex | [] [] [] [] [] | + freedink | [] [] | + gas | | + gawk | [] [] [] [] | + gcal | | + gcc | [] | + gettext-examples | [] [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] [] [] [] | + gettext-tools | [] [] [] [] [] [] | + gip | [] [] [] [] [] | + gjay | | + gliv | [] [] [] [] [] [] | + glunarclock | [] [] [] [] [] | + gnubiff | [] () | + gnucash | [] () () () | + gnuedu | [] | + gnulib | [] [] [] [] | + gnunet | | + gnunet-gtk | | + gnutls | [] [] | + gold | | + gpe-aerial | [] [] [] [] [] [] [] | + gpe-beam | [] [] [] [] [] [] [] | + gpe-bluetooth | [] [] | + gpe-calendar | [] [] [] [] | + gpe-clock | [] [] [] [] [] [] [] [] | + gpe-conf | [] [] [] [] [] [] [] | + gpe-contacts | [] [] [] [] [] | + gpe-edit | [] [] [] | + gpe-filemanager | [] [] [] | + gpe-go | [] [] [] [] [] [] [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] [] [] [] [] [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] [] [] [] [] [] | + gpe-su | [] [] [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] [] [] [] | + gpe-today | [] [] [] [] [] [] [] [] | + gpe-todo | [] [] [] [] [] | + gphoto2 | [] [] [] [] [] [] [] [] | + gprof | [] [] [] | + gpsdrive | [] [] | + gramadoir | [] [] | + grep | [] [] [] [] | + grub | [] [] [] | + gsasl | [] [] [] [] | + gss | [] [] [] | + gst-plugins-bad | [] [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] [] [] | + gtkam | [] [] [] [] [] [] | + gtkorphan | [] | + gtkspell | [] [] [] [] [] [] [] [] [] [] | + gutenprint | [] [] | + hello | [] [] [] [] | + help2man | [] [] | + hylafax | [] | + idutils | [] [] [] [] [] | + indent | [] [] [] [] [] [] [] | + iso_15924 | [] [] [] [] | + iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | + iso_3166_2 | [] [] [] | + iso_4217 | [] [] [] [] [] [] [] [] | + iso_639 | [] [] [] [] [] [] [] [] [] | + iso_639_3 | [] [] | + jwhois | [] [] [] [] | + kbd | [] [] [] | + keytouch | [] [] [] | + keytouch-editor | [] [] [] | + keytouch-keyboa... | [] [] [] | + klavaro | [] [] | + latrine | [] [] | + ld | | + leafpad | [] [] [] [] [] [] [] [] [] | + libc | [] [] [] [] | + libexif | [] [] () [] | + libextractor | | + libgnutls | [] [] | + libgpewidget | [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] [] | + libgphoto2_port | [] [] [] [] [] | + libgsasl | [] [] [] [] [] | + libiconv | [] [] [] [] [] | + libidn | [] [] | + lifelines | [] [] | + liferea | [] [] [] [] [] () () [] | + lilypond | [] | + linkdr | [] [] [] | + lordsawar | | + lprng | [] | + lynx | [] [] [] | + m4 | [] [] [] [] [] | + mailfromd | [] | + mailutils | [] | + make | [] [] [] [] | + man-db | [] [] [] | + man-db-manpages | [] [] [] | + minicom | [] [] [] [] | + mkisofs | [] [] [] | + myserver | | + nano | [] [] [] [] | + opcodes | [] [] | + parted | [] [] [] [] | + pies | [] | + popt | [] [] [] [] | + psmisc | [] [] [] | + pspp | [] [] | + pwdutils | [] | + radius | [] [] [] | + recode | [] [] [] [] [] [] [] [] | + rosegarden | () () | + rpm | [] [] [] | + rush | [] [] | + sarg | | + screem | | + scrollkeeper | [] [] [] [] [] [] [] [] | + sed | [] [] [] [] [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | [] | + skencil | [] [] | + solfege | [] [] [] [] | + solfege-manual | [] [] [] | + soundtracker | [] | + sp | | + sysstat | [] [] [] [] | + tar | [] [] [] [] | + texinfo | [] [] [] [] | + tin | [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] [] [] [] [] | + vice | [] | + vmm | [] | + vorbis-tools | [] [] | + wastesedge | [] | + wdiff | [] [] | + wget | [] [] [] [] [] [] [] | + wyslij-po | [] [] [] | + xchat | [] [] [] [] [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] | + +---------------------------------------------------+ + nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr + 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37 + + sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW + +---------------------------------------------------+ + a2ps | [] [] [] [] [] | 27 + aegis | [] | 9 + ant-phone | [] [] [] [] | 9 + anubis | [] [] [] [] | 15 + aspell | [] [] [] | 20 + bash | [] [] [] | 12 + bfd | [] | 6 + bibshelf | [] [] [] | 16 + binutils | [] [] | 8 + bison | [] [] | 12 + bison-runtime | [] [] [] [] [] [] | 29 + bluez-pin | [] [] [] [] [] [] [] [] | 37 + bombono-dvd | [] | 4 + buzztard | [] | 7 + cflow | [] [] [] | 9 + clisp | | 10 + coreutils | [] [] [] [] | 22 + cpio | [] [] [] [] [] [] | 13 + cppi | [] [] | 5 + cpplib | [] [] [] [] [] [] | 14 + cryptsetup | [] [] | 7 + dfarc | [] | 9 + dialog | [] [] [] [] [] [] [] | 30 + dico | [] | 2 + diffutils | [] [] [] [] [] [] | 30 + dink | | 4 + doodle | [] [] | 7 + e2fsprogs | [] [] [] | 11 + enscript | [] [] [] [] | 17 + exif | [] [] [] | 16 + fetchmail | [] [] [] | 17 + findutils | [] [] [] [] [] | 20 + flex | [] [] [] [] | 15 + freedink | [] | 10 + gas | [] | 4 + gawk | [] [] [] [] | 18 + gcal | [] [] | 5 + gcc | [] [] [] | 7 + gettext-examples | [] [] [] [] [] [] [] | 34 + gettext-runtime | [] [] [] [] [] [] [] | 29 + gettext-tools | [] [] [] [] [] [] | 22 + gip | [] [] [] [] | 22 + gjay | [] | 3 + gliv | [] [] [] | 14 + glunarclock | [] [] [] [] [] | 19 + gnubiff | [] [] | 4 + gnucash | () [] () [] () | 10 + gnuedu | [] [] | 7 + gnulib | [] [] [] [] | 16 + gnunet | [] | 1 + gnunet-gtk | [] [] [] | 5 + gnutls | [] [] [] | 10 + gold | [] | 4 + gpe-aerial | [] [] [] | 18 + gpe-beam | [] [] [] | 19 + gpe-bluetooth | [] [] [] | 13 + gpe-calendar | [] [] [] [] | 12 + gpe-clock | [] [] [] [] [] | 28 + gpe-conf | [] [] [] [] | 20 + gpe-contacts | [] [] [] | 17 + gpe-edit | [] [] [] | 12 + gpe-filemanager | [] [] [] [] | 16 + gpe-go | [] [] [] [] [] | 25 + gpe-login | [] [] [] | 11 + gpe-ownerinfo | [] [] [] [] [] | 25 + gpe-package | [] [] [] | 13 + gpe-sketchbook | [] [] [] | 20 + gpe-su | [] [] [] [] [] | 30 + gpe-taskmanager | [] [] [] [] [] | 29 + gpe-timesheet | [] [] [] [] [] | 25 + gpe-today | [] [] [] [] [] [] | 30 + gpe-todo | [] [] [] [] | 17 + gphoto2 | [] [] [] [] [] | 24 + gprof | [] [] [] | 15 + gpsdrive | [] [] [] | 11 + gramadoir | [] [] [] | 11 + grep | [] [] [] | 10 + grub | [] [] [] | 14 + gsasl | [] [] [] [] | 14 + gss | [] [] [] | 11 + gst-plugins-bad | [] [] [] [] | 26 + gst-plugins-base | [] [] [] [] [] | 24 + gst-plugins-good | [] [] [] [] | 24 + gst-plugins-ugly | [] [] [] [] [] | 29 + gstreamer | [] [] [] [] | 22 + gtick | [] [] [] | 13 + gtkam | [] [] [] | 20 + gtkorphan | [] [] [] | 14 + gtkspell | [] [] [] [] [] [] [] [] [] | 45 + gutenprint | [] | 10 + hello | [] [] [] [] [] [] | 21 + help2man | [] [] | 7 + hylafax | [] | 5 + idutils | [] [] [] [] | 17 + indent | [] [] [] [] [] [] | 30 + iso_15924 | () [] () [] [] | 16 + iso_3166 | [] [] () [] [] () [] [] [] () | 53 + iso_3166_2 | () [] () [] | 9 + iso_4217 | [] () [] [] () [] [] | 26 + iso_639 | [] [] [] () [] () [] [] [] [] | 38 + iso_639_3 | [] () | 8 + jwhois | [] [] [] [] [] | 16 + kbd | [] [] [] [] [] | 15 + keytouch | [] [] [] | 16 + keytouch-editor | [] [] [] | 14 + keytouch-keyboa... | [] [] [] | 14 + klavaro | [] | 11 + latrine | [] [] [] | 10 + ld | [] [] [] [] | 11 + leafpad | [] [] [] [] [] [] | 33 + libc | [] [] [] [] [] | 21 + libexif | [] () | 7 + libextractor | [] | 1 + libgnutls | [] [] [] | 9 + libgpewidget | [] [] [] | 14 + libgpg-error | [] [] [] | 9 + libgphoto2 | [] [] | 8 + libgphoto2_port | [] [] [] [] | 14 + libgsasl | [] [] [] | 13 + libiconv | [] [] [] [] | 21 + libidn | () [] [] | 11 + lifelines | [] | 4 + liferea | [] [] [] | 21 + lilypond | [] | 7 + linkdr | [] [] [] [] [] | 17 + lordsawar | | 1 + lprng | [] | 3 + lynx | [] [] [] [] | 17 + m4 | [] [] [] [] | 19 + mailfromd | [] [] | 3 + mailutils | [] | 5 + make | [] [] [] [] | 21 + man-db | [] [] [] | 8 + man-db-manpages | | 4 + minicom | [] [] | 16 + mkisofs | [] [] | 9 + myserver | | 0 + nano | [] [] [] [] | 21 + opcodes | [] [] [] | 11 + parted | [] [] [] [] [] | 15 + pies | [] [] | 3 + popt | [] [] [] [] [] [] | 27 + psmisc | [] [] | 11 + pspp | | 4 + pwdutils | [] [] | 6 + radius | [] [] | 9 + recode | [] [] [] [] | 28 + rosegarden | () | 0 + rpm | [] [] [] | 11 + rush | [] [] | 4 + sarg | | 1 + screem | [] | 3 + scrollkeeper | [] [] [] [] [] | 27 + sed | [] [] [] [] [] | 30 + sharutils | [] [] [] [] [] | 22 + shishi | [] | 3 + skencil | [] [] | 7 + solfege | [] [] [] [] | 16 + solfege-manual | [] | 8 + soundtracker | [] [] [] | 9 + sp | [] | 3 + sysstat | [] [] | 15 + tar | [] [] [] [] [] [] | 23 + texinfo | [] [] [] [] [] | 17 + tin | | 4 + unicode-han-tra... | | 0 + unicode-transla... | | 2 + util-linux-ng | [] [] [] [] | 20 + vice | () () | 1 + vmm | [] | 4 + vorbis-tools | [] | 6 + wastesedge | | 2 + wdiff | [] [] | 7 + wget | [] [] [] [] [] | 26 + wyslij-po | [] [] | 8 + xchat | [] [] [] [] [] [] | 36 + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63 + xkeyboard-config | [] [] [] | 22 + +---------------------------------------------------+ + 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW + 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 + + 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 June 2010 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://translationproject.org/extra/matrix.html'. + +1.5 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 +`coordinator@translationproject.org' to make the `.pot' files available +to the translation teams. + diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..27f1043 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,3 @@ +Martin Baulig (martin@home-of-linux.org) +Drazen Kacar (dave@srce.hr) +Benoît Dejean (tazforever@dlfp.org) diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..623b625 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + 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. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..2385c82 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,4100 @@ +2007-05-19 Benoît Dejean + + * features.def: + * include/glibtop/proclist.h: + + Small API change. + get_proclist returns pid_t instead of unsigned for consistency. + I have checked many archs and this doesn't break the ABI. + +2007-05-17 Benoît Dejean + + * configure.in: + + Bumped version number. + +2007-05-14 Benoît Dejean + + * include/glibtop/Makefile.am: + * lib/Makefile.am: + + Fixed dist. + +2007-05-13 Benoît Dejean + + * NEWS: + * configure.in: + + Released 2.19.2. + +2007-05-10 Benoît Dejean + + * lib/libgtop.sym: + + Added missing *_p symbols. + +2007-05-07 Benoît Dejean + + * configure.in: + * lib/Makefile.am: + * lib/libgtop.sym: + + Updated libtool version. + Now uses a symbol list instead of a regex. + +2007-05-07 Benoît Dejean + + * New API to get cwd, root and exe path + of a process. API not frozen yet. + +2007-04-27 Benoît Dejean + + Got rid of InodeDB. + This feature was optionnal and i have never heard of anyone using + it. I have never touched it so it may be broken since 2.6. + +2007-04-11 Benoît Dejean + + * *: + + Renamed all glibtop_init_xxx functions + to _glibtop_init_xxx so they get internal visibility. + + * configure.in: + + Bumped version number. + +2007-03-13 Benoît Dejean + + * MAINTAINERS: + + Updated. + +2007-02-25 Benoît Dejean + + * NEWS: + + Released 2.14.8. + +2007-02-20 Benoît Dejean + + * *: + + Removed noisy $Id$. + +2007-02-18 Benoît Dejean + + * configure.in: + * libgtop-sysdeps.m4: + * sysdeps/Makefile.am: + + Huge (k)FreeBSD update. + (k)FreeBSD support is freebsd/ + Other BSD are in bsd/ + + Patch by Joe Marcus Clarke + Alexander Nedotsukov + + Closes #407693. + +2007-02-14 Benoît Dejean + + * lib/read.c: (glibtop_read_l): + * lib/write.c: (glibtop_write_l): + + Handle EINTR. + + * configure.in: + + Post release version bump. + +2007-02-10 Benoît Dejean + + * NEWS: + * configure.in: + + Released 2.14.7. + +2007-01-14 Benoît Dejean + + * NEWS: + + Released 2.14.6. + +2007-01-11 Benoît Dejean + + * configure.in: + + Bumped version number to 2.14.6. + + * *: + + Got rid of CVS admin files. + +2006-12-03 Benoît Dejean + + * doc/reference/libgtop-docs.xml: + * glibtop.h: + * include/glibtop/sysinfo.h: + + Made gtk-doc happy in order to dist. + +2006-12-03 Benoît Dejean + + * NEWS: + + Released 2.14.5. + +2006-12-02 Benoît Dejean + + * Makefile.am: + * configure.in: + * doc/Makefile.am: + * doc/reference/Makefile.am: + * doc/reference/libgtop-docs.xml: + * doc/reference/libgtop-sections.txt: + * doc/reference/version.xml.in: + * gtk-doc.make: + * sysdeps/common/default.c: + + Converted to gtk-doc. + Patch by Germán Poó-Caamaño . + +2006-12-01 Julio M. Merino Vidal + + * configure.in: + * libgtop-sysdeps.m4: + + Use the AS_HELP_STRING macro to format help messages. + Fixes bug #337068. + +2006-11-27 Benoît Dejean + + * libgtop-sysdeps.m4: + + Added kfreebsd support. + Patch by Petr Salinger . + +2006-11-27 Benoît Dejean + + * configure.in: + + Bumped version number. + +2006-09-16 Benoît Dejean + + * NEWS: + * configure.in: + + Released 2.14.4. + +2006-09-10 Benoît Dejean + + * configure.in: + * include/glibtop/procstate.h: + + Removed wrong inline documentation. + Closes #355286. + +2006-09-05 Benoît Dejean + + * NEWS: + + Released 2.14.3. + +2006-08-14 Benoît Dejean + + * src/inodedb/Makefile.am: + + Fixed inodedb build with --as-needed to please people + who want to compile and optimize broken, deprecated and + never-used feature. + Patch by Daniel Gryniewicz + Closes #341041. + +2006-08-10 Benoît Dejean + + * configure.in: + + Bumped version number. + + * glibtop.h: + * include/glibtop/init_hooks.h: + + Added missing G_(BEGIN|END)_DECLS. + +2006-07-27 Benoît Dejean + + * NEWS: + + Released 2.14.2. + +2006-07-27 Benoît Dejean + + * include/glibtop/netload.h: + + Tiny interface addition to handle wireless interfaces. + +2006-06-26 Benoît Dejean + + * po/Makefile.in.in.in: + + Dropped dead file. + +2006-06-25 Benoît Dejean + + * Makefile.am: + + Fixed build. + Closes #341779. + +2006-06-24 Benoît Dejean + + * Makefile.am: + + Build examples only when needed. + Patch by dmacks@netspace.org. + Closes #342863. + +2006-06-24 Benoît Dejean + + * libgtop-sysdeps.m4: + * sysdeps/solaris/glibtop_machine.h: + + Updated the GLIBTOP_SOLARIS_RELEASE + + Patch by hua.zhang@sun.com. + Closes #345821. + +2006-06-24 Benoît Dejean + + * configure.in: + + Don't use kvm on newer solaris. + Patch by hua.zhang@sun.com. + Closes #345811. + +2006-06-04 Benoît Dejean + + * libgtop-sysdeps.m4: + + Removed undefined LIBGTOP_HACKER_TESTS. + Closes #342890. + +2006-06-03 Benoît Dejean + + * .cvsignore: + * Makefile.am: + * configure.in: + * po/LINGUAS: + + Use po/LINGUAS. + Closes #337902. + +2006-04-18 German Poo-Caaman~o + + * /include/glibtop/cpu.h: + * /include/glibtop/fsusage.h: + * /include/glibtop/loadavg.h: + * /include/glibtop/mem.h: + * /include/glibtop/mountlist.h: + * /include/glibtop/msg_limits.h: + * /include/glibtop/netload.h: + * /include/glibtop/ppp.h: + * /include/glibtop/procargs.h: + * /include/glibtop/prockernel.h: + * /include/glibtop/proclist.h: + * /include/glibtop/procmap.h: + * /include/glibtop/procmem.h: + * /include/glibtop/procopenfiles.h: + * /include/glibtop/procsegment.h: + * /include/glibtop/procsignal.h: + * /include/glibtop/procstate.h: + * /include/glibtop/proctime.h: + * /include/glibtop/procuid.h: + * /include/glibtop/sem_limits.h: + * /include/glibtop/shm_limits.h: + * /include/glibtop/swap.h: + * /include/glibtop/sysdeps.h: + * /include/glibtop/uptime.h: + + Changed struct's definitions to be one type-one member. To + avoid problems with any further gtk-doc's implementation. + +2006-04-18 Kjartan Maraas + + * configure.in: Remove obsolete entry for no_NO + * po/no.po: And the translation. + +2006-04-10 Benoît Dejean + + * NEWS: + + Released 2.14.1. + +2006-04-10 Benoît Dejean + + * lib/open.c: (glibtop_open_l): + * lib/read.c: (glibtop_read_l): + * lib/write.c: (glibtop_write_l): + + Fixed a bunch of signedness warnings. + +2006-04-04 Julio M. Merino Vidal + + * libgtop-sysdeps.m4: + * sysdeps/freebsd/msg_limits.c: + + Use configure checks to detect whether we need to define either + KERNEL or _KERNEL to get the definition of 'struct msginfo' in a + BSD system. This replaces the previous checks in the code that + relied on __FreeBSD__ and similar macros. + + Before this change, the explicit definition of _KERNEL in the + msg_limits.c file broke the build in NetBSD because it made the + system headers pull in stuff unavailable to userland. + + Fixes bug #337207. + +2006-04-04 Julio M. Merino Vidal + + * libgtop-sysdeps.m4: + * sysdeps/freebsd/Makefile.am: + + Check for the kvm library and use it to link the suid freebsd + sysdeps code (only if available). This library provides all the + kvm_* functions used in it and is needed, at least, under NetBSD. + + Fixes bug #337247. + +2006-04-04 Julio M. Merino Vidal + + * sysdeps/aix/glibtop_server.h: + * sysdeps/freebsd/glibtop_server.h: + * sysdeps/osf1/glibtop_server.h: + * sysdeps/stub/glibtop_server.h: + * sysdeps/stub_suid/glibtop_server.h: + + Synch the list of GLIBTOP_SUID_* constants with those expected by + the lib/sysdeps.c file. Fixes the build under, at least, NetBSD + and FreeBSD. + + Fixes bug #337246. + +2006-04-02 Benoît Dejean + + * configure.in: + + Bumped version to 2.14.1. + Removed no longer needed gcc flag. + +2006-04-02 Benoît Dejean + + * configure.in: + * src/daemon/daemon.h: + * src/daemon/gnuserv.c: (main): + + Reverted. See #336837 + +2006-03-18 Vladimer Sichinava + + * configure.in: Added "ka" (Georgian) to ALL_LINGUAS + +2006-03-13 Benoît Dejean + + * NEWS: + * configure.in: + + Released 2.14.0. + +2006-02-27 Benoît Dejean + + * NEWS: + * configure.in: + + Released 2.13.92. + +2006-02-20 Benoît Dejean + + * configure.in: + + Bump version to 2.13.4. + Reordered libs. Closes #329153. + +2006-01-23 Benoît Dejean + + * configure.in: + * NEW: + + Released 2.13.3. + +2006-01-02 Benoît Dejean + + * NEWS: + * configure.in: + + Released 2.13.2. + +2006-01-02 James Henstridge + + * configure.in (LT_VERSION_INFO): add quotes around symbol definition. + +2005-12-15 Benoît Dejean + + * configure.in: + * NEWS: + + Released 2.13.1. + +2005-12-13 Benoît Dejean + + * NEWS: + + Released 2.13.0. + +2005-12-12 James Henstridge + + * doc/auto-macros.texi.in: remove unused file. + + * doc/libgtop2.texi: don't include auto-macros.texi. + + * doc/Makefile.am: don't build auto-macros.texi, since none of its + macros are used in the documentation any more. + + * include/glibtop/global.h: don't include from headers. + + * .../*.c: make sure is the first thing included. + + * acinclude.m4: m4_include() libgtop-sysdeps.m4 rather than + inlining it. + + * acinclude.m4, libgtop-sysdeps.m4: use third argument to + AC_DEFINE() to set the comment. + + * configure.in: modernise a bit. + + * acconfig.h: remove file, since it is deprecated + + * autogen.sh: require automake 1.9 instead of 1.4. + +2005-12-09 Benoît Dejean + + * configure.in: + * glibtop.h: + * include/glibtop/cpu.h: + * include/glibtop/procmap.h: + + Increased GLIBTOP_NCPU to 32. + Added real_ncpu to struct glibtop. + Added smaps members to glibtop_map_entry. + + Bumped version number to 2.13.0 + Broke ABI again. Sorry. + +2005-12-08 Benoît Dejean + + * doc/reference.texi: + * include/glibtop/limits.h: + + Dropped unused file and updated documentation. + +2005-12-07 Benoît Dejean + + * configure.in: + + Bumped version number. + +2005-12-04 Theppitak Karoonboonyanan + + * configure.in: Added 'th' (Thai) to ALL_LINGUAS. + +2005-11-29 Benoît Dejean + + * NEWS: + * configure.in: + + Released 2.12.2. + No 2.12.1. + +2005-11-17 Timur Jamakeev + + * configure.in: Added 'ky' (Kirghiz) to ALL_LINGUAS. + +2005-10-30 Benoît Dejean + + * configure.in: + * include/glibtop/glibtop-backend-info.h: + * include/glibtop/glibtop-backend.h: + * include/glibtop/glibtop-client.h: + * lib/glibtop-backend-info.c: + * lib/glibtop-backend.c: + * lib/glibtop-client-private.h: + * lib/glibtop-client.c: + * lib/test-backends.c: + * sysdeps/common/backend.c: + * sysdeps/common/libgtop-common.backend: + + Dropped many dead files. + Bumped release number. + I guess this closes #320250. + +2005-10-28 Erdal Ronahi + + * configure.in: Added ku (Kurdish) to ALL_LINGUAS + +2005-09-04 Benoît Dejean + + * NEWS: + * configure.in: + + Released 2.12.0. + +2005-08-22 Benoît Dejean + + * configure.in: + + Hum hum, it's better if release number is 2.11.92 too. + +2005-08-22 Benoît Dejean + + * NEWS: + + Released 2.11.92. + +2005-08-08 Benoît Dejean + + * NEWS: + + Released 2.11.91. + +2005-08-04 Benoît Dejean + + * configure.in: + * examples/Makefile.am: + + Removed static examples. + +2005-08-02 Benoît Dejean + + * configure.in: + * include/glibtop/Makefile.am: + * include/glibtop/glibtop-server.h: + * include/glibtop/init_hooks.h: + * include/glibtop/sysdeps.h: + * lib/init.c: (glibtop_init_s): + * lib/sysdeps.c: + * sysdeps/aix/open.c: (glibtop_init_p): + * sysdeps/common/sysdeps_suid.c: + * sysdeps/freebsd/open.c: (glibtop_init_p): + * sysdeps/osf1/open_suid.c: (glibtop_init_p): + * sysdeps/solaris/open_suid.c: (glibtop_init_p): + * sysdeps/stub_suid/open.c: (glibtop_init_p): + + Moved _glibtop_init_hook_[sp] declaration to private + glibtop/init_hooks.h. Marked them const. + + Fixed GLIBTOP_SUID_NETLIST issues. + +2005-07-24 Benoît Dejean + + * NEWS: + * configure.in: Released 2.11.90. + +2005-07-22 Benoît Dejean + + * configure.in: 2.11.3 post release version bump. + +2005-07-13 Benoît Dejean + + * NEWS: Released 2.11.2. + +2005-07-06 Benoît Dejean + + * configure.in: 2.11.2 post release version bump. + +2005-07-03 Benoît Dejean + + * NEWS: Released 2.11.1. + +2005-06-15 Benoît Dejean + + * sysdeps/common/Makefile.am: + * sysdeps/linux/Makefile.am: Removed LT_VERSION_INFO from LDFLAGS + when unused. + +2005-06-08 Benoît Dejean + + * configure.in: 2.11.1 post release version bump. + +2005-06-08 Benoît Dejean + + * NEWS: Released 2.11.0. + +2005-06-07 Benoît Dejean + + * configure.in: + * glibtop.h: + * include/glibtop/close.h: + * include/glibtop/cpu.h: + * include/glibtop/fsusage.h: + * include/glibtop/loadavg.h: + * include/glibtop/mem.h: + * include/glibtop/mountlist.h: + * include/glibtop/msg_limits.h: + * include/glibtop/netlist.h: + * include/glibtop/netload.h: + * include/glibtop/ppp.h: + * include/glibtop/procargs.h: + * include/glibtop/prockernel.h: + * include/glibtop/proclist.h: + * include/glibtop/procmap.h: + * include/glibtop/procmem.h: + * include/glibtop/procopenfiles.h: + * include/glibtop/procsegment.h: + * include/glibtop/procsignal.h: + * include/glibtop/procstate.h: + * include/glibtop/proctime.h: + * include/glibtop/procuid.h: + * include/glibtop/sem_limits.h: + * include/glibtop/shm_limits.h: + * include/glibtop/swap.h: + * include/glibtop/sysdeps.h: + * include/glibtop/sysinfo.h: + * include/glibtop/uptime.h: + * sysdeps/common/Makefile.am: + * sysdeps/common/default.c: (glibtop_close), (glibtop_init), + (glibtop_get_cpu), (glibtop_get_fsusage), (glibtop_get_uptime), + (glibtop_get_sysinfo), (glibtop_get_swap), (glibtop_get_proc_uid), + (glibtop_get_proc_time), (glibtop_get_proc_state), + (glibtop_get_proc_signal), (glibtop_get_proc_segment), + (glibtop_get_proc_open_files), (glibtop_get_proc_mem), + (glibtop_get_proc_map), (glibtop_get_proc_args), + (glibtop_get_proc_argv), (glibtop_get_proclist), + (glibtop_get_proc_kernel), (glibtop_get_ppp), + (glibtop_get_netlist), (glibtop_get_netload), + (glibtop_get_mountlist), (glibtop_get_mem), (glibtop_get_loadavg), + (glibtop_get_msg_limits), (glibtop_get_sem_limits), + (glibtop_get_shm_limits), (glibtop_get_sysdeps): + + Added a lot of new functions to replace dirty macros. + Every macro glibtop_get_*(buf[, args]) has been turned to a function. + +2005-06-06 Benoît Dejean + + * dtd/: Bye bye. + +2005-06-06 Benoît Dejean + + * backends/: Removed useless files. + +2005-06-06 Benoît Dejean + + * examples/smp.c: (main): Removed translation. + + * lib/lib.pl: + * lib/read.c: + * lib/read_data.c: + * lib/write.c: + * src/daemon/gnuserv.c: s/gi18n.h/gi18n-lib.h. + +2005-06-06 Benoît Dejean + + * acinclude.m4: bye bye support. + +2005-06-06 Benoît Dejean + + * support/ : Removed unused files. + +2005-06-06 Benoît Dejean + + * examples/smp.c: + * include/Makefile.am: + * include/libgtop-i18n.h: + * lib/lib.pl: + * lib/read.c: + * lib/read_data.c: + * lib/write.c: + * src/daemon/gnuserv.c: Got rid of include/libgtop-i18n.h. + +2005-06-06 Benoît Dejean + + * configure.in: version bump. + +2005-06-05 Benoît Dejean + + * README: Updated so people can find the ChangeLogs. + +2005-04-27 Benoît Dejean + + * configure.in: 2.10.2 post release bump. + + * include/glibtop/Makefile.am: + * include/glibtop/parameter.h: + * lib/init.c: Re-install open.h to please GTop (libgtop perl wrapper). + +2005-04-10 Benoît Dejean + + * NEWS: Released 2.10.1. + +2005-04-01 Adi Attar + + * configure.in: Added "xh" to ALL_LINGUAS. + +2005-03-31 Steve Murphy + + * configure.in: Added "rw" to ALL_LINGUAS. + +2005-03-31 Benoît Dejean + + * libgtop-2.0.pc.in: Fixed. + +2005-03-29 Benoît Dejean + + * lib/read_data.c: (glibtop_read_data_l): Fixed warning. + +2005-03-25 Benoît Dejean + + * lib/error.c: (glibtop_error_io_vr), (glibtop_warn_io_vr): + s/strerror/g_strerror. + +2005-03-11 Benoît Dejean + + * configure.in: Post release version bump. + +2005-03-07 Benoît Dejean + + * NEWS: + * configure.in: Released 2.10.0. + +2005-02-28 Benoît Dejean + + * NEWS: Released 2.9.92. + +2005-02-25 Benoît Dejean + + * configure.in: /me stupid. I've already post-bumped version. + +2005-02-24 Benoît Dejean + + * configure.in: post release bump 2.9.93. + +2005-02-22 Benoît Dejean + + * src/Makefile.am: Build and install libgtop2_daemon only if needed. + +2005-02-21 Benoît Dejean + + * lib/Makefile.am: don't export private symbols. + +2005-02-15 Benoît Dejean + + * backends/server/server.h: + * configure.in: + * glibtop.h: + * include/glibtop/Makefile.am: + * include/glibtop/gnuserv.h: + * include/glibtop/open.h: + * include/glibtop/read.h: + * include/glibtop/read_data.h: + * include/glibtop/types.h: + * include/glibtop/write.h: + * lib/close.c: + * lib/init.c: + * lib/lib.pl: + * lib/open.c: + * lib/parameter.c: + * lib/read.c: + * lib/read_data.c: + * lib/write.c: + * src/daemon/daemon.h: + * src/daemon/io.c: + * src/daemon/main.c: (handle_parent_connection): + * src/daemon/slave.c: (handle_slave_connection), + (handle_slave_command): + * sysdeps/common/gnuslib.c: + * sysdeps/solaris/glibtop_private.h: Removed some dead files. + Don't install private headers. + + Depends on glib-2.6. + Post-release bump : 2.9.92 + +2005-02-15 Benoît Dejean + + * include/glibtop/error.h: Don't export private symbols. + +2005-02-15 Benoît Dejean + + * include/glibtop/error.h: G_GNUC_NORETURN love. + + * include/glibtop/errors.h: + * lib/errors.c: Bye bye dead code. + +2005-02-06 Benoît Dejean + + * NEWS: + * configure.in: Released 2.9.91. + +2005-01-24 Benoît Dejean + + * NEWS: + * configure.in: Released 2.9.90. + +2005-01-24 Benoît Dejean + + * include/glibtop/procopenfiles.h: + * sysdeps/linux/procopenfiles.c: + * sysdeps/stub/procopenfiles.c: UTF-8-ified. + +2005-01-22 Benoît Dejean + + * examples/openfiles.c: (show_open_files): + * include/glibtop/procopenfiles.h: added localsock { name } to + glibtop_open_files_entry. Should not break ABI. + +2005-01-12 Benoît Dejean + + * configure.in: 2.9.5. + +2005-01-10 Benoît Dejean + + * NEWS: Released 2.9.4. + +2005-01-10 Benoît Dejean + + * configure.in: + * examples/.cvsignore: + * examples/Makefile.am: + * examples/openfiles.c: (show_open_files), (main): + * features.def: + * include/glibtop/Makefile.am: + * include/glibtop/command.h: + * include/glibtop/procopenfiles.h: + * include/glibtop/sysdeps.h: + * include/glibtop/union.h: + * structures.def: + * sysdeps/linux/Makefile.am: + * sysdeps/linux/procopenfiles.c: (glibtop_init_proc_open_files_s), + (get_socket_endpoint), (glibtop_get_proc_open_files_s): + * sysdeps/stub/Makefile.am: + * sysdeps/stub/procopenfiles.c: (glibtop_init_proc_open_files_s), + (glibtop_get_proc_open_files_s): + + New feature by nick@reloco.com.ar (Nicolás Lichtmaier). + + glibtop_get_open_files(pid) -> list of files by process. + TODO: Add documentation. + +2005-01-03 Benoît Dejean + + * examples/pprint.c: (pprint_get_cpu): + * features.def: + * include/glibtop/cpu.h: + * sysdeps/linux/cpu.c: (glibtop_init_cpu_s), (glibtop_get_cpu_s): + Added I/O and IRQ wait time to glibtop_cpu. Closes #160443. + + * configure.in: Post-release bump 2.9.4 + +2004-12-29 Benoît Dejean + + * lib/read_data.c: (glibtop_read_data_l): + * lib/write.c: (glibtop_write_l): Fixed error messages. + Closes #162406. + +2004-12-23 Benoît Dejean + + * include/glibtop/error.h: + * lib/parameter.c: (glibtop_set_parameter_l): + * lib/read_data.c: (glibtop_read_data_l): + * sysdeps/common/error.c: (print_server_name), (glibtop_error_vr), + (glibtop_error_io_vr), (glibtop_warn_vr), (glibtop_warn_io_vr), + (glibtop_error_r), (glibtop_warn_r), (glibtop_error_io_r), + (glibtop_warn_io_r), (glibtop_error), (glibtop_warn), + (glibtop_error_io), (glibtop_warn_io): Turned all macros to functions. + Marked everything as G_GNUC_PRINTF and fixed format bugs. + + * sysdeps/common/fsusage.c: Marked some functions as G_GNUC_INTERNAL + +2004-12-20 Benoît Dejean + + * NEWS: + * configure.in: Released 2.9.3. + +2004-12-10 Benoît Dejean + + * lib/lib.pl: Fixed Argument passing between library and server. + Thanks everyone. Closes #139809. + +2004-12-06 Benoît Dejean + + * acconfig.h: + * configure.in: + * debian/libgtop-dev.files.in: + * doc/Makefile.am: + * examples/Makefile.am: + * examples/third.c: + * include/glibtop/cpu.h: + * include/glibtop/fsusage.h: + * include/glibtop/loadavg.h: + * include/glibtop/mem.h: + * include/glibtop/mountlist.h: + * include/glibtop/msg_limits.h: + * include/glibtop/netlist.h: + * include/glibtop/netload.h: + * include/glibtop/ppp.h: + * include/glibtop/procargs.h: + * include/glibtop/prockernel.h: + * include/glibtop/proclist.h: + * include/glibtop/procmap.h: + * include/glibtop/procmem.h: + * include/glibtop/procsegment.h: + * include/glibtop/procsignal.h: + * include/glibtop/procstate.h: + * include/glibtop/proctime.h: + * include/glibtop/procuid.h: + * include/glibtop/sem_limits.h: + * include/glibtop/shm_limits.h: + * include/glibtop/swap.h: + * include/glibtop/sysdeps.h: + * include/glibtop/uptime.h: + * po/POTFILES.in: + * sysdeps/Makefile.am: + * sysdeps/names/.cvsignore: + * sysdeps/names/Makefile.am: + * sysdeps/names/cpu.c: + * sysdeps/names/fsusage.c: + * sysdeps/names/loadavg.c: + * sysdeps/names/mem.c: + * sysdeps/names/mountlist.c: + * sysdeps/names/msg_limits.c: + * sysdeps/names/netlist.c: + * sysdeps/names/netload.c: + * sysdeps/names/ppp.c: + * sysdeps/names/procargs.c: + * sysdeps/names/prockernel.c: + * sysdeps/names/proclist.c: + * sysdeps/names/procmap.c: + * sysdeps/names/procmem.c: + * sysdeps/names/procsegment.c: + * sysdeps/names/procsignal.c: + * sysdeps/names/procstate.c: + * sysdeps/names/proctime.c: + * sysdeps/names/procuid.c: + * sysdeps/names/sem_limits.c: + * sysdeps/names/shm_limits.c: + * sysdeps/names/swap.c: + * sysdeps/names/sysdeps.c: + * sysdeps/names/uptime.c: Removed libgtop_names :) + +2004-11-30 Benoît Dejean + + * configure.in: post-release bump to 2.9.1. + +2004-11-30 Benoît Dejean + + * NEWS: + * configure.in: released 2.9.0 + +2004-11-22 Benoît Dejean + + * AUTHORS: + * MAINTAINERS: UTF-8-ified. + + * acconfig.h: + * acinclude.m4: + * configure.in: + * kernel/ChangeLog: + * kernel/sysctl/.cvsignore: + * kernel/sysctl/Makefile: + * kernel/sysctl/libgtop.c: + * kernel/sysctl/libgtop.h: + * kernel/sysctl/libgtop_syms.c: + * kernel/sysctl/main.c: + * kernel/sysctl/patch-2.2.1: + * kernel/sysctl/patch-2.2.x: + * kernel/table.h: + * kernel/table20/Makefile: + * kernel/table20/README: + * kernel/table20/entry-i386.S: + * kernel/table20/kernel.patch: + * kernel/table20/main.c: + * kernel/table20/unistd-i386.h: + * kernel/table20/version.h: + * kernel/table21/.cvsignore: + * kernel/table21/Makefile: + * kernel/table21/README: + * kernel/table21/entry-i386.S: + * kernel/table21/main.c: + * kernel/table21/module.c: + * kernel/table21/unistd-i386.h: + * kernel/table21/version.h: + * kernel/version.h: + * libgtop-sysdeps.m4: + * sysdeps/Makefile.am: + * sysdeps/kernel/.cvsignore: + * sysdeps/kernel/ChangeLog: + * sysdeps/kernel/Makefile.am: + * sysdeps/kernel/close.c: + * sysdeps/kernel/cpu.c: + * sysdeps/kernel/glibtop_private.h: + * sysdeps/kernel/glibtop_server.h: + * sysdeps/kernel/kernel.h: + * sysdeps/kernel/kernel.s: + * sysdeps/kernel/loadavg.c: + * sysdeps/kernel/mem.c: + * sysdeps/kernel/msg_limits.c: + * sysdeps/kernel/netload.c: + * sysdeps/kernel/open.c: + * sysdeps/kernel/ppp.c: + * sysdeps/kernel/procargs.c: + * sysdeps/kernel/procdata.c: + * sysdeps/kernel/prockernel.c: + * sysdeps/kernel/proclist.c: + * sysdeps/kernel/procmap.c: + * sysdeps/kernel/procmem.c: + * sysdeps/kernel/procsegment.c: + * sysdeps/kernel/procsignal.c: + * sysdeps/kernel/procstate.c: + * sysdeps/kernel/proctime.c: + * sysdeps/kernel/procuid.c: + * sysdeps/kernel/sem_limits.c: + * sysdeps/kernel/shm_limits.c: + * sysdeps/kernel/siglist.c: + * sysdeps/kernel/swap.c: + * sysdeps/kernel/sysinfo.c: + * sysdeps/kernel/uptime.c: Removed kernel patch and implementation. + +2004-11-18 Benoît Dejean + + * Makefile.am: Forgot to ship libgtopconfig.h. + +2004-11-18 Benoît Dejean + + * LIBGTOP-VERSION: + * libgtop-mirror.sh: Removed unused files. + + * libgtopconfig.h.in: Added. + * Makefile.am: + * configure.in: + * glibtop.h: Added libgtopconfig.h and LIBGTOP_VERSION_CHECK(X, Y, Z). + This can be used in build tests. + +2004-11-15 Benoît Dejean + + * copyright.txt: Added myself. + +2004-11-13 Benoît Dejean + + * include/glibtop/procargs.h: + * sysdeps/common/procargs.c: (glibtop_get_proc_argv_l): Removed SUID + wrappers because glibtop_proc_argv_l is a client-side function that wraps + glibtop_get_proc_args. + +2004-11-13 Benoît Dejean + + * structures.def: Removed old functions. OMG, everything is really broken + here :/ + +2004-11-13 Benoît Dejean + + * configure.in: Bumped to 2.9.0 + + * configure.in: + * examples/.cvsignore: + * examples/Makefile.am: + * examples/netlist.c: (main): + * features.def: + * include/glibtop/Makefile.am: + * include/glibtop/command.h: + * include/glibtop/netlist.h: + * include/glibtop/sysdeps.h: + * include/glibtop/union.h: + * include/glibtop/version.h: + * src/daemon/version.c: + * sysdeps/linux/Makefile.am: + * sysdeps/linux/netlist.c: (glibtop_init_netlist_s), + (glibtop_get_netlist_s): + * sysdeps/names/Makefile.am: + * sysdeps/names/netlist.c: + * sysdeps/solaris/Makefile.am: + * sysdeps/solaris/netlist.c: (glibtop_init_netlist_s), + (glibtop_get_netlist_s): Added new function glibtop_get_netlist(). + Implemented for linux and solaris. Doc needed. + +2004-10-11 Benoît Dejean + + * NEWS: Released 2.8.1. + +2004-10-10 Benoît Dejean + + * lib/init.c: Replaced C99 initializer. + + * lib/read.c: (do_read): 1-line cleanup. + +2004-10-09 Benoît Dejean + + * configure.in: Depends on glib 2.4.0 + +2004-09-25 Benoît Dejean + + * glibtop.h: Added missing include . + +2004-09-22 Benoît Dejean + + * configure.in: CFLAGS: Removed -W, added -Winline. + +2004-09-14 Gora Mohanty + + * configure.in: Added 'or' to ALL_LINGUAS. + +2004-09-13 Benoît Dejean + + * configure.in: bumped to 2.8.1. + + * sysdeps/common/fsusage.c: + * sysdeps/common/gnuslib.c: (glibtop_make_connection), + (connect_to_unix_server), (glibtop_internet_addr): + * sysdeps/linux/glibtop_server.c: (get_pageshift): + * sysdeps/linux/glibtop_server.h: + * sysdeps/linux/open.c: (glibtop_open_s): + * sysdeps/linux/ppp.c: (is_ISDN_on): Cleanups. Thanks to Kjartan Maraas. + Closes #151557. + +2004-09-13 Benoît Dejean + + * NEWS: + * configure.in: 2.8.0 + +2004-08-30 Benoît Dejean + + * NEWS: Released 2.7.92. + +2004-08-28 Benoît Dejean + + * backends/server/command.c: (glibtop_call_i): Zeroed all args. + + * configure.in: Bumped soname (thanks to seb128 and Dodji even if i've + fully understand everything. + + * include/glibtop/array.h: + * include/glibtop/compat_10.h: + * include/glibtop/glib-arrays.h: + * include/glibtop/interfaces.h: + * include/glibtop/proccwd.h: + * lib/glib-arrays.c: + * sysdeps/names/interfaces.c: + * sysdeps/names/proccwd.c: Got rid of never-used / never-implemented files. + +2004-08-28 Akagic Amila + + * configure.in: Added 'bs' to ALL_LINGUAS. + +2004-08-22 Benoît Dejean + + * lib/command.c: (glibtop_call_l): Zeroed all args. + +2004-08-21 Kjartan Maraas + + * configure.in: Add «nb» to ALL_LINGUAS. + +2004-08-15 Benoît Dejean + + * NEWS: + * configure.in: LibGTop 2.7.91. + +2004-08-09 Benoît Dejean + + * configure.in: Added HAVE_IFADDRS_H + * sysdeps/linux/netload.c: (glibtop_get_netload_s): Disable IPv6 + support is ifaddrs.h is not available. + + Closes #149376. + +2004-08-09 Benoît Dejean + + * configure.in: Added -gnu89 to CFLAGS. + + * examples/Makefile.am: Fixed LDFLAGS. + + * sysdeps/common/fsusage.c: (glibtop_get_fsusage_s): + * sysdeps/linux/fsusage.c: (linux_2_6_0): + * sysdeps/linux/proctime.c: (glibtop_get_proc_time_s): + * sysdeps/linux/sysinfo.c: (init_sysinfo): Fixed C89 issues. + + Closes #149375. + +2004-08-03 Benoît Dejean + + * NEWS: + * configure.in: LibGTop 2.7.90. + +2004-07-20 Benoît Dejean + + * configure.in: LibGTop 2.7.5. + +2004-07-20 Benoît Dejean + + * NEWS: + * configure.in: Released LibGTop 2.7.4. + +2004-07-18 Benoît Dejean + + * doc/reference.texi: + * include/glibtop/command.h: + * include/glibtop/glib-arrays.h: + * include/glibtop/proclist.h: + * lib/glib-arrays.c: (glibtop_get_proclist_as_array_l): + * lib/lib.pl: + * scripts/c_types.pl: + * src/daemon/main.c: (handle_parent_connection): + * src/daemon/slave.c: (handle_slave_connection): + * support/mkstemp.c: + * sysdeps/aix/proclist.c: (glibtop_get_proclist_s): + * sysdeps/freebsd/cpu.c: (glibtop_get_cpu_p): + * sysdeps/freebsd/prockernel.c: (glibtop_get_proc_kernel_p): + * sysdeps/freebsd/proclist.c: (glibtop_get_proclist_p): + * sysdeps/freebsd/procmem.c: (glibtop_get_proc_mem_p): + * sysdeps/kernel/proclist.c: (glibtop_get_proclist_s): + * sysdeps/linux/proclist.c: (glibtop_get_proclist_s): + * sysdeps/osf1/proclist.c: (glibtop_get_proclist_p): + * sysdeps/solaris/proclist.c: (glibtop_get_proclist_s): + * sysdeps/stub/proclist.c: (glibtop_get_proclist_s): + * sysdeps/stub_suid/proclist.c: (glibtop_get_proclist_p): + * sysdeps/sun4/proclist.c: (glibtop_get_proclist_p): Glibify a bit more. + Closes #147618. + +2004-07-17 Benoît Dejean + + * include/glibtop/fsusage.h: Added read, write. This members provides + total read and write in bytes since boot_time. + + * include/glibtop/netload.h: Added hwaddress : provides harware address, + eg MAC address. mtu, address and subnet are now guint32. + +2004-07-15 Benoît Dejean + + * include/glibtop/procstate.h: Added GLIBTOP_PROCESS_DEAD constant. + +2004-07-07 Benoît Dejean + + * include/glibtop/procargs.h: Added new glibtop_get_proc_argv*() functions. + These are more easier to use than glibtop_get_proc_args*(). They return + a NULL-terminated array of string (like main's char* argv[]). + +2004-07-07 Benoît Dejean + + * include/glibtop/netinfo.h: + * structures.def: + * sysdeps/names/netinfo.c: Removed netinfo.[ch] that were never used. + +2004-07-03 Benoît Dejean + + * sysdeps/names/fsusage.c: Added missing fsusage names. + +2004-07-03 Benoît Dejean + + * glibtop.h: Moved foward declaration of glibtop to break circular + #includes dependencies. + +2004-06-18 Benoît Dejean + + * include/glibtop/error.h: Also tries C99 __VA_ARGS__ before using + functions. + + * include/glibtop/error.h: Moved 8 static error functions to + sysdeps/common/error.c. This is the end of an big useless code + bloat : expect ~8KB of object size reduction. + + * include/glibtop/procuid.h: s/int/gint32/g + + * lib/errors.c: (glibtop_error_quark): + * lib/read.c: (do_read), (glibtop_read_l): + * lib/read_data.c: (glibtop_read_data_l): Minor cleanups. + + * sysdeps/names/netload.c: + * include/glibtop/netload.h: Added IPv6 feature : provides address, + prefix and scope. This breaks the ABI. Not documented yet : check + this file. + +2004-06-13 Benoît Dejean + + * include/glibtop/sysinfo.h: Changed get_sysinfo prototype so that it + returns a const pointer. Added missing macro. + +2004-06-12 Benoît Dejean + + * include/glibtop/fsusage.h: block_size is now defined as a guint32 + instead of a fuzzy gint. + + * lib/sysdeps.c: (glibtop_get_sysdeps_r): Small cleanup. + + * lib/init.c: Added missing initializer. + +2004-06-09 Benoît Dejean + + * *.{c,h} : whitespace clean up. + +2004-06-07 Benoît Dejean + + * lib/parameter.c: + * support/popt.c: (poptGetContext): Cleaned. + + * support/vsnprintf.c: s/strncpy/g_strlcpy + +2004-05-28 Benoît Dejean + + * examples/*: Added missing #include. + * ChangeLog: Converted to UTF-8. + +2004-04-16 Iñaki Larrañaga + + * configure.in: Added "eu" (Basque) to ALL_LINGUAS. + +2004-04-09 Guntupalli Karunakar + + * configure.in: Added "gu" (Gujarati) to ALL_LINGUAS. + +2004-04-07 Bastien Nocera + + * configure.in: version 2.6.0 + +2004-04-07 Bastien Nocera + + * include/glibtop/fsusage.h: fix typo in the #defines for + FSUSAGE_BLOCK_SIZE (patch by Benoît Dejean ) + +2004-03-30 Adam Weinberger + + * configure.in: Added en_CA (Canadian English) to ALL_LINGUAS. + +2004-03-22 Gareth Owen + + * configure.in: Added en_GB to ALL_LINGUAS + +2004-03-22 Guntupalli Karunakar + + * configure.in: Added "pa" (Punjabi) to ALL_LINGUAS. + +2004-03-15 Bastien Nocera + + * include/glibtop/fsusage.h: set GLIBTOP_MAX_FSUSAGE properly, + use gint in the headers instead of int (Closes: #125049) + +2004-03-11 Kjartan Maraas + + * configure.in: Up versions etc. + * po/am.po: Update foo. + * po/ar.po: + * po/az.po: + * po/be.po: + * po/bg.po: + * po/bn.po: + * po/ca.po: + * po/cs.po: + * po/cy.po: + * po/da.po: + * po/de.po: + * po/el.po: + * po/es.po: + * po/et.po: + * po/fa.po: + * po/fi.po: + * po/fr.po: + * po/ga.po: + * po/gl.po: + * po/he.po: + * po/hi.po: + * po/hr.po: + * po/hu.po: + * po/id.po: + * po/it.po: + * po/ja.po: + * po/ko.po: + * po/lt.po: + * po/lv.po: + * po/mk.po: + * po/ml.po: + * po/mn.po: + * po/ms.po: + * po/nl.po: + * po/nn.po: + * po/no.po: + * po/pl.po: + * po/pt.po: + * po/pt_BR.po: + * po/ro.po: + * po/ru.po: + * po/sk.po: + * po/sl.po: + * po/sq.po: + * po/sr.po: + * po/sr@Latn.po: + * po/sv.po: + * po/ta.po: + * po/tr.po: + * po/uk.po: + * po/vi.po: + * po/zh_CN.po: + * po/zh_TW.po: + +2004-03-11 Bastien Nocera + + * NEWS: update the NEWS file for the release + +2004-03-11 Bastien Nocera + + * include/Makefile.am: fix distchecking + +2003-12-27 Ole Laursen + + * include/glibtop/fsusage.h: Added block_size field. (Closes: #125049) + +2004-03-05 Bastien Nocera + + * include/glibtop/procmap.h: patch by Benoît Dejean + to break the API, I mean, to make it easier to generate Python bindings + (Closes: #129701) + +2004-03-04 Bastien Nocera + + * configure.in: + * include/libgtop-i18n.h: + * lib/lib.pl: + * lib/read.c: + * lib/read_data.c: + * lib/write.c: + * sysdeps/names/cpu.c: + * sysdeps/names/fsusage.c: + * sysdeps/names/loadavg.c: + * sysdeps/names/mem.c: + * sysdeps/names/mountlist.c: + * sysdeps/names/msg_limits.c: + * sysdeps/names/netload.c: + * sysdeps/names/ppp.c: + * sysdeps/names/procargs.c: + * sysdeps/names/prockernel.c: + * sysdeps/names/proclist.c: + * sysdeps/names/procmap.c: + * sysdeps/names/procmem.c: + * sysdeps/names/procsegment.c: + * sysdeps/names/procsignal.c: + * sysdeps/names/procstate.c: + * sysdeps/names/proctime.c: + * sysdeps/names/procuid.c: + * sysdeps/names/sem_limits.c: + * sysdeps/names/shm_limits.c: + * sysdeps/names/swap.c: + * sysdeps/names/sysdeps.c: + * sysdeps/names/uptime.c: remove dependency on libgnome, + check for linux/isdn.h for distros using the 2.6 kernel headers + +2004-02-07 Kevin Vandersloot + + * configure.in: release 2.5.1 + +2004-02-02 Sebastien Bacher + + * sysdeps/linux/mem.c: (glibtop_get_mem_s): patch from + Benoît Dejean to fix libtop_mem.used + and glibtop_mem.shared values (Closes: #129863). + +Wed Jan 7 02:23:28 2004 Jonathan Blandford + + * libgtop-2.0.pc.in: Should be -lgtop-2.0, #130506 + +2004-01-05 Frederic Crozat + + * libgtop.spec.in: License is GPL, not LGPL. + +2004-01-05 Malcolm Tredinnick + + * libgtop-2.0.pc.in: Include -lgtop in the linking flags. + Bug #130506. + +2004-01-03 Robert Sedak + + * configure.in: Added "hr" in ALL_LINGUAS. + +2003-12-22 Bastien Nocera + + * acinclude.m4: + * configure.in: remove linking to libgtop and checks for 64-bit + integer bytes (fixes warning on build on glib 2.0 systems) + +2003-11-02 Ćœygimantas Beručka + + * configure.in: Added "lt" to ALL_LINGUAS. + +2003-10-21 Bastien Nocera + + * Makefile.am: + * configure.in: + * src/inodedb/.cvsignore: + * sysdeps/names/Makefile.am: + install only one library, libgtop-2.0 + Fix build-time warnings due to the redefinition of guint64 + +2003-10-20 Bastien Nocera + + * lib/read.c: (glibtop_read_l): + * lib/read_data.c: (glibtop_read_data_l): + * lib/write.c: (glibtop_write_l): apply patch for ngettext support + by Christian Neumair + +2003-10-20 Bastien Nocera + + * include/glibtop/cpu.h: + * include/glibtop/procstate.h: + * include/glibtop/procuid.h: + * include/glibtop/uptime.h: + * lib/sysdeps.c: + * sysdeps/names/cpu.c: + * sysdeps/names/procstate.c: + * sysdeps/names/procuid.c: + * sysdeps/names/uptime.c: Apply patch by the_h1ghlander@yahoo.com and + Cory Omand for Solaris support + +2003-10-20 Bastien Nocera + + * src/inodedb/Makefile.am: link to libgtop_suid_common-2.0.la + (Closes: #107990) + +2003-10-20 Bastien Nocera + + * acconfig.h: + * acinclude.m4: + * include/glibtop/array.h: + * include/glibtop/command.h: + * include/glibtop/cpu.h: + * include/glibtop/fsusage.h: + * include/glibtop/glibtop-backend-info.h: + * include/glibtop/glibtop-backend.h: + * include/glibtop/glibtop-client.h: + * include/glibtop/inodedb.h: + * include/glibtop/interfaces.h: + * include/glibtop/limits.h: + * include/glibtop/loadavg.h: + * include/glibtop/mem.h: + * include/glibtop/mountlist.h: + * include/glibtop/msg_limits.h: + * include/glibtop/netinfo.h: + * include/glibtop/netload.h: + * include/glibtop/ppp.h: + * include/glibtop/procargs.h: + * include/glibtop/proccwd.h: + * include/glibtop/prockernel.h: + * include/glibtop/proclist.h: + * include/glibtop/procmap.h: + * include/glibtop/procmem.h: + * include/glibtop/procsegment.h: + * include/glibtop/procsignal.h: + * include/glibtop/procstate.h: + * include/glibtop/proctime.h: + * include/glibtop/procuid.h: + * include/glibtop/sem_limits.h: + * include/glibtop/shm_limits.h: + * include/glibtop/swap.h: + * include/glibtop/sysdeps.h: + * include/glibtop/sysinfo.h: + * include/glibtop/uptime.h: + * lib/glibtop-backend.c: (glibtop_backend_get): + * lib/glibtop-client.c: (glibtop_client_open_backend): + * lib/inodedb.c: (glibtop_inodedb_lookup_s): + * lib/lib.pl: + * src/inodedb/README.inodedb: + * src/inodedb/mkinodedb2.c: (main): s/u_int64_t/guint64/ + +2003-10-20 Bastien Nocera + + * Makefile.am: fix distchecking, release 2.5.0 + +2003-10-20 Bastien Nocera + + * configure.in: fix the library versioning to be hand-made rather + than uber-calculated from some esoteric numbers + +2003-10-20 Bastien Nocera + + * glibtop.h: + * include/glibtop/close.h: + * include/glibtop/command.h: + * include/glibtop/cpu.h: + * include/glibtop/error.h: + * include/glibtop/fsusage.h: + * include/glibtop/global.h: + * include/glibtop/inodedb.h: + * include/glibtop/loadavg.h: + * include/glibtop/mem.h: + * include/glibtop/mountlist.h: + * include/glibtop/msg_limits.h: + * include/glibtop/netload.h: + * include/glibtop/open.h: + * include/glibtop/parameter.h: + * include/glibtop/ppp.h: + * include/glibtop/procargs.h: + * include/glibtop/prockernel.h: + * include/glibtop/proclist.h: + * include/glibtop/procmap.h: + * include/glibtop/procmem.h: + * include/glibtop/procsegment.h: + * include/glibtop/procsignal.h: + * include/glibtop/procstate.h: + * include/glibtop/proctime.h: + * include/glibtop/procuid.h: + * include/glibtop/read.h: + * include/glibtop/read_data.h: + * include/glibtop/sem_limits.h: + * include/glibtop/shm_limits.h: + * include/glibtop/signal.h: + * include/glibtop/swap.h: + * include/glibtop/sysdeps.h: + * include/glibtop/sysinfo.h: + * include/glibtop/types.h: + * include/glibtop/union.h: + * include/glibtop/uptime.h: + * include/glibtop/version.h: + * include/glibtop/write.h: + * lib/Makefile.am: + * lib/command.c: (glibtop_call_l): + * lib/init.c: + * lib/inodedb.c: + * lib/lib.pl: + * lib/open.c: + * lib/read.c: + * lib/read_data.c: (glibtop_read_data_l): + * lib/structures.pl: + * lib/write.c: + * sysdeps/names/cpu.c: + * sysdeps/names/fsusage.c: + * sysdeps/names/loadavg.c: + * sysdeps/names/mem.c: + * sysdeps/names/mountlist.c: + * sysdeps/names/msg_limits.c: + * sysdeps/names/netinfo.c: + * sysdeps/names/netload.c: + * sysdeps/names/ppp.c: + * sysdeps/names/procargs.c: + * sysdeps/names/proccwd.c: + * sysdeps/names/prockernel.c: + * sysdeps/names/proclist.c: + * sysdeps/names/procmap.c: + * sysdeps/names/procmem.c: + * sysdeps/names/procsegment.c: + * sysdeps/names/procsignal.c: + * sysdeps/names/procstate.c: + * sysdeps/names/proctime.c: + * sysdeps/names/procuid.c: + * sysdeps/names/sem_limits.c: + * sysdeps/names/shm_limits.c: + * sysdeps/names/swap.c: + * sysdeps/names/sysdeps.c: + * sysdeps/names/uptime.c: fixed compilation + +2003-10-20 Bastien Nocera + + * RELNOTES-0.25: removed + * RELNOTES-1.0: removed + * RELNOTES-1.0.x: removed + * RELNOTES-1.1.x: removed + * include/glibtop/Makefile.am: + * include/glibtop/xmalloc.h: removed xmalloc.h + * lib/command.c: (glibtop_call_l): + * lib/init.c: (_init_server): + * lib/inodedb.c: (glibtop_inodedb_open_s), + (glibtop_inodedb_close_s): + * lib/read_data.c: (glibtop_read_data_l): + * lib/xmalloc.c: removed xmalloc.h + replace all the xmalloc crap by glib memory management functions + +2003-10-20 Bastien Nocera + + * lib/Makefile.am: + * libgtop-config.in: + * libgtop.spec.in: + * libgtopConf.sh.in: + * src/inodedb/Makefile.am: removed traces of guile, intllibs and + libgnomesupport + +2003-10-20 Bastien Nocera + + * .cvsignore: updated + * configure.in: removed all traces of guile stuff + * sysdeps/guile/.cvsignore: removed + +2003-10-20 Bastien Nocera + + * sysdeps/Makefile.am: + * sysdeps/guile/ChangeLog: + * sysdeps/guile/Makefile.am: + * sysdeps/guile/guile.pl: + * sysdeps/guile/names/.cvsignore: + * sysdeps/guile/names/Makefile.am: + * sysdeps/guile/names/guile-names.pl: removed guile + +2003-10-20 Bastien Nocera + + * Makefile.am: + * configure.in: remove guile and libgnome-support stuff + +2003-10-20 Bastien Nocera + + * configure.in: make it compile + +2003-10-19 Carlos PerellĂł MarĂ­n + + * support/*: Reverted libgtop changes. It's a common module + and I should not modify it. + * Added/removed files. Now the move should be done. + +2003-10-19 Carlos PerellĂł MarĂ­n + + * libgtop-GNOME-2-0-branch moved to HEAD. + +2003-09-30 Laurent Dhima + + * configure.in: Added "sq" to ALL_LINGUAS. + +2003-09-17 Fatih Demir + + * configure.in: Added "ta" (Tamil) to the languages' list. + +2003-09-13 Carlos PerellĂł MarĂ­n + + * configure.in (ALL_LINGUAS): Removed es_ES. + +2003-09-08 Kevin Vandersloot + + * configure.in: release 2.0.5 + +2003-09-06 Taneem Ahmed + + * configure.in: Added "bn" to ALL_LINGUAS. + +2003-08-24 Kevin Vandersloot + + * configure.in: release 2.0.4 + +2003-08-13 Guntupalli Karunakar + + * configure.in: Added "hi" (Hindi) in ALL_LINGUAS. + +2003-08-13 Andrew Sobala + + * configure.in: release 2.0.3 + +2003-08-09 Dafydd Harries + + * configure.in: Added "cy" (Welsh) to ALL_LINGUAS. + +2003-08-03 Malcolm Tredinnick + + * Makefile.am: Change subdirectory build order so that + 'distclean' target work (and other targets remain working). + Fixes bug #84622. + +2003-06-10 Kjartan Maraas + + * libgtop-2.0.pc.in: Fix missing build flags. Patch from + Julio Merino. Fixes bug #103086. + * sysdeps/linux/mem.c: (glibtop_get_mem_s): Fix memory calculation + under Linux. Patch from . Fixes bug #68626. + +2003-06-10 Kjartan Maraas + + * sysdeps/freebsd/glibtop_machine.h: + * sysdeps/kernel/glibtop_private.h: + * sysdeps/solaris/glibtop_machine.h: + * sysdeps/solaris/glibtop_private.h: Comment out text after + #endif to make some compilers happy. + +2003-05-11 Andrew Sobala + + * configure.in: release 2.0.2 + +2003-05-10 Danilo Ć egan + + * configure.in: Added "sr" and "sr@Latn" to ALL_LINGUAS. + +2003-04-17 Abel Cheung + + * configure.in: Added "mk" to ALL_LINGUAS. + +2003-03-13 Christian Rose + + * configure.in: Added "ml" to ALL_LINGUAS. + +2003-03-10 Roozbeh Pournader + + * configure.in: Added "fa" to ALL_LINGUAS. + +2003-03-08 Gil "Dolfin" Osher + + * configure.in: Added he to ALL_LINGUAS. + +2003-02-25 T?”ivo Leedj?€rv + + * configure.in: Added et to ALL_LINGUAS. + +2003-02-16 Mohammad DAMT + + * po/id.po: Added Indonesian translation + * configure.in: Added "id" to ALL_LINGUAS + +2003-01-31 James Henstridge + + * acinclude.m4 (GNOME_SUPPORT_CHECKS): use AC_LIBOBJ() to set + LIBOBJS variable, since newer autoconf's barf on direct access. + This also takes care of setting LTLIBOBJS for us. + +2003-01-29 Abel Cheung + + * configure.in: Added ar to ALL_LINGUAS + +2003-01-25 Alessio Frusciante + + * configure.in: Added "it" (Italian) to ALL_LINGUAS. + +2003-01-23 Marius Andreiana + + * configure.in: Added "ro" to ALL_LINGUAS + +2003-01-22 Christian Rose + + * configure.in: Added "mn" to ALL_LINGUAS. + +2003-01-16 Daniel Yacob + + * configure.in: added am to ALL_LINGUAS + +2003-01-12 Kevin Vandersloot + + * configure.in: release 2.0.1 + +2002-12-30 Bastien Nocera + + * Added sysdeps/aix directory that was missing + +2002-10-08 Laurent Vivier + + * Framework for AIX support + +2002-08-07 Vincent Berger + + * support/: Add alloca management for AIX + * configure.in: correct checking for nm + +2002-11-03 Dmitry G. Mastrukov + + * configure.in: Added Belarusian to ALL_LINGUAS + +2002-09-26 Stanislav Brabec + + * configure.in: Added cs to ALL_LINGUAS. + +2002-09-26 jacob berkman + + * configure.in (ALL_LINGUAS): remove cs until the file actually + gets added + +2002-09-26 Stanislav Brabec + + * configure.in: Added cs to ALL_LINGUAS. + +2002-08-20 Peteris Krisjanis + + * configure.in: (ALL_LINGUAS) Added Latvian (lv). + +2002-06-25 Yanko Kaneti + + * configure.in: (ALL_LINGUAS) Added Bulgarian (bg). + +2002-05-10 Kevin Vandersloot + + * configure.in: release 2.0.0 + +2002-05-28 Carlos Perello Marin + + * configure.in (ALL_LINGUAS): Removed all es_* and added only es_ES. + +2002-05-08 Pablo Saratxaga + + * configure.in: Added Vietnamese (vi) to ALL_LINGUAS + +2002-03-12 James Henstridge + + * acinclude.m4 (LIBGTOP_HEACKER_TESTS): AM_CONDITIONAL() + statements can't be conditionally executed (automake compat fix). + (GNOME_LIBGTOP_SYSDEPS): move the conditional here so that it is + always executed. + +2002-02-10 Kevin Vandersloot + + * configure.in: bump version + + * release 1.90.2 + +2002-02-09 Bastien Nocera + + reviewed by: Kevin Vandersloot + + * configure.in: remove need for dc, and clean up + * stamp-h.in, .cvsignore: remove + +2002-02-05 Abel Cheung + + * configure.in (ALL_LINGUAS): zh_CN.GB2312 -> zh_CN + +2001-01-14 Hasbullah bin Pit + + * configure.in: Added ms in ALL_LINGUAS. + * po/ms.po: Added Malay Translation. + * po/.cvsignore: Added 'libgtop-2.0.pot'. + +2001-01-14 Abel Cheung + + * configure.in: Sync'ed ALL_LINGUAS with files in po directory, + and renamed GETTEXT_PACKAGE to avoid conflict with libgtop 1.0.x. + +2002-01-10 Kevin Vandersloot + + * acininclude.m4: add back the support stuf but make it really + work + + * configure.in: bump version number, add back GNOME_SUPPORT + check since that was causing a build failure + + * release 1.90.1 + +2002-01-09 Kevin Vandersloot + + * acinclude.m4: remove gnome support check. Fixes the build + for those with automake < 1.4p5. + + * configure.in: remove check for GNOME_SUPPORT + +2001-14-27 Miles Lane + + * acconfig.h: Added "#undef HAVE_GETTEXT" entry. + * LIBGTOP_VERSION: Removed file. + * configure.in: added glib-gettextize support and + moved in the *VERSION* stuff from LIBGTOP_VERSION. + +2001-11-27 Kevin Vandersloot + + * acinclude.m4: copy some of the macros that were formerly + in gnome-macros + + * configure.in, sysdeps/Makefile.am: comment out guile + support for now. + + * release 1.90.0 + +2001-11-26 Kevin Vandersloot + + * src/daemon/gnuserv.c: Apply patch fixing security issue from + intexxia labs - #1048-261101 + +2001-11-26 Abel Cheung + + * src/inodedb/file_by_inode.c: Rename to file_by_inode2.c + * src/inodedb/mkinodedb.c: Rename to mkinodedb2.c + + * po/POTFILES.in: Reflect above change + + * */.cvsignore: Add various files + +2001-11-25 Kevin Vandersloot + + * port stable libgtop to GNOME 2.0. Too much to detail. + pkgconfig is now used. Libs are named libgtop-2.0 etc for + parallel install. + +2001-10-17 Abel Chueng + + * configure.in, Makefile.am, include/glibtop/Makefile.am: headers + moved to $(includedir)/libgtop-1.0/glibtop. + +2001-09-16 Abel Chueng + + * configure.in: Added "zh_TW" to ALL_LINGUAS. + +2001-02-13 Martin Baulig + + Released LibGTop 1.0.12 "Gerolzhofen". + + * NEWS: Added news entry to 1.0.12. + + * LIBGTOP-VERSION: Set version number to 1.0.12, binary age 11, + interface age 11. + +2001-02-19 Simos Xenitellis + + * configure.in: Added "el" to ALL_LINGUAS. + +2001-02-15 Martin Baulig + + Released LibGTop 1.0.11 "Jasmin". + + * NEWS: Added news entry for 1.0.11. + +2001-02-14 Martin Baulig + + Merged from LIBGTOP_1_1_2_PATCHES. + + * libgtop-sysdeps.m4 (GLIBTOP_SOLARIS_RELEASE): Define this on Solaris; + we use version codes like 270 for SunOS 5.7 and 251 for SunOS 2.5.1. + + * LIBGTOP-VERSION (LIBGTOP_VERSION_SUFFIX): Added this so you can + have your tarballs called `libgtop-1.x.y-snap.tar.gz' or whatever. + This only affects the `VERSION' variable and thus how the resulting + tarball will be called, but not `LIBGTOP_VERSION_CODE' etc. + + * configure.in, acconfig.h: Added checks for + and + + * configure.in (DL_LIB): Check for dlopen() and AC_SUBST this. + + * Makefile.am: Make `aclocal.m4' also depend on `LIBGTOP-VERSION' + when in maintainer-mode. + +2001-02-14 Martin Baulig + + * include/glibtop/limits.h: Removed; this file doesn't exist + in the stable branch. + +2001-02-13 Martin Baulig + + * LIBGTOP-VERSION: Set version number to 1.0.11, binary age 10, + interface age 10. + +2001-02-13 Stanislav Visnovsky + + * configure.in: Added sk to ALL_LINGUAS + +2001-02-08 Gustavo Maciel Dias Vieira + + * configure.in (ALL_LINGUAS): Added pt_BR to ALL_LINGUAS. + +2000-11-21 Martin Baulig + + * libgtop-config.h.in: Added `--cflags', `--libs' and `--extra-libs' + parameters. + +2000-11-20 Martin Baulig + + Released LibGTop 1.0.10 "November Rain". + + * LIBGTOP-VERSION: Set version number to 1.0.10, binary age 9, + interface age 9. + +2000-05-25 Martin Baulig + + Released LibGTop 1.0.9 "Stuttgart". + + * LIBGTOP-VERSION: Set version number to 1.0.9 binary age 8, + interface age 8. + + (LibGTop 1.0.8 "Frankfurt" was not publically released.) + +2000-02-20 Martin Baulig + + * LIBGTOP-VERSION: Set version number to 1.0.8 binary age 7, + interface age 7. + +2000-02-15 Martin Baulig + + Released LibGTop 1.0.7 "Copenhagen". + +1999-10-19 Martin Baulig + + * LIBGTOP-VERSION: Set version number to 1.0.7 binary age 6, + interface age 6. + +1999-10-18 Martin Baulig + + Released LibGTop 1.0.6 "October LibGTop". + +1999-10-18 Martin Baulig + + * NEWS.old: Removed obsolete file. + + * RELNOTES-1.0.x: Added release notes for LibGTop 1.0.6. + + * TODO: Removed obsolete file. + + * NEWS: We start maintaining a NEWS file now :) + +1999-10-16 Martin Baulig + + * LIBGTOP-VERSION: Set version number to 1.0.6 binary age 5, + interface age 5. + +1999-10-09 Jesus Bravo Alvarez + + * configure.in (ALL_LINGUAS): Added Galician (gl) + +1999-09-29 Martin Baulig + + Released LibGTop 1.0.5. + +1999-09-29 Martin Baulig + + * configure.in (libgtop_top_builddir): AC_SUBST this. + +1999-09-24 Martin Baulig + + * LIBGTOP-VERSION: Set version number to 1.0.5 binary age 4, + interface age 4. + +1999-09-24 Martin Baulig + + Released LibGTop 1.0.4. + +1999-09-22 Kjartan Maraas + + * configure.in: Added "da" to ALL_LINGUAS. + +1999-09-19 Martin Baulig + + * libgtopConf.sh.in: Added MODULE_VERSION on Miguel's + request (set it to "libgtop-@LIBGTOP_VERSION@"). + +1999-09-18 Pablo Saratxaga + + * configure.in, po/*.po: merged *.po files from HEAD CVS + +1999-09-17 Martin Baulig + + * configure.in: Make it work if we have GNOME and the user + gave use --without-gnome (fixes bug #1735). + +1999-09-17 Martin Baulig + + * LIBGTOP-VERSION: Set version number to 1.0.4 binary age 3, + interface age 3. + +1999-09-16 Martin Baulig + + Merged everything since May 31 from HEAD and released + LibGTop 1.0.3. + +1999-07-29 Martin Baulig + + * include/glibtop/error.h: Use G_GNUC_UNUSED. + + * configure.in (ENABLE_STATIC, ENABLE_SHARED): New automake + conditionals. + +1999-07-11 Tomas Ogren + + * configure.in: Added sv to ALL_LINGUAS + +1999-07-11 Tomas Ogren + + * sysdeps/names/procmem.c: Fixed a tyop + +1999-05-31 Martin Baulig + + * LIBGTOP-VERSION: Set version number to 1.0.3 binary age 2, + interface age 2. + +1999-05-31 Martin Baulig + + Released LibGTop 1.0.2. + +1999-05-26 Martin Baulig + + * configure.in (INCLUDES): Define `LIBGTOP_VERSION_CODE' here so we + can use version conditionals in the sysdeps code. + +1999-05-25 Martin Baulig + + * libgtop-sysdeps.m4: Make the I4B check work for NetBSD. + +1999-05-16 Martin Baulig + + * doc: Merged the LibGTop Manual from the HEAD. + +1999-03-01 Martin Baulig + + Released LibGTop 1.0.1. + + * LIBGTOP-VERSION: Set version number to 1.0.1 binary age 0, + interface age 0. + +1999-03-01 Martin Baulig + + * configure.in (LIBGTOP_LIBS): Move `-lgtop_common' last to + make it work with static-only libs. Thanks to Roderik Muit + for pointing this out. + (PERL): First check for `perl5', then for `perl'. Thanks again + to Roderik Muit. + +1999-02-24 Martin Baulig + + Released LibGTop 1.0.0. + + * LIBGTOP-VERSION: Set version number to 1.0.0 binary age 0, + interface age 0. + + * configure.in: Require GLIB >= 1.2.0. + +1999-02-23 Martin Baulig + + Released LibGTop 0.100.0. + + Make the copyright of LibGTop be the GNU General Public License. + + * LIBGTOP-VERSION: Set version number to 0.100.0 binary age 0, + interface age 0. + + * copyright.txt: Set the year to 1998-99 and pretty-format it a + little bit. Same in all C source and header files. + +1999-02-21 Martin Baulig + + * configure.in (LIBGTOP_*_INCS): Define `HAVE_GLIBTOP_MACHINE_H' + if appropriate. + +1999-02-19 Martin Baulig + + Released LibGTop 0.99.9. + + * LIBGTOP-VERSION: Set version number to 0.99.9 binary age 0, + interface age 0. + + * include/glibtop/error.h: Don't include . + * sysdeps/common/error.c: Use `int' not `gint'. + + * misc/porting-libgtop.txt: Added a few instructions on how + to port LibGTop to Solaris. + + * Replace all __BEGIN_DELCS with LIBGTOP_BEGIN_DECLS and all + __END_DECLS with LIBGTOP_END_DECLS; remove all __P macros and + use real function prototypes. + +1999-02-18 Martin Baulig + + * include/glibtop/*.h: Use glib-like function prototypes + instead of "extern __P((args))". + + * sysdeps/common/error.h: Replaced inline with static. + +1999-02-18 Martin Baulig + + * */*.awk: Replaced all awk scripts with perl scripts since it is + more likely that people have a working perl interpreter than GNU + awk on their system. + +1999-02-18 Martin Baulig + + * sysdeps/common/error.c (glibtop_error_r, glibtop_warn_r): Define + them as G_INLINE_FUNC in if possible. + (glibtop_error_io_r, glibtop_warn_io_r): Likewise. + (glibtop_error_vr, glibtop_warn_vr): New functions taking a va_list. + (glibtop_error_io_vr, glibtop_warn_io_vr): New functions taking an + errno an a va_list. + +1999-02-17 Martin Baulig + + Released LibGTop 0.99.8. + +1999-02-16 Martin Baulig + + * examples/Makefile.am, lib/Makefile.am, src/daemon/Makefile.am, + sysdeps/common/Makefile.am, sysdeps/guile/Makefile.am, + sysdeps/guile/names/Makefile.am, sysdeps/kernel/Makefile.am, + sysdeps/linux/Makefile.am, sysdeps/names/Makefile.am, + sysdeps/osf1/Makefile.am, sysdeps/stub/Makefile.am, + sysdeps/stub_suid/Makefile.am, sysdeps/sun4/Makefile.am: + Initialize INCLUDES to `@INCLUDES@' to make it clear that it is + set in configure.in. It is ok to add things there, but you must + not remove the `@INCLUDES@'. + +1999-02-15 Jeff Garzik + + * examples/Makefile.am, lib/Makefile.am, src/daemon/Makefile.am, + sysdeps/common/Makefile.am, sysdeps/guile/Makefile.am, + sysdeps/guile/names/Makefile.am, sysdeps/kernel/Makefile.am, + sysdeps/linux/Makefile.am, sysdeps/names/Makefile.am, + sysdeps/osf1/Makefile.am, sysdeps/stub/Makefile.am, + sysdeps/stub_suid/Makefile.am, sysdeps/sun4/Makefile.am: + Removed hardcoded gcc arguments from CFLAGS. + + * include/glibtop/error.h: + Added FIXME comment about varargs macros breaking Sun cc + compilation. + +1999-02-12 Martin Baulig + + Thanks to Frederic Devernay for pointing out that we need to define + __BEGIN_DECLS and __END_DECLS when not using GNOME. + + * configure.in: Define `WITHOUT_GNOME' if appropriate. + + * include/glibtop/global.h: Define __BEGIN_DECLS and __END_DECLS + when WITHOUT_GNOME not when _IN_LIBGTOP. + +1999-02-12 Martin Baulig + + * include/glibtop/global.h: Applied patch from Frederic Devernay; + __BEGIN_DECLS and __END_DECLS are only defined inside _IN_LIBGTOP. + +1999-02-10 Martin Baulig + + * configure.in (program_invocation_name): Check whether we need + to declare this; some libc5 systems define that symbol but do + not declare it in any header file. + +1999-02-10 Martin Baulig + + * libgtop.spec.in, libgtop.spec: Replaced libgtop.spec with + with libgtop.spec.in, so libgtop.spec is now a generated file. + +1999-02-05 Martin Baulig + + * include/glibtop/global.h: Enclose some of the stuff in this + file in `#ifdef _IN_LIBGTOP'. + +1999-02-04 Martin Baulig + + * include/glibtop/global.h (_): Use dgettext (), not gettext (). + +1999-01-23 Martin Baulig + + * libgtopConf.sh.in (LIBGTOP_DATADIR): New variable. + +1999-01-06 Martin Baulig + + * libgtop-sysdeps.m4: Always enable SMP support for Linux. + +1999-01-03 Martin Baulig + + Released LibGTop 0.99.2. + +1999-01-05 Martin Baulig + + * libgtop.spec: Always build SMP support; binary packages should + contain all possible features. + + * configure.in: LibGTop will now require GLIB >= 1.1.12. + +1999-01-05 Martin Baulig + + * configure.in: Make it abort if the `dc' utility is not installed. + +1999-01-03 Martin Baulig + + Released LibGTop 0.99.1. + +1998-12-25 Martin Baulig + + * configure.in (LIBGTOP_INCS): Define `HAVE_LIBGTOP_SMP' if SMP + support was enabled. + +1998-12-22 Yukihiro Nakai + + * configure.in (ALL_LINGUAS): Added `ja'. + +1998-12-18 Martin Baulig + + * Makefile.am: Applied patch from Edward Jason Riedy to use '#' + as separator in sed commands. + +1998-12-15 Martin Baulig + + Released LibGTop 0.99.0 which is a feature-freezed version + for GNOME 1.0. + +1998-12-09 Martin Baulig + + * configure.in: We need to define LIBSUPPORT and SUPPORTINCS under + all circumstances as it is in gnome-libs. + + * include/glibtop/procargs.h (glibtop_get_proc_args): Make the + return value a `char *' instead of a `const char *'. + +1998-12-09 Martin Baulig + + * LIBGTOP-VERSION: Set version number to 0.29.1. + +1998-12-09 Martin Baulig + + * libgtop-sysdeps.m4: Moved here from the macros directory, + formerly known as `macros/gnome-libgtop-sysdeps.m4'. + (--enable-hacker-mode): New command line parameter to configure, + enables building of unstable sysdeps directories. + (LIBGTOP_HACKER_TESTS): New macro to check for unsafe things when + hacker mode was enabled. + +1998-12-06 Martin Baulig + + * configure.in: Make it abort if GNOME cannot be found and + the --without-gnome parameter was not given. + +1998-12-03 Martin Baulig + + * LIBGTOP-VERSION (LIBGTOP_VERSION_CODE): Pipe the expression + through `dc' so we get a real number. + +1998-12-03 Martin Baulig + + LibGTop now requires gettext >= 0.10.35. + + * intl: Removed &intl CVS alias. + +1998-11-27 Martin Baulig + + * LIBGTOP-VERSION: Set version number to 0.29.0. + + * TODO: Add things that need to be done before Dec 15. + + This is basically a feature freeze for the C language part + of LibGTop except for things that are marked with (***) in + the TODO. + +1998-11-20 Martin Baulig + + * sysdeps/common/mountlist.c: Applied a patch from Kenneth Stailey to + make it work on OpenBSD. + +1998-11-18 Martin Baulig + + * lib/open.c (glibtop_open_l): We need to set argv[0] in call + to execl () to avoid a core dump in _init () on FreeBSD 3.0. + +1998-11-11 Martin Baulig + + * include/glibtop/gnuserv.h (MCOOKIE_SCREEN): Don't define this + any longer, we now use the port the daemon is listening on instead + of a fixed screen. + +1998-11-11 Martin Baulig + + * configure.in (--enable-debug): Define LIBGTOP_ENABLE_DEBUG + if this parameter is given. + (--enable-fatal-warnings): New parameter to make all warnings + fatal; define `LIBGTOP_FATAL_WARNINGS' if given. + + * sysdeps/common/error.c (glibtop_error_r): Use abort () instead + of exit () if LIBGTOP_ENABLE_DEBUG. + (glibtop_error_io_r): Likewise. + (glibtop_warn_r): Call abort () if LIBGTOP_FATAL_WARNINGS. + (glibtop_warn_io_r): Likewise. + + [NOTE: To get a core dump of the libgtop_server, you need to + remove all suid/sgid bits and invoke it as a priviledged user.] + +1998-11-08 Raja R Harinath + + * Makefile.am (support): Don't build if not BUILD_GNOME_SUPPORT. + +1998-11-02 Martin Baulig + + * include/glibtop/parameter.h: Added `GLIBTOP_PARAM_REQUIRED'. + + * lib/parameter.c (glibtop_set_parameter_l): It's no longer + allowed to set GLIBTOP_PARAM_FEATURES. + (glibtop_get_parameter_l): You can use `GLIBTOP_PARAM_REQUIRED' + to read server->required and ... + (glibtop_set_parameter_l): ... set it here. + +1998-10-26 Martin Baulig + + Added `Network Load' feature (netload). + + * include/glibtop/netload.h: New file. + * features.def: Added new feature `netload'. + +1998-10-26 Martin Baulig + + Added `Command Line Parameters' feature (proc_args). + + * include/glibtop/proc_args.h: New file. + * features.def: Added new feature `proc_args'. + + * lib/lib.awk: New type `unsigned' for the features.def which + is `unsigned'. + +1998-10-25 Martin Baulig + + Added PPP/ISDN support. + + * include/glibtop/ppp.h: New file. + * features.def: Added new feature `ppp'. + + * acconfig.h (HAVE_I4B): Defined if we have the I4B package. + (HAVE_I4B_ACCT): Defined if we have ISDN statistics with I4B. + + * misc: New directory. + * misc/i4b_acct.txt: Read this file to get ISDN statistics on BSD. + + * lib/lib.awk: New type `ushort' for the features.def which is + `unsigned short'. + +1998-10-20 Martin Baulig + + * include/glibtop/proc_signal.h: Use a 2-element-array of + type `guint64' for all signal masks instead of just + scalar numbers. This avoids problems on systems with more + than 64 signals. + + If there is any operating system out there with even more than + 128 signals, we can simply increase the number of array elements + here. + + [NOTE for people porting libgtop: + + Please use all 64 bits of the `guint64' and not just 32 - the + signal number (as it is used in calls to kill () ...) should be + a bit-index into this field; if a process ignores for instance + signal 64, it has the 0-bit of sigcatch[1] set, if it ignores 63, + this is the 63-bit of sigcatch[0] and so on ... + + The mapping between signal numbers and their names is done via the + glibtop_sys_siglist [] field which should be declared in + sysdeps/@sysdeps_dir@/siglist.c - see linux for an example. + ] + + * features.def: It's now safe to put things like `loadavg[3]' + here - the awk skripts should correctly threat this as an array. + +1998-10-12 Martin Baulig + + * configure.in (GNOME_COMPILE_WARNINGS): Let the user enable + compiler warnings. + (--with-libgtop-guile): Make the default to build the guile + interface if guile can be found. + + * Makefile.am (confexec_DATA): Install `feature.def' as + `libgtop-features.def'. + * libgtop.spec: Added `%{prefix}/lib/*.def' to the file list. + +1998-10-11 Martin Baulig + + * configure.in: Don't create `guile/Makefile'. + * Makefile.am (DIST_SUBDIRS): Removed. + (SUBDIRS): Removed `guile'. + + * include/glibtop/*.h: Removed external delarations of all + `glibtop_guile_*' functions that were formerly defined in + sysdeps/guile/guile.c and sysdeps/guile/names/guile-names.c. + +1998-10-11 Martin Baulig + + * sysdeps/guile/ChangeLog: New file. + + * LIBGTOP-VERSION: Set version number to 0.26.3. + * libgtop.spec: Likewise. + + * Makefile.am (confexec_DATA): Added `features.def'. + * libgtop-config.in: Added `--features-def-file' parameter + to get pathname of installed `features.def' file. + + * perl: Removed everything in this subdirectory. This was + only experimental. The real perl bindings for LibGTop are + in the libgtop-bindings module. + +1998-10-11 Martin Baulig + + * src/inodedb/Makefile.am: Removed @libs_xauth@ and -lgdbm + from the _LDADD variables since libtool automatically gets + the dependencies. + * src/daemon/Makefile.am: Likewise. + * examples/Makefile.am: Likewise. + +1998-10-10 Martin Baulig + + * configure (LIBGTOP_EXTRA_LIBS): Added `GLIB_LIBS'. + + * perl/ChangeLog: New file. + +1998-10-07 Martin Baulig + + * configure.in (ALL_LINGUAS): Added `de'. + +1998-10-03 Martin Baulig + + * include/glibtop/global.h: Only include system header files + if we are `_IN_LIBGTOP'. + (G_GNUC_NORETURN, G_GNUC_CONST, G_GNUC_UNUSED): Added those + definitions if we are `_IN_LIBGTOP'. + +1998-09-29 Sung-Hyun Nam + + * configure.in (ALL_LINGUAS): add `ko' + * po/ko.po: new file. + +1998-09-27 Martin Baulig + + * configure.in: Make it really *require* GLIB >= 1.1.3. + +1998-09-27 Raja R Harinath + + * configure.in: Move check for `-lresolv', `-lsocket' and `-lnsl' + after X11 checks. + +1998-09-27 Martin Baulig + + * configure.in: Do not even check for guile if it is disabled. + +1998-09-12 Martin Baulig + + * include/glibtop/sysinfo.h: New file. This is used in guname to + fetch as many information about the system as possible like detailed + information about hardware etc. + + * configure.in (AM_PATH_GLIB): LibGTop now requires glib. + +1998-09-09 Martin Baulig + + * include/glibtop/proctime.h (glibtop_proc_time): Added `xcpu_utime' + and `xcpu_stime'. + + * sysdeps/linux/ChangeLog: New file. + + * glibtop.h (glibtop): Added `ncpu'. This is zero for single processor + systems and the number of CPUs otherwise. + + * include/glibtop/cpu.h (glibtop_cpu): Added `xcpu_total', `xcpu_user', + `xcpu_nice', `xcpu_sys' and `xcpu_idle'. + (GLIBTOP_NCPU): #define this to 4. + +1998-09-08 Martin Baulig + + * configure.in: Make the default to disable guile. + +1998-08-30 Martin Baulig + + * LIBGTOP-VERSION (LIBGTOP_VERSION_CODE): Added. This is a numerical + constant ("1.234.567" -> 1234567) to be used in C preprocessor + conditionals. + +1998-08-29 Martin Baulig + + * LIBGTOP-VERSION (LIBGTOP_INTERFACE_AGE, LIBGTOP_BINARY_AGE): Added. + * configure.in (LIBGTOP_INTERFACE_AGE, LIBGTOP_BINARY_AGE): AC_SUBST. + (LT_RELEASE, LT_CURRENT, LT_REVISION, LT_AGE): AC_SUBST. + (LT_VERSION_INFO): Sets `-version-info' for libtool. + + * */Makefile.am: We now use the correct `-version-info' parameter + for libtool. + +1998-08-25 Martin Baulig + + * include/glibtop/command.h (glibtop_call): Third argument is + now `const void *'. + + * include/glibtop/xmalloc.h (g_free): Now taking a + `const void *'. + +1998-08-25 Martin Baulig + + * src/daemon/ChangeLog: New file. + + * sysdeps/sun4/ChangeLog: New file. + + * sysdeps/stub/ChangeLog: New file. + + * configure.in: Added check for `-lsocket'. + (LIBGTOP_INCS): Added $(SUPPORTINCS). + (INCLUDES): Added $(SUPPORTINCS). + + * acconfig.h: Added `NEED_DECLARATION_GETHOSTNAME', + `NEED_DECLARATION_SETREUID', `NEED_DECLARATION_SETREGID' + and `NEED_DECLARATION_GETPAGESIZE'. + + * includue/glibtop/global.h (): Include this. + + * lib/init.c (_init_server): Declared `static'. + + * lib/read_data.c: Added cast to `const void *' in calls to + `recv' and `read' to avoid compiler warnings. + + * configure.in (INCLUDES): No longer using installed header files. + +1998-08-23 Martin Baulig + + * features.def (mountlist): Using `int(fs_usage)'. + +1998-08-21 Martin Baulig + + * ANNOUNCE-0.25: Released LibGTop 0.25 stable. + +1998-08-18 Martin Baulig + + * LIBGTOP-VERSION: Set version number to 0.25.0. There is now really + a feature freeze until it's released, bug fixes only ... + + * include/glibtop/procmap (glibtop_map_entry): Added `flags' and + `filename' fields. + + * LIBGTOP-VERSION: Added `LIBGTOP_MICRO_VERSION'. + * libgtopConf.sh.in: Likewise. + + * libgtopConf.sh.in: Added `LIBGTOP_EXTRA_LIBS'. + + * sysdeps/linux/procmap.c: Added implementation. + +1998-08-17 Martin Baulig + + * include/glibtop/procmap (glibtop_map_entry): Added `offset' and + `perm' fields. + + * src/inodedb: New directory. + * src/inodedb/README: New file - read it to know what this is about. + + * configure.in (--with-libgtop-inodedb): New `configure' parameter. + * include/glibtop/inodedb.h: New file. + * sysdeps/common/inodedb.c: New file. + +1998-08-17 Martin Baulig + + * LIBGTOP-VERSION: Released libgtop-0.25pre1. With this + release I made what Linus calles a ``feature freeze'' until + 0.25 is out. A Tarball and RPMS can be found at my site: + `ftp://ftp.home-of-linux.org/pub/'. + +1998-08-17 Martin Baulig + + * libgtop-conf.in: New file. + +1998-08-16 Martin Baulig + + * include/glibtop/loadavg.h (glibtop_loadavg): Added new + fields `nr_running', `nr_tasks', `last_pid'. + * features.def (loadavg): Added new fields `nr_running', + `nr_tasks', `last_pid'. + +1998-08-12 Martin Baulig + + * include/glibtop/procsegment.h (glibtop_proc_segment): Using + `text_rss', `shlib_rss', `data_rss' and `dirty_size' instead of + `tsr', `lrs', `drs' and `dt'. New field `stack_rss'. + + * sysdeps/linux/procmem.c: Memory sizes now correctly in bytes. + * sysdeps/linux/procsegment.c: Dito. + + * sysdeps/kernel/procsegment.c: Stack pages are reported via + `stack_rss' and no longer count towards `data_rss' + * kernel/table.h (table_proc_segment): Added `srs' field. + * kernel/table21/module.c (TBL_PROC_SEGMENT): Added kernel support + for this. + + * sysdeps/{linux, kernel, stub}/procmap.c: New files. + +1998-08-11 Martin Baulig + + * guile/features.awk: New file. + * guile/make-docbook.scm: Improved automatical generation of + the documentation file `reference.sgml'. + * guile/reference.sgml: This file is automatically generated, + but many people have problems with it, so we add it to CVS. + +1998-08-10 Martin Baulig + + * include/glibtop/procmap.h (glibtop_proc_map): New file. + * features.def: Added definition of `proc_map'. + + * include/glibtop/proctime.h (glibtop_proc_time): Added new + fields `rtime' and `frequency'. + +1998-08-09 Martin Baulig + + * include/glibtop/prockernel.h (glibtop_proc_kernel): Renamed + `wchan' field to `nwchan'; added `wchan' which is of type `char [40]'. + + * features.def: Changed format of this file to support multiple + arguments to be passed to a function. + + * include/glibtop/proclist.h: `glibtop_get_proclist' now takes two + more arguments `method' and `param'. + +1998-08-07 Martin Baulig + + * sysdeps/freebsd/ChangeLog: New file. + + * src/server: Removed. + * src/daemon/{server, version}.c: New files. + * src/daemon/Makefile.am: Added `libgtop_server'; this has been + moved here from `src/server' since it shares some source code files + with the `libgtop_daemon'. + + * LIBGTOP-VERSION: Added `LIBGTOP_SERVER_VERSION'. + * src/daemon/gnuserv.c, lib/open.c: Improved version check between + client and server. + + * include/glibtop/output.h: Removed. + + * sysdeps/stub_suid: New directory. This is mainly used as example + for people porting libgtop to other systems. + + * sysdeps/common/sysdeps_suid.c: New file. + Defines `glibtop_init_hook_p'. + + * sysdeps/osf1/*.c (glibtop_init__s): New functions. + (glibtop_init__p): New functions. + +1998-08-07 Martin Baulig + + * glibtop.h (_glibtop): New fields `error_method', `sysdeps' and + `required'. I added an improved error handling: the client can tell + the libraries which fields are absolutely required for each features + and if it fails to set one of them, this will create an error which + is handled depending upon the `error_method'. + + * include/glibtop/open.h: Define some constants for `error_method'. + + * lib/sysdeps.c (glibtop_get_sysdeps_r): No longer actually call any + sysdeps function, it now simply copies `server->sysdeps'. + (_glibtop_init_hook_s): Added. List of functions to be called during + `glibtop_init_s' set to `glibtop_init__s'. + + * include/glibtop/sysdeps.h (): Removed. + (glibtop_init_func_t): New typedef. + (_glibtop_init_hook_s): Added. + + * sysdeps/linux/*.c (glibtop_init__s): New functions. + (glibtop_get_proc_*): Zero is now a valid pid. + + * sysdeps/kernel/*.c (glibtop_init__s): New functions. + (glibtop_get_proc_*): Zero is now a valid pid. + +1998-08-06 Martin Baulig + + * configure.in (HAVE_SOCKETS, HAVE_SOCKADDR_SUN_LEN): New checks. + + * include/glibtop/*.h: Using `GLIBTOP_GUILE' instead of `HAVE_GUILE' + so one should be able to use libgtop without guile in an application + even if guile is installed. + + * sysdeps/common/mountlist.c: Fixed some `xstrdup' problems. + + * lib/open.c: Now correctly reading server features for + `GLIBTOP_METHOD_PIPE'. + + * sysdeps/freebsd: New directory. + +1998-08-01 Martin Baulig + + * include/glibtop/swap.h (glibtop_swap): Added `pagein' and `pageout'. + + * kernel/table20/table.h: Removed. + * kernel/table21/table.h: Removed. + * kernel/table.h: Added. Things are now binary compatible between + both kernel versions. + +1998-07-30 Martin Baulig + + * acconfig.h (guint64, int64_t): Added. + + * lib/lib.awk: Using correct `(1 << GLIBTOP_SYSDEPS_)' + in call to `glibtop_init_r'. + + * configure.in (GNOME_LIBGTOP_TYPES): New check. + + * include/glibtop/*.h: Using `guint64' instead of `unsigned long' + and `long' to avoid problems when client is on a 32bit system and + the server on a 64bit system. + + * sysdeps/common/gnuslib.c: Using `0xffffffff' instead of -1 + as error code for inet_addr () since on 64bit systems, + `inet_addr (some_error) != (INET_ADDR) -1'. + + * configure.in: Only defining guile stuff if + we really have guile. + +1998-07-29 Martin Baulig + + * guile/ChangeLog: New file. + + * features.def: New format - now includes type of return value + and parameters. + + * lib/lib.awk: Changed to use new `features.def'. + * sysdeps/guile/guile.awk: Dito; + * sysdeps/guile/names/guile-names.awk: Dito. + + * libgtopConf.sh.in: Added + `LIBGTOP_NAMES_LIBS', `LIBGTOP_NAMES_INCS', + `LIBGTOP_GUILE_NAMES_LIBS', `LIBGTOP_GUILE_NAMES_INCS', + `LIBGTOP_MAJOR_VERSION', `LIBGTOP_MINOR_VERSION' + `LIBGTOP_VERSION', `libgtop_sysdeps_dir'. + + * acinclude.m4 (AC_LC_SYSDEPS): Removed since this has been + replaced with `GNOME_LIBGTOP_SYSDEPS' long ago. + + * LIBGTOP-VERSION: New file. + + * */Makefile.am (INCLUDES): Removed; now defined in `configure.in'. + + * sysdeps/names/mountlist.c: New file. + + * lib/{init, open}.c (GTOP_SERVER): Renamed to `LIBGTOP_SERVER'. + + * configure.in (INCLUDES): Added definition. + (libgtop_want_names): Always true; `libgtop_names.la' is now + always created since some other programs rely upon it - but + have to use `LIBGTOP_NAMES_LIBS' and `LIBGTOP_NAMES_INCS' to + use it in your application. + (libgtop_want_guile_names): Always true; but you have to use + `LIBGTOP_GUILE_NAMES_LIBS' and `LIBGTOP_GUILE_NAMES_INCS' to + use it in your application. + (LIBGTOP_LIBS): Removed `-lgtop_names' and `-lgtop_guile_names'. + (LIBGTOP_NAMES_LIBS): New variable. Use it to link your + application with the names interface. + (LIBGTOP_NAMES_INCS): New variable. Also #defines `GLIBTOP_NAMES' + which is now required if your application wants to use the names + interface. + (LIBGTOP_GUILE_NAMES_LIBS): New variable. Use it to link your + application with the guile names interface. + (LIBGTOP_GUILE_NAMES_INCS): New variable. Also #defines + `GLIBTOP_NAMES' and `GLIBTOP_GUILE_NAMES' which are now required + if your application wants to use the guile names interface. + +1998-07-24 Martin Baulig + + * sysdeps/common/mountlist.c (glibtop_get_mountlist_s): + Added `all_fs' parameter. + + * sysdeps/{kernel, linux}/*.c: Replaced `glibtop_init_r' with + `glibtop_init_s'. + + * sysdeps/sun4/open.c (glibtop_init_p): Removed `program_name' + parameter. + + * sysdeps/osf1/glibtop_suid.h: New file. + + * sysdeps/osf1/glibtop_server.h: Now correctly using + `(1 << GLIBTOP_SYSDEPS_*)' instead of `GLIBTOP_SYSDEPS_*'. + + * sysdeps/osf1/open_suid.c (glibtop_init_p): New function. + + * sysdeps/osf1/proc*.c: Done some more work here. + +1998-07-23 Martin Baulig + + * include/glibtop/procsignal.h (glibtop_proc_signal): + Changed type for `signal', `blocked', `sigignore' and + `sigcatch' to `unsigned long long'. + +1998-07-22 Martin Baulig + + * include/glibtop/fsusage.h: New file. + + * features.def: Added new feature `fsusage'. + + * sysdeps/common/fsusage.c (glibtop_get_fsusage_s): New function. + (get_fs_usage): Declared as `static'. + + * sysdeps/names/fsusage.c: New file. + + * include/glibtop/mountlist.h: New file. + + * features.def: Added new feature `mountlist'. + + * sysdeps/common/mountlist.c (glibtop_get_mountlist_s): New function. + (read_filesystem_list): Declared as `static'. + + * sysdeps/common/Makefile.am (libgtop_common_la_SOURCES): + Added `fsusage.[ch]' and `mountlist.[ch]'. + + * include/glibtop/signal.h: New file. + + * sysdeps/{kernel, linux, osf1, sun4, stub}/siglist.c: New files. + +1998-07-22 Martin Baulig + + * lib/init.c (glibtop_init_s): Added this init function of + the sysdeps directory `libgtop_sysdeps.la'. + + * lib/open.c (glibtop_open_l): Unconditionally calling + `glibtop_init_s' after server initialization. + + * lib/lib.awk: Removed references to functions from + `libgtop_sysdeps_suid.la' to avoid undefined symbols. + + * sysdeps/stub/open.c (glibtop_open_s): Renamed this + function from `glibtop_open_r'. + + * sysdeps/stub/close.c (glibtop_close_s): Renamed this + function from `glibtop_close_l'. + + * sysdeps/kernel/open.c (glibtop_open_s): Renamed this + function from `glibtop_open_r'. + + * sysdeps/kernel/close.c (glibtop_close_s): Renamed this + function from `glibtop_close_l'. + + * sysdeps/linux/open.c (glibtop_open_s): Renamed this + function from `glibtop_open_r'. + + * sysdeps/linux/close.c (glibtop_close_s): Renamed this + function from `glibtop_close_l'. + + * sysdeps/osf1/Makefile.am (lib_LTLIBRARIES): Added + `libgtop_sysdeps_suid.la' for the suid server. + + * sysdeps/osf1/open_suid.c (glibtop_open_p): New file. + Contains all stuff that was formerly in `open.c'. + + * sysdeps/osf1/open.c: Moved everything from here into + the new file `open_suid.c'. + + * sysdeps/osf1/open.c (glibtop_open_s): New function. + + * sysdeps/osf1/close_suid.c (glibtop_close_p): New file. + + * sysdeps/osf1/close.c (glibtop_close_s): New function. + + * sysdeps/osf1/*.c: Using the new init, open and close + functions. + + * sysdeps/sun4/Makefile.am (lib_LTLIBRARIES): Added + `libgtop_sysdeps_suid.la' for the suid server. + + * sysdeps/sun4/nosuid.c (glibtop_open_s, glibtop_close_s): New file + + * sysdeps/sun4/*.c: All functions now have the `_p' suffix. + + * sysdeps/common/Makefile.am (lib_LTLIBRARIES): Added + `libgtop_suid_common.la' which only contains stuff that is + needed in the suid parts. + + * sysdeps/common/xmalloc.c: Using `glibtop_error_io_r' instead + of `glibtop_error_r'. + + * sysdeps/{kernel, linux, osf1, sun4, stub}/init.c: Removed. + `glibtop_init_s' has been moved into `lib/init.c' since it's the + same in all the sysdeps directories. + + * src/server/main.c: It is now an error to request a feature that + does not need the suid server. + + * src/proxy: Removed. + +1998-07-21 Martin Baulig + + * doc/ChangeLog: New file. + + * sysdeps/kernel/*.c: Using `glibtop_error_io_r' instead + of `glibtop_error_r'. + + * sysdeps/kernel/proclist.c: Now using the table () function, too. + This means that currently the table () function can fetch all + information for libgtop and you can even unmount /proc ! + +1998-07-18 Martin Baulig + + * lib/{init, open}.c: Added `GLIBTOP_METHOD_PIPE' again. + + * src/server/main.c: Removed gettext stuff. + +1998-07-17 Martin Baulig + + * sysdeps/common/sysdeps.c (glibtop_get_sysdeps_r): Using + library functions with '_l' prefix instead of directly calling + sysdeps code with '_r' prefix. This is necessary for client/server + mode. + + * lib/lib.awk (glibtop_get_*): Now correctly using + `(1 << GLIBTOP_SYSDEPS_*)' instead of `GLIBTOP_SYSDEPS_*'. + + * sysdeps/sun4/proclist.c (glibtop_get_proclist_p): Added + implementation of that feature. + + * sysdeps/sun4/proc_{uid, state}.c: Now working quite well. + + * sysdeps/sun4/proc_{mem, time, signal, kernel, segment}.c: Added + some basic implementation; this isn't really working yet. + + * sysdeps/linux/sem_limits.c: Applied patch from Albert K T Hui + for glibc 2.1. + +1998-07-15 Martin Baulig + + * sysdeps/sun4/loadavg.h: New file. Imported from top 3.4. + + * sysdeps/sun4/uptime.c (glibtop_get_uptime_p): Added + implementation of that function using glibtop_get_cpu (). + + * sysdeps/sun4/loadavg.c (glibtop_get_loadavg_p): Added + implementation of that feature. + + * sysdeps/sun4/{shm_limits.c, msg_limits.c, shm_limits.c}: + Added implementation of this features. + +1998-07-14 Martin Baulig + + * src/daemon/server_config.h.in: Added some comments. + + * src/daemon/server_config.pl: New file. This is a script you can use + to create `server_config.h'. It will query you for some configuration + options. + + * configure.in (AC_PROG_AWK): Replaced this test with explicit test + for `gawk' and `awk' since `mawk' doesn't work. + +1998-07-14 Martin Baulig + + * src/daemon/gnuserv.c: Doing correct server initialization + using `glibtop_set_parameter_l' and `glibtop_init_r'. + + * src/daemon/main.c: Removed call to `glibtop_init_r'. + + * lib/open.c (glibtop_open_l): We now call the open function + of the sysdeps directory (glibtop_open_r) for server method + `GLIBTOP_METHOD_DIRECT'. + + * sysdeps/{linux, sun4, stub}/open.c: No longer `memset' + server to zero. + + * src/daemon/slave.c: New file. + + * src/daemon/*.c: Done some more work on the daemon. + + * sysdeps/common/gnuslib.c: Removed IPC stuff. + + * include/glibtop/gnuserv.h: Removed IPC stuff. + + * include/glibtop/command.h (glibtop_response_unit): Added + typedef for `struct _glibtop_response_unit'. + + * lib/Makefile.am: Using `$(top_srcdir)/features.def' + instead of `$(top_builddir)/features.def'. + + * sysdeps/guile/Makefile.am: Using `$(top_srcdir)/features.def' + instead of `$(top_builddir)/features.def'. + + * sysdeps/guile/names/Makefile.am: Dito. + + * sysdeps/stub/*.c: changed suffix of all functions + from '_s' to '_r'; see also ChangeLog entry from Jun 6. + +1998-07-13 Martin Baulig + + * src/daemon/server_config.h: Removed from CVS. + This is a config file which needs to be edited. + + * src/daemon/server_config.h.in: Added. This is just + an example for `server_config.h'. + +1998-07-13 Martin Baulig + + * glibtop.h: Fixed invocation of `glibtop_close_r'. + + * sysdeps/linux/procstate.c: Added missing `fclose'. + + * include/glibtop/gnuserv.h (UNIX_DOMAIN_SOCKETS): Defining. + + * include/glibtop/open.h (GLIBTOP_METHOD_UNIX): Added. + + * lib/init.c: Added new method `GLIBTOP_METHOD_UNIX'. + + * lib/open.c: Added support for Unix Domain Sockets. + + * lib/close.c: Now closing inet and unix connections. + + * lib/parameter.c (glibtop_set_parameter_l): You can now + set the `method' and `features' fields. + + * src/daemon/server_config.h: New file. + + * src/daemon/{gnuserv.c, main.c}: More work on the server. + +1998-07-10 Martin Baulig + + * src/Makefile.am (SUBDIRS): Removed `proxy'. This directory + is considered obsolete and will be removed soon. + +1998-07-06 Martin Baulig + + * sysdeps/common/mountlist.c: using functions from `xmalloc.c'. + + * sysdeps/common/error.c: all functions now accept NULL as + `server' argument. + + * acconfig.h (AFS, MOUNTED_FREAD, MOUNTED_FREAD_FSTYP, + MOUNTED_GETFSSTAT, MOUNTED_GETMNT, MOUNTED_GETMNTENT1, + MOUNTED_GETMNTENT2, MOUNTED_GETMNTINFO, MOUNTED_LISTMNTENT, + MOUNTED_VMOUNT, STAT_STATFS3_OSF1, STAT_READ_FILSYS, + STAT_STATFS2_BSIZE, STAT_STATFS2_FSIZE, STAT_STATFS2_FS_DATA, + STAT_STATFS4, STAT_STATVFS, STATFS_TRUNCATES_BLOCK_COUNTS): + New macros. + + * configure.in: added GNOME_FILEUTILS_CHECKS. + + * sysdeps/common/{fsusage, mountlist}.[ch]: + Imported from GNU Fileutils 3.16. + + * sysdeps/common/mountlist.c: using g_malloc, g_realloc and g_strdup. + +1998-07-03 Martin baulig + + * macros/gnome-libgtop-sysdeps.m4: No longer use + `glibtop_machine.h' for Linux. + + * sysdeps/linux/glibtop_machine.h: Removed. + + * sysdeps/guile/guile.awk: Using `scm_append' + instead of `gh_append'. + + * sysdeps/guile/names/guile-names.awk: dito. + + * sysdeps/linux/*.c: Using code from stable branch again. + + * include/glibtop/parameter.h: New file. + + * lib/parameter.c: New file. + + * lib/{open, init}.c: Done some more work on server + initialization + +1998-06-21 Martin Baulig + + * perl/*: Added perl interface. + + * sysdeps/linux/cpu.c: Bug fix. + + * include/glibtop/global.h: Only including guile header files + within libgtop. + + * configure.in (LIGBTOP_LIBS): Added `-lgtop'. + + * Makefile.am: Creating `perl/Makefile.PL' from `perl/Makefile.PL.in' + and `perl/Libgtop.xs' using `perl/perl.awk'. + +1998-06-18 Martin Baulig + + * sysdeps/linux/*.c: Reverted some stuff from 06-07-1998 + since it was too buggy. + + * glibtop.h (_glibtop): New field `server_port'. + + * lib/xmalloc.c (g_strdup): New function. + + * lib/gnuclient.c: Removed. + + * lib/{command, write, read}.c: Changed client <-> server + interface to make less system calls. + + * src/daemon/main.c: Changed server side of interface. + + * include/glibtop/command.h (struct _glibtop_response): New + structure to return data from the server to the client. + +1998-06-14 Martin Baulig + + * glibtop.h (struct _glibtop): Added `socket' field. + + * include/glibtop/gnuserv.h: New file. Imported from xemacs 20.3. + + * sysdeps/common/gnuslib.c: New file. Imported from xemacs 20.3 + + * lib/gnuclient.c: New file. Imported from xemacs 20.3 + + * sysdeps/daemon/gnuserv.c: New file. Imported from xemacs 20.3 + + * sysdeps/daemon: New directory. + + * configure.in (LIBGTOP_LIBS, LIBGTOP_GUILE_LIBS): Added + `$X_LIBS -lXau' when we have xauth. + + * acconfig.h (HAVE_XAUTH): New tag. + + * configure.in: Added check for `HAVE_XAUTH'. + + * sysdeps/common/error.c (glibtop_warn_r): New function - + same as `glibtop_error_r', but doesn't call `exit'. + (glibtop_error_io_r, glibtop_warn_io_r): New functions, + display `strerror (errno)' together with message. + + * include/glibtop/global.h (TIME_WITH_SYS_TIME): including + correct headers; (HAVE_UNISTD_H): Added conditional. + Added `#include ' and `#include '. + + * acconfig.h (HAVE_LINUX_TABLE): New tag. + + * lib/lib.awk: New file. + Creates `lib.c' depending upon `features.def'. + + * lib/.c: Removed. + + * sysdeps/guile/guile.awk: New file. + Creates `guile.c' depending upon `features.def'. + + * sysdeps/guile/*.c: Removed. + +1998-06-13 Martin Baulig + + * features.def: List of features for `guile-names.awk'. + + * sysdeps/guile/names/guile-names.awk: New file. + Creates `guile-names.c' depending upon `features.def'. + + * sysdeps/guile/names/*.c: Removed. + + * kernel: New directory. Contains some kernel code to + implement a new system call table () to fetch information + directly from the Linux kernel. + + * sysdeps/kernel: New directory. Uses the table () function + from the `kernel' directory to fetch things directly from + the Linux kernel. + + * sysdeps/Makefile.am (DIST_SUBDIRS): Added `kernel'. + + * configure.in: Removed `build_CC' again. + +1998-06-12 Martin Baulig + + * include/glibtop/sysdeps.h (glibtop_types_sysdeps): + Forgot to change declaration on Jun 6. + + * sysdeps/names/sysdeps.c (glibtop_types_sysdeps): + Using numeric constants from `types.h' instead of string + constants; forgot to change this on Jun 6. Added information + about new `features' field of `_glibtop_sysdeps'. + + * sysdeps/guile/names/*.c (glibtop_guile_types_*): + Using `gh_ulong2scm' instead of `gh_str02scm'. + + * sysdeps/guile/proclist.c: Replaced call to + `gh_append2 ()' with `gh_append ()'. + + * sysdeps/guile/names/*.c: dito. + +1998-06-08 Martin Baulig + + * support: Added again. + + * Makefile.am (SUBDIRS): Added `support' again. + + * configure.in: First, we check for gnome. If it is not + found, we run GNOME_SUPPORT_CHECKS; otherwise use + `$GNOME_LIBDIR -lgnomesupport'. + +1998-06-07 Martin Baulig + + * examples/ChangeLog: New file. + + * macros/gnome-libgtop-sysdeps.m4: Include + `glibtop_machine.h' for Linux. + + * sysdeps/linux/glibtop_machine.h: New file. + + * sysdeps/linux/*.c: Performance optimizations. We now use + `open' and `read' instead of `fopen' and `fscanf'. + + * *.[ch]: Using single underscore instead of two underscores + for function prefixes (regexp: ``s,__([rspl])\b,_$1,g'') to + avoid ambiguity with mangled C++ names. + +1998-06-06 Martin Baulig + + * sysdeps/osf1/glibtop_server.h: New file. + + * sysdeps/osf1/*.c: renamed all functions implementing + features that don't need to be suid to '__s'. + + * sysdeps/names/procdata.c: Removed that file. + + * include/glibtop/*.h (glibtop_types_*): Changed declaration. + + * glibtop.h: Added `#include '. + + * include/glibtop/types.h: New file - numeric constants + for `glibtop_types_'. + + * sysdeps/names/*.c (glibtop_types_*): Using numeric + constants from `types.h' instead of string constants. + +1998-06-05 Martin Baulig + + * support: removed that directory. + + * configure.in: we check whether '-lgnomesupport' is + included in $GNOME_LIBS and add it together with + $GNOME_LIBDIR to LIBSUPPORT in this case. + + Gnome (gnome-libs) is now required to build libgtop, + added short comment to configure.in how to revert this + change. + + * Makefile.am: removed `support' subdir. + +1998-06-03 Martin Baulig + + * libgtop.spec: New file. + + * Makefile.am (EXTRA_DIST): Added `autogen.sh' and + `libgtop.spec'. + + * configure.in (LIBGTOP_INCS): is now identically to + `LIBGTOP_GUILE_INCS'. + + * include/glibtop/global.h: only including intl headers + while compiling libgtop. + +1998-06-02 Federico Mena Quintero + + * src/server/main.c: #include + +1998-06-02 Martin Baulig + + * lib/open.c (glibtop_open): renamed to `glibtop_open__l'. + + * sysdeps/linux/open.c (glibtop_open): renamed to + `glibtop_open__r'. + + * include/glibtop/open.h (GLIBTOP_OPEN_NO_OVERRIDE): + tells `glibtop_open' to use the default server and not + to check the environment variables. + + * include/glibtop/sysdeps.h (_glibtop_sysdeps): + renamed 'dummy' member to 'features'. + + * src/proxy/*: new directory - proxy server. + + * include/glibtop/command.h (GLIBTOP_CMND_SYSDEPS): + added definition here. + + * src/server/main.c (GLIBTOP_CMND_SYSDEPS): new + command to get glibtop_server_features. + +1998-06-01 Martin Baulig + + * NEWS: added more detailed description of today's and + yesterday's changes. + + * include/glibtop/*.h: to use the ChangeLog entry from May 28: + '__l' is a function defined in the client part; + '__s' is a function defined in the sysdeps part and + '__p' is a function that needs special priviledges. + '__r' is mapped either on '__p' or on '__s'. + the function without suffix is mapped on '__l'. + + * sysdeps/common/sysdeps.c: now using '__r' functions, + they are #defined either as the '__p' or the '__s' ones. + + * sysdeps/linux/*.c: changed call of 'glibtop_init__r', + it now takes two additional arguments. + + * examples/{first.c, second.c}: now using 'glibtop_init' + instead of 'glibtop_init__r'. + + * include/glibtop/sysdeps.h: added 'dummy' member so + 'GLIBTOP_SYSDEPS_' now start with 1. + + * include/glibtop/*.h: we now #define 'glibtop_get_' + as 'glibtop_get___l' and 'glibtop_get___r' + either as the '__p' or the '__s' function. + + * lib/*.c: removed #if's - we now decide at runtime + whether to use the server or to call the appropriate + function for the sysdeps directory. + +1998-05-28 Martin Baulig + + * src/server/main.c: we now use the '__p' functions, + but only if the appropriate 'GLIBTOP_SUID_' + has a non-zero value. + + * configure.in (@machine_incs@): always use + `-I$(top_srcdir)/sysdeps/@sysdeps_dir@'; it's no + longer conditional. + + * examples/Makefile.am: removed the '_linux' examples. + + * sysdeps/linux/*.c: renamed all functions implementing + features to '__s'. + + * lib/*.c: renamed all functions implementing features + to '__l'; we only emit code for those functions if the + corresponding 'GLIBTOP_SUID_' has a positive value. + + * include/glibtop/*.h: added some new function suffixes: + '__l' is a function defined in the client part; + '__s' is a function defined in the sysdeps part and + '__p' is a function that needs special priviledges. + '__r' is mapped either on '__l' or on '__s'. + + * sysdeps/linux/glibtop_server.h: New file - + defines system dependent constants 'GLIBTOP_SUID_' + being either 'GLIBTOP_SYSDEPS_'+1 depending upon + whether or not this feature requires using the server. + + * lib/sysdeps.c: removed that file; it is no longer + needed. + +1998-05-25 Martin Baulig + + * src/server/main.c: Fixed `broken pipe' error when server + is running SUID; accidentally uses setreuid () instead of + setregid (). + +1998-05-24 Martin Baulig + + * sysdeps/sun4/{open.c, mem.c, glibtop_machine.h}: added + memory statistics. + + * include/glibtop/mem.h (_glibtop_mem): added `locked' + member to this structure for SunOS. + +1998-05-23 Martin Baulig + + * sysdeps/sun4/{open.c, cpu.c}: Started porting. + Getting CPU usage now working. Took a lot of code + from top-3.4. + + * sysdeps/sun4/glibtop_machine.h: New file. + System dependend header file for SunOS. + + * configure.in (CFLAGS): added -D_IN_LIBGTOP + + * */Makefile.am (INCLUDES): removed -I$(includedir). + +1998-05-22 Martin Baulig + + * doc/{libgtop-ref.sgml, libgtop-ref.dsl}: New files. + This is a reference manual that gets automatically + build from make-docbook.scm. + + * guile/make-docbook.scm: New file. Uses the guile + interface of libgtop to create docbook documentation + for all functions. + +1998-05-21 Martin Baulig + + * Makefile.am: 'gtopConf.sh' has been renamed to + 'libgtopConf.sh'; variables in this script have changed. + + * lib/Makefile.am: uses '@LIBGTOP_SERVER@' instead of + '@GTOP_SERVER@'. + + * configure.in: renamed variables for 'libgtopConf.sh.in'. + + * acconfig.h: added 'NEED_LIBGTOP'. + + * libgtopConf.sh.in: renamed from 'gtopConf.sh.in'; + we now define 'LIBGTOP_LIBDIR', 'LIBGTOP_INCLUDEDIR', + 'LIBGTOP_LIBS', 'LIBGTOP_INCS', 'LIBGTOP_GUILE_LIBS', + 'LIBGTOP_GUILE_INCS', 'LIBGTOP_BINDIR', 'LIBGTOP_SERVER', + 'libgtop_sysdeps_dir', 'libgtop_need_server', + 'libgtop_use_machine_h', 'libgtop_guile_found', + 'libgtop_want_names', 'libgtop_want_guile_names', + 'libgtop_want_examples'. + + * gtopConf.sh.in: renamed to 'libgtopConf.sh.in'. + + * acinclude.m4 (AC_LC_SYSDEPS): rewrote that macro - + moved some of the code to 'macros/gnome-libgtop-sysdeps.m4'; + renamed variables: look at the ChangeLog entry for the + new 'libgtopConf.sh.in' for details. + + * doc/gnome-hackers.sgml: added information about latest + changes in 'acinclude.m4' and 'gtopConf.sh.in'. + + * Makefile.am: conditionally building 'examples' subdir, + added 'copyright.txt' to EXTRA_DIST. + + * configure.in: added 'gtop_guile_found', 'gtop_want_names', + 'gtop_want_guile_names' and 'gtop_want_examples' for use in + 'gtopConf.sh.in'; added 'include' and 'include/glibtop' subdirs. + + * acconfig.h: added 'GLIBTOP_EXAMPLES'. + + * acinclude.m4 (AC_LC_SYSDEPS): define 'GLIBTOP_NAMES' when + building libgtop and a new conditional 'GLIBTOP_NAMES'; added + new parameter '--without-examples'; define 'GLIBTOP_EXAMPLES' + and conditional 'GLIBTOP_EXAMPLES'. + + * gtopConf.sh.in: added 'GTOP_GUILE_FOUND', 'GTOP_WANT_NAMES', + 'GTOP_WANT_GUILE_NAMES' and 'GTOP_WANT_EXAMPLES'. + + * include/glibtop/Makefile.am: new file - header file + now get properly installed and go into the distribution. + + * include/Makefile.am: new file + + * sysdeps/guile/Makefile.am: added 'DIST_SUBDIRS' + + * sysdeps/Makefile.am: added 'DIST_SUBDIRS' + + * doc/gnome-hackers.sgml: new file - short intro on how + to use libgtop in the gnome project; especially 'configure' + and 'gtopConf.sh'. + + * doc/gnome-hackers.dsl: new file - sets output filename + and directory for 'gnome-hackers.sgml'. + + * doc/libgtop.dsl: most stuff from this file has moved + to 'dbtohtml.dsl', it now only overrides the output + filename and directory. + + * doc/dbtohtml.dsl: new file - contains most that was + formerly in 'libgtop.dsl'. + + * configure.in: 'GTOP_INCS' and 'GTOP_LIBS' now really + point to the places where everything gets installed and + no longer to the build directory, so that they can be + used in 'gtopConf.sh'. + + * acinclude.m4 (AC_LC_SYSDEPS): added 'machine_incs' + which is used in 'INCLUDES' in several 'Makefile.am's; + fixed typo 'ac_cv_want_names'; added missing AC_SUBST + of 'use_glibtop_machine_h'. + +1998-05-20 Martin Baulig + + * NEWS: added more detailed description of + today's changes. + + * examples/third.c: added required check for + 'GLIBGTOP_GUILE_NAMES'. + + * sysdeps/Makefile.am: only build 'names' subdir + when necessary. + + * sysdeps/guile/Makefile.am: only build 'names' + subdir when necessary. + + * acinclude.m4 (AC_LC_SYSDEPS): added + '--enable-libgtop-server' (default=auto), + '--enable-libgtop-names' (default=yes) and + '--enable-libgtop-guile' (default=yes); we + now define 'GLIBTOP_NAMES' here. + + * acconfig.h: added 'GLIBTOP_NAMES' and + 'GLIBTOP_GUILE_NAMES' + + * gtopConf.sh.in: added definition of 'GTOP_GUILE_LIBS' + and 'GTOP_GUILE_INCS': + + 'GTOP_LIBS' and 'GTOP_INCS' now contains everything + that is needed to link with libgtop. + + 'GTOP_GUILE_LIBS' and 'GTOP_GUILE_INCS' now contains + everything that is needed to link with libgtop and its + guile interface. When guile cannot be found on the system + or building of the guile interface was disables, they are + identical to 'GTOP_LIBS' and 'GTOP_INCS' + [FIXME: Should I make them empty in this case?] + + * sysdeps/osf1/procuid.c (glibtop_get_proc_uid__r): + added implementation for DEC OSF/1. + + * sysdeps/sun4/uptime.c: forgot to checkin + + * sysdeps/sun4/loadavg.c: forgot to checkin + + * sysdeps/osf1/uptime.c: forgot to checkin + + * sysdeps/osf1/loadavg.c: forgot to checkin + +1998-05-19 Martin Baulig + + * sysdeps/stub/uptime.c: forgot this file all the + time - stub for glibtop_uptime + + * sysdeps/stub/loadavg.c: forgot this file all the + time - stub for glibtop_loadavg + + * NEWS: Libgtop is now in the GNOME CVS Repository. + + * po/Makefile.in.in: new file + + * ABOUT-NLS: new file + +1998-05-17 Martin Baulig + + * NEWS: added some stuff from 'README.LATEST'. + + * README.LATEST: incorporated content of this file + into 'NEWS'. + + * include/glibtop: added references to + 'glibtop_types_* []' and 'glibtop_guile_types_*'. + + * sysdeps/guile/names: added implementations of + 'glibtop_types_*' and 'glibtop_description_*'. + + * sysdeps/names: added 'glibtop_types_* []', + changed 'glibtop_descriptions_* []'. + +1998-05-11 Martin Baulig + + * sysdeps/linux: finished the remaining proc_* + functions. + + * sysdeps/guile: all guile functions now return + the 'flags' member as first element of the list. + + * include/glibtop/procstate.h (glibtop_proc_state): + added 'uid' and 'gid' members; the library tries hard + to set those values; it will never set the corresponding + 'flags' value unless the values are correct. + + * examples/first.c: added some nice features. + + * examples/second.c: new file - dumps out all + currently running processes. + +1998-05-11 Martin Baulig + + * sysdeps/linux/cpu.c: added 'frequency' member + to 'struct _glibtop_cpu'. + + * include/glibtop/cpu.h (glibtop_cpu): + added 'frequency' member + + * sysdeps/guile/names/procdata.c: splitted into + procstate.c, procuid.c, procmem.c, proctime.c, + procsignal.c, prockernel.c and procsegment.c + + * sysdeps/guile/procdata.c: splitted into + procstate.c, procuid.c, procmem.c, proctime.c, + procsignal.c, prockernel.c and procsegment.c + + * lib/procdata.c: splitted into + procstate.c, procuid.c, procmem.c, proctime.c, + procsignal.c, prockernel.c and procsegment.c + + * include/glibtop/procdata.h: splitted into + procstate.h, procuid.h, procmem.h, proctime.h, + procsignal.h, prockernel.h and procsegment.h + +1998-05-10 Martin Baulig + + * sysdeps/osf1: port to OSF1 has been made. + +1998-05-07 Martin Baulig + + * sysdeps/guile/sysdeps.c: changes to reflect the + new flags of procdata. + + * sysdeps/common/sysdeps.c: changes to reflect the + new flags of procdata. + + * sysdeps/linux/procdata.c: 'flags' member is now + 'unsigned long flags [2]'. When we give + glibtop_get_procdata () a pid of zero, only + the flags are returned. + + * sysdeps/linux: now using static constant instead + of #define for sysdeps. + + * include/glibtop/procdata.h: flags is now + 'unsigned long flags [2]'. + + * examples/first.c: output sysdeps + +1998-05-03 Martin Baulig + + * ltconfig.diff: ugly hack: when cross compiling, we assume + building shared libraries work. + +1998-05-02 Martin Baulig + + * sysdeps/stub/init.c: new file - initializes global server. + + * sysdeps/linux/init.c: new file - initializes global server. + + * lib/init.c: new file - initializes global server. + + * glibtop.h: global changes to the interfaces, all functions except + glibtop_open() and glibtop_close() that took a server argument have + now a '__r' suffix; the original name is now a macro that uses + glibtop_global_server. + +1998-04-12 Martin Baulig + + * sysdeps/linux/open.c: we set server->os_version_code here, + copied from gnome-utils/gtop/proc/version.c + + * sysdeps/linux/procdata.c: added implementation for this feature, + mainly copied from gnome-utils/gtop/proc/readproc.c + + * glibtop.h: added os_version_code member to struct _glibtop + + * src/server/Makefile.am: moved here from src + + * src/server/version.c: moved here from src + + * src/server/output.c: moved here from src + + * src/server/main.c: moved here from src + + * src/mico/server.cc: new file - simple mico client + + * src/mico/client.cc: new file - simple mico client + + * src/mico/proclist.idl: new file - simple mico interface + + * src/version.c: moved to src/server + + * src/output.c: moved to src/server + + * src/main.c: moved to src/server + +1998-04-11 Martin Baulig + + * doc/libgtop.sgml: added chapter on how to extend the library + + * sysdeps/names/procdata.c: new file - names for glibtop_procdata + + * sysdeps/linux/procdata.c: new file - copy from sysdeps/stub + + * sysdeps/stub/procdata.c: new file - stub for glibtop_procdata + + * sysdeps/guile/names/procdata.c: new file - guile names for glibtop_procdata + + * sysdeps/guile/procdata.c: new file - guile interface for glibtop_procdata + + * lib/procdata.c: new file - library function for glibtop_procdata + + * include/glibtop/procdata.h: new file - interface for glibtop_procdata - + get detailed information about a process + +1998-04-10 Martin Baulig + + * doc/libgtop.sgml: wrote some more documentation + + * NEWS: Added new directory sysdeps/guile/names. It is the guile interface + to the gtop_names library found in sysdeps/names. Changed + GLIBTOP_DESCRIPTIONS to GLIBTOP_NAMES and added GLIBTOP_GUILE_NAMES + to the header files. + + * sysdeps/guile/names/boot.c: new file - added also + cpu.c, mem.c, swap.c, uptime.c, loadavg.c, shm_limits.c, + msg_limits.c, sem_limits.c, proclist.c and sysdeps.c + to this directory. + + * sysdeps/guile/cpu.c: bugfixes + + * sysdeps/guile/proclist.c: bugfixes + + * sysdeps/names/sysdeps.c (glibtop_labels_sysdeps): more verbose now + + * examples/third.c: added gtop_guile_names library + + * doc/libgtop.sgml: documented guile interface + + * glibtop.h: changed GLIBTOP_DESCRIPTIONS to GLIBTOP_NAMES; + added GLIBTOP_GUILE_NAMES when we have the gtop_guile_names + library added in sysdeps/guile/names + +1998-04-09 Martin Baulig + + * NEWS: Added new directories guile and names to sysdeps. In names are + some string constants about the data stored in the structures. + guile is a guile interface for the library. It is used in + examples /third (which has been completely rewritten). + The header files define things from names when GLIBTOP_DESCRIPTIONS + if defined and/or from guile when HAVE_GUILE is defined. + + * sysdeps/names/cpu.c: new file, also added + cpu.c, mem.c, swap.c, uptime.c loadavg.c, shm_limits.c, + msg_limits.c, sem_limits.c, proclist.c and sysdeps.c to + this directory + + * sysdeps/guile/boot.c: new file, also added + cpu.c, mem.c, swap.c, uptime.c loadavg.c, shm_limits.c, + msg_limits.c, sem_limits.c, proclist.c and sysdeps.c to + this directory + + * sysdeps/common/sem_limits.c: moved to sysdeps/names + + * sysdeps/common/msg_limits.c: moved to sysdeps/names + + * sysdeps/common/sem_limits.c: moved to sysdeps/names + + * examples/third.c: completely rewritten - simple guile interpreter linked + with libgtop_guile + + * examples/second.c: removed + +1998-04-08 Martin Baulig + + * ANNOUNCE: new file + + * examples/third.scm: new file - sample guile file + + * examples/third.c: new file - guile wrapper for libgtop + + * examples/second.c: new file - simple guile test from guile-tut.info + + * README: new file + + * libgtop-mirror.sh: new file: mirror script for my web site + + * doc/dbtohtml.dsl: renamed to libgtop.dsl + +1998-04-06 Martin Baulig + + * lib/command.c: some changes in the interface + + * src/main.c: some changes in the interface, we can now return + some arbitrary data + + * lib/proclist.c: new file - library function for glibtop_proclist + + * sysdeps/linux/proclist.c: new file - implementation for glibtop_proclist + + * sysdeps/stub/proclist.c: new file - stub for glibtop_proclist + + * include/glibtop/proclist.h: new file - glibtop_proclist + + * include/glibtop/union.h: new file + + * lib/read_data.c: new file + + * include/glibtop/read_data.h: new file + + * sysdeps/common/xmalloc.c: new file - moved here from lib + + * sysdeps/common/error.c: new file - moved here from lib + + * lib/xmalloc.c: moved to sysdeps/common + + * lib/error.c: moved to sysdeps/common + +1998-04-05 Martin Baulig + + * lib/shm_limits.c: new file - library function for + glibtop_shm_limits + + * lib/msg_limits.c: new file - library function for + glibtop_msg_limits + + * lib/sem_limits.c: new file - library function for + glibtop_sem_limits + + * sysdeps/linux/shm_limits.c: new file - implementation for + glibtop_shm_limits + + * sysdeps/linux/msg_limits.c: new file - implementation for + glibtop_msg_limits + + * sysdeps/linux/sem_limits.c: new file - implementation for + glibtop_sem_limits + + * sysdeps/stub/shm_limits.c: new file - stub for + glibtop_shm_limits + + * sysdeps/stub/msg_limits.c: new file - stub for + glibtop_msg_limits + + * sysdeps/stub/sem_limits.c: new file - stub for + glibtop_sem_limits + + * sysdeps/common/shm_limits.c: new file - limit names + + * sysdeps/common/msg_limits.c: new file - limit names + + * sysdeps/common/sem_limits.c: new file - limit names + + * include/glibtop/shm_limits.h: new file - glibtop_shm_limits + + * include/glibtop/msg_limits.h: new file - glibtop_msg_limits + + * include/glibtop/sem_limits.h: new file - glibtop_sem_limits + + * sysdeps/common/sysdeps.c: moved here from sysdeps/stub + + * sysdeps/linux/sysdeps.c: moved to sysdeps/common + + * sysdeps/stub/sysdeps.c: moved to sysdeps/common + + * sysdeps/stub/ipc_limits.c: splitted info shm_limits.c, msg_limits.c + and sem_limits.c + + * sysdeps/linux/ipc_limits.c: splitted into shm_limits.c, msg_limits.c + and sem_limits.c + + * lib/ipc_limits.c: splitted into shm_limits.c, msg_limits.c + and sem_limits.c + + * include/ipc_limits.h: splitted into shm_limits.h, msg_limits.h + and sem_limits.s + + * lib/ipc_limits.c: new file - library function for + glibtop_ipc_limits + + * sysdeps/linux/ipc_limits.c: new file - implementation for + glibtop_ipc_limits + + * sysdeps/stub/ipc_limits.c: new file - stub for + glibtop_ipc_limits + + * include/glibtop/ipc_limits.h: new file - glibtop_ipc_limits - + sysv ipc limits + + * doc/libgtop.sgml: worked on documentation + + * lib/uptime.c: new file - library function for + glibtop_uptime + + * lib/loadavg.c: new file - library function for + glibtop_loadavg + + * lib/sysinfo.c: removed - splitted into + uptime.c and loadavg.c + + * sysdeps/linux/uptime.c: new file - implementation for + glibtop_uptime + + * sysdeps/linux/loadavg.c: new file - implementation for + glibtop_loadavg + + * sysdeps/linux/sysinfo.c: removed - splitted into + uptime.c and loadavg.c + + * sysdeps/stub/uptime.c: new file - stub for + glibtop_uptime + + * sysdeps/stub/loadavg.c: new file - stub for + glibtop_loadavg + + * sysdeps/stub/sysinfo.c: removed - splitted into + uptime.c and loadavg.c + + * src/main.c: added GLIBTOP_CMND_UPTIME and + GLIBTOP_CMND_LOADAVG implementation + + * include/glibtop/loadavg.h: new file - glibtop_loadavg + + * include/glibtop/uptime.h: new file - glibtop_uptime + + * include/glibtop/loadavg.h: removed - splitted into + uptime.h and loadavg.h + + * src/main.c: added GLIBTOP_CMND_SYSDEPS implementation + + * lib/sysdeps.c: new file - library function for glibtop_sysdeps + + * sysdeps/linux/sysdeps.c: new file - copied from sysdeps/stub + + * sysdeps/stub/sysdeps.c: new file - implementation for glibtop_sysinfo - + this is really the implementation and not just a stub + + * src/sysdeps.c: moved to sysdeps/stub - this file is now part + of the library + + * lib/sysinfo.c: new file - library function for glibtop_sysinfo + + * sysdeps/linux/sysinfo.c: new file - linux version for glibtop_sysinfo + + * sysdeps/stub/sysinfo.c: new file - stub for glibtop_sysinfo + + * include/glibtop/sysinfo.h: new file - provides uptime, idle time + and load averange. + + * po/libgtop.pot: removed file + + * sysdeps/linux/cpu.c: using long unsigned format + * sysdeps/linux/mem.c: using long usigned format + * sysdeps/linux/swap.c: using long unsigned format + * examples/first.c: using long unsigned format + + * initial version. + diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..2099840 --- /dev/null +++ b/INSTALL @@ -0,0 +1,370 @@ +Installation Instructions +************************* + +Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, +Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell command `./configure && make && make install' +should configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + 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, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. 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. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + 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'. + + 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. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`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. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf limitation. Until the limitation is lifted, you can use +this workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + 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. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..9cb4939 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,30 @@ +ACLOCAL_AMFLAGS = -I m4 + +if EXAMPLES +EXAMPLES_DIR = examples +else +EXAMPLES_DIR = +endif + +SUBDIRS = po misc include sysdeps lib src $(EXAMPLES_DIR) doc + +libgtopinclude_HEADERS = glibtop.h libgtopconfig.h +libgtopincludedir = $(includedir)/libgtop-2.0 + +EXTRA_DIST = autogen.sh libgtop.spec.in copyright.txt \ + features.def libgtopconfig.h.in \ + libgtop-sysdeps.m4 README \ + libgtop-2.0.pc.in acinclude.m4 \ + libgtop.doap \ + m4/introspection.m4 + +dist-hook: + cp libgtop.spec $(distdir) + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libgtop-2.0.pc + +libgtop-features.def: features.def + @LN_S@ $< $@ + +DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --enable-introspection diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..230c38a --- /dev/null +++ b/Makefile.in @@ -0,0 +1,998 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(libgtopinclude_HEADERS) \ + $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = libgtop.spec libgtop-2.0.pc libgtopconfig.h +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(libgtopincludedir)" +DATA = $(pkgconfig_DATA) +HEADERS = $(libgtopinclude_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = po misc include sysdeps lib src examples doc +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/libgtop-2.0.pc.in $(srcdir)/libgtop.spec.in \ + $(srcdir)/libgtopconfig.h.in ABOUT-NLS AUTHORS COPYING \ + ChangeLog INSTALL NEWS README TODO compile config.guess \ + config.rpath config.sub install-sh ltconfig ltmain.sh missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +GZIP_ENV = --best +DIST_ARCHIVES = $(distdir).tar.xz +DIST_TARGETS = dist-xz +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = -I m4 +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +@EXAMPLES_FALSE@EXAMPLES_DIR = +@EXAMPLES_TRUE@EXAMPLES_DIR = examples +SUBDIRS = po misc include sysdeps lib src $(EXAMPLES_DIR) doc +libgtopinclude_HEADERS = glibtop.h libgtopconfig.h +libgtopincludedir = $(includedir)/libgtop-2.0 +EXTRA_DIST = autogen.sh libgtop.spec.in copyright.txt \ + features.def libgtopconfig.h.in \ + libgtop-sysdeps.m4 README \ + libgtop-2.0.pc.in acinclude.m4 \ + libgtop.doap \ + m4/introspection.m4 + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libgtop-2.0.pc +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +libgtop.spec: $(top_builddir)/config.status $(srcdir)/libgtop.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +libgtop-2.0.pc: $(top_builddir)/config.status $(srcdir)/libgtop-2.0.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +libgtopconfig.h: $(top_builddir)/config.status $(srcdir)/libgtopconfig.h.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-libgtopincludeHEADERS: $(libgtopinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgtopincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgtopincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgtopincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgtopincludedir)" || exit $$?; \ + done + +uninstall-libgtopincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgtopincludedir)'; $(am__uninstall_files_from_dir) + +# 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. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --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) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) $(HEADERS) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(libgtopincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-libgtopincludeHEADERS install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-libgtopincludeHEADERS uninstall-pkgconfigDATA + +.MAKE: $(am__recursive_targets) all install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libtool cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ + dist-tarZ dist-xz dist-zip distcheck distclean \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libgtopincludeHEADERS \ + install-man install-pdf install-pdf-am install-pkgconfigDATA \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-libgtopincludeHEADERS \ + uninstall-pkgconfigDATA + +.PRECIOUS: Makefile + + +dist-hook: + cp libgtop.spec $(distdir) + +libgtop-features.def: features.def + @LN_S@ $< $@ + +# 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: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..3135df7 --- /dev/null +++ b/NEWS @@ -0,0 +1,637 @@ +11 September 2017: Overview of changes in 2.38.0 +================================================ + +* Updated translations + +04 September 2017: Overview of changes in 2.37.92 +================================================ + +* Updated translations +* Code cleanup + +07 August 2017: Overview of changes in 2.37.90 +================================================ + +* Added reserved fields to the sysdeps struct +* Updated translations +* Fixed build failure in FreeBSD 11 + +22 May 2017: Overview of changes in 2.37.2 +================================================ + +* Added support for per-process io monitoring + * Linux + * FreeBSD +* Updated translations +* Added nullpointer check +* Use unicode in translatable strings + +20 March 2017: Overview of changes in 2.36.0 +================================================ + +* Version bumped + +13 March 2017: Overview of changes in 2.35.92 +================================================ + +* Better output format for arrays + +13 February 2017: Overview of changes in 2.35.90 +================================================ + +* Linux: + - Use dynamically allocated cpu buffer + - Do not cache getpagesize() + - Use faster g_ascii_isspace in tokenization + - Ignore paragraphs not describing a CPU/core + +* Updated translations +* Added more gettext options + +16 January 2017: Overview of changes in 2.34.2 +================================================ + +* Linux: + - fill last_processor member + +* Updated translations +* Added more gettext options + +20 August 2016: Overview of changes in 2.34.1 +================================================ + +* FreeBSD: + - rewrite netload to use official APIs + - mark wireless interfaces as such + +* All + - rename --with-libgtop-examples to --with-examples + - use gettext instead of intltool/glib-gettext + - added Language headers to the translations + + +Special thanks to Gleb Smirnoff, Antoine Brodin, Koop Mast and Ting-Wei Lan for +the FreeBSD fixes, to Javier Jardón for the gettext migration and to Piotr Drąg +for adding the Language headers. + +22 March 2016: Overview of changes in 2.34.0 +================================================ + +* Stable release + +29 February 2016: Overview of changes in 2.33.91 + +* Updated translations +* Fix building on must-libc + +18 January 2016: Overview of changes in 2.33.4 + +* On OpenBSD only PID 1 is special +* Call setlocale in main + +14 December: Overview of changes in 2.33.3 + +* Fixed borken compilation on OpenBSD +* Updated translations. + +21 September 2015: Overview of changes in 2.32.0 + +* Stable release + +14 September 2015: Overview of changes in 2.31.91 +================================================ +* Darwin: + - Fixed build. + +* All + - GI docs fixes + - include fixes + - Updated translations + +16 August 2015: Overview of changes in 2.31.90 +============================================= +* ABI changes: + - ABI was inconsistent on platforms like FreeBSD which make use of + glibtop_machine. The ABI was actually different between the + library and the server. Fixed this by simply always defining + glibtop_machine in glibtop struct. + - Add Pss and Swap members in glibtop_proc_mem. + - This is the second ABI breakage in since 2.28 (the first one was + bumping NCPU), there were no release for 2.30. + +* FreeBSD: + - proclist: exclude the "idle" kernel process when GLIBTOP_EXCLUDE_IDLE. + - Remove extraneous glibtop_init() calls. + +* Linux: + - proc_mem: implement Pss and Swap. + - Remove extraneous glibtop_init() calls. + +* All: + - Propagate the change that machine in struct glibtop is now a + pointer. Hope that change doesn't break build on other platforms, + I can only test Linux and FreeBSD. + + +5 August 2015: Overview of changes in 2.31.4 +============================================= +* 71 commits ! +* Implement a proper --enable-debug mode. +* FreeBSD: + - procstate: set process name for kernel (pid=0) + - procmap: get dev/inode for ZFS (no filename yet) + - mem: rework memory usage to something more meaningful + - proclist: don't report threads + - proctime: fix CPU times +* Linux: + - mem: use MemAvailable when available + - mem: match `free`, report Slab as Cached. + - support for x.y versionsmemory to match `free` +* Fix a lot of GI tags: it now works without crashing. +* Server and daemon binaries are now dynamically linked against their libgtop. +* Update a lot of examples/. +* Clean up some very old code. +* Updated translations. + +Special thanks to Ting-Wei Lan for providing patches and feedback on FreeBSD. + +22 June 2015: Overview of changes in 2.31.3 +============================================= +* Numerous OpenBSD backend fixes. +* Fixed FreeBSD build issues. +* Implemented procaffinity support for NetBSD. +* Updated translations + +19 August 2013: Overview of changes in 2.28.5 +============================================= +* Fix numerous bugs in the OpenBSD backend. +* Updated translations. + +30 August 2011: Overview of changes in 2.28.4 +============================================= +* Fix numerous bugs in the FreeBSD backend. +* Split off OpenBSD code in its own backend, and fixes. +* Updated translations. + +25 March 2011: Overview of changes in 2.28.3 +================================================ +* Fix build issue for strict linkers. +* Add Introspection support +* Cygwin fixes. +* FreeBSD: Fix get_mem() on 64-bit systems. +* Updated translations. + +28 September 2010: Overview of changes in 2.28.2 +================================================ +* Updated translations. + +30 March 2010: Overview of changes in 2.28.1 +============================================ +* Updated translations. + +21 September 2009: Overview of changes in 2.28.0 +================================================ +* Updated translations. + +25 May 2009: Overview of changes in 2.27.3 +========================================== +* linux: + - fixed format error. + +3 May 2009: Overview of changes in 2.27.2 +========================================= +* linux: + - glibtop_get_proc_map: oops, fixed segfault. + +3 May 2009: Overview of changes in 2.27.1 +========================================= +* linux: + - glibtop_get_proc_map is ~40% faster. This should be noticeable + in system-monitor. +* New cygwin support. + +13 April 2009: Overview of changes in 2.26.1 +============================================ +* linux: + - glibtop_get_mounlist(...): also hide "none" fs. + +1 Mars 2009: Overview of changes in 2.26.0 +========================================== +* Nothing. + +17 February 2009: Overview of changes in 2.25.91 +================================================ +* Synced with gnome-2-24. + +19 January 2009: Overview of changes in 2.24.4 +============================================== +* Fixed license: libgtop is GPL-2. + +12 January 2009: Overview of changes in 2.24.3 +============================================== +* linux: + - fixed potential memory leak. Vincent Untz. + - fixed read(2) usage. Should fix the missing cpus bug in system-monitor. +* darwin: + - fixed build. "paul". + +22 Septembre 2008: Overview of changes in 2.24.0 +================================================ +* Translation updates. + +18 August 2008: Overview of changes in 2.23.90 +============================================== +* freebsd: + - updated port by Joe Marcus Clarke. + +23 June 2008: Overview of changes in 2.23.4 +=========================================== +* linux: + - Fixed and improved glibtop_get_fsusage with kernel >= 2.6.25. + Closes #539360. + +24 May 2008: Overview of changes in 2.23.2 +========================================== +* glibtop_get_proc_open_files API can also lists IPv6 TCP sockets. +* glibtop_get_proc_affinity : new API to retrieve process CPU affinity. + +(Let's hope one day i'll find the gtk-doc documentation ...) + +* linux: + - fixed parsing of big /proc/stat for uptime. + +04 April 2008: Overview of changes in 2.22.1 +============================================ +* Fixed compilation/dist for !linux. + Closes #525953. + +10 Mars 2008: Overview of changes in 2.22.0 +=========================================== +* linux: + - fixed proc_kernel. + +25 February 2008: Overview of changes in 2.21.92 +================================================ +* linux: + - fixed smaps parsing on >= 2.6.24.x. + +14 January 2008: Overview of changes in 2.21.5 +============================================== +* freebsd: + - fixed build on GNU/kfreebsd. Petr Salinger. + - fixed procmem units. Kuang-che Wu. + +28 October 2007: Overview of changes in 2.21.1 +============================================== +* don't export _p/_s private symbols anymore. This is not an API/ABI breakage. +* darwin implementation by Benjamin Reed. +* linux: + - splitted fsusage and mountlist implementations; + - smarter mountlist(allfs = False); + - fixed some compile warning on 64bit; +* solaris: + - fixed netload build by Henry Zhang. + +16 September 2007: Overview of changes in 2.20.0 +================================================ +* Updated translations. + +27 August 2007: Overview of changes in 2.19.92 +============================================== +* Fixed stupid hardwired path in linux/sysinfo.c + +26 August 2007: Overview of changes in 2.19.91 +============================================== +* Translations updates. +* linux: + - Small internal improvement. Might fix sysinfo when having more than + 8 CPUS. + +9 July 2007: Overview of changes in 2.19.5 +========================================== +* linux: + - fixed proc_map for >= 2.6.22 +* freebsd: + - implemented procwd and procopenfiles + Joe Marcus Clarke + +18 June 2007: Overview of changes in 2.19.4 +=========================================== +* solaris: + - fixed build. Damien Carbery. + +3 June 2007: Overview of changes in 2.19.3 +========================================== +* Small API change. get_proclist returns pid_t instead of unsigned + for consistency. +* linux: + - fixed an typo bug in open_files. + - got rid of useless glibtop_init_s calls. +* Enable example build by defaut. +* Dropped G_GNUC_INTERNAL attributes no longer needed. + This will please people trying to implement G_GNUC macro with a non + GNU Compiler. + +13 May 2007: Overview of changes in 2.19.2 +========================================== +* This is the first release of the 2.19.x series. +* Got rid of inodedb (you don't even know what it is ;) +* New unstable API glibtop_get_proc_wd to get working directories of + a process. +* Fixed OpenBSD build. Jasper Lievisse Adriaanse. + +25 February 2007: Overview of changes in 2.14.8 +=============================================== +* bsd implementations have been splitted by Joe Marcus Clarke + and Alexander Nedotsukov. (k)freeBSD now has a separate implementation. + +February 10, 2007: Overview of changes in 2.14.7 +================================================ +* bsd: + - massive kfreeBSD and FreeBSD updates by Roy Marples and Petr Salinger. +* mountlist can now ignore objfs and ctfs filesystems. +* fsusage won't return bavail > bfree anymore. + +January 14, 2007: Overview of changes in 2.14.6 +=============================================== +* linux: + - fixed stack overflow in glibtop_get_proc_map + - fixed handling of long filenames in glibtop_get_proc_map and glibtop_get_proc_open_files. + - micro-optimization + +December 3, 2006: Overview of changes in 2.14.5 +=============================================== +* Added kfreebsd support (Petr Salinger ). +* Added solaris glibtop_get_proc_open_files (Henry Zhang ). +* Migrated to gtk-doc (Germán Poó-Caamaño ). +* glibtop_get_mountlist can now ignore nsfd FS. + +September 16, 2006: Overview of changes in 2.14.4 +================================================= +* Fixed linux maps/smaps parsing on 64bit kernel. + +September 5, 2006: Overview of changes in 2.14.3 +================================================ +* Fixed build with --as-needed. +* Added missing G_BEGIN_DECLS/G_END_DECLS. + +July 27, 2006: Overview of changes in 2.14.2 +============================================ +* Updated solaris support (hua.zhang@sun.com) +* Small linux updates and improvments. + +April 10, 2006: Overview of changes in 2.14.1 +============================================= +* Updated translations. +* Fixed NetBSD port (Julio M. Merino Vidal ). +* Fixed some warnings. + +Mars 13, 2006: Overview of changes in 2.14.0 +============================================ +* Updated translations. + +February 27, 2006: Overview of changes in 2.13.92 +================================================= +* Fixed proc_state documentation. +* Updated mountlist ignore list. + +January 23, 2006: Overview of changes in 2.13.3 +=============================================== +* linux: + - fixe get_procmap for linux < 2.6.14. + +January 2, 2006: Overview of changes in 2.13.2 +============================================== +* Fixed libtool versioning (James Henstridge) + +December 15, 2005: Overview of changes in 2.13.1 +================================================ +* linux: + - fixed proclist + - implemented server->real_ncpu + +December 13, 2005: Overview of changes in 2.13.0 +================================================ +* Requires automake-1.9 (James Henstridge) +* Supports up to 32 CPU +* Supports Linux smaps +* linux: fixed SMP detection + +This release is not ABI compatible with previous releases. Sorry. + +November 29, 2005: Overview of changes from 2.12.0 to 2.12.1 +============================================================ +* Dropped dead files +* linux: 1-line cleanup. + +September 4, 2005: Overview of changes from 2.11.92 to 2.12.0 +============================================================= +* Updated translations. + +August 22, 2005: Overview of changes from 2.11.91 to 2.11.92 +============================================================ +* Linux: + - fixed for 2.6 without /sys + - glibtop_get_cpu() : Do not add irq, softirq and iowait to idle. + +August 9, 2005: Overview of changes from 2.11.90 to 2.11.91 +=========================================================== +* All: + - cleaned some headers. + - removed static examples. +* Linux: + - fixed some issues with 2.6 without /sys + +July 24, 2005: Overview of changes from 2.11.2 to 2.11.90 +========================================================= +* Linux: + - fixed glibtop_uptime .flags. + +July &3, 2005: Overview of changes from 2.11.1 to 2.11.2 +======================================================== +* Linux: + - little improvements for 2.6. + +July 3, 2005: Overview of changes from 2.11.0 to 2.11.1 +======================================================= +* Linux: + - glibtop_get_swap : added page(in|out) for linux 2.6. + +June 8, 2005: Overview of changes from 2.10.x to 2.11.0 +======================================================= +* Replaced a lot of macros by functions +* Got rid of dozens of useless files. +* libgtop 2.11.x are and will stay API and ABI compatible with 2.10.x, i swear. + +April 10, 2005: Overview of changes from 2.10.0 to 2.10.1 +========================================================= +* Updated i18n. +* Little cleanup and fixed gcc-4.0 compilation. +* linux: fixed loadavg and uptime if locale != C. + Updated siglist. +* Tighter libgtop-2.0.pc. + +Mars 7, 2005: Overview of Changes from 2.9.92 to 2.10.0 +======================================================= +* Updated i18n. + +February 28, 2005: Overview of Changes from 2.9.90 to 2.9.92 +============================================================ +* *BSD updated by marcus@freebsd.org (Joe Marcus Clarke). +* Removed a lot of dead files :) +* Don't build&install libgtop_daemon when it's never used. + +February 6, 2004: Overview of Changes from 2.9.90 to 2.9.91 +========================================================== +* Fixed typo in stub. +* Updated i18n. + +January 24, 2004: Overview of Changes from 2.9.4 to 2.9.90 +========================================================== +* Updated Linux support. + +January 10, 2004: Overview of Changes from 2.9.3 to 2.9.4 +========================================================= +* New glibtop_proc_open_files nick@reloco.com.ar (Nicolás Lichtmaier). +* Updated AIX support (Christophe Belle). + +December 20, 2004: Overview of Changes from 2.9.0 to 2.9.3 +========================================================== +* Removed libgtop_names. +* Fixed Argument passing between library and server. #139809. +* *BSD updated by marcus@freebsd.org (Joe Marcus Clarke). +* glibtop_get_mountlist(False) now ignores 'unknown' fs. + + +November 30, 2004: Overview of Changes from 2.8.1 to 2.9.0 +========================================================= +* glibtop_get_netload : Fixed segfault on linux with ppp devices. +* NEW glibtop_get_netlist : retrieves the list of all available interfaces. +* NEW LIBGTOP_CHECK_VERSION(major, minor, micro) +* Removed dead kernel patch and implementation. +* Cleanups on Linux and Solaris. + +October 11, 2004: Overview of Changes from 2.8.0 to 2.8.1 +========================================================= +* Improved Solaris and AIX support. + + +August 13, 2004: Overview of Changes from 2.7.92 to 2.8.0 +========================================================= +* No changes + + +August 30, 2004: +=============== +* Applied some *BSD patches. +* Removed old files. + + +August 15, 2004: +=============== +* Fixed compilation with C89-only compilers and old libc. + + +August 3, 2004: +============== +* Some cleanups. +* Fixed the behaviour of some linux proc_*() functions. +* Updated the documentation. + + +July 19, 2004: Overview of Changes from 2.6.1 to 2.7.4 +====================================================== +* Plenty of code cleanups. Uninlined a lot of functions. ~5-10KB object size + reduction. +* Glibify a bit more. +* API changes: + - glibtop_fsusage provides total read and writes since boot_time. + - glibtop_netload provides hardware address. IPv6 enable. + - Added glibtop_get_proc_argv. + +Work in progress : +* Finish glibtop_fsusage implementation for Linux. +* Some fuctions don't conform to the documentation, e.g. proctime. + +March 11, 2004: +=============== + +* Released LibGTop 2.5.99 "Gross Work", dedicated to people who do push-ups + in the loos. + + - plenty of code cleanups + + - removed the dependency on libgnome, only glib required now + + - Linux 2.6 support, NetBSD support and better FreeBSD support + + - Make the block size available for filesystem statistics + +February 27, 2001: +================= + +* Released LibGTop 1.0.12 "Gerolzhofen". + + - fix for Solaris 8 from Laszlo PETER (msg_limits, sem_limits). + + - fix for FreeBSD 4.2 from Rolf Grossmann (FreeBSD now uses + `_KERNEL' instead of `KERNEL'). Bug #51334. + + - for BSDI, comment out `subnet' field in netload; this should make + it compile, but there may be other problems. Bug #13345. + + This release is for GNOME 1.4 Beta2. + +February 14, 2001: +================= + +* Released LibGTop 1.0.11 "Jasmin": + + [The release which was supposed to be called "Gerolzhofen".] + + - merged in the Solaris code from LIBGTOP_1_1_2_PATCHES. + + - minor OpenBSD fixes. + + - again a bunch of updated translations. + + Please test the Solaris stuff and report and bugs and + problems as soon as possible; I'll make a new release + for the 2nd beta of GNOME 1.4 if necessary. + +November 20, 2000: +================= + +* Released LibGTop 1.0.10 "November Rain": + + - this release contains a bunch of updated translations. + +May 25, 2000: +============ + +* Released LibGTop 1.0.9 "Stuttgart". + + (LibGTop 1.0.8 "Frankfurt" was not publically released.) + +February 15, 2000: +================= + +* Released LibGTop 1.0.7 "Copenhagen": + + - this is a bug fix release for the GUADEC CD-ROM; + it contains fixes in both the Linux and *BSD sysdeps + directory. + +October 18, 1999: +================ + +* Released LibGTop 1.0.6 "October LibGTop": + + - compilation fixes for FreeBSD. + - updated reference manual. + +September 29, 1999: +================== + +* Released LibGTop 1.0.5. + diff --git a/README b/README new file mode 100644 index 0000000..812a366 --- /dev/null +++ b/README @@ -0,0 +1,20 @@ +LATEST NEWS: +=========== + +Please look also in the file 'NEWS' for latest news. + +Martin + + +ChangeLogs: +========== + +LibGTop has many ChangeLogs files. The following files are the the +most important : + +- ChangeLog is the main ChangeLog. +- sysdeps//ChangeLog is the ChangeLog for arch specific changes. +- sysdeps/common/ChangeLog is the ChangeLog for common changes (shared + implementation between archs). + +Benoît diff --git a/TODO b/TODO new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/TODO diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..79e0b37 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,525 @@ +dnl This is just copied m4s from need-declaration.m4 gnome-fileutils.m4 +dnl gnome-supprt-checks.m4 and a little from gnome-libgtop-check.m4 +dnl and finally libgtop-sysdeps.m4 + +dnl +dnl LIBGTOP_CHECK_TYPE +dnl +dnl Improved version of AC_CHECK_TYPE which takes into account +dnl that we need to #include some other header files on some +dnl systems to get some types. + +dnl AC_LIBGTOP_CHECK_TYPE(TYPE, DEFAULT) +AC_DEFUN([AC_LIBGTOP_CHECK_TYPE], +[AC_REQUIRE([AC_HEADER_STDC])dnl +AC_MSG_CHECKING(for $1) +AC_CACHE_VAL(ac_cv_type_$1, +[AC_EGREP_CPP(dnl +changequote(<<,>>)dnl +<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl +changequote([,]), [#include +#if STDC_HEADERS +#include +#include +#endif + +/* For Tru64 */ +#ifdef HAVE_SYS_BITYPES_H +#include +#endif +], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl +AC_MSG_RESULT($ac_cv_type_$1) +if test $ac_cv_type_$1 = no; then + AC_DEFINE($1, $2, [Define to $2 if does not define.]) +fi +]) + +dnl +dnl GNOME_LIBGTOP_TYPES +dnl +dnl some typechecks for libgtop. +dnl + +AC_DEFUN([GNOME_LIBGTOP_TYPES], +[ + AC_CHECK_HEADERS(sys/bitypes.h) +]) + +dnl See whether we need a declaration for a function. +dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES]) +AC_DEFUN([GCC_NEED_DECLARATION], +[AC_MSG_CHECKING([whether $1 must be declared]) +AC_CACHE_VAL(gcc_cv_decl_needed_$1, +[AC_TRY_COMPILE([ +#include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +$2], +[char *(*pfn) = (char *(*)) $1], +eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")]) +if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then + AC_MSG_RESULT(yes) + gcc_need_declarations="$gcc_need_declarations $1" + gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + AC_DEFINE_UNQUOTED($gcc_tr_decl, 1, [Define if $1 () must be declared.]) +else + AC_MSG_RESULT(no) +fi +])dnl + +dnl Check multiple functions to see whether each needs a declaration. +dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES]) +AC_DEFUN([GCC_NEED_DECLARATIONS], +[for ac_func in $1 +do +GCC_NEED_DECLARATION($ac_func, $2) +done +] +) + +dnl +dnl GNOME_FILEUTILS_CHECKS +dnl +dnl checks that are needed for the diskusage applet. +dnl + +AC_DEFUN([GNOME_FILEUTILS_CHECKS], +[ +AC_CHECK_HEADERS(fcntl.h sys/param.h sys/statfs.h sys/fstyp.h \ +mnttab.h mntent.h sys/statvfs.h sys/vfs.h sys/mount.h \ +sys/filsys.h sys/fs_types.h sys/fs/s5param.h) + +AC_CHECK_FUNCS(bcopy endgrent endpwent fchdir ftime ftruncate \ +getcwd getmntinfo gettimeofday isascii lchown \ +listmntent memcpy mkfifo strchr strerror strrchr vprintf) + +dnl Set some defaults when cross-compiling + +if test x$cross_compiling = xyes ; then + case "$host_os" in + linux*) + fu_cv_sys_mounted_getmntent1=yes + fu_cv_sys_stat_statfs2_bsize=yes + ;; + sunos*) + fu_cv_sys_stat_statfs4=yes + ;; + freebsd*) + fu_cv_sys_stat_statfs2_bsize=yes + ;; + osf*) + fu_cv_sys_stat_statfs3_osf1=yes + ;; + esac +fi + +# Determine how to get the list of mounted filesystems. +list_mounted_fs= + +# If the getmntent function is available but not in the standard library, +# make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX). +AC_FUNC_GETMNTENT + +# This test must precede the ones for getmntent because Unicos-9 is +# reported to have the getmntent function, but its support is incompatible +# with other getmntent implementations. + +# NOTE: Normally, I wouldn't use a check for system type as I've done for +# `CRAY' below since that goes against the whole autoconf philosophy. But +# I think there is too great a chance that some non-Cray system has a +# function named listmntent to risk the false positive. + +if test -z "$list_mounted_fs"; then +# Cray UNICOS 9 +AC_MSG_CHECKING([for listmntent of Cray/Unicos-9]) +AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent, +[fu_cv_sys_mounted_cray_listmntent=no +AC_EGREP_CPP(yes, +[#ifdef _CRAY +yes +#endif +], [test $ac_cv_func_listmntent = yes \ +&& fu_cv_sys_mounted_cray_listmntent=yes] +) +] +) +AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent) +if test $fu_cv_sys_mounted_cray_listmntent = yes; then +list_mounted_fs=found +AC_DEFINE(MOUNTED_LISTMNTENT, 1, + [Define if there is a function named listmntent that can be used to list all mounted filesystems. [UNICOS]]) +fi +fi + +if test $ac_cv_func_getmntent = yes; then + +# This system has the getmntent function. +# Determine whether it's the one-argument variant or the two-argument one. + +if test -z "$list_mounted_fs"; then +# 4.3BSD, SunOS, HP-UX, Dynix, Irix +AC_MSG_CHECKING([for one-argument getmntent function]) +AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1, +[test $ac_cv_header_mntent_h = yes \ +&& fu_cv_sys_mounted_getmntent1=yes \ +|| fu_cv_sys_mounted_getmntent1=no]) +AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1) +if test $fu_cv_sys_mounted_getmntent1 = yes; then +list_mounted_fs=found +AC_DEFINE(MOUNTED_GETMNTENT1, 1, + [Define if there is a function named getmntent for reading the list of mounted filesystems, and that function takes a single argument. [4.3BSD, SunOS, HP-UX, Dynix, Irix]]) +fi +fi + +if test -z "$list_mounted_fs"; then +# SVR4 +AC_MSG_CHECKING([for two-argument getmntent function]) +AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2, +[AC_EGREP_HEADER(getmntent, sys/mnttab.h, +fu_cv_sys_mounted_getmntent2=yes, +fu_cv_sys_mounted_getmntent2=no)]) +AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2) +if test $fu_cv_sys_mounted_getmntent2 = yes; then +list_mounted_fs=found +AC_DEFINE(MOUNTED_GETMNTENT2, 1, + [Define if there is a function named getmntent for reading the list of mounted filesystems, and that function takes two arguments. [SVR4]]) +fi +fi + +if test -z "$list_mounted_fs"; then +AC_MSG_ERROR([could not determine how to read list of mounted filesystems]) +fi + +fi + +if test -z "$list_mounted_fs"; then +# DEC Alpha running OSF/1. +AC_MSG_CHECKING([for getfsstat function]) +AC_CACHE_VAL(fu_cv_sys_mounted_getsstat, +[AC_TRY_LINK([ +#include +#include +#include ], +[struct statfs *stats; +int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); ], +fu_cv_sys_mounted_getsstat=yes, +fu_cv_sys_mounted_getsstat=no)]) +AC_MSG_RESULT($fu_cv_sys_mounted_getsstat) +if test $fu_cv_sys_mounted_getsstat = yes; then +list_mounted_fs=found +AC_DEFINE(MOUNTED_GETFSSTAT, 1, + [Define if there is a function named getfsstat for reading the list of mounted filesystems. [DEC Alpha running OSF/1]]) +fi +fi + +if test -z "$list_mounted_fs"; then +# AIX. +AC_MSG_CHECKING([for mntctl function and struct vmount]) +AC_CACHE_VAL(fu_cv_sys_mounted_vmount, +[AC_TRY_CPP([#include ], +fu_cv_sys_mounted_vmount=yes, +fu_cv_sys_mounted_vmount=no)]) +AC_MSG_RESULT($fu_cv_sys_mounted_vmount) +if test $fu_cv_sys_mounted_vmount = yes; then +list_mounted_fs=found +AC_DEFINE(MOUNTED_VMOUNT, 1, + [Define if there is a function named mntctl that can be used to read the list of mounted filesystems, and there is a system header file that declares `struct vmount.' [AIX]]) +fi +fi + +if test -z "$list_mounted_fs"; then +# SVR3 +AC_MSG_CHECKING([for FIXME existence of three headers]) +AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp, +[AC_TRY_CPP([ +#include +#include +#include ], +fu_cv_sys_mounted_fread_fstyp=yes, +fu_cv_sys_mounted_fread_fstyp=no)]) +AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp) +if test $fu_cv_sys_mounted_fread_fstyp = yes; then +list_mounted_fs=found +AC_DEFINE(MOUNTED_FREAD_FSTYP, 1, + [Define if (like SVR2) there is no specific function for reading the list of mounted filesystems, and your system has these header files: and . [SVR3]]) +fi +fi + +if test -z "$list_mounted_fs"; then +# 4.4BSD and DEC OSF/1. +AC_MSG_CHECKING([for getmntinfo function]) +AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo, +[ +ok= +if test $ac_cv_func_getmntinfo = yes; then +AC_EGREP_HEADER(f_type;, sys/mount.h, +ok=yes) +fi +test -n "$ok" \ +&& fu_cv_sys_mounted_getmntinfo=yes \ +|| fu_cv_sys_mounted_getmntinfo=no +]) +AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo) +if test $fu_cv_sys_mounted_getmntinfo = yes; then +list_mounted_fs=found +AC_DEFINE(MOUNTED_GETMNTINFO, 1, + [Define if there is a function named getmntinfo for reading the list of mounted filesystems. [4.4BSD]]) +fi +fi + +# FIXME: add a test for netbsd-1.1 here + +if test -z "$list_mounted_fs"; then +# Ultrix +AC_MSG_CHECKING([for getmnt function]) +AC_CACHE_VAL(fu_cv_sys_mounted_getmnt, +[AC_TRY_CPP([ +#include +#include ], +fu_cv_sys_mounted_getmnt=yes, +fu_cv_sys_mounted_getmnt=no)]) +AC_MSG_RESULT($fu_cv_sys_mounted_getmnt) +if test $fu_cv_sys_mounted_getmnt = yes; then +list_mounted_fs=found +AC_DEFINE(MOUNTED_GETMNT, 1, + [Define if there is a function named getmnt for reading the list of mounted filesystems. [Ultrix]]) +fi +fi + +if test -z "$list_mounted_fs"; then +# SVR2 +AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab]) +AC_CACHE_VAL(fu_cv_sys_mounted_fread, +[AC_TRY_CPP([#include ], +fu_cv_sys_mounted_fread=yes, +fu_cv_sys_mounted_fread=no)]) +AC_MSG_RESULT($fu_cv_sys_mounted_fread) +if test $fu_cv_sys_mounted_fread = yes; then +list_mounted_fs=found +AC_DEFINE(MOUNTED_FREAD, 1, + [Define if there is no specific function for reading the list of mounted filesystems. fread will be used to read /etc/mnttab. [SVR2]]) +fi +fi + +if test -z "$list_mounted_fs"; then +AC_MSG_ERROR([could not determine how to read list of mounted filesystems]) +# FIXME -- no need to abort building the whole package +# Cannot build mountlist.c or anything that needs its functions +fi + +AC_CHECKING(how to get filesystem space usage) +space=no + +# Perform only the link test since it seems there are no variants of the +# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs) +# because that got a false positive on SCO OSR5. Adding the declaration +# of a `struct statvfs' causes this test to fail (as it should) on such +# systems. That system is reported to work fine with STAT_STATFS4 which +# is what it gets when this test fails. +if test $space = no; then +# SVR4 +AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs, +[AC_TRY_LINK([#include +#include ], +[struct statvfs fsd; statvfs (0, &fsd);], +fu_cv_sys_stat_statvfs=yes, +fu_cv_sys_stat_statvfs=no)]) +if test $fu_cv_sys_stat_statvfs = yes; then +space=yes +AC_DEFINE(STAT_STATVFS, 1, + [Define if there is a function named statvfs. [SVR4]]) +fi +fi + +if test $space = no; then +# DEC Alpha running OSF/1 +AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)]) +AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1, +[AC_TRY_RUN([ +#include +#include +#include +int main () +{ +struct statfs fsd; +fsd.f_fsize = 0; +return (statfs (".", &fsd, sizeof (struct statfs))); +}], +fu_cv_sys_stat_statfs3_osf1=yes, +fu_cv_sys_stat_statfs3_osf1=no, +fu_cv_sys_stat_statfs3_osf1=no)]) +AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1) +if test $fu_cv_sys_stat_statfs3_osf1 = yes; then +space=yes +AC_DEFINE(STAT_STATFS3_OSF1, 1, + [Define if statfs takes 3 args. [DEC Alpha running OSF/1]]) +fi +fi + +if test $space = no; then +# AIX +AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl +member (AIX, 4.3BSD)]) +AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize, +[AC_TRY_RUN([ +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#ifdef HAVE_SYS_MOUNT_H +#include +#endif +#ifdef HAVE_SYS_VFS_H +#include +#endif +int main () +{ +struct statfs fsd; +fsd.f_bsize = 0; +return (statfs (".", &fsd)); +}], +fu_cv_sys_stat_statfs2_bsize=yes, +fu_cv_sys_stat_statfs2_bsize=no, +fu_cv_sys_stat_statfs2_bsize=no)]) +AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize) +if test $fu_cv_sys_stat_statfs2_bsize = yes; then +space=yes +AC_DEFINE(STAT_STATFS2_BSIZE, 1, + [Define if statfs takes 2 args and struct statfs has a field named f_bsize. [4.3BSD, SunOS 4, HP-UX, AIX PS/2]]) +fi +fi + +if test $space = no; then +# SVR3 +AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)]) +AC_CACHE_VAL(fu_cv_sys_stat_statfs4, +[AC_TRY_RUN([#include +#include +int main () +{ +struct statfs fsd; +return (statfs (".", &fsd, sizeof fsd, 0)); +}], +fu_cv_sys_stat_statfs4=yes, +fu_cv_sys_stat_statfs4=no, +fu_cv_sys_stat_statfs4=no)]) +AC_MSG_RESULT($fu_cv_sys_stat_statfs4) +if test $fu_cv_sys_stat_statfs4 = yes; then +space=yes +AC_DEFINE(STAT_STATFS4, 1, + [Define if statfs takes 4 args. [SVR3, Dynix, Irix, Dolphin]]) +fi +fi + +if test $space = no; then +# 4.4BSD and NetBSD +AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl +member (4.4BSD and NetBSD)]) +AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize, +[AC_TRY_RUN([#include +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#ifdef HAVE_SYS_MOUNT_H +#include +#endif +int main () +{ +struct statfs fsd; +fsd.f_fsize = 0; +return (statfs (".", &fsd)); +}], +fu_cv_sys_stat_statfs2_fsize=yes, +fu_cv_sys_stat_statfs2_fsize=no, +fu_cv_sys_stat_statfs2_fsize=no)]) +AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize) +if test $fu_cv_sys_stat_statfs2_fsize = yes; then +space=yes +AC_DEFINE(STAT_STATFS2_FSIZE, 1, + [Define if statfs takes 2 args and struct statfs has a field named f_fsize. [4.4BSD, NetBSD]]) +fi +fi + +if test $space = no; then +# Ultrix +AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)]) +AC_CACHE_VAL(fu_cv_sys_stat_fs_data, +[AC_TRY_RUN([#include +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#ifdef HAVE_SYS_MOUNT_H +#include +#endif +#ifdef HAVE_SYS_FS_TYPES_H +#include +#endif +int main () +{ +struct fs_data fsd; +/* Ultrix's statfs returns 1 for success, +0 for not mounted, -1 for failure. */ +return (statfs (".", &fsd) != 1); +}], +fu_cv_sys_stat_fs_data=yes, +fu_cv_sys_stat_fs_data=no, +fu_cv_sys_stat_fs_data=no)]) +AC_MSG_RESULT($fu_cv_sys_stat_fs_data) +if test $fu_cv_sys_stat_fs_data = yes; then +space=yes +AC_DEFINE(STAT_STATFS2_FS_DATA, 1, + [Define if statfs takes 2 args and the second argument has type struct fs_data. [Ultrix]]) +fi +fi + +if test $space = no; then +# SVR2 +AC_TRY_CPP([#include ], +AC_DEFINE(STAT_READ_FILSYS, 1, + [Define if there is no specific function for reading filesystems usage information and you have the header file. [SVR2]]) +space=yes) +fi + +if test -n "$list_mounted_fs" && test $space != no; then +DF_PROG="df" +# AC_LIBOBJ(fsusage) +# AC_LIBOBJ(mountlist) +fi + +# Check for SunOS statfs brokenness wrt partitions 2GB and larger. +# If exists and struct statfs has a member named f_spare, +# enable the work-around code in fsusage.c. +AC_MSG_CHECKING([for statfs that truncates block counts]) +AC_CACHE_VAL(fu_cv_sys_truncating_statfs, +[AC_TRY_COMPILE([ +#if !defined(sun) && !defined(__sun) +choke -- this is a workaround for a Sun-specific problem +#endif +#include +#include ], +[struct statfs t; long c = *(t.f_spare);], +fu_cv_sys_truncating_statfs=yes, +fu_cv_sys_truncating_statfs=no, +)]) +if test $fu_cv_sys_truncating_statfs = yes; then +AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS, 1, + [Define if the block counts reported by statfs may be truncated to 2GB and the correct values may be stored in the f_spare array. [SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem. SunOS 4.1.1 seems not to be affected.]]) +fi +AC_MSG_RESULT($fu_cv_sys_truncating_statfs) + +AC_CHECKING(for AFS) +test -d /afs && AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.]) +]) + + +m4_include([libgtop-sysdeps.m4]) diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..25b724d --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1513 @@ +# generated automatically by aclocal 1.15 -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# 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. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 11 (pkg-config-0.29.1) + +dnl Copyright © 2004 Scott James Remnant . +dnl Copyright © 2012-2015 Dan Nicholson +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29.1]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])dnl PKG_PROG_PKG_CONFIG + +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])dnl _PKG_CONFIG + +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. +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 +])dnl _PKG_SHORT_ERRORS_SUPPORTED + + +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])dnl PKG_CHECK_MODULES + + +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC + + +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_INSTALLDIR + + +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_NOARCH_INSTALLDIR + + +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])dnl PKG_CHECK_VAR + +dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------ +dnl +dnl Prepare a "--with-" configure option using the lowercase +dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and +dnl PKG_CHECK_MODULES in a single macro. +AC_DEFUN([PKG_WITH_MODULES], +[ +m4_pushdef([with_arg], m4_tolower([$1])) + +m4_pushdef([description], + [m4_default([$5], [build with ]with_arg[ support])]) + +m4_pushdef([def_arg], [m4_default([$6], [auto])]) +m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) +m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) + +m4_case(def_arg, + [yes],[m4_pushdef([with_without], [--without-]with_arg)], + [m4_pushdef([with_without],[--with-]with_arg)]) + +AC_ARG_WITH(with_arg, + AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, + [AS_TR_SH([with_]with_arg)=def_arg]) + +AS_CASE([$AS_TR_SH([with_]with_arg)], + [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], + [auto],[PKG_CHECK_MODULES([$1],[$2], + [m4_n([def_action_if_found]) $3], + [m4_n([def_action_if_not_found]) $4])]) + +m4_popdef([with_arg]) +m4_popdef([description]) +m4_popdef([def_arg]) + +])dnl PKG_WITH_MODULES + +dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ----------------------------------------------- +dnl +dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES +dnl check._[VARIABLE-PREFIX] is exported as make variable. +AC_DEFUN([PKG_HAVE_WITH_MODULES], +[ +PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) + +AM_CONDITIONAL([HAVE_][$1], + [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) +])dnl PKG_HAVE_WITH_MODULES + +dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------------------ +dnl +dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after +dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make +dnl and preprocessor variable. +AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], +[ +PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) + +AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], + [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) +])dnl PKG_HAVE_DEFINE_WITH_MODULES + +# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# 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. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.15' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.15], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.15])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# 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. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $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 + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/gettext.m4]) +m4_include([m4/gtk-doc.m4]) +m4_include([m4/iconv.m4]) +m4_include([m4/intlmacosx.m4]) +m4_include([m4/introspection.m4]) +m4_include([m4/lib-ld.m4]) +m4_include([m4/lib-link.m4]) +m4_include([m4/lib-prefix.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) +m4_include([m4/nls.m4]) +m4_include([m4/po.m4]) +m4_include([m4/progtest.m4]) +m4_include([acinclude.m4]) diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..7257368 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +(test -f $srcdir/configure.ac \ + && test -f $srcdir/copyright.txt \ + && test -d $srcdir/sysdeps) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level gnome directory" + exit 1 +} + +which gnome-autogen.sh || { + echo "You need to install gnome-common from the GNOME CVS" + exit 1 +} +REQUIRED_AUTOMAKE_VERSION=1.9 +. gnome-autogen.sh diff --git a/compile b/compile new file mode 100755 index 0000000..a85b723 --- /dev/null +++ b/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# 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, see . + +# 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. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..2e9ad7f --- /dev/null +++ b/config.guess @@ -0,0 +1,1462 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2016 Free Software Foundation, Inc. + +timestamp='2016-10-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 3 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, see . +# +# 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. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + + +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 1992-2016 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 + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# 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 tuples: *-*-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=`(uname -p 2>/dev/null || \ + /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 ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-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) and ABI. + case "${UNAME_MACHINE_ARCH}" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + 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 + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + 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/[-_].*//' | cut -d. -f1,2` + ;; + 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}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${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 ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + 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` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + 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 ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + 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:*:[4567]) + 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/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + 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 -q __LP64__ + 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:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # 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-${LIBC}`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 "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + 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 -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + mips64el:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${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-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + 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.[02]*:*) + 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 i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-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; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + 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.[02]*:*) + 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 ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + 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 ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-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 + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + 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 ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + 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 ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +cat >&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: diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..b20c7a6 --- /dev/null +++ b/config.h.in @@ -0,0 +1,453 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if you have the Andrew File System. */ +#undef AFS + +/* 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 the gettext package used by the library */ +#undef GETTEXT_PACKAGE + +/* Same as LINUX_VERSION_CODE either from or from the + running kernel (if there are no configured kernel sources). */ +#undef GLIBTOP_LINUX_VERSION_CODE + +/* Solaris release code (eg. 20501 for Solaris 2.5.1). */ +#undef GLIBTOP_SOLARIS_RELEASE + +/* 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 `bcopy' function. */ +#undef HAVE_BCOPY + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +#undef HAVE_CFLOCALECOPYCURRENT + +/* Define to 1 if you have the Mac OS 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 `dlerror' function. */ +#undef HAVE_DLERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the `dlopen' function. */ +#undef HAVE_DLOPEN + +/* Define to 1 if you have the `endgrent' function. */ +#undef HAVE_ENDGRENT + +/* Define to 1 if you have the `endpwent' function. */ +#undef HAVE_ENDPWENT + +/* Define to 1 if you have the `fchdir' function. */ +#undef HAVE_FCHDIR + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `ftime' function. */ +#undef HAVE_FTIME + +/* Define to 1 if you have the `ftruncate' function. */ +#undef HAVE_FTRUNCATE + +/* Define to 1 if you have the `getcwd' function. */ +#undef HAVE_GETCWD + +/* Define to 1 if you have the `getloadavg' function. */ +#undef HAVE_GETLOADAVG + +/* Define to 1 if you have the `getmntent' function. */ +#undef HAVE_GETMNTENT + +/* Define to 1 if you have the `getmntinfo' function. */ +#undef HAVE_GETMNTINFO + +/* 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 `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the `getwd' function. */ +#undef HAVE_GETWD + +/* Define if I4B is available */ +#undef HAVE_I4B + +/* Define if I4B accounting is supported */ +#undef HAVE_I4B_ACCT + +/* Define if you have the iconv() function and it works. */ +#undef HAVE_ICONV + +/* defined if you have ifaddrs.h */ +#undef HAVE_IFADDRS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `isascii' function. */ +#undef HAVE_ISASCII + +/* defined if you have linux/isdn.h */ +#undef HAVE_ISDN_H + +/* Define to 1 if you have the `lchown' function. */ +#undef HAVE_LCHOWN + +/* Define to 1 if you have the `kstat' library (-lkstat). */ +#undef HAVE_LIBKSTAT + +/* Define to 1 if you have the `mach' library (-lmach). */ +#undef HAVE_LIBMACH + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +#undef HAVE_LIBNSL + +/* Define to 1 if you have the `resolv' library (-lresolv). */ +#undef HAVE_LIBRESOLV + +/* Define to 1 if you have the `socket' library (-lsocket). */ +#undef HAVE_LIBSOCKET + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_VERSION_H + +/* Define to 1 if you have the `listmntent' function. */ +#undef HAVE_LISTMNTENT + +/* Define to 1 if you have the `memcpy' function. */ +#undef HAVE_MEMCPY + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mkfifo' function. */ +#undef HAVE_MKFIFO + +/* Define to 1 if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the header file. */ +#undef HAVE_MNTENT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MNTTAB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NET_IF_VAR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PROCFS_H + +/* Define to 1 if you have the `putenv' function. */ +#undef HAVE_PUTENV + +/* Define if struct sockaddr_un has a sun_len member */ +#undef HAVE_SOCKADDR_SUN_LEN + +/* Define if BSD sockets are supported */ +#undef HAVE_SOCKETS + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the `strftime' function. */ +#undef HAVE_STRFTIME + +/* Define to 1 if you have the 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 `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the `strtoul' function. */ +#undef HAVE_STRTOUL + +/* Define to 1 if `st_rdev' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_RDEV + +/* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use + `HAVE_STRUCT_STAT_ST_RDEV' instead. */ +#undef HAVE_ST_RDEV + +/* Define to 1 if you have the `swapctl' function. */ +#undef HAVE_SWAPCTL + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_BITYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_FILSYS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_FSTYP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_FS_S5PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_FS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MOUNT_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_PROCFS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STATFS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STATVFS_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 header file. */ +#undef HAVE_SYS_VFS_H + +/* Define to 1 if you have the `uname' function. */ +#undef HAVE_UNAME + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the 'vmgetinfo' function in libperfstat */ +#undef HAVE_VMGETINFO + +/* Define to 1 if you have the `vprintf' function. */ +#undef HAVE_VPRINTF + +/* Define if Xauth is supported */ +#undef HAVE_XAUTH + +/* Define to disable debugging */ +#undef LIBGTOP_ENABLE_DEBUG + +/* Define to enable fatal warnings */ +#undef LIBGTOP_FATAL_WARNINGS + +/* Define if libgtop server is required */ +#undef LIBGTOP_NEED_SERVER + +/* The path to the libgtop server */ +#undef LIBGTOP_SERVER + +/* The libgtop server version */ +#undef LIBGTOP_SERVER_VERSION + +/* The libgtop version number */ +#undef LIBGTOP_VERSION + +/* The libgtop version number as an integer */ +#undef LIBGTOP_VERSION_CODE + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Define if there is no specific function for reading the list of mounted + filesystems. fread will be used to read /etc/mnttab. [SVR2] */ +#undef MOUNTED_FREAD + +/* Define if (like SVR2) there is no specific function for reading the list of + mounted filesystems, and your system has these header files: + and . [SVR3] */ +#undef MOUNTED_FREAD_FSTYP + +/* Define if there is a function named getfsstat for reading the list of + mounted filesystems. [DEC Alpha running OSF/1] */ +#undef MOUNTED_GETFSSTAT + +/* Define if there is a function named getmnt for reading the list of mounted + filesystems. [Ultrix] */ +#undef MOUNTED_GETMNT + +/* Define if there is a function named getmntent for reading the list of + mounted filesystems, and that function takes a single argument. [4.3BSD, + SunOS, HP-UX, Dynix, Irix] */ +#undef MOUNTED_GETMNTENT1 + +/* Define if there is a function named getmntent for reading the list of + mounted filesystems, and that function takes two arguments. [SVR4] */ +#undef MOUNTED_GETMNTENT2 + +/* Define if there is a function named getmntinfo for reading the list of + mounted filesystems. [4.4BSD] */ +#undef MOUNTED_GETMNTINFO + +/* Define if there is a function named listmntent that can be used to list all + mounted filesystems. [UNICOS] */ +#undef MOUNTED_LISTMNTENT + +/* Define if there is a function named mntctl that can be used to read the + list of mounted filesystems, and there is a system header file that + declares `struct vmount.' [AIX] */ +#undef MOUNTED_VMOUNT + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* 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 runtime. + 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 if the block counts reported by statfs may be truncated to 2GB and + the correct values may be stored in the f_spare array. [SunOS 4.1.2, 4.1.3, + and 4.1.3_U1 are reported to have this problem. SunOS 4.1.1 seems not to be + affected.] */ +#undef STATFS_TRUNCATES_BLOCK_COUNTS + +/* Define if there is no specific function for reading filesystems usage + information and you have the header file. [SVR2] */ +#undef STAT_READ_FILSYS + +/* Define if statfs takes 2 args and struct statfs has a field named f_bsize. + [4.3BSD, SunOS 4, HP-UX, AIX PS/2] */ +#undef STAT_STATFS2_BSIZE + +/* Define if statfs takes 2 args and struct statfs has a field named f_fsize. + [4.4BSD, NetBSD] */ +#undef STAT_STATFS2_FSIZE + +/* Define if statfs takes 2 args and the second argument has type struct + fs_data. [Ultrix] */ +#undef STAT_STATFS2_FS_DATA + +/* Define if statfs takes 3 args. [DEC Alpha running OSF/1] */ +#undef STAT_STATFS3_OSF1 + +/* Define if statfs takes 4 args. [SVR3, Dynix, Irix, Dolphin] */ +#undef STAT_STATFS4 + +/* Define if there is a function named statvfs. [SVR4] */ +#undef STAT_STATVFS + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if we need to define KERNEL to get 'struct msginfo' */ +#undef STRUCT_MSGINFO_NEEDS_KERNEL + +/* Define to 1 if we need to define _KERNEL to get 'struct msginfo' */ +#undef STRUCT_MSGINFO_NEEDS__KERNEL + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING + +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE +#endif + +/* Note that we are building libgtop rather than using it */ +#undef _IN_LIBGTOP + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `int' if doesn't define. */ +#undef gid_t + +/* 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 int' if does not define. */ +#undef off_t + +/* Define to `int' if does not define. */ +#undef pid_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define to `int' if does not define. */ +#undef ssize_t + +/* Define to `int' if doesn't define. */ +#undef uid_t diff --git a/config.rpath b/config.rpath new file mode 100755 index 0000000..b625621 --- /dev/null +++ b/config.rpath @@ -0,0 +1,684 @@ +#! /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-2014 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's _LT_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + ecc*) + wl='-Wl,' + ;; + icc* | ifort*) + wl='-Wl,' + ;; + lf95*) + wl='-Wl,' + ;; + nagfor*) + wl='-Wl,-Wl,,' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + wl='-Wl,' + ;; + ccc*) + wl='-Wl,' + ;; + xl* | bgxl* | bgf* | mpixl*) + wl='-Wl,' + ;; + como) + wl='-lopt=' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + wl= + ;; + *Sun\ C*) + wl='-Wl,' + ;; + esac + ;; + esac + ;; + newsos6) + ;; + *nto* | *qnx*) + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + rdos*) + ;; + solaris*) + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + wl='-Qoption ld ' + ;; + *) + wl='-Wl,' + ;; + esac + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl='-Wl,' + ;; + unicos*) + wl='-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's _LT_LINKER_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32* | cegcc*) + # 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 + ;; + haiku*) + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = no; then + hardcode_libdir_flag_spec= + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=no + if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then + : + else + ld_shlibs=no + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd2.[01]*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd* | dragonfly*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + ;; + *) + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + *nto* | *qnx*) + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if the +# linker has special search rules. +library_names_spec= # the last element of library_names_spec in libtool.m4 +libname_spec='lib$name' +case "$host_os" in + aix3*) + library_names_spec='$libname.a' + ;; + aix[4-9]*) + library_names_spec='$libname$shrext' + ;; + amigaos*) + case "$host_cpu" in + powerpc*) + library_names_spec='$libname$shrext' ;; + m68k) + library_names_spec='$libname.a' ;; + esac + ;; + beos*) + library_names_spec='$libname$shrext' + ;; + bsdi[45]*) + library_names_spec='$libname$shrext' + ;; + cygwin* | mingw* | pw32* | cegcc*) + shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=.dylib + library_names_spec='$libname$shrext' + ;; + dgux*) + library_names_spec='$libname$shrext' + ;; + freebsd[23].*) + library_names_spec='$libname$shrext$versuffix' + ;; + freebsd* | dragonfly*) + library_names_spec='$libname$shrext' + ;; + gnu*) + library_names_spec='$libname$shrext' + ;; + haiku*) + library_names_spec='$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + library_names_spec='$libname$shrext' + ;; + interix[3-9]*) + library_names_spec='$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) + library_names_spec='$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + library_names_spec='$libname$shrext' + ;; + knetbsd*-gnu) + library_names_spec='$libname$shrext' + ;; + netbsd*) + library_names_spec='$libname$shrext' + ;; + newsos6) + library_names_spec='$libname$shrext' + ;; + *nto* | *qnx*) + library_names_spec='$libname$shrext' + ;; + openbsd*) + library_names_spec='$libname$shrext$versuffix' + ;; + os2*) + libname_spec='$name' + shrext=.dll + library_names_spec='$libname.a' + ;; + osf3* | osf4* | osf5*) + library_names_spec='$libname$shrext' + ;; + rdos*) + ;; + solaris*) + library_names_spec='$libname$shrext' + ;; + sunos4*) + library_names_spec='$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) + library_names_spec='$libname$shrext' + ;; + sysv4*MP*) + library_names_spec='$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec='$libname$shrext' + ;; + tpf*) + library_names_spec='$libname$shrext' + ;; + uts4*) + library_names_spec='$libname$shrext' + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. +# +# 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. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# 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. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# 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 or 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 1992-2016 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-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + 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 | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -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*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -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 \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-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-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | 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-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # 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 + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + 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 + ;; + cr16 | cr16-*) + basic_machine=cr16-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 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + 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*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 + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + 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 + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + 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 + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + 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 + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + 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 | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little) + 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 | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + 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 + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + 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 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + 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 + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + 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 + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-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[24]aeb | 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. + -auroraux) + os=-auroraux + ;; + -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* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -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* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -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* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix*) + # 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 + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -ios) + ;; + -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 + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + 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 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + 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 + ;; + -cnk*|-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: diff --git a/configure b/configure new file mode 100755 index 0000000..5635a7b --- /dev/null +++ b/configure @@ -0,0 +1,22515 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for libgtop 2.38.0. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # 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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# 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'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='libgtop' +PACKAGE_TARNAME='libgtop' +PACKAGE_VERSION='2.38.0' +PACKAGE_STRING='libgtop 2.38.0' +PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop' +PACKAGE_URL='' + +ac_unique_file="copyright.txt" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_list= +gt_needs= +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +GTK_DOC_USE_REBASE_FALSE +GTK_DOC_USE_REBASE_TRUE +GTK_DOC_USE_LIBTOOL_FALSE +GTK_DOC_USE_LIBTOOL_TRUE +GTK_DOC_BUILD_PDF_FALSE +GTK_DOC_BUILD_PDF_TRUE +GTK_DOC_BUILD_HTML_FALSE +GTK_DOC_BUILD_HTML_TRUE +ENABLE_GTK_DOC_FALSE +ENABLE_GTK_DOC_TRUE +HAVE_GTK_DOC_FALSE +HAVE_GTK_DOC_TRUE +GTKDOC_DEPS_LIBS +GTKDOC_DEPS_CFLAGS +HTML_DIR +GTKDOC_MKPDF +GTKDOC_REBASE +GTKDOC_CHECK_PATH +GTKDOC_CHECK +server_programs +sysdeps_suid_lib +LIBGTOP_SERVER +LIBGTOP_BINDIR +LIBGTOP_INCS +LIBGTOP_LIBS +LIBGTOP_EXTRA_LIBS +AM_CPPFLAGS +sysdeps_dir +libs_xauth +X_EXTRA_LIBS +X_LIBS +X_PRE_LIBS +X_CFLAGS +XMKMF +GETTEXT_PACKAGE +POSUB +LTLIBINTL +LIBINTL +INTLLIBS +LTLIBICONV +LIBICONV +INTL_MACOSX_LIBS +XGETTEXT_EXTRA_OPTIONS +MSGMERGE +XGETTEXT_015 +XGETTEXT +GMSGFMT_015 +MSGFMT_015 +GMSGFMT +MSGFMT +GETTEXT_MACRO_VERSION +USE_NLS +ALLOCA +DL_LIB +LIBOBJS +GLIB_LIBS +GLIB_CFLAGS +LIBGTOP_SYSDEPS_PRIVATE_FSUSAGE_FALSE +LIBGTOP_SYSDEPS_PRIVATE_FSUSAGE_TRUE +LIBGTOP_SYSDEPS_PRIVATE_MOUNTLIST_FALSE +LIBGTOP_SYSDEPS_PRIVATE_MOUNTLIST_TRUE +LIBGTOP_NEED_SERVER_FALSE +LIBGTOP_NEED_SERVER_TRUE +KVM_LIBS +libgtop_have_sysinfo +libgtop_postinstall +HACKER_MODE_FALSE +HACKER_MODE_TRUE +EXAMPLES_FALSE +EXAMPLES_TRUE +libgtop_need_server +libgtop_sysdeps_dir +CROSS_COMPILING_FALSE +CROSS_COMPILING_TRUE +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +ac_ct_AR +DLLTOOL +OBJDUMP +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +SED +LIBTOOL +LN_S +AR +AS +RANLIB +PERL +libgtop_top_builddir +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +LT_VERSION_INFO +LIBGTOP_VERSION_CODE +LIBGTOP_VERSION +LIBGTOP_SERVER_VERSION +LIBGTOP_MICRO_VERSION +LIBGTOP_MINOR_VERSION +LIBGTOP_MAJOR_VERSION +ACLOCAL_AMFLAGS +HAVE_INTROSPECTION_FALSE +HAVE_INTROSPECTION_TRUE +INTROSPECTION_MAKEFILE +INTROSPECTION_LIBS +INTROSPECTION_CFLAGS +INTROSPECTION_TYPELIBDIR +INTROSPECTION_GIRDIR +INTROSPECTION_GENERATE +INTROSPECTION_COMPILER +INTROSPECTION_SCANNER +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_introspection +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +with_examples +enable_hacker_mode +enable_nls +enable_rpath +with_libiconv_prefix +with_libintl_prefix +with_x +enable_debug +enable_fatal_warnings +with_html_dir +enable_gtk_doc +enable_gtk_doc_html +enable_gtk_doc_pdf +' + ac_precious_vars='build_alias +host_alias +target_alias +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +LT_SYS_LIBRARY_PATH +GLIB_CFLAGS +GLIB_LIBS +XMKMF +GTKDOC_DEPS_CFLAGS +GTKDOC_DEPS_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# 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. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +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 + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -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) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$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 ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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 ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + 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 ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=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 ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_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'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# 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 + 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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 libgtop 2.38.0 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 \`..'] + +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] + --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] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/libgtop] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_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 + +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR + +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 + case $ac_init_help in + short | recursive ) echo "Configuration of libgtop 2.38.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-introspection=[no/auto/yes] + Enable introspection for this build + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-hacker-mode Enable building of unstable sysdeps + --disable-nls do not use Native Language Support + --disable-rpath do not hardcode runtime library paths + --enable-debug Turn on debugging [default=no] + --enable-fatal-warnings Make all warnings fatal [debug=no] + --enable-gtk-doc use gtk-doc to build documentation [[default=no]] + --enable-gtk-doc-html build documentation in html format [[default=yes]] + --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). + --with-examples Build the libgtop examples [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-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib + --without-libintl-prefix don't search for libintl in includedir and libdir + --with-x use the X Window System + --with-html-dir=PATH path to installed docs + +Some influential environment variables: + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config + GLIB_LIBS linker flags for GLIB, overriding pkg-config + XMKMF Path to xmkmf, Makefile generator for X Window System + GTKDOC_DEPS_CFLAGS + C compiler flags for GTKDOC_DEPS, overriding pkg-config + GTKDOC_DEPS_LIBS + linker flags for GTKDOC_DEPS, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested 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 + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +libgtop configure 2.38.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 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 +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* 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_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ---------------------------------------------------------------------- ## +## Report this to http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop ## +## ---------------------------------------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by libgtop $as_me 2.38.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +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` +/usr/bin/hostinfo = `(/usr/bin/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=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append 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 + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > 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 + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +as_fn_append ac_header_list " stdlib.h" +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_header_list " sys/param.h" +gt_needs="$gt_needs " +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; 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,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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_config_headers="$ac_config_headers config.h" + + +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 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + +am__api_version='1.15' + +# 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. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&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_fn_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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$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' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $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". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='libgtop' + VERSION='2.38.0' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar plaintar pax cpio none' + +# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 +$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; } + if test $am_uid -le $am_max_uid; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + _am_tools=none + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 +$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; } + if test $am_gid -le $am_max_gid; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + _am_tools=none + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +$as_echo_n "checking how to create a ustar tar archive... " >&6; } + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_ustar-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x ustar -w "$$tardir"' + am__tar_='pax -L -x ustar -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H ustar -L' + am__tar_='find "$tardir" -print | cpio -o -H ustar -L' + am__untar='cpio -i -H ustar -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_ustar}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 + ($am__untar &5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 + (cat conftest.dir/file) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + if ${am_cv_prog_tar_ustar+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_prog_tar_ustar=$_am_tool +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +$as_echo "$am_cv_prog_tar_ustar" >&6; } + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + + + + # Check whether --enable-introspection was given. +if test "${enable_introspection+set}" = set; then : + enableval=$enable_introspection; +else + enable_introspection=auto +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gobject-introspection" >&5 +$as_echo_n "checking for gobject-introspection... " >&6; } + + case $enable_introspection in #( + no) : + found_introspection="no (disabled, use --enable-introspection to enable)" + ;; #( + yes) : + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + : +else + as_fn_error $? "gobject-introspection-1.0 is not installed" "$LINENO" 5 +fi + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.6.7\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.6.7") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + found_introspection=yes +else + as_fn_error $? "You need to have gobject-introspection >= 0.6.7 installed to build libgtop" "$LINENO" 5 +fi + ;; #( + auto) : + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.6.7\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.6.7") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + found_introspection=yes +else + found_introspection=no +fi + ;; #( + *) : + as_fn_error $? "invalid argument passed to --enable-introspection, should be one of [no/auto/yes]" "$LINENO" 5 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_introspection" >&5 +$as_echo "$found_introspection" >&6; } + + INTROSPECTION_SCANNER= + INTROSPECTION_COMPILER= + INTROSPECTION_GENERATE= + INTROSPECTION_GIRDIR= + INTROSPECTION_TYPELIBDIR= + if test "x$found_introspection" = "xyes"; then + INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` + INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` + INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` + INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` + INTROSPECTION_GIRDIR=`echo ${INTROSPECTION_GIRDIR} | sed -e "s|${datadir}|\\\$(datadir)|"` + INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" + INTROSPECTION_TYPELIBDIR=`echo ${INTROSPECTION_TYPELIBDIR} | sed -e "s|${libdir}|\\\$(libdir)|"` + INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` + INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` + INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection + fi + + + + + + + + + + if test "x$found_introspection" = "xyes"; then + HAVE_INTROSPECTION_TRUE= + HAVE_INTROSPECTION_FALSE='#' +else + HAVE_INTROSPECTION_TRUE='#' + HAVE_INTROSPECTION_FALSE= +fi + + + + +ACLOCAL_AMFLAGS=\${ACLOCAL_FLAGS} + + +LIBGTOP_MAJOR_VERSION=2 + +LIBGTOP_MINOR_VERSION=38 + +LIBGTOP_MICRO_VERSION=0 + +LIBGTOP_SERVER_VERSION=5 + +LIBGTOP_VERSION=2.38.0 + +LIBGTOP_VERSION_CODE=2038000 + + +# libtool versioning +LT_VERSION_INFO="-version-info 11:0:0" + + +ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I ." + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&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_fn_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" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* 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 -std 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 -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +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 + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +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 + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 +$as_echo_n "checking for library containing strerror... " >&6; } +if ${ac_cv_search_strerror+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strerror (); +int +main () +{ +return strerror (); + ; + return 0; +} +_ACEOF +for ac_lib in '' cposix; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_strerror=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_strerror+:} false; then : + break +fi +done +if ${ac_cv_search_strerror+:} false; then : + +else + ac_cv_search_strerror=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 +$as_echo "$ac_cv_search_strerror" >&6; } +ac_res=$ac_cv_search_strerror +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&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_fn_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" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* 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 -std 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 -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +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 + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +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 + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +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 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#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)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + + +libgtop_top_builddir=`pwd` + + +for ac_prog in gawk 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +test -z "$AWK" && as_fn_error $? "Sorry, you need a working awk interpreter." "$LINENO" 5 + +for ac_prog in perl5 perl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PERL" && break +done + +test -z "$PERL" && as_fn_error $? "You need to have a working perl interpreter." "$LINENO" 5 + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + +export CC CXX RANLIB LD AS AR + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + +export cross_compiling + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.6' +macro_revision='2.4.6' + + + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case $ECHO in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n "$lt_cv_sys_max_cmd_len"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +$as_echo "$with_sysroot" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +$as_echo_n "checking for a working dd... " >&6; } +if ${ac_cv_path_lt_DD+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in dd; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +$as_echo "$ac_cv_path_lt_DD" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +$as_echo_n "checking how to truncate binary pipes... " >&6; } +if ${lt_cv_truncate_bin+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +$as_echo "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + +# 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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + pic_mode=default +fi + + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test "${with_aix_soname+set}" = set; then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else + if ${lt_cv_with_aix_soname+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +$as_echo "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC=$CC +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works"; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works"; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='$wl--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test no = "$ld_shlibs"; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + else + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + osf3*) + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='$wl-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='$wl-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test no = "$ld_shlibs" && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test yes = "$hardcode_automatic"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else + + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen=shl_load +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen=dlopen +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report what library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + if test "x$cross_compiling" = xyes; then + CROSS_COMPILING_TRUE= + CROSS_COMPILING_FALSE='#' +else + CROSS_COMPILING_TRUE='#' + CROSS_COMPILING_FALSE= +fi + + + + + + + + + +# Check whether --with-examples was given. +if test "${with_examples+set}" = set; then : + withval=$with_examples; + build_examples="$withval" +else + build_examples=yes +fi + + + if test x"$build_examples" = xyes; then + EXAMPLES_TRUE= + EXAMPLES_FALSE='#' +else + EXAMPLES_TRUE='#' + EXAMPLES_FALSE= +fi + + + # Check whether --enable-hacker-mode was given. +if test "${enable_hacker_mode+set}" = set; then : + enableval=$enable_hacker_mode; hacker_mode="$enableval" +else + hacker_mode=no +fi + + + if test x"$hacker_mode" = xyes; then + HACKER_MODE_TRUE= + HACKER_MODE_FALSE='#' +else + HACKER_MODE_TRUE='#' + HACKER_MODE_FALSE= +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgtop sysdeps directory" >&5 +$as_echo_n "checking for libgtop sysdeps directory... " >&6; } + + case "$host_os" in + linux*) + libgtop_sysdeps_dir=linux + libgtop_have_sysinfo=yes + libgtop_need_server=no + libgtop_sysdeps_private_mountlist=yes + libgtop_sysdeps_private_fsusage=yes + ;; + netbsd*|bsdi*) + libgtop_sysdeps_dir=bsd + libgtop_need_server=yes + libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod 2755 $(bindir)/libgtop_server2' + ;; + openbsd*) + libgtop_sysdeps_dir=openbsd + libgtop_need_server=yes + libgtop_sysdeps_private_mountlist=yes + libgtop_sysdeps_private_fsusage=yes + libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod 2555 $(bindir)/libgtop_server2' + ;; + freebsd*|kfreebsd*) + libgtop_sysdeps_dir=freebsd + libgtop_need_server=yes + libgtop_sysdeps_private_mountlist=yes + libgtop_sysdeps_private_fsusage=yes + libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod 2755 $(bindir)/libgtop_server2' + ;; + solaris*) + libgtop_sysdeps_dir=solaris + libgtop_need_server=yes + libgtop_postinstall='chgrp sys $(bindir)/libgtop_server && chmod 2755 $(bindir)/libgtop_server' + ;; + aix*) + libgtop_sysdeps_dir=aix + libgtop_need_server=yes + libgtop_have_sysinfo=yes + libgtop_postinstall='chgrp system $(bindir)/libgtop_server && chmod g+s $(bindir)/libgtop_server2' + ;; + darwin*) + libgtop_sysdeps_dir=darwin + libgtop_need_server=yes + libgtop_have_sysinfo=yes + libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod g+s $(bindir)/libgtop_server2' + ;; + cygwin*) + libgtop_sysdeps_dir=cygwin + libgtop_need_server=no + libgtop_have_sysinfo=yes + libgtop_sysdeps_private_mountlist=yes + ;; + *) + if test x$hacker_mode = xyes ; then + case "$host_os" in + sunos4*) + #Please note that this port is obsolete and not working at + #all. It is only useful for people who want to fix it ... :-) + libgtop_sysdeps_dir=sun4 + libgtop_need_server=yes + ;; + osf*) + libgtop_sysdeps_dir=osf1 + libgtop_need_server=yes + ;; + *) + libgtop_sysdeps_dir=stub + libgtop_need_server=no + ;; + esac + else + libgtop_sysdeps_dir=stub + libgtop_need_server=no + fi + ;; + esac + + test -z "$libgtop_postinstall" && libgtop_postinstall=: + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgtop_sysdeps_dir" >&5 +$as_echo "$libgtop_sysdeps_dir" >&6; } + + + + + + case "$host_os" in + *bsd*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5 +$as_echo_n "checking for kvm_open in -lkvm... " >&6; } +if ${ac_cv_lib_kvm_kvm_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lkvm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char kvm_open (); +int +main () +{ +return kvm_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_kvm_kvm_open=yes +else + ac_cv_lib_kvm_kvm_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_kvm_open" >&5 +$as_echo "$ac_cv_lib_kvm_kvm_open" >&6; } +if test "x$ac_cv_lib_kvm_kvm_open" = xyes; then : + KVM_LIBS=-lkvm +else + KVM_LIBS= +fi + + + + for ac_header in net/if_var.h +do : + ac_fn_c_check_header_compile "$LINENO" "net/if_var.h" "ac_cv_header_net_if_var_h" " +#include +#include +#include +" +if test "x$ac_cv_header_net_if_var_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NET_IF_VAR_H 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for I4B" >&5 +$as_echo_n "checking for I4B... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +#include +#include + +#ifdef HAVE_NET_IF_VAR_H +#include +#endif + +#include +#include + +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__FreeBSD_kernel__) +#include +#else +#include +#endif + +int +main () +{ + + size_t size = sizeof (struct sppp); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + have_i4b=yes +else + have_i4b=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_i4b" >&5 +$as_echo "$have_i4b" >&6; } + if test x$have_i4b = xyes; then + +$as_echo "#define HAVE_I4B 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for I4B accounting" >&5 +$as_echo_n "checking for I4B accounting... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +#include +#include + +#ifdef HAVE_NET_IF_VAR_H +#include +#endif + +#include +#include + +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__FreeBSD_kernel__) +#include +#else +#include +#endif + +#include + +int +main () +{ + + size_t size = sizeof (struct i4bisppp_softc); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + have_i4b_acct=yes +else + have_i4b_acct=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_i4b_acct" >&5 +$as_echo "$have_i4b_acct" >&6; } + if test x$have_i4b_acct = xyes ; then + +$as_echo "#define HAVE_I4B_ACCT 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: +*** I4B accounting disabled - you won't get any PPP statistics. +*** Read \"misc/i4b_acct.txt\" in the LibGTop source directory +*** to see how to enable it." >&5 +$as_echo "$as_me: WARNING: +*** I4B accounting disabled - you won't get any PPP statistics. +*** Read \"misc/i4b_acct.txt\" in the LibGTop source directory +*** to see how to enable it." >&2;} + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking what we need to define to get struct msginfo" >&5 +$as_echo_n "checking what we need to define to get struct msginfo... " >&6; } + if ${msginfo_cv_needs+:} false; then : + $as_echo_n "(cached) " >&6 +else + msginfo_cv_needs= + for def in nothing KERNEL _KERNEL; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define $def +#include +#include +#include +#include + +int +main (void) +{ + struct msginfo mi; + mi.msgmax = 0; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + msginfo_cv_needs=$def + if test ${msginfo_cv_needs} = KERNEL; then + +$as_echo "#define STRUCT_MSGINFO_NEEDS_KERNEL 1" >>confdefs.h + + elif test ${msginfo_cv_needs} = _KERNEL; then + +$as_echo "#define STRUCT_MSGINFO_NEEDS__KERNEL 1" >>confdefs.h + + fi + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test -n "${msginfo_cv_needs}" && break + done + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $msginfo_cv_needs" >&5 +$as_echo "$msginfo_cv_needs" >&6; } + if test -z "${msginfo_cv_needs}"; then + as_fn_error $? "Could not find the definition of 'struct msginfo'" "$LINENO" 5 + fi + ;; + linux*) + os_major_version=`uname -r | sed 's/-pre[0-9]*//' | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + os_minor_version=`uname -r | sed 's/-pre[0-9]*//' | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + os_micro_version=`uname -r | sed 's/-pre[0-9]*//' | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + os_version_expr="$os_major_version 65536 * $os_minor_version 256 * + $os_micro_version + p q" + + for ac_header in linux/version.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "linux/version.h" "ac_cv_header_linux_version_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_version_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_VERSION_H 1 +_ACEOF + have_linux_version_h=yes +else + have_linux_version_h=no +fi + +done + + + if test x$have_linux_version_h = xyes ; then + version_code=`cat /usr/include/linux/version.h | \ + grep \#define | grep LINUX_VERSION_CODE` + os_version_code=`echo $version_code | \ + sed 's/^.*LINUX_VERSION_CODE[ \t]*\([0-9]*\).*$/\1/'` + else + os_version_code=`echo "$os_version_expr" | dc` + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux kernel version code" >&5 +$as_echo_n "checking for Linux kernel version code... " >&6; } + +cat >>confdefs.h <<_ACEOF +#define GLIBTOP_LINUX_VERSION_CODE $os_version_code +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $os_version_code" >&5 +$as_echo "$os_version_code" >&6; } + ;; + solaris*) + os_major_version=`uname -r | sed 's/\([0-9]*\).\([0-9]*\)\.*\([0-9]*\)/\1/'` + os_minor_version=`uname -r | sed 's/\([0-9]*\).\([0-9]*\)\.*\([0-9]*\)/\2/'` + os_micro_version=`uname -r | sed 's/\([0-9]*\).\([0-9]*\)\.*\([0-9]*\)/\3/'` + test -z "$os_micro_version" && os_micro_version=0 + os_version_expr="$os_major_version 10000 * $os_minor_version 100 * + $os_micro_version + p q" + os_version_code=`echo "$os_version_expr" | dc` + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris release code" >&5 +$as_echo_n "checking for Solaris release code... " >&6; } + +cat >>confdefs.h <<_ACEOF +#define GLIBTOP_SOLARIS_RELEASE $os_version_code +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $os_version_code" >&5 +$as_echo "$os_version_code" >&6; } + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need libgtop" >&5 +$as_echo_n "checking whether we need libgtop... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgtop_need_server" >&5 +$as_echo "$libgtop_need_server" >&6; } + + if test x$libgtop_need_server = xyes ; then + +$as_echo "#define LIBGTOP_NEED_SERVER 1" >>confdefs.h + + fi + + if test x$libgtop_need_server = xyes; then + LIBGTOP_NEED_SERVER_TRUE= + LIBGTOP_NEED_SERVER_FALSE='#' +else + LIBGTOP_NEED_SERVER_TRUE='#' + LIBGTOP_NEED_SERVER_FALSE= +fi + + if test x$libgtop_sysdeps_private_mountlist = xyes; then + LIBGTOP_SYSDEPS_PRIVATE_MOUNTLIST_TRUE= + LIBGTOP_SYSDEPS_PRIVATE_MOUNTLIST_FALSE='#' +else + LIBGTOP_SYSDEPS_PRIVATE_MOUNTLIST_TRUE='#' + LIBGTOP_SYSDEPS_PRIVATE_MOUNTLIST_FALSE= +fi + + if test x$libgtop_sysdeps_private_fsusage = xyes; then + LIBGTOP_SYSDEPS_PRIVATE_FSUSAGE_TRUE= + LIBGTOP_SYSDEPS_PRIVATE_FSUSAGE_FALSE='#' +else + LIBGTOP_SYSDEPS_PRIVATE_FSUSAGE_TRUE='#' + LIBGTOP_SYSDEPS_PRIVATE_FSUSAGE_FALSE= +fi + + + + for ac_header in sys/bitypes.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/bitypes.h" "ac_cv_header_sys_bitypes_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_bitypes_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_BITYPES_H 1 +_ACEOF + +fi + +done + + + +GLIB_REQUIRED=2.6.0 +GOBJECT_REQUIRED=2.26.0 + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 +$as_echo_n "checking for GLIB... " >&6; } + +if test -n "$GLIB_CFLAGS"; then + pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \$GLIB_REQUIRED gobject-2.0 >= \$GOBJECT_REQUIRED\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GOBJECT_REQUIRED") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GOBJECT_REQUIRED" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GLIB_LIBS"; then + pkg_cv_GLIB_LIBS="$GLIB_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \$GLIB_REQUIRED gobject-2.0 >= \$GOBJECT_REQUIRED\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GOBJECT_REQUIRED") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GOBJECT_REQUIRED" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GOBJECT_REQUIRED" 2>&1` + else + GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GOBJECT_REQUIRED" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GLIB_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GOBJECT_REQUIRED) were not met: + +$GLIB_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 GLIB_CFLAGS +and GLIB_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "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 GLIB_CFLAGS +and GLIB_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" "$LINENO" 5; } +else + GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS + GLIB_LIBS=$pkg_cv_GLIB_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + + +ac_fn_c_check_header_mongrel "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "$ac_includes_default" +if test "x$ac_cv_header_ifaddrs_h" = xyes; then : + HAVE_IFADDRS_H=yes +else + HAVE_IFADDRS_H=no +fi + + +if test x$HAVE_IFADDRS_H = xyes ; then + +$as_echo "#define HAVE_IFADDRS_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* 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"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 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 sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$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 + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_RDEV 1 +_ACEOF + + +$as_echo "#define HAVE_ST_RDEV 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if ${ac_cv_struct_tm+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if ${ac_cv_type_uid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then : + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +$as_echo "#define uid_t int" >>confdefs.h + + +$as_echo "#define gid_t int" >>confdefs.h + +fi + + +ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define ssize_t int +_ACEOF + +fi + +for ac_header in memory.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "memory.h" "ac_cv_header_memory_h" "$ac_includes_default" +if test "x$ac_cv_header_memory_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MEMORY_H 1 +_ACEOF + +fi + +done + +for ac_header in string.h strings.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + break +fi + +done + +ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" +if test "x$ac_cv_func_strerror" = xyes; then : + $as_echo "#define HAVE_STRERROR 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strerror.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strerror.$ac_objext" + ;; +esac + +fi + + + +DL_LIB= +for ac_func in dlopen +do : + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLOPEN 1 +_ACEOF + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + DL_LIB="-ldl" +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + DL_LIB="-ldld" +else + + for ac_func in dlopen +do : + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLOPEN 1 +_ACEOF + DL_LIB="" +else + DL_LIB="" +fi +done + + +fi + + +fi + + +fi +done + +oLIBS="$LIBS" +LIBS="$LIBS $DL_LIB" +for ac_func in dlerror +do : + ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" +if test "x$ac_cv_func_dlerror" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLERROR 1 +_ACEOF + +fi +done + +LIBS="$oLIBS" + + +ac_fn_c_check_header_mongrel "$LINENO" "linux/isdn.h" "ac_cv_header_linux_isdn_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_isdn_h" = xyes; then : + HAVE_ISDN_H=yes +else + HAVE_ISDN_H=no +fi + + +if test x$HAVE_ISDN_H = xyes ; then + +$as_echo "#define HAVE_ISDN_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for vmgetinfo in -lperfstat" >&5 +$as_echo_n "checking for vmgetinfo in -lperfstat... " >&6; } +if ${ac_cv_lib_perfstat_vmgetinfo+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lperfstat $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char vmgetinfo (); +int +main () +{ +return vmgetinfo (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_perfstat_vmgetinfo=yes +else + ac_cv_lib_perfstat_vmgetinfo=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_perfstat_vmgetinfo" >&5 +$as_echo "$ac_cv_lib_perfstat_vmgetinfo" >&6; } +if test "x$ac_cv_lib_perfstat_vmgetinfo" = xyes; then : + +$as_echo "#define HAVE_VMGETINFO 1" >>confdefs.h + +fi + + +case "$host_os" in + solaris*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kstat_open in -lkstat" >&5 +$as_echo_n "checking for kstat_open in -lkstat... " >&6; } +if ${ac_cv_lib_kstat_kstat_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lkstat $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char kstat_open (); +int +main () +{ +return kstat_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_kstat_kstat_open=yes +else + ac_cv_lib_kstat_kstat_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kstat_kstat_open" >&5 +$as_echo "$ac_cv_lib_kstat_kstat_open" >&6; } +if test "x$ac_cv_lib_kstat_kstat_open" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBKSTAT 1 +_ACEOF + + LIBS="-lkstat $LIBS" + +fi + + for ac_func in getloadavg swapctl +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + for ac_header in procfs.h sys/procfs.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + break +fi + +done + + + + case $host_os in + solaris[8-9] | solaris2.[0-9].*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5 +$as_echo_n "checking for kvm_open in -lkvm... " >&6; } +if ${ac_cv_lib_kvm_kvm_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lkvm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char kvm_open (); +int +main () +{ +return kvm_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_kvm_kvm_open=yes +else + ac_cv_lib_kvm_kvm_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_kvm_open" >&5 +$as_echo "$ac_cv_lib_kvm_kvm_open" >&6; } +if test "x$ac_cv_lib_kvm_kvm_open" = xyes; then : + + LIBS="-lkvm $LIBS" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm with -lelf" >&5 +$as_echo_n "checking for kvm_open in -lkvm with -lelf... " >&6; } + if ${ac_cv_lib_kvm_with_elf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_LIBS="$LIBS" + LIBS="-lkvm -lelf $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +char kvm_open(); +int +main () +{ +kvm_open() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_kvm_with_elf=yes +else + ac_cv_lib_kvm_with_elf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + +fi + + if test "$ac_cv_lib_kvm_with_elf" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + LIBS="-lkvm -lelf $LIBS" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + +fi + + ;; + esac + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for vm_statistics in -lmach" >&5 +$as_echo_n "checking for vm_statistics in -lmach... " >&6; } +if ${ac_cv_lib_mach_vm_statistics+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmach $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char vm_statistics (); +int +main () +{ +return vm_statistics (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mach_vm_statistics=yes +else + ac_cv_lib_mach_vm_statistics=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mach_vm_statistics" >&5 +$as_echo "$ac_cv_lib_mach_vm_statistics" >&6; } +if test "x$ac_cv_lib_mach_vm_statistics" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBMACH 1 +_ACEOF + + LIBS="-lmach $LIBS" + +fi + + +saved_CFLAGS=$CFLAGS +CFLAGS="$CFLAGS -D_GNU_SOURCE" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether program_invocation_name must be declared" >&5 +$as_echo_n "checking whether program_invocation_name must be declared... " >&6; } +if ${gcc_cv_decl_needed_program_invocation_name+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif + +#include +#include +#include +#include + +int +main () +{ +char *(*pfn) = (char *(*)) program_invocation_name + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "gcc_cv_decl_needed_program_invocation_name=no" +else + eval "gcc_cv_decl_needed_program_invocation_name=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +if eval "test \"`echo '$gcc_cv_decl_needed_'program_invocation_name`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + gcc_need_declarations="$gcc_need_declarations program_invocation_name" + gcc_tr_decl=NEED_DECLARATION_`echo program_invocation_name | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + +cat >>confdefs.h <<_ACEOF +#define $gcc_tr_decl 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +CFLAGS=$saved_CFLAGS + +ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" +if test "x$ac_cv_func_socket" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_inet_h" = xyes; then : + + +$as_echo "#define HAVE_SOCKETS 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking \"for sun_len member in struct sockaddr_un\"" >&5 +$as_echo_n "checking \"for sun_len member in struct sockaddr_un\"... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ +static struct sockaddr_un x; x.sun_len = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; +$as_echo "#define HAVE_SOCKADDR_SUN_LEN 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + + +fi + + +fi + + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } +if ${ac_cv_working_alloca_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_working_alloca_h=yes +else + ac_cv_working_alloca_h=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } +if ${ac_cv_func_alloca_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +void *alloca (size_t); +# endif +# endif +# endif +# endif +#endif + +int +main () +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_alloca_works=yes +else + ac_cv_func_alloca_works=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h + +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=\${LIBOBJDIR}alloca.$ac_objext + +$as_echo "#define C_ALLOCA 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if ${ac_cv_os_cray+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF + + break +fi + + done +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } +if ${ac_cv_c_stack_direction+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_c_stack_direction=0 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_stack_direction=1 +else + ac_cv_c_stack_direction=-1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + + + + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + +for ac_func in getpagesize +do : + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETPAGESIZE 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +$as_echo_n "checking for working mmap... " >&6; } +if ${ac_cv_func_mmap_fixed_mapped+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_mmap_fixed_mapped=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 !defined STDC_HEADERS && !defined HAVE_STDLIB_H +char *malloc (); +#endif + +/* This mess was copied from the GNU getpagesize.h. */ +#ifndef HAVE_GETPAGESIZE +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef 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; + const char *cdata2; + int i, pagesize; + int fd, fd2; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + return 1; + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + return 2; + if (write (fd, data, pagesize) != pagesize) + return 3; + close (fd); + + /* Next, check that the tail of a page is zero-filled. File must have + non-zero length, otherwise we risk SIGBUS for entire page. */ + fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); + if (fd2 < 0) + return 4; + cdata2 = ""; + if (write (fd2, cdata2, 1) != 1) + return 5; + data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); + if (data2 == MAP_FAILED) + return 6; + for (i = 0; i < pagesize; ++i) + if (*(data2 + i)) + return 7; + close (fd2); + if (munmap (data2, pagesize)) + return 8; + + /* 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) + return 9; + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + return 10; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + return 11; + + /* 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) + return 12; + if (read (fd, data3, pagesize) != pagesize) + return 13; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + return 14; + close (fd); + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_mmap_fixed_mapped=yes +else + ac_cv_func_mmap_fixed_mapped=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 +$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +$as_echo "#define HAVE_MMAP 1" >>confdefs.h + +fi +rm -f conftest.mmap conftest.txt + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } +if ${ac_cv_type_signal+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_signal=int +else + ac_cv_type_signal=void +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + +for ac_func in strftime +do : + ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" +if test "x$ac_cv_func_strftime" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRFTIME 1 +_ACEOF + +else + # strftime is in -lintl on SCO UNIX. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 +$as_echo_n "checking for strftime in -lintl... " >&6; } +if ${ac_cv_lib_intl_strftime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strftime (); +int +main () +{ +return strftime (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_strftime=yes +else + ac_cv_lib_intl_strftime=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 +$as_echo "$ac_cv_lib_intl_strftime" >&6; } +if test "x$ac_cv_lib_intl_strftime" = xyes; then : + $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h + +LIBS="-lintl $LIBS" +fi + +fi +done + +for ac_func in getcwd gettimeofday getwd putenv strdup strtoul uname +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +$as_echo_n "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then : + enableval=$enable_nls; USE_NLS=$enableval +else + USE_NLS=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } + + + + + GETTEXT_MACRO_VERSION=0.19 + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MSGFMT+:} false; then : + $as_echo_n "(cached) " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GMSGFMT+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +$as_echo "$GMSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac + + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_XGETTEXT+:} false; then : + $as_echo_n "(cached) " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + rm -f messages.po + + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MSGMERGE+:} false; then : + $as_echo_n "(cached) " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +$as_echo "$MSGMERGE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$localedir" || localedir='${datadir}/locale' + + + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + + + ac_config_commands="$ac_config_commands po-directories" + + + + 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 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 + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` + while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${acl_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + 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 variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${acl_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +$as_echo_n "checking for shared library run path origin... " >&6; } +if ${acl_cv_rpath+:} false; then : + $as_echo_n "(cached) " >&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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +$as_echo "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then : + enableval=$enable_rpath; : +else + enable_rpath=yes +fi + + + + + acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 +$as_echo_n "checking for 64-bit host... " >&6; } +if ${gl_cv_solaris_64bit+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _LP64 +sixtyfour bits +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "sixtyfour bits" >/dev/null 2>&1; then : + gl_cv_solaris_64bit=yes +else + gl_cv_solaris_64bit=no +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 +$as_echo "$gl_cv_solaris_64bit" >&6; } + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + + + + + + + + + + + + + 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 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/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBICONV= + LTLIBICONV= + INCICONV= + LIBICONV_PREFIX= + HAVE_LIBICONV= + 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= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + 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 "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + 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/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; 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 "$acl_hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_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 "$acl_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 + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + 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/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + 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 "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_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=\"$acl_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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 +$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } +if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : + $as_echo_n "(cached) " >&6 +else + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +CFPreferencesCopyAppValue(NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_CFPreferencesCopyAppValue=yes +else + gt_cv_func_CFPreferencesCopyAppValue=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + +$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 +$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } +if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : + $as_echo_n "(cached) " >&6 +else + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +CFLocaleCopyCurrent(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_CFLocaleCopyCurrent=yes +else + gt_cv_func_CFLocaleCopyCurrent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + +$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h + + 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 + + + + + + + LIBINTL= + LTLIBINTL= + POSUB= + + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 +$as_echo_n "checking for GNU gettext in libc... " >&6; } +if eval \${$gt_func_gnugettext_libc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; + +int +main () +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$gt_func_gnugettext_libc=yes" +else + eval "$gt_func_gnugettext_libc=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$gt_func_gnugettext_libc + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + + + + + + 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 + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +$as_echo_n "checking for iconv... " >&6; } +if ${am_cv_func_iconv+:} false; then : + $as_echo_n "(cached) " >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_func_iconv=yes +fi +rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +$as_echo "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +$as_echo_n "checking for working iconv... " >&6; } +if ${am_cv_func_iconv_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes; then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main () +{ +int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + am_cv_func_iconv_works=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +$as_echo "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +$as_echo "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +$as_echo_n "checking how to link with libiconv... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +$as_echo "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + 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-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/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBINTL= + LTLIBINTL= + INCINTL= + LIBINTL_PREFIX= + HAVE_LIBINTL= + 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= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + 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 "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + 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/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; 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 "$acl_hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_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 "$acl_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 + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + 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/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + 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 "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_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=\"$acl_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 + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 +$as_echo_n "checking for GNU gettext in libintl... " >&6; } +if eval \${$gt_func_gnugettext_libintl+:} false; then : + $as_echo_n "(cached) " >&6 +else + gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + +int +main () +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$gt_func_gnugettext_libintl=yes" +else + eval "$gt_func_gnugettext_libintl=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + +int +main () +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" +fi +eval ac_res=\$$gt_func_gnugettext_libintl + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + fi + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + 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 + +$as_echo "#define ENABLE_NLS 1" >>confdefs.h + + else + USE_NLS=no + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +$as_echo_n "checking whether to use NLS... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 +$as_echo_n "checking where the gettext function comes from... " >&6; } + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 +$as_echo "$gt_source" >&6; } + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 +$as_echo_n "checking how to link with libintl... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 +$as_echo "$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 + + +$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h + + +$as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h + + fi + + POSUB=po + fi + + + + INTLLIBS="$LIBINTL" + + + + + + + +GETTEXT_PACKAGE=libgtop-2.0 + + +cat >>confdefs.h <<_ACEOF +#define GETTEXT_PACKAGE "$GETTEXT_PACKAGE" +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 +$as_echo_n "checking for X... " >&6; } + + +# Check whether --with-x was given. +if test "${with_x+set}" = set; then : + withval=$with_x; +fi + +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + case $x_includes,$x_libraries in #( + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( + *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : + $as_echo_n "(cached) " >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -f -r conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + cat >Imakefile <<'_ACEOF' +incroot: + @echo incroot='${INCROOT}' +usrlibdir: + @echo usrlibdir='${USRLIBDIR}' +libdir: + @echo libdir='${LIBDIR}' +_ACEOF + if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. + for ac_var in incroot usrlibdir libdir; do + eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" + done + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl dylib la dll; do + if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && + test -f "$ac_im_libdir/libX11.$ac_extension"; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ac_x_includes= ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /usr/lib64 | /lib | /lib64) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -f -r conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R7/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R7 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R7/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R7 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for Xlib.h. + # First, try using that file with no special directory specified. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # We can compile using X headers with no special include directory. +ac_x_includes= +else + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Xlib.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lX11 $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +XrmInitialize () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + LIBS=$ac_save_LIBS +for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl dylib la dll; do + if test -r "$ac_dir/libX11.$ac_extension"; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +case $ac_x_includes,$ac_x_libraries in #( + no,* | *,no | *\'*) + # Didn't find X, or a directory has "'" in its name. + ac_cv_have_x="have_x=no";; #( + *) + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$ac_x_includes'\ + ac_x_libraries='$ac_x_libraries'" +esac +fi +;; #( + *) have_x=yes;; + esac + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 +$as_echo "$have_x" >&6; } + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$x_includes'\ + ac_x_libraries='$x_libraries'" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 +$as_echo "libraries $x_libraries, headers $x_includes" >&6; } +fi + +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + +$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 +$as_echo_n "checking whether -R must be followed by a space... " >&6; } + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + ac_xsave_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + X_LIBS="$X_LIBS -R$x_libraries" +else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + X_LIBS="$X_LIBS -R $x_libraries" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 +$as_echo "neither works" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_c_werror_flag=$ac_xsave_c_werror_flag + LIBS=$ac_xsave_LIBS + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn Johnson says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And Karl Berry says + # the Alpha needs dnet_stub (dnet does not exist). + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XOpenDisplay (); +int +main () +{ +return XOpenDisplay (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } +if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (); +int +main () +{ +return dnet_ntoa (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dnet_dnet_ntoa=yes +else + ac_cv_lib_dnet_dnet_ntoa=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" +fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } +if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet_stub $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (); +int +main () +{ +return dnet_ntoa (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dnet_stub_dnet_ntoa=yes +else + ac_cv_lib_dnet_stub_dnet_ntoa=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" +fi + + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to T.E. Dickey. + # The functions gethostbyname, getservbyname, and inet_addr are + # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. + ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" +if test "x$ac_cv_func_gethostbyname" = xyes; then : + +fi + + if test $ac_cv_func_gethostbyname = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_gethostbyname=yes +else + ac_cv_lib_nsl_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" +fi + + if test $ac_cv_lib_nsl_gethostbyname = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 +$as_echo_n "checking for gethostbyname in -lbsd... " >&6; } +if ${ac_cv_lib_bsd_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_bsd_gethostbyname=yes +else + ac_cv_lib_bsd_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 +$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } +if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" +fi + + fi + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says Simon Leinen: it contains gethostby* + # variants that don't use the name server (or something). -lsocket + # must be given before -lnsl if both are needed. We assume that + # if connect needs -lnsl, so does gethostbyname. + ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" +if test "x$ac_cv_func_connect" = xyes; then : + +fi + + if test $ac_cv_func_connect = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 +$as_echo_n "checking for connect in -lsocket... " >&6; } +if ${ac_cv_lib_socket_connect+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char connect (); +int +main () +{ +return connect (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_connect=yes +else + ac_cv_lib_socket_connect=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 +$as_echo "$ac_cv_lib_socket_connect" >&6; } +if test "x$ac_cv_lib_socket_connect" = xyes; then : + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" +fi + + fi + + # Guillermo Gomez says -lposix is necessary on A/UX. + ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" +if test "x$ac_cv_func_remove" = xyes; then : + +fi + + if test $ac_cv_func_remove = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 +$as_echo_n "checking for remove in -lposix... " >&6; } +if ${ac_cv_lib_posix_remove+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lposix $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char remove (); +int +main () +{ +return remove (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_posix_remove=yes +else + ac_cv_lib_posix_remove=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 +$as_echo "$ac_cv_lib_posix_remove" >&6; } +if test "x$ac_cv_lib_posix_remove" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" +fi + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" +if test "x$ac_cv_func_shmat" = xyes; then : + +fi + + if test $ac_cv_func_shmat = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 +$as_echo_n "checking for shmat in -lipc... " >&6; } +if ${ac_cv_lib_ipc_shmat+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lipc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shmat (); +int +main () +{ +return shmat (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ipc_shmat=yes +else + ac_cv_lib_ipc_shmat=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 +$as_echo "$ac_cv_lib_ipc_shmat" >&6; } +if test "x$ac_cv_lib_ipc_shmat" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" +fi + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS=$LDFLAGS + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # John Interrante, Karl Berry + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 +$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } +if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lICE $X_EXTRA_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char IceConnectionNumber (); +int +main () +{ +return IceConnectionNumber (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ICE_IceConnectionNumber=yes +else + ac_cv_lib_ICE_IceConnectionNumber=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } +if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" +fi + + LDFLAGS=$ac_save_LDFLAGS + +fi + + +ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" +if test "x$ac_cv_func_gethostbyname" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_gethostbyname=yes +else + ac_cv_lib_nsl_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNSL 1 +_ACEOF + + LIBS="-lnsl $LIBS" + +fi + +fi + +ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" +if test "x$ac_cv_func_connect" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 +$as_echo_n "checking for connect in -lsocket... " >&6; } +if ${ac_cv_lib_socket_connect+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char connect (); +int +main () +{ +return connect (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_connect=yes +else + ac_cv_lib_socket_connect=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 +$as_echo "$ac_cv_lib_socket_connect" >&6; } +if test "x$ac_cv_lib_socket_connect" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSOCKET 1 +_ACEOF + + LIBS="-lsocket $LIBS" + +fi + +fi + +ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton" +if test "x$ac_cv_func_inet_aton" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv" >&5 +$as_echo_n "checking for inet_aton in -lresolv... " >&6; } +if ${ac_cv_lib_resolv_inet_aton+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char inet_aton (); +int +main () +{ +return inet_aton (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_resolv_inet_aton=yes +else + ac_cv_lib_resolv_inet_aton=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton" >&5 +$as_echo "$ac_cv_lib_resolv_inet_aton" >&6; } +if test "x$ac_cv_lib_resolv_inet_aton" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBRESOLV 1 +_ACEOF + + LIBS="-lresolv $LIBS" + +fi + +fi + + + +saved_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $X_CFLAGS" +test -z "$with_xauth" && { ac_fn_c_check_header_mongrel "$LINENO" "X11/Xauth.h" "ac_cv_header_X11_Xauth_h" "$ac_includes_default" +if test "x$ac_cv_header_X11_Xauth_h" = xyes; then : + +else + with_xauth=no +fi + + } +test -z "$with_xauth" && { { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XauGetAuthByAddr in -lXau" >&5 +$as_echo_n "checking for XauGetAuthByAddr in -lXau... " >&6; } +if ${ac_cv_lib_Xau_XauGetAuthByAddr+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXau $X_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XauGetAuthByAddr (); +int +main () +{ +return XauGetAuthByAddr (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xau_XauGetAuthByAddr=yes +else + ac_cv_lib_Xau_XauGetAuthByAddr=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xau_XauGetAuthByAddr" >&5 +$as_echo "$ac_cv_lib_Xau_XauGetAuthByAddr" >&6; } +if test "x$ac_cv_lib_Xau_XauGetAuthByAddr" = xyes; then : + : +else + with_xauth=no +fi + } +test -z "$with_xauth" && with_xauth=yes +if test "$with_xauth" = "yes"; then + +$as_echo "#define HAVE_XAUTH 1" >>confdefs.h + + +T="" +for W in $X_LIBS -lXau; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done +libs_xauth="$T" + +fi +CPPFLAGS="$saved_CPPFLAGS" + + + +for ac_header in fcntl.h sys/param.h sys/statfs.h sys/fstyp.h \ +mnttab.h mntent.h sys/statvfs.h sys/vfs.h sys/mount.h \ +sys/filsys.h sys/fs_types.h sys/fs/s5param.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_func in bcopy endgrent endpwent fchdir ftime ftruncate \ +getcwd getmntinfo gettimeofday isascii lchown \ +listmntent memcpy mkfifo strchr strerror strrchr vprintf +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + +if test x$cross_compiling = xyes ; then + case "$host_os" in + linux*) + fu_cv_sys_mounted_getmntent1=yes + fu_cv_sys_stat_statfs2_bsize=yes + ;; + sunos*) + fu_cv_sys_stat_statfs4=yes + ;; + freebsd*) + fu_cv_sys_stat_statfs2_bsize=yes + ;; + osf*) + fu_cv_sys_stat_statfs3_osf1=yes + ;; + esac +fi + +# Determine how to get the list of mounted filesystems. +list_mounted_fs= + +# If the getmntent function is available but not in the standard library, +# make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX). +# getmntent is in the standard C library on UNICOS, in -lsun on Irix 4, +# -lseq on Dynix/PTX, -lgen on Unixware. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getmntent" >&5 +$as_echo_n "checking for library containing getmntent... " >&6; } +if ${ac_cv_search_getmntent+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getmntent (); +int +main () +{ +return getmntent (); + ; + return 0; +} +_ACEOF +for ac_lib in '' sun seq gen; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_getmntent=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_getmntent+:} false; then : + break +fi +done +if ${ac_cv_search_getmntent+:} false; then : + +else + ac_cv_search_getmntent=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getmntent" >&5 +$as_echo "$ac_cv_search_getmntent" >&6; } +ac_res=$ac_cv_search_getmntent +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + ac_cv_func_getmntent=yes + +$as_echo "#define HAVE_GETMNTENT 1" >>confdefs.h + +else + ac_cv_func_getmntent=no +fi + + + +# This test must precede the ones for getmntent because Unicos-9 is +# reported to have the getmntent function, but its support is incompatible +# with other getmntent implementations. + +# NOTE: Normally, I wouldn't use a check for system type as I've done for +# `CRAY' below since that goes against the whole autoconf philosophy. But +# I think there is too great a chance that some non-Cray system has a +# function named listmntent to risk the false positive. + +if test -z "$list_mounted_fs"; then +# Cray UNICOS 9 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for listmntent of Cray/Unicos-9" >&5 +$as_echo_n "checking for listmntent of Cray/Unicos-9... " >&6; } +if ${fu_cv_sys_mounted_cray_listmntent+:} false; then : + $as_echo_n "(cached) " >&6 +else + fu_cv_sys_mounted_cray_listmntent=no +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef _CRAY +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + test $ac_cv_func_listmntent = yes \ +&& fu_cv_sys_mounted_cray_listmntent=yes + +fi +rm -f conftest* + + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_cray_listmntent" >&5 +$as_echo "$fu_cv_sys_mounted_cray_listmntent" >&6; } +if test $fu_cv_sys_mounted_cray_listmntent = yes; then +list_mounted_fs=found + +$as_echo "#define MOUNTED_LISTMNTENT 1" >>confdefs.h + +fi +fi + +if test $ac_cv_func_getmntent = yes; then + +# This system has the getmntent function. +# Determine whether it's the one-argument variant or the two-argument one. + +if test -z "$list_mounted_fs"; then +# 4.3BSD, SunOS, HP-UX, Dynix, Irix +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for one-argument getmntent function" >&5 +$as_echo_n "checking for one-argument getmntent function... " >&6; } +if ${fu_cv_sys_mounted_getmntent1+:} false; then : + $as_echo_n "(cached) " >&6 +else + test $ac_cv_header_mntent_h = yes \ +&& fu_cv_sys_mounted_getmntent1=yes \ +|| fu_cv_sys_mounted_getmntent1=no +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntent1" >&5 +$as_echo "$fu_cv_sys_mounted_getmntent1" >&6; } +if test $fu_cv_sys_mounted_getmntent1 = yes; then +list_mounted_fs=found + +$as_echo "#define MOUNTED_GETMNTENT1 1" >>confdefs.h + +fi +fi + +if test -z "$list_mounted_fs"; then +# SVR4 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument getmntent function" >&5 +$as_echo_n "checking for two-argument getmntent function... " >&6; } +if ${fu_cv_sys_mounted_getmntent2+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "getmntent" >/dev/null 2>&1; then : + fu_cv_sys_mounted_getmntent2=yes +else + fu_cv_sys_mounted_getmntent2=no +fi +rm -f conftest* + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntent2" >&5 +$as_echo "$fu_cv_sys_mounted_getmntent2" >&6; } +if test $fu_cv_sys_mounted_getmntent2 = yes; then +list_mounted_fs=found + +$as_echo "#define MOUNTED_GETMNTENT2 1" >>confdefs.h + +fi +fi + +if test -z "$list_mounted_fs"; then +as_fn_error $? "could not determine how to read list of mounted filesystems" "$LINENO" 5 +fi + +fi + +if test -z "$list_mounted_fs"; then +# DEC Alpha running OSF/1. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getfsstat function" >&5 +$as_echo_n "checking for getfsstat function... " >&6; } +if ${fu_cv_sys_mounted_getsstat+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int +main () +{ +struct statfs *stats; +int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + fu_cv_sys_mounted_getsstat=yes +else + fu_cv_sys_mounted_getsstat=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getsstat" >&5 +$as_echo "$fu_cv_sys_mounted_getsstat" >&6; } +if test $fu_cv_sys_mounted_getsstat = yes; then +list_mounted_fs=found + +$as_echo "#define MOUNTED_GETFSSTAT 1" >>confdefs.h + +fi +fi + +if test -z "$list_mounted_fs"; then +# AIX. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mntctl function and struct vmount" >&5 +$as_echo_n "checking for mntctl function and struct vmount... " >&6; } +if ${fu_cv_sys_mounted_vmount+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + fu_cv_sys_mounted_vmount=yes +else + fu_cv_sys_mounted_vmount=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_vmount" >&5 +$as_echo "$fu_cv_sys_mounted_vmount" >&6; } +if test $fu_cv_sys_mounted_vmount = yes; then +list_mounted_fs=found + +$as_echo "#define MOUNTED_VMOUNT 1" >>confdefs.h + +fi +fi + +if test -z "$list_mounted_fs"; then +# SVR3 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FIXME existence of three headers" >&5 +$as_echo_n "checking for FIXME existence of three headers... " >&6; } +if ${fu_cv_sys_mounted_fread_fstyp+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + fu_cv_sys_mounted_fread_fstyp=yes +else + fu_cv_sys_mounted_fread_fstyp=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_fread_fstyp" >&5 +$as_echo "$fu_cv_sys_mounted_fread_fstyp" >&6; } +if test $fu_cv_sys_mounted_fread_fstyp = yes; then +list_mounted_fs=found + +$as_echo "#define MOUNTED_FREAD_FSTYP 1" >>confdefs.h + +fi +fi + +if test -z "$list_mounted_fs"; then +# 4.4BSD and DEC OSF/1. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getmntinfo function" >&5 +$as_echo_n "checking for getmntinfo function... " >&6; } +if ${fu_cv_sys_mounted_getmntinfo+:} false; then : + $as_echo_n "(cached) " >&6 +else + +ok= +if test $ac_cv_func_getmntinfo = yes; then +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "f_type;" >/dev/null 2>&1; then : + ok=yes +fi +rm -f conftest* + +fi +test -n "$ok" \ +&& fu_cv_sys_mounted_getmntinfo=yes \ +|| fu_cv_sys_mounted_getmntinfo=no + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntinfo" >&5 +$as_echo "$fu_cv_sys_mounted_getmntinfo" >&6; } +if test $fu_cv_sys_mounted_getmntinfo = yes; then +list_mounted_fs=found + +$as_echo "#define MOUNTED_GETMNTINFO 1" >>confdefs.h + +fi +fi + +# FIXME: add a test for netbsd-1.1 here + +if test -z "$list_mounted_fs"; then +# Ultrix +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getmnt function" >&5 +$as_echo_n "checking for getmnt function... " >&6; } +if ${fu_cv_sys_mounted_getmnt+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + fu_cv_sys_mounted_getmnt=yes +else + fu_cv_sys_mounted_getmnt=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmnt" >&5 +$as_echo "$fu_cv_sys_mounted_getmnt" >&6; } +if test $fu_cv_sys_mounted_getmnt = yes; then +list_mounted_fs=found + +$as_echo "#define MOUNTED_GETMNT 1" >>confdefs.h + +fi +fi + +if test -z "$list_mounted_fs"; then +# SVR2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is possible to resort to fread on /etc/mnttab" >&5 +$as_echo_n "checking whether it is possible to resort to fread on /etc/mnttab... " >&6; } +if ${fu_cv_sys_mounted_fread+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + fu_cv_sys_mounted_fread=yes +else + fu_cv_sys_mounted_fread=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_fread" >&5 +$as_echo "$fu_cv_sys_mounted_fread" >&6; } +if test $fu_cv_sys_mounted_fread = yes; then +list_mounted_fs=found + +$as_echo "#define MOUNTED_FREAD 1" >>confdefs.h + +fi +fi + +if test -z "$list_mounted_fs"; then +as_fn_error $? "could not determine how to read list of mounted filesystems" "$LINENO" 5 +# FIXME -- no need to abort building the whole package +# Cannot build mountlist.c or anything that needs its functions +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get filesystem space usage..." >&5 +$as_echo "$as_me: checking how to get filesystem space usage..." >&6;} +space=no + +# Perform only the link test since it seems there are no variants of the +# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs) +# because that got a false positive on SCO OSR5. Adding the declaration +# of a `struct statvfs' causes this test to fail (as it should) on such +# systems. That system is reported to work fine with STAT_STATFS4 which +# is what it gets when this test fails. +if test $space = no; then +# SVR4 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking statvfs function (SVR4)" >&5 +$as_echo_n "checking statvfs function (SVR4)... " >&6; } +if ${fu_cv_sys_stat_statvfs+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +struct statvfs fsd; statvfs (0, &fsd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + fu_cv_sys_stat_statvfs=yes +else + fu_cv_sys_stat_statvfs=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statvfs" >&5 +$as_echo "$fu_cv_sys_stat_statvfs" >&6; } +if test $fu_cv_sys_stat_statvfs = yes; then +space=yes + +$as_echo "#define STAT_STATVFS 1" >>confdefs.h + +fi +fi + +if test $space = no; then +# DEC Alpha running OSF/1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 3-argument statfs function (DEC OSF/1)" >&5 +$as_echo_n "checking for 3-argument statfs function (DEC OSF/1)... " >&6; } +if ${fu_cv_sys_stat_statfs3_osf1+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + fu_cv_sys_stat_statfs3_osf1=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ +struct statfs fsd; +fsd.f_fsize = 0; +return (statfs (".", &fsd, sizeof (struct statfs))); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + fu_cv_sys_stat_statfs3_osf1=yes +else + fu_cv_sys_stat_statfs3_osf1=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs3_osf1" >&5 +$as_echo "$fu_cv_sys_stat_statfs3_osf1" >&6; } +if test $fu_cv_sys_stat_statfs3_osf1 = yes; then +space=yes + +$as_echo "#define STAT_STATFS3_OSF1 1" >>confdefs.h + +fi +fi + +if test $space = no; then +# AIX +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5 +$as_echo_n "checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)... " >&6; } +if ${fu_cv_sys_stat_statfs2_bsize+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + fu_cv_sys_stat_statfs2_bsize=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#ifdef HAVE_SYS_MOUNT_H +#include +#endif +#ifdef HAVE_SYS_VFS_H +#include +#endif +int main () +{ +struct statfs fsd; +fsd.f_bsize = 0; +return (statfs (".", &fsd)); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + fu_cv_sys_stat_statfs2_bsize=yes +else + fu_cv_sys_stat_statfs2_bsize=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs2_bsize" >&5 +$as_echo "$fu_cv_sys_stat_statfs2_bsize" >&6; } +if test $fu_cv_sys_stat_statfs2_bsize = yes; then +space=yes + +$as_echo "#define STAT_STATFS2_BSIZE 1" >>confdefs.h + +fi +fi + +if test $space = no; then +# SVR3 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5 +$as_echo_n "checking for four-argument statfs (AIX-3.2.5, SVR3)... " >&6; } +if ${fu_cv_sys_stat_statfs4+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + fu_cv_sys_stat_statfs4=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int main () +{ +struct statfs fsd; +return (statfs (".", &fsd, sizeof fsd, 0)); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + fu_cv_sys_stat_statfs4=yes +else + fu_cv_sys_stat_statfs4=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs4" >&5 +$as_echo "$fu_cv_sys_stat_statfs4" >&6; } +if test $fu_cv_sys_stat_statfs4 = yes; then +space=yes + +$as_echo "#define STAT_STATFS4 1" >>confdefs.h + +fi +fi + +if test $space = no; then +# 4.4BSD and NetBSD +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5 +$as_echo_n "checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)... " >&6; } +if ${fu_cv_sys_stat_statfs2_fsize+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + fu_cv_sys_stat_statfs2_fsize=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#ifdef HAVE_SYS_MOUNT_H +#include +#endif +int main () +{ +struct statfs fsd; +fsd.f_fsize = 0; +return (statfs (".", &fsd)); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + fu_cv_sys_stat_statfs2_fsize=yes +else + fu_cv_sys_stat_statfs2_fsize=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs2_fsize" >&5 +$as_echo "$fu_cv_sys_stat_statfs2_fsize" >&6; } +if test $fu_cv_sys_stat_statfs2_fsize = yes; then +space=yes + +$as_echo "#define STAT_STATFS2_FSIZE 1" >>confdefs.h + +fi +fi + +if test $space = no; then +# Ultrix +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with struct fs_data (Ultrix)" >&5 +$as_echo_n "checking for two-argument statfs with struct fs_data (Ultrix)... " >&6; } +if ${fu_cv_sys_stat_fs_data+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + fu_cv_sys_stat_fs_data=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#ifdef HAVE_SYS_MOUNT_H +#include +#endif +#ifdef HAVE_SYS_FS_TYPES_H +#include +#endif +int main () +{ +struct fs_data fsd; +/* Ultrix's statfs returns 1 for success, +0 for not mounted, -1 for failure. */ +return (statfs (".", &fsd) != 1); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + fu_cv_sys_stat_fs_data=yes +else + fu_cv_sys_stat_fs_data=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_fs_data" >&5 +$as_echo "$fu_cv_sys_stat_fs_data" >&6; } +if test $fu_cv_sys_stat_fs_data = yes; then +space=yes + +$as_echo "#define STAT_STATFS2_FS_DATA 1" >>confdefs.h + +fi +fi + +if test $space = no; then +# SVR2 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +$as_echo "#define STAT_READ_FILSYS 1" >>confdefs.h + +space=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi + +if test -n "$list_mounted_fs" && test $space != no; then +DF_PROG="df" +# AC_LIBOBJ(fsusage) +# AC_LIBOBJ(mountlist) +fi + +# Check for SunOS statfs brokenness wrt partitions 2GB and larger. +# If exists and struct statfs has a member named f_spare, +# enable the work-around code in fsusage.c. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for statfs that truncates block counts" >&5 +$as_echo_n "checking for statfs that truncates block counts... " >&6; } +if ${fu_cv_sys_truncating_statfs+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if !defined(sun) && !defined(__sun) +choke -- this is a workaround for a Sun-specific problem +#endif +#include +#include +int +main () +{ +struct statfs t; long c = *(t.f_spare); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + fu_cv_sys_truncating_statfs=yes +else + fu_cv_sys_truncating_statfs=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +if test $fu_cv_sys_truncating_statfs = yes; then + +$as_echo "#define STATFS_TRUNCATES_BLOCK_COUNTS 1" >>confdefs.h + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_truncating_statfs" >&5 +$as_echo "$fu_cv_sys_truncating_statfs" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AFS..." >&5 +$as_echo "$as_me: checking for AFS..." >&6;} +test -d /afs && +$as_echo "#define AFS 1" >>confdefs.h + + + +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; +$as_echo "#define LIBGTOP_ENABLE_DEBUG 1" >>confdefs.h + +else + +$as_echo "#define LIBGTOP_ENABLE_DEBUG 0" >>confdefs.h + +fi + +# Check whether --enable-fatal-warnings was given. +if test "${enable_fatal_warnings+set}" = set; then : + enableval=$enable_fatal_warnings; +$as_echo "#define LIBGTOP_FATAL_WARNINGS 1" >>confdefs.h + +fi + + +LIBGTOP_LIBS='-L$(libdir)' +LIBGTOP_INCS='-I$(includedir)/libgtop-2.0' + +if test x$libgtop_have_sysinfo = xyes ; then + LIBGTOP_INCS="$LIBGTOP_INCS -DHAVE_LIBGTOP_SYSINFO" +fi + +LIBGTOP_INCS="$LIBGTOP_INCS $GLIB_CFLAGS" + +libgtop_save_prefix="$prefix" +libgtop_save_exec_prefix="$exec_prefix" +test "x$prefix" = xNONE && prefix=$ac_default_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +LIBGTOP_BINDIR=`eval echo "${bindir}"` +LIBGTOP_SERVER=`eval echo "${bindir}/libgtop_server2"` +prefix="$libgtop_save_prefix" +exec_prefix="$libgtop_save_exec_prefix" + +sysdeps_dir="$libgtop_sysdeps_dir" + + +if test -z "$LIBGTOP_EXTRA_LIBS" ; then + LIBGTOP_EXTRA_LIBS="$libs_xauth" +else + LIBGTOP_EXTRA_LIBS="$LIBGTOP_EXTRA_LIBS $libs_xauth" +fi + +LIBGTOP_EXTRA_LIBS="$GLIB_LIBS $LIBGTOP_EXTRA_LIBS" + +LIBGTOP_LIBS="$LIBGTOP_LIBS" + +if test "$GCC" = "yes" ; then + CFLAGS="\ + -Winline \ + -Wall \ + -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \ + -Wnested-externs -Wpointer-arith \ + -Wcast-align -Wsign-compare \ + $CFLAGS" +fi + +AM_CPPFLAGS="-I\$(top_builddir) -I\$(top_srcdir) -I\$(top_srcdir)/sysdeps/$sysdeps_dir -I\$(top_srcdir)/include $GLIB_CFLAGS $X_CFLAGS" + +# Add various defines to the config.h file ... + + +$as_echo "#define _IN_LIBGTOP 1" >>confdefs.h + + +$as_echo "#define LIBGTOP_VERSION \"2.38.0\"" >>confdefs.h + + +$as_echo "#define LIBGTOP_SERVER_VERSION \"5\"" >>confdefs.h + + +$as_echo "#define LIBGTOP_VERSION_CODE 2038000" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define LIBGTOP_SERVER "$LIBGTOP_SERVER" +_ACEOF + + + + + + + + + + + +if test x$libgtop_need_server = xyes ; then + sysdeps_suid_lib="\$(top_builddir)/sysdeps/\$(sysdeps_dir)/libgtop_sysdeps_suid-2.0.la" + server_programs='libgtop_server2' +else + sysdeps_suid_lib= + server_programs= +fi + + + + + + + gtk_doc_requires="gtk-doc >= 1.4" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk-doc" >&5 +$as_echo_n "checking for gtk-doc... " >&6; } + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_doc_requires\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$gtk_doc_requires") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + have_gtk_doc=yes +else + have_gtk_doc=no +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gtk_doc" >&5 +$as_echo "$have_gtk_doc" >&6; } + + if test "$have_gtk_doc" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + You will not be able to create source packages with 'make dist' + because $gtk_doc_requires is not found." >&5 +$as_echo "$as_me: WARNING: + You will not be able to create source packages with 'make dist' + because $gtk_doc_requires is not found." >&2;} + fi + + # Extract the first word of "gtkdoc-check", so it can be a program name with args. +set dummy gtkdoc-check; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GTKDOC_CHECK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GTKDOC_CHECK"; then + ac_cv_prog_GTKDOC_CHECK="$GTKDOC_CHECK" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GTKDOC_CHECK="gtkdoc-check.test" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GTKDOC_CHECK=$ac_cv_prog_GTKDOC_CHECK +if test -n "$GTKDOC_CHECK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 +$as_echo "$GTKDOC_CHECK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "gtkdoc-check", so it can be a program name with args. +set dummy gtkdoc-check; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GTKDOC_CHECK_PATH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_CHECK_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_CHECK_PATH="$GTKDOC_CHECK_PATH" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_CHECK_PATH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_CHECK_PATH=$ac_cv_path_GTKDOC_CHECK_PATH +if test -n "$GTKDOC_CHECK_PATH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK_PATH" >&5 +$as_echo "$GTKDOC_CHECK_PATH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + for ac_prog in gtkdoc-rebase +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GTKDOC_REBASE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_REBASE in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE +if test -n "$GTKDOC_REBASE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 +$as_echo "$GTKDOC_REBASE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$GTKDOC_REBASE" && break +done +test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" + + # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. +set dummy gtkdoc-mkpdf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GTKDOC_MKPDF+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_MKPDF in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF +if test -n "$GTKDOC_MKPDF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 +$as_echo "$GTKDOC_MKPDF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + +# Check whether --with-html-dir was given. +if test "${with_html_dir+set}" = set; then : + withval=$with_html_dir; +else + with_html_dir='${datadir}/gtk-doc/html' +fi + + HTML_DIR="$with_html_dir" + + + # Check whether --enable-gtk-doc was given. +if test "${enable_gtk_doc+set}" = set; then : + enableval=$enable_gtk_doc; +else + enable_gtk_doc=no +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 +$as_echo_n "checking whether to build gtk-doc documentation... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 +$as_echo "$enable_gtk_doc" >&6; } + + if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then + as_fn_error $? " + You must have $gtk_doc_requires installed to build documentation for + $PACKAGE_NAME. Please install gtk-doc or disable building the + documentation by adding '--disable-gtk-doc' to '$0'." "$LINENO" 5 + fi + + if test "x$PACKAGE_NAME" != "xglib"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5 +$as_echo_n "checking for GTKDOC_DEPS... " >&6; } + +if test -n "$GTKDOC_DEPS_CFLAGS"; then + pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GTKDOC_DEPS_LIBS"; then + pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` + else + GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GTKDOC_DEPS_PKG_ERRORS" >&5 + + : +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + : +else + GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS + GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + fi + + # Check whether --enable-gtk-doc-html was given. +if test "${enable_gtk_doc_html+set}" = set; then : + enableval=$enable_gtk_doc_html; +else + enable_gtk_doc_html=yes +fi + + # Check whether --enable-gtk-doc-pdf was given. +if test "${enable_gtk_doc_pdf+set}" = set; then : + enableval=$enable_gtk_doc_pdf; +else + enable_gtk_doc_pdf=no +fi + + + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi + + if test -z "$AM_DEFAULT_VERBOSITY"; then + AM_DEFAULT_VERBOSITY=1 + fi + + + if test x$have_gtk_doc = xyes; then + HAVE_GTK_DOC_TRUE= + HAVE_GTK_DOC_FALSE='#' +else + HAVE_GTK_DOC_TRUE='#' + HAVE_GTK_DOC_FALSE= +fi + + if test x$enable_gtk_doc = xyes; then + ENABLE_GTK_DOC_TRUE= + ENABLE_GTK_DOC_FALSE='#' +else + ENABLE_GTK_DOC_TRUE='#' + ENABLE_GTK_DOC_FALSE= +fi + + if test x$enable_gtk_doc_html = xyes; then + GTK_DOC_BUILD_HTML_TRUE= + GTK_DOC_BUILD_HTML_FALSE='#' +else + GTK_DOC_BUILD_HTML_TRUE='#' + GTK_DOC_BUILD_HTML_FALSE= +fi + + if test x$enable_gtk_doc_pdf = xyes; then + GTK_DOC_BUILD_PDF_TRUE= + GTK_DOC_BUILD_PDF_FALSE='#' +else + GTK_DOC_BUILD_PDF_TRUE='#' + GTK_DOC_BUILD_PDF_FALSE= +fi + + if test -n "$LIBTOOL"; then + GTK_DOC_USE_LIBTOOL_TRUE= + GTK_DOC_USE_LIBTOOL_FALSE='#' +else + GTK_DOC_USE_LIBTOOL_TRUE='#' + GTK_DOC_USE_LIBTOOL_FALSE= +fi + + if test -n "$GTKDOC_REBASE"; then + GTK_DOC_USE_REBASE_TRUE= + GTK_DOC_USE_REBASE_FALSE='#' +else + GTK_DOC_USE_REBASE_TRUE='#' + GTK_DOC_USE_REBASE_FALSE= +fi + + + +ac_config_files="$ac_config_files Makefile libgtop.spec po/Makefile.in misc/Makefile include/Makefile include/glibtop/Makefile sysdeps/Makefile sysdeps/common/Makefile sysdeps/stub/Makefile sysdeps/stub_suid/Makefile sysdeps/sun4/Makefile sysdeps/osf1/Makefile sysdeps/linux/Makefile sysdeps/freebsd/Makefile sysdeps/solaris/Makefile sysdeps/aix/Makefile sysdeps/bsd/Makefile sysdeps/darwin/Makefile sysdeps/cygwin/Makefile sysdeps/openbsd/Makefile src/Makefile src/daemon/Makefile lib/Makefile examples/Makefile doc/Makefile doc/reference/Makefile doc/reference/version.xml libgtop-2.0.pc libgtopconfig.h" + + +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, we kill variables containing newlines. +# 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. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + 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}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${HAVE_INTROSPECTION_TRUE}" && test -z "${HAVE_INTROSPECTION_FALSE}"; then + as_fn_error $? "conditional \"HAVE_INTROSPECTION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then + as_fn_error $? "conditional \"CROSS_COMPILING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${EXAMPLES_TRUE}" && test -z "${EXAMPLES_FALSE}"; then + as_fn_error $? "conditional \"EXAMPLES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HACKER_MODE_TRUE}" && test -z "${HACKER_MODE_FALSE}"; then + as_fn_error $? "conditional \"HACKER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBGTOP_NEED_SERVER_TRUE}" && test -z "${LIBGTOP_NEED_SERVER_FALSE}"; then + as_fn_error $? "conditional \"LIBGTOP_NEED_SERVER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBGTOP_SYSDEPS_PRIVATE_MOUNTLIST_TRUE}" && test -z "${LIBGTOP_SYSDEPS_PRIVATE_MOUNTLIST_FALSE}"; then + as_fn_error $? "conditional \"LIBGTOP_SYSDEPS_PRIVATE_MOUNTLIST\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBGTOP_SYSDEPS_PRIVATE_FSUSAGE_TRUE}" && test -z "${LIBGTOP_SYSDEPS_PRIVATE_FSUSAGE_FALSE}"; then + as_fn_error $? "conditional \"LIBGTOP_SYSDEPS_PRIVATE_FSUSAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_GTK_DOC_TRUE}" && test -z "${HAVE_GTK_DOC_FALSE}"; then + as_fn_error $? "conditional \"HAVE_GTK_DOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $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} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# 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'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by libgtop $as_me 2.38.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + 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_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +libgtop config.status 2.38.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + 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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ +nm_file_list_spec \ +lt_cv_truncate_bin \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' + +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile' + + + +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake < 1.5. + 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 || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "libgtop.spec") CONFIG_FILES="$CONFIG_FILES libgtop.spec" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "misc/Makefile") CONFIG_FILES="$CONFIG_FILES misc/Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/glibtop/Makefile") CONFIG_FILES="$CONFIG_FILES include/glibtop/Makefile" ;; + "sysdeps/Makefile") CONFIG_FILES="$CONFIG_FILES sysdeps/Makefile" ;; + "sysdeps/common/Makefile") CONFIG_FILES="$CONFIG_FILES sysdeps/common/Makefile" ;; + "sysdeps/stub/Makefile") CONFIG_FILES="$CONFIG_FILES sysdeps/stub/Makefile" ;; + "sysdeps/stub_suid/Makefile") CONFIG_FILES="$CONFIG_FILES sysdeps/stub_suid/Makefile" ;; + "sysdeps/sun4/Makefile") CONFIG_FILES="$CONFIG_FILES sysdeps/sun4/Makefile" ;; + "sysdeps/osf1/Makefile") CONFIG_FILES="$CONFIG_FILES sysdeps/osf1/Makefile" ;; + "sysdeps/linux/Makefile") CONFIG_FILES="$CONFIG_FILES sysdeps/linux/Makefile" ;; + "sysdeps/freebsd/Makefile") CONFIG_FILES="$CONFIG_FILES sysdeps/freebsd/Makefile" ;; + "sysdeps/solaris/Makefile") CONFIG_FILES="$CONFIG_FILES sysdeps/solaris/Makefile" ;; + "sysdeps/aix/Makefile") CONFIG_FILES="$CONFIG_FILES sysdeps/aix/Makefile" ;; + "sysdeps/bsd/Makefile") CONFIG_FILES="$CONFIG_FILES sysdeps/bsd/Makefile" ;; + "sysdeps/darwin/Makefile") CONFIG_FILES="$CONFIG_FILES sysdeps/darwin/Makefile" ;; + "sysdeps/cygwin/Makefile") CONFIG_FILES="$CONFIG_FILES sysdeps/cygwin/Makefile" ;; + "sysdeps/openbsd/Makefile") CONFIG_FILES="$CONFIG_FILES sysdeps/openbsd/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/daemon/Makefile") CONFIG_FILES="$CONFIG_FILES src/daemon/Makefile" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "doc/reference/Makefile") CONFIG_FILES="$CONFIG_FILES doc/reference/Makefile" ;; + "doc/reference/version.xml") CONFIG_FILES="$CONFIG_FILES doc/reference/version.xml" ;; + "libgtop-2.0.pc") CONFIG_FILES="$CONFIG_FILES libgtop-2.0.pc" ;; + "libgtopconfig.h") CONFIG_FILES="$CONFIG_FILES libgtopconfig.h" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + 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 against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #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. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # 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. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 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. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# The names of the tagged configurations supported by this script. +available_tags='' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and where our libraries should be installed. +lt_sysroot=$lt_sysroot + +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain=$ac_aux_dir/ltmain.sh + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + "po-directories":C) + 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" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/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 assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assignment from automake < 1.5. + 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 # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# 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 || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..40ba5f4 --- /dev/null +++ b/configure.ac @@ -0,0 +1,386 @@ +dnl +dnl Configure script for the Gnome library +dnl + +m4_define([libgtop_major_version], [2]) +m4_define([libgtop_minor_version], [38]) +m4_define([libgtop_micro_version], [0]) +m4_define([libgtop_version], [libgtop_major_version.libgtop_minor_version.libgtop_micro_version]) + +dnl increment if the interface has additions, changes, removals. +m4_define([libgtop_current], [11]) + +dnl increment any time the source changes; set to +dnl 0 if you increment CURRENT +m4_define([libgtop_revision], [0]) + +dnl increment if any interfaces have been added; set to 0 +dnl if any interfaces have been removed. removal has +dnl precedence over adding, so set to 0 if both happened. +m4_define([libgtop_age], [0]) + +# Increase each time you change the client/server protocol. +m4_define([libgtop_server_version], [5]) + +# Version code calculation +m4_define([libgtop_version_code], [m4_eval(libgtop_major_version * 1000000 + libgtop_minor_version * 1000 + libgtop_micro_version)]) + +AC_PREREQ(2.62) +AC_INIT([libgtop], [libgtop_version], + [http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop]) +AC_CONFIG_SRCDIR(copyright.txt) +AC_CONFIG_HEADERS(config.h) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE([-Wno-portability tar-ustar no-dist-gzip dist-xz]) +AM_SILENT_RULES([yes]) +AC_CONFIG_MACRO_DIR([m4]) +GOBJECT_INTROSPECTION_CHECK([0.6.7]) + +AC_SUBST(ACLOCAL_AMFLAGS, [\${ACLOCAL_FLAGS}]) + +AC_SUBST(LIBGTOP_MAJOR_VERSION, [libgtop_major_version]) +AC_SUBST(LIBGTOP_MINOR_VERSION, [libgtop_minor_version]) +AC_SUBST(LIBGTOP_MICRO_VERSION, [libgtop_micro_version]) +AC_SUBST(LIBGTOP_SERVER_VERSION, [libgtop_server_version]) +AC_SUBST(LIBGTOP_VERSION, [libgtop_version]) +AC_SUBST(LIBGTOP_VERSION_CODE, [libgtop_version_code]) + +# libtool versioning +AC_SUBST(LT_VERSION_INFO, + ["-version-info libgtop_current:libgtop_revision:libgtop_age"]) + +ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I ." + +AC_ISC_POSIX +AC_PROG_CC +AC_STDC_HEADERS +dnl AC_ARG_PROGRAM + +dnl We need this at some places. +libgtop_top_builddir=`pwd` +AC_SUBST(libgtop_top_builddir) + +dnl We don't use `AC_PROG_AWK' since it checks for mawk first which +dnl does not work for libgtop. +AC_CHECK_PROGS(AWK, gawk awk, ) +test -z "$AWK" && AC_MSG_ERROR([Sorry, you need a working awk interpreter.]) + +dnl Most people should have a working perl interpreter on their system +AC_CHECK_PROGS(PERL, perl5 perl) +test -z "$PERL" && AC_MSG_ERROR([You need to have a working perl interpreter.]) + +AC_CHECK_TOOL(CC,gcc) +AC_CHECK_TOOL(RANLIB,ranlib) +AC_CHECK_TOOL(AS,as) +AC_CHECK_TOOL(AR,ar) + +export CC CXX RANLIB LD AS AR + +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET + +export cross_compiling + +AM_PROG_LIBTOOL + +AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes) + +GNOME_LIBGTOP_SYSDEPS +GNOME_LIBGTOP_TYPES + +GLIB_REQUIRED=2.6.0 +GOBJECT_REQUIRED=2.26.0 + +PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GOBJECT_REQUIRED) +AC_SUBST(GLIB_CFLAGS) +AC_SUBST(GLIB_LIBS) + +AC_CHECK_HEADER(ifaddrs.h, [HAVE_IFADDRS_H=yes], [HAVE_IFADDRS_H=no]) +if test x$HAVE_IFADDRS_H = xyes ; then + AC_DEFINE(HAVE_IFADDRS_H, 1, [defined if you have ifaddrs.h]) +fi + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_STRUCT_ST_RDEV +AC_HEADER_TIME +AC_STRUCT_TM +AC_TYPE_UID_T + +dnl For SunOS +AC_CHECK_TYPE(ssize_t, int) +AC_CHECK_HEADERS(memory.h) +AC_CHECK_HEADERS(string.h strings.h, break) +AC_REPLACE_FUNCS(strerror) + +dnl dlopen() and dlsym() +DL_LIB= +AC_CHECK_FUNCS(dlopen,,[ + AC_CHECK_LIB(dl, dlopen, DL_LIB="-ldl", [ + AC_CHECK_LIB(dld, shl_load, DL_LIB="-ldld", [ + AC_CHECK_FUNCS(dlopen, DL_LIB="", DL_LIB="") + ]) + ]) +]) +oLIBS="$LIBS" +LIBS="$LIBS $DL_LIB" +AC_CHECK_FUNCS(dlerror,,) +LIBS="$oLIBS" +AC_SUBST(DL_LIB) + +dnl Linux +AC_CHECK_HEADER(linux/isdn.h,[HAVE_ISDN_H=yes],[HAVE_ISDN_H=no]) +if test x$HAVE_ISDN_H = xyes ; then + AC_DEFINE(HAVE_ISDN_H, 1, [defined if you have linux/isdn.h]) +fi + +dnl AIX +AC_CHECK_LIB(perfstat, vmgetinfo, + AC_DEFINE(HAVE_VMGETINFO, 1, + [Define to 1 if you have the 'vmgetinfo' function in libperfstat])) + +dnl Solaris +case "$host_os" in + solaris*) + AC_CHECK_LIB(kstat, kstat_open) + AC_CHECK_FUNCS(getloadavg swapctl) + AC_CHECK_HEADERS(procfs.h sys/procfs.h, break) + + + dnl Some versions of Solaris require -lelf for -lkvm + case $host_os in + solaris[[8-9]] | solaris2.[[0-9]].*) + AC_CHECK_LIB(kvm, kvm_open,[ + LIBS="-lkvm $LIBS" + ],[AC_MSG_CHECKING(for kvm_open in -lkvm with -lelf) + AC_CACHE_VAL(ac_cv_lib_kvm_with_elf, + [ac_save_LIBS="$LIBS" + LIBS="-lkvm -lelf $LIBS" + AC_TRY_LINK([char kvm_open();], [kvm_open()], + ac_cv_lib_kvm_with_elf=yes, ac_cv_lib_kvm_with_elf=no) + LIBS="$ac_save_LIBS" + ]) + if test "$ac_cv_lib_kvm_with_elf" = "yes"; then + AC_MSG_RESULT(yes) + LIBS="-lkvm -lelf $LIBS" + else + AC_MSG_RESULT(no) + fi + ]) + ;; + esac + ;; +esac + +dnl For DEC OSF1 +AC_CHECK_LIB(mach, vm_statistics) + +dnl For some broken libc5 systems (Debian 1.3) +saved_CFLAGS=$CFLAGS +CFLAGS="$CFLAGS -D_GNU_SOURCE" +GCC_NEED_DECLARATION(program_invocation_name, [ +#include +#include +#include +#include +]) + +CFLAGS=$saved_CFLAGS + +AC_CHECK_FUNC(socket, + [AC_CHECK_HEADER(netinet/in.h, + [AC_CHECK_HEADER(arpa/inet.h, [ + AC_DEFINE(HAVE_SOCKETS, 1, [Define if BSD sockets are supported]) + AC_MSG_CHECKING("for sun_len member in struct sockaddr_un") + AC_TRY_LINK([ +#include +#include +#include + ], + [static struct sockaddr_un x; x.sun_len = 1;], + [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOCKADDR_SUN_LEN, 1, [Define if struct sockaddr_un has a sun_len member])], + [AC_MSG_RESULT(no)])])])]) + +dnl Checks for library functions. +AC_FUNC_ALLOCA +AC_FUNC_MMAP +AC_TYPE_SIGNAL +AC_FUNC_STRFTIME +AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname) + +AM_GNU_GETTEXT_VERSION([0.19.4]) +AM_GNU_GETTEXT([external]) + +GETTEXT_PACKAGE=libgtop-2.0 +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", + [Define to the gettext package used by the library]) + +AC_PATH_XTRA + +dnl For Solaris +dnl Please don't move this before AC_PATH_XTRA +AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)]) +AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)]) +AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton)]) + +dnl The construct foo=`echo $w1 $w2 $w3` fails on some systems if $w1 = -e or -n +dnl So we use the following instead. +dnl XE_SPACE(var, words) +define([XE_SPACE],[ +T="" +for W in $2; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done +$1="$T" +])dnl + +dnl Autodetect Xauth +dnl -lXau is only used by gnuclient, so use a special variable for Xauth X libs +saved_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $X_CFLAGS" +test -z "$with_xauth" && { AC_CHECK_HEADER(X11/Xauth.h, ,with_xauth=no) } +test -z "$with_xauth" && { AC_CHECK_LIB(Xau, XauGetAuthByAddr,[:],with_xauth=no, $X_LIBS) } +test -z "$with_xauth" && with_xauth=yes +if test "$with_xauth" = "yes"; then + AC_DEFINE(HAVE_XAUTH, 1, [Define if Xauth is supported]) + XE_SPACE(libs_xauth, $X_LIBS -lXau) +fi +CPPFLAGS="$saved_CPPFLAGS" +AC_SUBST(libs_xauth) + +dnl For diskusage stuff +GNOME_FILEUTILS_CHECKS + +dnl Debugging +AC_ARG_ENABLE(debug, + AS_HELP_STRING([--enable-debug], + [Turn on debugging @<:@default=no@:>@]), + AC_DEFINE(LIBGTOP_ENABLE_DEBUG, 1, [Define to enable debugging]), + AC_DEFINE(LIBGTOP_ENABLE_DEBUG, 0, [Define to disable debugging])) +AC_ARG_ENABLE(fatal-warnings, + AS_HELP_STRING([--enable-fatal-warnings], + [Make all warnings fatal @<:@debug=no@:>@]), + AC_DEFINE(LIBGTOP_FATAL_WARNINGS, 1, + [Define to enable fatal warnings])) + +dnl These definitions are expanded in make. +LIBGTOP_LIBS='-L$(libdir)' +LIBGTOP_INCS='-I$(includedir)/libgtop-2.0' + +if test x$libgtop_have_sysinfo = xyes ; then + LIBGTOP_INCS="$LIBGTOP_INCS -DHAVE_LIBGTOP_SYSINFO" +fi + +LIBGTOP_INCS="$LIBGTOP_INCS $GLIB_CFLAGS" + +libgtop_save_prefix="$prefix" +libgtop_save_exec_prefix="$exec_prefix" +test "x$prefix" = xNONE && prefix=$ac_default_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +LIBGTOP_BINDIR=`eval echo "${bindir}"` +LIBGTOP_SERVER=`eval echo "${bindir}/libgtop_server2"` +prefix="$libgtop_save_prefix" +exec_prefix="$libgtop_save_exec_prefix" + +sysdeps_dir="$libgtop_sysdeps_dir" +AC_SUBST(sysdeps_dir) + +if test -z "$LIBGTOP_EXTRA_LIBS" ; then + LIBGTOP_EXTRA_LIBS="$libs_xauth" +else + LIBGTOP_EXTRA_LIBS="$LIBGTOP_EXTRA_LIBS $libs_xauth" +fi + +LIBGTOP_EXTRA_LIBS="$GLIB_LIBS $LIBGTOP_EXTRA_LIBS" + +LIBGTOP_LIBS="$LIBGTOP_LIBS" + +if test "$GCC" = "yes" ; then + CFLAGS="\ + -Winline \ + -Wall \ + -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \ + -Wnested-externs -Wpointer-arith \ + -Wcast-align -Wsign-compare \ + $CFLAGS" +fi + +AM_CPPFLAGS="-I\$(top_builddir) -I\$(top_srcdir) -I\$(top_srcdir)/sysdeps/$sysdeps_dir -I\$(top_srcdir)/include $GLIB_CFLAGS $X_CFLAGS" + +# Add various defines to the config.h file ... +AH_VERBATIM([_GNU_SOURCE], +[/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE +#endif]) +AC_DEFINE([_IN_LIBGTOP], 1, + [Note that we are building libgtop rather than using it]) +AC_DEFINE([LIBGTOP_VERSION], ["libgtop_version"], + [The libgtop version number]) +AC_DEFINE([LIBGTOP_SERVER_VERSION], ["libgtop_server_version"], + [The libgtop server version]) +AC_DEFINE([LIBGTOP_VERSION_CODE], [libgtop_version_code], + [The libgtop version number as an integer]) +AC_DEFINE_UNQUOTED([LIBGTOP_SERVER], ["$LIBGTOP_SERVER"], + [The path to the libgtop server]) + +AC_SUBST(AM_CPPFLAGS) + +AC_SUBST(LIBGTOP_EXTRA_LIBS) +AC_SUBST(GLIB_LIBS) +AC_SUBST(LIBGTOP_LIBS) +AC_SUBST(LIBGTOP_INCS) +AC_SUBST(LIBGTOP_BINDIR) +AC_SUBST(LIBGTOP_SERVER) + +if test x$libgtop_need_server = xyes ; then + sysdeps_suid_lib="\$(top_builddir)/sysdeps/\$(sysdeps_dir)/libgtop_sysdeps_suid-2.0.la" + server_programs='libgtop_server2' +else + sysdeps_suid_lib= + server_programs= +fi +AC_SUBST(sysdeps_suid_lib) +AC_SUBST(server_programs) + +GTK_DOC_CHECK(1.4) + +AC_CONFIG_FILES([ +Makefile +libgtop.spec +po/Makefile.in +misc/Makefile +include/Makefile +include/glibtop/Makefile +sysdeps/Makefile +sysdeps/common/Makefile +sysdeps/stub/Makefile +sysdeps/stub_suid/Makefile +sysdeps/sun4/Makefile +sysdeps/osf1/Makefile +sysdeps/linux/Makefile +sysdeps/freebsd/Makefile +sysdeps/solaris/Makefile +sysdeps/aix/Makefile +sysdeps/bsd/Makefile +sysdeps/darwin/Makefile +sysdeps/cygwin/Makefile +sysdeps/openbsd/Makefile +src/Makefile +src/daemon/Makefile +lib/Makefile +examples/Makefile +doc/Makefile +doc/reference/Makefile +doc/reference/version.xml +libgtop-2.0.pc +libgtopconfig.h +]) + +AC_OUTPUT diff --git a/copyright.txt b/copyright.txt new file mode 100644 index 0000000..71741f8 --- /dev/null +++ b/copyright.txt @@ -0,0 +1,22 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 2.0. + + Contributed by Martin Baulig , April 1998. + Contributed by Benoît Dejean , 2004. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..fc98710 --- /dev/null +++ b/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2013-05-30.07; # UTC + +# Copyright (C) 1999-2014 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, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/doc/ChangeLog b/doc/ChangeLog new file mode 100644 index 0000000..bf4e6b6 --- /dev/null +++ b/doc/ChangeLog @@ -0,0 +1,90 @@ +2007-02-15 Benoît Dejean + + * reference/Makefile.am: + + Fixed distcheck. + +2006-02-21 Benoît Dejean + + * reference.texi: Fixed glibtop_get_proc_state doc. + Patch by Emil Nowak . + +2005-01-03 Benoît Dejean + + * reference.texi: Updated. + +2004-12-04 Benoît Dejean + + * reference.texi: Updated. + +2004-08-03 Benoît Dejean + + * reference.texi: Updated. + +2004-07-07 Benoît Dejean + + * reference.texi: updated. + Added glibtop_get_proc_argv. + Added glibtop_fsusage.block_size. + +2004-03-05 Bastien Nocera + + * reference.texi: update for new API + +2003-10-20 Bastien Nocera + + * reference.texi: s/u_int64_t/guint64/ + +2003-10-20 Bastien Nocera + + * Makefile.am: removed traces of guile, intllibs and libgnomesupport + +2002-03-12 James Henstridge + + * Makefile.am (MAKEINFO): using += seems to screw up the build + with newer automakes. Set it explicitly (using @MAKEINFO@) seems + to be compatible with both. + +2001-11-26 Abel Cheung + + * libgtop.texi, Makefile.am: Renamed to libgtop2.texi + * about.texi: Very minor update. + +1999-10-18 Martin Baulig + + * about.texi: Added a note about LibGTop and GNOME. + + * reference.texi (glibtop_proc_state): Fix description of the `state' + field for LibGTop 1.0.x. + +1999-09-29 Martin Baulig + + * Makefile.am (MAKEINFO): Add `-I @libgtop_top_builddir@/doc' here. + +1999-05-16 Martin Baulig + + * main.texi: This is now the main file which will @include all + chapter files so we can use `texinfo-multiple-files-update'. + + * reference.texi: Added all missing sections with a "not yet written" + notice. + +1999-05-16 Martin Baulig + + * white-paper.texi: Initial version of the LibGTop White Paper. + + * Makefile.am: Create `auto-macros.texi' from `auto-macros.texi.in' + which will contain some `@set' commands for the LibGTop version etc. + + * auto-macros.texi.in: New file. This is a template for + `auto-macros.texi' which will be automatically generated. + +1999-05-09 Martin Baulig + + * about.texi: Split the `libgtop.texi' into one file pro chapter, + this is the "About LibGTop". + + * reference.texi: The "LibGTop Reference Manual". + + * libgtop.texi: Initial version of the new LibGTop Manual. + diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..d5fc081 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,8 @@ +SUBDIRS = reference + +info_TEXINFOS = libgtop2.texi + +libgtop2_TEXINFOS = libgtop2.texi about.texi reference.texi \ + version.texi main.texi white-paper.texi + +AM_MAKEINFOFLAGS = -I $(libgtop_top_builddir)/doc diff --git a/doc/Makefile.in b/doc/Makefile.in new file mode 100644 index 0000000..4acfb0d --- /dev/null +++ b/doc/Makefile.in @@ -0,0 +1,1034 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = doc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \ + $(srcdir)/stamp-vti $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +AM_V_DVIPS = $(am__v_DVIPS_@AM_V@) +am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@) +am__v_DVIPS_0 = @echo " DVIPS " $@; +am__v_DVIPS_1 = +AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@) +am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@) +am__v_MAKEINFO_0 = @echo " MAKEINFO" $@; +am__v_MAKEINFO_1 = +AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@) +am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@) +am__v_INFOHTML_0 = @echo " INFOHTML" $@; +am__v_INFOHTML_1 = +AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@) +am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@) +am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@; +am__v_TEXI2DVI_1 = +AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@) +am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@) +am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@; +am__v_TEXI2PDF_1 = +AM_V_texinfo = $(am__v_texinfo_@AM_V@) +am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@) +am__v_texinfo_0 = -q +am__v_texinfo_1 = +AM_V_texidevnull = $(am__v_texidevnull_@AM_V@) +am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) +am__v_texidevnull_0 = > /dev/null +am__v_texidevnull_1 = +INFO_DEPS = $(srcdir)/libgtop2.info +am__TEXINFO_TEX_DIR = $(srcdir) +DVIS = libgtop2.dvi +PDFS = libgtop2.pdf +PSS = libgtop2.ps +HTMLS = libgtop2.html +TEXINFOS = libgtop2.texi +TEXI2DVI = texi2dvi +TEXI2PDF = $(TEXI2DVI) --pdf --batch +MAKEINFOHTML = $(MAKEINFO) --html +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) +DVIPS = dvips +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__installdirs = "$(DESTDIR)$(infodir)" +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(libgtop2_TEXINFOS) $(srcdir)/Makefile.in ChangeLog \ + mdate-sh texinfo.tex +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = reference +info_TEXINFOS = libgtop2.texi +libgtop2_TEXINFOS = libgtop2.texi about.texi reference.texi \ + version.texi main.texi white-paper.texi + +AM_MAKEINFOFLAGS = -I $(libgtop_top_builddir)/doc +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .dvi .html .info .pdf .ps .texi +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +.texi.info: + $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + am__cwd=`pwd` && $(am__cd) $(srcdir) && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + else :; fi && \ + cd "$$am__cwd"; \ + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $@ $<; \ + then \ + rc=0; \ + $(am__cd) $(srcdir); \ + else \ + rc=$$?; \ + $(am__cd) $(srcdir) && \ + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ + fi; \ + rm -rf $$backupdir; exit $$rc + +.texi.dvi: + $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ + $< + +.texi.pdf: + $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ + $< + +.texi.html: + $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) + $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $(@:.html=.htp) $<; \ + then \ + rm -rf $@ && mv $(@:.html=.htp) $@; \ + else \ + rm -rf $(@:.html=.htp); exit 1; \ + fi +$(srcdir)/libgtop2.info: libgtop2.texi $(srcdir)/version.texi $(libgtop2_TEXINFOS) +libgtop2.dvi: libgtop2.texi $(srcdir)/version.texi $(libgtop2_TEXINFOS) +libgtop2.pdf: libgtop2.texi $(srcdir)/version.texi $(libgtop2_TEXINFOS) +libgtop2.html: libgtop2.texi $(srcdir)/version.texi $(libgtop2_TEXINFOS) +$(srcdir)/version.texi: $(srcdir)/stamp-vti +$(srcdir)/stamp-vti: libgtop2.texi $(top_srcdir)/configure + @(dir=.; test -f ./libgtop2.texi || dir=$(srcdir); \ + set `$(SHELL) $(srcdir)/mdate-sh $$dir/libgtop2.texi`; \ + echo "@set UPDATED $$1 $$2 $$3"; \ + echo "@set UPDATED-MONTH $$2 $$3"; \ + echo "@set EDITION $(VERSION)"; \ + echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \ + (cmp -s vti.tmp$$$$ $(srcdir)/version.texi \ + || (echo "Updating $(srcdir)/version.texi" && \ + cp vti.tmp$$$$ $(srcdir)/version.texi.tmp$$$$ && \ + mv $(srcdir)/version.texi.tmp$$$$ $(srcdir)/version.texi)) && \ + rm -f vti.tmp$$$$ $(srcdir)/version.texi.$$$$ + @cp $(srcdir)/version.texi $@ + +mostlyclean-vti: + -rm -f vti.tmp* $(srcdir)/version.texi.tmp* + +maintainer-clean-vti: + -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi +.dvi.ps: + $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + $(DVIPS) $(AM_V_texinfo) -o $@ $< + +uninstall-dvi-am: + @$(NORMAL_UNINSTALL) + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ + rm -f "$(DESTDIR)$(dvidir)/$$f"; \ + done + +uninstall-html-am: + @$(NORMAL_UNINSTALL) + @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ + rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ + done + +uninstall-info-am: + @$(PRE_UNINSTALL) + @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ + if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ + then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ + done; \ + else :; fi + @$(NORMAL_UNINSTALL) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ + (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ + echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ + rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ + else :; fi); \ + done + +uninstall-pdf-am: + @$(NORMAL_UNINSTALL) + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ + done + +uninstall-ps-am: + @$(NORMAL_UNINSTALL) + @list='$(PSS)'; test -n "$(psdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ + rm -f "$(DESTDIR)$(psdir)/$$f"; \ + done + +dist-info: $(INFO_DEPS) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; \ + for base in $$list; do \ + case $$base in \ + $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$base; then d=.; else d=$(srcdir); fi; \ + base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ + for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ + if test -f $$file; then \ + relfile=`expr "$$file" : "$$d/\(.*\)"`; \ + test -f "$(distdir)/$$relfile" || \ + cp -p $$file "$(distdir)/$$relfile"; \ + else :; fi; \ + done; \ + done + +mostlyclean-aminfo: + -rm -rf libgtop2.t2d libgtop2.t2p + +clean-aminfo: + -test -z "libgtop2.dvi libgtop2.pdf libgtop2.ps libgtop2.html" \ + || rm -rf libgtop2.dvi libgtop2.pdf libgtop2.ps libgtop2.html + +maintainer-clean-aminfo: + @list='$(INFO_DEPS)'; for i in $$list; do \ + i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ + echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ + rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ + done + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-info +check-am: all-am +check: check-recursive +all-am: Makefile $(INFO_DEPS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(infodir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-aminfo clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: $(DVIS) + +html: html-recursive + +html-am: $(HTMLS) + +info: info-recursive + +info-am: $(INFO_DEPS) + +install-data-am: install-info-am + +install-dvi: install-dvi-recursive + +install-dvi-am: $(DVIS) + @$(NORMAL_INSTALL) + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ + done +install-exec-am: + +install-html: install-html-recursive + +install-html-am: $(HTMLS) + @$(NORMAL_INSTALL) + @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ + $(am__strip_dir) \ + d2=$$d$$p; \ + if test -d "$$d2"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ + $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ + echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ + $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ + else \ + list2="$$list2 $$d2"; \ + fi; \ + done; \ + test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ + done; } +install-info: install-info-recursive + +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ + fi; \ + for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ + for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ + $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ + if test -f $$ifile; then \ + echo "$$ifile"; \ + else : ; fi; \ + done; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done + @$(POST_INSTALL) + @if $(am__can_run_installinfo); then \ + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ + done; \ + else : ; fi +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: $(PDFS) + @$(NORMAL_INSTALL) + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done +install-ps: install-ps-recursive + +install-ps-am: $(PSS) + @$(NORMAL_INSTALL) + @list='$(PSS)'; test -n "$(psdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-aminfo \ + maintainer-clean-generic maintainer-clean-vti + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \ + mostlyclean-libtool mostlyclean-vti + +pdf: pdf-recursive + +pdf-am: $(PDFS) + +ps: ps-recursive + +ps-am: $(PSS) + +uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ + uninstall-pdf-am uninstall-ps-am + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-aminfo clean-generic clean-libtool \ + cscopelist-am ctags ctags-am dist-info distclean \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-aminfo \ + maintainer-clean-generic maintainer-clean-vti mostlyclean \ + mostlyclean-aminfo mostlyclean-generic mostlyclean-libtool \ + mostlyclean-vti pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-dvi-am uninstall-html-am \ + uninstall-info-am uninstall-pdf-am uninstall-ps-am + +.PRECIOUS: Makefile + + +# 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: diff --git a/doc/about.texi b/doc/about.texi new file mode 100644 index 0000000..73cb191 --- /dev/null +++ b/doc/about.texi @@ -0,0 +1,123 @@ +@node About, White Paper, Top, Top +@chapter About LibGTop + +LibGTop is a library to get system specific data such as CPU and Memory Usage +and information about running Processes. + +On Systems like Solaris or Digital Unix where you need special privileges to +get those data, it uses a setuid/setgid server to do so. + +Even if LibGTop is a part of the GNOME desktop environment +(@uref{http://www.gnome.org}), the main interface of LibGTop is totally +independent from any particular desktop environment, so you can also use it +as a standalone library in any piece of GPLed software. + +@menu +* Availability:: Where to get LibGTop +* Supported Platforms:: Supported Platforms +* Mailing List:: Helping with LibGTop development +* Thanks:: People who contributed to LibGTop +@end menu + +@node Availability, Supported Platforms, About, About +@section Availability + +The master source of LibGTop is the GNOME CVS tree +(see @uref{http://www.gnome.org} for details), but you can also get the +latest release tarballs from + +@display +@uref{ftp://ftp.gnome.org/pub/GNOME/sources/libgtop/} +@end display + +@noindent +or any of its mirror sites. + +The latest stable version of LibGTop is 1.0.12 which is also the one that comes +together with GNOME 1.0. It belongs to @code{LIBGTOP_STABLE_1_0} branch in CVS. +Actual development occurs in the @code{libgtop-GNOME-2-0-port} which is +currently versioned 1.90.0. + +@node Supported Platforms, Mailing List, Availability, About +@section Supported Platforms + +The stable branch currently supports the following platforms: + +@itemize @bullet +@item All versions of Linux + +LibGTop was tested under Linux 2.0.x and 2.2.x on the ix86 and the alpha, but +it should also work without problems on SparcLinux or Linux 2.4.x. + +Note: I'm speaking of the Linux kernel here, not the GNU/Linux operating system. + +@item FreeBSD, NetBSD and OpenBSD + +LibGTop was tested under FreeBSD 2.2.6 and 3.0, NetBSD 1.3.2 and OpenBSD 2.4. +Support for NetBSD 1.4 was added in LibGTop 1.0.2. + +@end itemize + +The platforms listed above are known to be stable and working. However, if +you're using the latest development version, you can use it on the following +platforms as well: + +@itemize @bullet +@item BSD/OS + +There is a port for BSD/OS (aka BSDI) 2.x and 3.x from Timur Bakeyev which +should also work with 4.x. This isn't tested very well, but it should be +working. + +@item Digital Unix + +There is some basic support for Digital Unix (formerly DEC OSF/1) V3.2C, but +this may still be a bit unstable. I'm currently working on this port as time +permits so it should be fully supported soon. + +@item Solaris + +The Solaris port currently works on Solaris 7 and maybe also on other releases. +Thanks a lot to Drazen Kacar and everyone who helped working on this port. They +have really done excellent work here and I'm pretty sure that this port will be +fully functional on most Solaris versions in near future. + +@end itemize + +@node Mailing List, Thanks, Supported Platforms, About +@section Mailing List + +There is a @email{libgtop-devel-list@@egroups.com} mailing list for people who +want to help with the development of LibGTop. + +It is meant as a low-traffic, but high content-list where we can discuss +technical details such as adding new sysdeps ports etc. + +Especially, I'd like to see people with a deeper knowledge of operating systems +internals joining my list so we can discuss technical details of the sysdeps +code. + +It is *not* for users that want to know how to compile LibGTop etc. + +You can subscribe to this mailing list and view the mailing list archives +on the LibGTop Page at @uref{http://www.home-of-linux.org/gnome/libgtop}. + +@node Thanks, , Mailing List, About +@section Thanks + +At the place I'd like to thank the following people who contributed to +LibGTop (listed in chronological order): + +@itemize @bullet +@item Sebastian Wilhelmi who had the initial idea of LibGTop and helped +me a lot in the early beginning. +@item Josh Sled for the initial FreeBSD port. +@item Jeremy Lea for his BSD patches. +@item Timur Bakeyev for the BSDI port. +@item Drazen Kacar and the other people on the LibGTop development mailing +list for the Solaris port. +@item Kevin Vandersloot for the effort to port to GNOME 2.0. +@item All people sending me patches, having good ideas, ... +@item Everyone I have forgotten in this list ... +@end itemize + diff --git a/doc/libgtop2.info b/doc/libgtop2.info new file mode 100644 index 0000000..45c4d1c --- /dev/null +++ b/doc/libgtop2.info @@ -0,0 +1,1950 @@ +This is libgtop2.info, produced by makeinfo version 6.3 from +libgtop2.texi. + +INFO-DIR-SECTION Libraries: +START-INFO-DIR-ENTRY +* LibGTop2: (libgtop2). Library to get system specific data + such as cpu and memory usage, active + processes +END-INFO-DIR-ENTRY + +This is the LibGTop Reference Manual version 2.38.0 (last modified 27 +November 2016). + + Copyright 1999 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the sections entitled "Copying" and "GNU General Public License" +are included exactly as in the original, and provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Free Software Foundation. + + + +File: libgtop2.info, Node: Top, Next: About, Prev: (dir), Up: (dir) + +* Menu: + +* About:: About LibGTop +* White Paper:: LibGTop White Paper +* Reference Manual:: LibGTop Reference Manual + + -- The Detailed Node Listing -- + +About LibGTop + +* Availability:: Where to get LibGTop +* Supported Platforms:: Supported Platforms +* Mailing List:: Helping with LibGTop development +* Thanks:: People who contributed to LibGTop + +LibGTop White Paper + +* Introduction:: Introduction +* Overview:: Overview + +Overview + +* Interface Design:: Things that need to be considered +* Server Implementation:: The LibGTop "server" + +LibGTop Reference Manual + +* System Dependent:: System Dependent Functions. +* Common Functions:: Common Functions. +* Library Functions:: Library Functions. + +System Dependent Functions + +* glibtop_cpu:: CPU Usage. +* glibtop_mem:: Memory Usage. +* glibtop_swap:: Swap Usage. +* glibtop_uptime:: System Uptime. +* glibtop_loadavg:: Load Average. +* glibtop_proclist:: Process List. +* glibtop_proc_state:: Process State. +* glibtop_proc_uid:: Process UID and TTY Information. +* glibtop_proc_mem:: Process Memory Information. +* glibtop_proc_time:: Process Time Information. +* glibtop_proc_signal:: Process Signal Information. +* glibtop_proc_kernel:: Process Kernel Data Information. +* glibtop_proc_segment:: Process Segment Information. +* glibtop_proc_args:: Process Arguments. +* glibtop_proc_map:: Process Memory Maps. +* glibtop_netload:: Network Load. +* glibtop_ppp:: PPP Usage. + +Common Functions + +* glibtop_mountlist:: Mount List. +* glibtop_fsusage:: File System Usage. + +Library Functions + +* glibtop_init:: Server Initialization. +* glibtop_sysdeps:: Server Sysdeps. +* Library Parameters:: Library Parameters. + + +File: libgtop2.info, Node: About, Next: White Paper, Prev: Top, Up: Top + +1 About LibGTop +*************** + +LibGTop is a library to get system specific data such as CPU and Memory +Usage and information about running Processes. + + On Systems like Solaris or Digital Unix where you need special +privileges to get those data, it uses a setuid/setgid server to do so. + + Even if LibGTop is a part of the GNOME desktop environment +(), the main interface of LibGTop is totally +independent from any particular desktop environment, so you can also use +it as a standalone library in any piece of GPLed software. + +* Menu: + +* Availability:: Where to get LibGTop +* Supported Platforms:: Supported Platforms +* Mailing List:: Helping with LibGTop development +* Thanks:: People who contributed to LibGTop + + +File: libgtop2.info, Node: Availability, Next: Supported Platforms, Prev: About, Up: About + +1.1 Availability +================ + +The master source of LibGTop is the GNOME CVS tree (see + for details), but you can also get the latest +release tarballs from + + + +or any of its mirror sites. + + The latest stable version of LibGTop is 1.0.12 which is also the one +that comes together with GNOME 1.0. It belongs to 'LIBGTOP_STABLE_1_0' +branch in CVS. Actual development occurs in the 'libgtop-GNOME-2-0-port' +which is currently versioned 1.90.0. + + +File: libgtop2.info, Node: Supported Platforms, Next: Mailing List, Prev: Availability, Up: About + +1.2 Supported Platforms +======================= + +The stable branch currently supports the following platforms: + + * All versions of Linux + + LibGTop was tested under Linux 2.0.x and 2.2.x on the ix86 and the + alpha, but it should also work without problems on SparcLinux or + Linux 2.4.x. + + Note: I'm speaking of the Linux kernel here, not the GNU/Linux + operating system. + + * FreeBSD, NetBSD and OpenBSD + + LibGTop was tested under FreeBSD 2.2.6 and 3.0, NetBSD 1.3.2 and + OpenBSD 2.4. Support for NetBSD 1.4 was added in LibGTop 1.0.2. + + The platforms listed above are known to be stable and working. +However, if you're using the latest development version, you can use it +on the following platforms as well: + + * BSD/OS + + There is a port for BSD/OS (aka BSDI) 2.x and 3.x from Timur + Bakeyev which should also work with 4.x. This isn't tested very + well, but it should be working. + + * Digital Unix + + There is some basic support for Digital Unix (formerly DEC OSF/1) + V3.2C, but this may still be a bit unstable. I'm currently working + on this port as time permits so it should be fully supported soon. + + * Solaris + + The Solaris port currently works on Solaris 7 and maybe also on + other releases. Thanks a lot to Drazen Kacar and everyone who + helped working on this port. They have really done excellent work + here and I'm pretty sure that this port will be fully functional on + most Solaris versions in near future. + + +File: libgtop2.info, Node: Mailing List, Next: Thanks, Prev: Supported Platforms, Up: About + +1.3 Mailing List +================ + +There is a mailing list for people who +want to help with the development of LibGTop. + + It is meant as a low-traffic, but high content-list where we can +discuss technical details such as adding new sysdeps ports etc. + + Especially, I'd like to see people with a deeper knowledge of +operating systems internals joining my list so we can discuss technical +details of the sysdeps code. + + It is *not* for users that want to know how to compile LibGTop etc. + + You can subscribe to this mailing list and view the mailing list +archives on the LibGTop Page at +. + + +File: libgtop2.info, Node: Thanks, Prev: Mailing List, Up: About + +1.4 Thanks +========== + +At the place I'd like to thank the following people who contributed to +LibGTop (listed in chronological order): + + * Sebastian Wilhelmi who had the initial idea of LibGTop and helped + me a lot in the early beginning. + * Josh Sled for the initial FreeBSD port. + * Jeremy Lea for his BSD patches. + * Timur Bakeyev for the BSDI port. + * Drazen Kacar and the other people on the LibGTop development + mailing list for the Solaris port. + * Kevin Vandersloot for the effort to port to GNOME 2.0. + * All people sending me patches, having good ideas, ... + * Everyone I have forgotten in this list ... + + +File: libgtop2.info, Node: White Paper, Next: Reference Manual, Prev: About, Up: Top + +2 LibGTop White Paper +********************* + +* Menu: + +* Introduction:: Introduction +* Overview:: Overview + + +File: libgtop2.info, Node: Introduction, Next: Overview, Prev: White Paper, Up: White Paper + +2.1 Introduction +================ + +Many modern UNIX systems like Solaris, BSD or Digitial Unix only allow +priviledged processes to read information like CPU and Memory Usage or +information about running processes. + + * BSD, for instance, doesn't have any other way to get those data + than reading directly from '/dev/kmem' and you need to be in the + 'kmem' group to be able to read this. + + * Other systems, like Digital Unix, allow all users to get things + like CPU and Memory statistics, but only root may read information + about any process other than the current one (you may not even get + information about your own processes if you're not root). + + * Linux has a very nice '/proc' filesystem, but reading and parsing + '/proc' is very slow and inefficient. + + * Solaris is a bit better, but you still need to be in the 'sys' + group or even root to get some data. + + Because of this system utilities like 'ps', 'uptime' or 'top' often +are setgid kmem or setuid root. Usually, they're also very specific to +the system they're written for and not easily portable to other systems +without a lot of work. + + This, of cause, becomes a problem for graphical tools like 'gtop' - +making a GTK+ program setgid or even setuid would be a security hole as +big as you can drive the entire X11 source code through. For the GNOME +project, we also needed some kind of library which provides all the +required information in a portable since there's more than just one +single program that wants to use them - for instance 'gtop' and the +'multiload', 'cpumemusage' and 'netload' panel applets. + + +File: libgtop2.info, Node: Overview, Prev: Introduction, Up: White Paper + +2.2 Overview +============ + +This section should give you a short overview on how LibGTop was +developed, which things needed to be considered and how it works. + +* Menu: + +* Interface Design:: Things that need to be considered +* Server Implementation:: The LibGTop "server" + + +File: libgtop2.info, Node: Interface Design, Next: Server Implementation, Prev: Overview, Up: Overview + +2.2.1 Interface Design +---------------------- + +At the very beginning, it was necessary to collect all the data the +library part should provide and put them into some C structures. This +was not that easiy as it might sound since LibGTop should be portable to +any modern UNIX system with a common library part on all those systems, +but the data that should be returned vary from system to system. For +instance some systems support shared memory, but some others may not. + + The header files where we define these C structures (which are +system-independent) are shared between client and server. This way we +can call the system dependent code directly where we do not need any +special privileges to do so. + + All of those structures contain a 'flags' member which is interpreted +as a bit mask and tells the caller of the library functions which of the +fields in the returned structure are valid and which are not. + + +File: libgtop2.info, Node: Server Implementation, Prev: Interface Design, Up: Overview + +2.2.2 Server Implementation +--------------------------- + +The LibGTop "server" is a setgid/setuid binary which contains all the +system dependent code which needs special privileges. It is only build +if it's required on the current system (for instance, the Linux kernel +provides all the required data via its '/proc' filesystem so we do not +need the server at all) and it only contains the "features" which need +privileges. + + Whenever we do not need any privileges to get all the data for some +of the requested structures (here called "features") the library calls +the sysdeps code directly rather than using the server. + + +File: libgtop2.info, Node: Reference Manual, Prev: White Paper, Up: Top + +3 LibGTop Reference Manual +************************** + +* Menu: + +* System Dependent:: System Dependent Functions. +* Common Functions:: Common Functions. +* Library Functions:: Library Functions. + + +File: libgtop2.info, Node: System Dependent, Next: Common Functions, Prev: Reference Manual, Up: Reference Manual + +3.1 System Dependent Functions +============================== + +* Menu: + +* glibtop_cpu:: CPU Usage. +* glibtop_mem:: Memory Usage. +* glibtop_swap:: Swap Usage. +* glibtop_uptime:: System Uptime. +* glibtop_loadavg:: Load Average. +* glibtop_proclist:: Process List. +* glibtop_proc_state:: Process State. +* glibtop_proc_uid:: Process UID and TTY Information. +* glibtop_proc_mem:: Process Memory Information. +* glibtop_proc_time:: Process Time Information. +* glibtop_proc_signal:: Process Signal Information. +* glibtop_proc_kernel:: Process Kernel Data Information. +* glibtop_proc_segment:: Process Segment Information. +* glibtop_proc_args:: Process Arguments. +* glibtop_proc_map:: Process Memory Maps. +* glibtop_netload:: Network Load. +* glibtop_ppp:: PPP Usage. + + +File: libgtop2.info, Node: glibtop_cpu, Next: glibtop_mem, Prev: System Dependent, Up: System Dependent + +3.1.1 CPU Usage +--------------- + +Library function 'glibtop_get_cpu': + + void glibtop_get_cpu (glibtop_cpu *buf); + void glibtop_get_cpu_l (glibtop *server, glibtop_cpu *buf); + + Declaration of 'glibtop_cpu' in '': + + typedef struct _glibtop_cpu glibtop_cpu; + + struct _glibtop_cpu + { + guint64 flags, + total, + user, + nice, + sys, + idle, + iowait, + irq, + softirq, + frequency, + xcpu_total [GLIBTOP_NCPU], + xcpu_user [GLIBTOP_NCPU], + xcpu_nice [GLIBTOP_NCPU], + xcpu_sys [GLIBTOP_NCPU], + xcpu_idle [GLIBTOP_NCPU], + xcpu_iowait [GLIBTOP_NCPU], + xcpu_irq [GLIBTOP_NCPU], + xcpu_softirq [GLIBTOP_NCPU], + xcpu_flags; + }; + + All CPU units are measured in "jiffies" which are normally 1/100th of +a second (in which case 'frequency' equals 100), but can also be in any +other unit. To get seconds, divide them by 'frequency'. + +'total' + Number of clock ticks since system boot. + +'user' + Number of clock ticks the system spent in user mode. + +'nice' + Number of clock ticks the system spent in user mode (nice). + +'sys' + Number of clock ticks the system spent in system mode. + +'idle' + Number of clock ticks the system spent in the idle task. + +'iowait' + Number of clock ticks the system spent waiting for I/O to complete. + +'irq' + Number of clock ticks the system spent servicing interrupts. + +'softirq' + Number of clock ticks the system spent servicing softirqs. + +'frequency' + Tick frequency (default is 100). + + The 'xcpu_' values are for SMP systems - they are the same than +'total', 'user', 'nice', 'sys', 'idle', 'iowait', 'irq' and 'softirq' +except that they are arrays of 'GLIBTOP_NCPU' (defined in +'') elements and contain one value for each CPU in the +system. + +'xcpu_flags' + This is interpreted as a bit-field: on systems like Solaris, not + all CPUs need to be running all the time, so we set the + corresponding bit for each CPU that is currently running. + + Please note that all of the cpu values are absolute values measured +in certain units (to get seconds, divide them by 'frequency') since +system boot. To get percentual values, you need to call 'glibtop_cpu', +save the result, wait some time and then call it again and divide the +differences of the two values by the time you have waited. + + +File: libgtop2.info, Node: glibtop_mem, Next: glibtop_swap, Prev: glibtop_cpu, Up: System Dependent + +3.1.2 Memory Usage +------------------ + +Library function 'glibtop_get_mem': + + void glibtop_get_mem (glibtop_mem *buf); + void glibtop_get_mem_l (glibtop *server, glibtop_mem *buf); + + Declaration of 'glibtop_mem' in '': + + typedef struct _glibtop_mem glibtop_mem; + + struct _glibtop_mem + { + guint64 flags, + total, + used, + free, + shared, + buffer, + cached, + user, + locked; + }; + + Unless explicitly stated otherwise, all memory units are in bytes. + +'total' + Total physical memory. + +'used' + Used memory size. + +'free' + Free memory size. + +'shared' + Shared memory size. + + This are both segments that are 'mmap()'ed with 'MAP_SHARED' and + IPC Shared Memory segments. + +'buffer' + Size of buffers. + +'cached' + Size of cached memory. + +'user' + Memory used from user processes. + + This is normally 'total - free - shared - buffer - cached'. + +'locked' + Memory in locked segments. + + +File: libgtop2.info, Node: glibtop_swap, Next: glibtop_uptime, Prev: glibtop_mem, Up: System Dependent + +3.1.3 Swap Usage +---------------- + +Library function 'glibtop_get_swap': + + void glibtop_get_swap (glibtop_swap *buf); + void glibtop_get_swap_l (glibtop *server, glibtop_swap *buf); + + Declaration of 'glibtop_swap' in '': + + typedef struct _glibtop_swap glibtop_swap; + + struct _glibtop_swap + { + guint64 flags, + total, + used, + free, + pagein, + pageout; + }; + + The following units are in bytes. + +'total' + Total swap space in the system. + +'used' + Used swap space. + +'free' + Free swap space. + + You can use 'pagein' and 'pageout' to get some measure about how much +the system is swapping at the moment. They're increased each time a +page is swapped in or out, so you need to save this values, wait a +little bit, get them again and then compare the two results to find out +how much the system swapped in the meantime. + +'pagein' + Total number of swap pages that have been brought in since system + boot + +'pageout' + Total number of swap pages that have been brought out since system + boot + + +File: libgtop2.info, Node: glibtop_uptime, Next: glibtop_loadavg, Prev: glibtop_swap, Up: System Dependent + +3.1.4 Uptime +------------ + +Library function 'glibtop_get_uptime': + + void glibtop_get_uptime (glibtop_uptime *buf); + void glibtop_get_uptime_l (glibtop *server, glibtop_uptime *buf); + + Declaration of 'glibtop_uptime' in '': + + typedef struct _glibtop_uptime glibtop_uptime; + + struct _glibtop_uptime + { + guint64 flags; + double uptime, + idletime; + guint64 boot_time; + }; + + When porting LibGTop to a new system, you only need to implement +'uptime' and 'idletime' if there's a faster or better way to obtain them +as using 'glibtop_cpu' for it. Look at 'sysdeps/freebsd/uptime.c' for +an example on how to obtain them using 'glibtop_cpu'. + +'uptime' + Time in seconds since system boot. + +'idletime' + Time in seconds the system spent in the idle task since system + boot. + + The following one was from a request on the 'linux-kernel' mailing +list; on a laptop with advanced power management 'glibtop_cpu.total' may +not reflect the correct boot time of the system if the power was turned +off by means of APM in the meantime. + +'boot_time' + Time of last system boot in seconds since the epoch. + + +File: libgtop2.info, Node: glibtop_loadavg, Next: glibtop_proclist, Prev: glibtop_uptime, Up: System Dependent + +3.1.5 Load Average +------------------ + +Library function 'glibtop_get_loadavg': + + void glibtop_get_loadavg (glibtop_loadavg *buf); + void glibtop_get_loadavg_l (glibtop *server, glibtop_loadavg *buf); + + Declaration of 'glibtop_loadavg' in '': + + typedef struct _glibtop_loadavg glibtop_loadavg; + + struct _glibtop_loadavg + { + guint64 flags; + double loadavg [3]; + guint64 nr_running, + nr_tasks, + last_pid; + }; + +'loadavg' + + Number of jobs running simultaneously averaged over 1, 5 and 15 + minutes. + + The following fields are Linux specific and deprecated. You don't +need to implement them when porting LibGTop to a new system as they may +be removed in a future version. + +'nr_running' + Number of tasks currently running. + +'nr_tasks' + Total number of tasks. + +'last_pid' + Last PID. + + +File: libgtop2.info, Node: glibtop_proclist, Next: glibtop_proc_state, Prev: glibtop_loadavg, Up: System Dependent + +3.1.6 Process List +------------------ + +Library function 'glibtop_get_proclist': + + unsigned * + glibtop_get_proclist (glibtop_proclist *buf, + gint64 which, gint64 arg); + + unsigned * + glibtop_get_proclist_l (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg); + + Constants for the 'which' argument: + + #define GLIBTOP_KERN_PROC_ALL 0 + #define GLIBTOP_KERN_PROC_PID 1 + #define GLIBTOP_KERN_PROC_PGRP 2 + #define GLIBTOP_KERN_PROC_SESSION 3 + #define GLIBTOP_KERN_PROC_TTY 4 + #define GLIBTOP_KERN_PROC_UID 5 + #define GLIBTOP_KERN_PROC_RUID 6 + + #define GLIBTOP_KERN_PROC_MASK 15 + + #define GLIBTOP_EXCLUDE_IDLE 0x1000 + #define GLIBTOP_EXCLUDE_SYSTEM 0x2000 + #define GLIBTOP_EXCLUDE_NOTTY 0x4000 + + Declaration of 'glibtop_proclist' in '': + + typedef struct _glibtop_proclist glibtop_proclist; + + struct _glibtop_proclist + { + guint64 flags, + number, + total, + size; + }; + + This function returns a list of all or a selected subset of all +running processes. You can use the 'which' and 'arg' arguments to +specify which processes should be returned. + + You can use the following values for the 'which' argument: + +'GLIBTOP_KERN_PROC_ALL' + Return information about all processes (the 'arg' argument is + ignored). + +'GLIBTOP_KERN_PROC_PID' + Return information about all process with the pid PID which is + passed in 'arg'. You can use this to find out whether some process + still exists. + +'GLIBTOP_KERN_PROC_PGRP' + Return all processes in process group PGRP which is passed in + 'arg'. + +'GLIBTOP_KERN_PROC_SESSION' + Return all processes in session SESSION which is passed in 'arg'. + +'GLIBTOP_KERN_PROC_TTY' + Return all processes which have the controlling tty TTY which is + passed in 'arg' (TTY is interpreted as device number). + +'GLIBTOP_KERN_PROC_UID' + Return all processes with effective uid UID which is passed in + 'arg'. + +'GLIBTOP_KERN_PROC_RUID' + Return all processes with real uid RUID which is passed in 'arg'. + + You can alter the list of returned processes by using a binary OR of +'which' and the following constants: + +'GLIBTOP_EXCLUDE_IDLE' + Exclude idle processes. +'GLIBTOP_EXCLUDE_SYSTEM' + Exclude system processes. +'GLIBTOP_EXCLUDE_NOTTY' + Exclude processes without a controlling terminal. + + The return value of 'glibtop_get_proclist' is either 'NULL' on error +or a 'unsigned *' list of pids. Additionally, the following fields of +'glibtop_proclist' are set: + +'number' + Number of entries in the returned list. + +'total' + Total size of the returned list (this equals 'number * size'). + +'size' + Size of a single entry in the returned list (this equals 'sizeof + (unsigned)'). + + The returned list is allocated using 'g_malloc' and must be freed +using 'g_free' to avoid a memory leak. + + +File: libgtop2.info, Node: glibtop_proc_state, Next: glibtop_proc_uid, Prev: glibtop_proclist, Up: System Dependent + +3.1.7 Process State +------------------- + +Library function 'glibtop_get_proc_state': + + void + glibtop_get_proc_state (glibtop_proc_state *buf, pid_t pid); + + void + glibtop_get_proc_state_l (glibtop *server, glibtop_proc_state *buf, + pid_t pid); + + Declaration of 'glibtop_proc_state' in '': + + typedef struct _glibtop_proc_state glibtop_proc_state; + + struct _glibtop_proc_state + { + guint64 flags; + char cmd[40]; + char state; + int uid, + gid, + ruid, + rgid; + int has_cpu, + processor, + last_processor; + + }; + +'cmd' + Basename of the executable file in the call to 'exec'. +'state' + Process state ('R' = running, 'S' = sleeping, 'D' = + uninterruptible, 'Z' = zombie, 'T' = stopped, 'I' = idle). + + This was changed to an 'unsigned' bitfield in LibGTop 1.1.x where + there are also some constants for it. + + When porting LibGTop, please _try hard_ to implement the following +fields. For security reasons, it is *very important* that you *only* +set the 'flags' bits for those fields if their *values are correct*. + +'uid' + Effective UID of the process. +'gid' + Effective GID of the process. +'ruid' + Real UID of the process. +'rgid' + Read GID of the process. + + The following fields are for SMP systems: + +'has_cpu' + This is either 0 or 1 depending on whether the process currently + has a CPU or not. + +'processor' + This is the processor id of the CPU this process is currently + running on (which can be used as index in the 'xcpu_' fields of + 'glibtop_cpu' for instance; since zero is a valid processor id, you + must check 'has_cpu' in this case to find out whether the process + really has a CPU). + +'last_processor' + The is the processor id of the CPU the process was last running on. + +'GLIBTOP_PROCESS_RUNNING' + The process is currently running. +'GLIBTOP_PROCESS_INTERRUPTIBLE' + The process is currently in an interruptible sleep. +'GLIBTOP_PROCESS_UNINTERRUPTIBLE' + The process is currently in uninterruptible sleep (the so-called + "disk sleep"). +'GLIBTOP_PROCESS_ZOMBIE' + The process is a zombie. +'GLIBTOP_PROCESS_STOPPED' + The process is currently stopped (received 'SIGSTOP' or attached to + a debugger). +'GLIBTOP_PROCESS_SWAPPING' + The process is currently swapping. + + +File: libgtop2.info, Node: glibtop_proc_uid, Next: glibtop_proc_mem, Prev: glibtop_proc_state, Up: System Dependent + +3.1.8 Process UID and TTY information +------------------------------------- + +Library function 'glibtop_get_proc_uid': + + void + glibtop_get_proc_uid (glibtop_proc_uid *buf, pid_t pid); + + void + glibtop_get_proc_uid_l (glibtop *server, glibtop_proc_uid *buf, + pid_t pid); + + Declaration of 'glibtop_proc_uid' in '': + + typedef struct _glibtop_proc_uid glibtop_proc_uid; + + struct _glibtop_proc_uid + { + guint64 flags; + int uid, + euid, + gid, + egid, + suid, + sgid, + fsuid, + fsgid, + pid, + ppid, + pgrp, + session, + tty, + tpgid, + priority, + nice, + ngroups, + groups [GLIBTOP_MAX_GROUPS]; + }; + +'uid' + User ID +'euid' + Effective User ID +'gid' + Group ID +'egid' + Effective Group ID +'pid' + Process ID +'ppid' + PID of parent process +'pgrp' + Process group ID +'session' + Session ID +'tty' + Full device number of controlling terminal +'tpgid' + Terminal process group ID +'priority' + Kernel scheduling priority. +'nice' + Standard unix nice level of process. +'ngroups' + Number of additional process groups. +'groups' + Array of additional process groups + ('GLIBTOP_MAX_GROUPS' is defined in ''). + + +File: libgtop2.info, Node: glibtop_proc_mem, Next: glibtop_proc_time, Prev: glibtop_proc_uid, Up: System Dependent + +3.1.9 Process Memory information +-------------------------------- + +Library function 'glibtop_get_proc_mem': + + void + glibtop_get_proc_mem (glibtop_proc_mem *buf, pid_t pid); + + void + glibtop_get_proc_mem_l (glibtop *server, glibtop_proc_mem *buf, + pid_t pid); + + Declaration of 'glibtop_proc_mem' in '': + + typedef struct _glibtop_proc_mem glibtop_proc_mem; + + struct _glibtop_proc_mem + { + guint64 flags, + size, + vsize, + resident, + share, + rss, + rss_rlim; + }; + +'size' + Total number of pages of memory. +'vsize' + Number of pages of virtual memory. +'resident' + Number of residnet set (non-swapped) pages. +'share' + Number of pages of shared (mmap\'d) memory. +'rss' + Number of pages the process has in real memory, minus 3 for + administrative purposes. + + This is just the pages which count towards text, data, or stack + space. This does not include pages which have not been + demand-loaded in, or which are swapped out. +'rss_rlim' + Current limit in bytes on the rss of the process (usually + 2,147,483,647). + + The description above is taken from the manual page of the '/proc' +filesystem under Linux and is a little bit confusing, so I make this +clear here. + + *A word for people porting LibGTop to other systems:* Every operating +system has its own idea about the memory usage of a process and also +system utilities like 'ps' show different things on different systems. + + Nevertheless, we should try to make LibGTop as system independent as +possible, so I give you some hints here how 'glibtop_get_proc_mem' +should work. + + * When you use 'mmap' with either 'MAP_SHARED' or 'MAP_PRIVATE', this + should only affect the 'vsize' of the process and none of its + 'size', 'resident', 'shared' and 'rss' sizes. + + * As soon as you read some of the 'mmap()'ed pages, they will be + demand- oaded and thus count towards the 'size' of the process. + + Also - we assume there is enough free memory - they are resident in + memory until they get stolen or swapped out and thus increase the + 'resident' and 'rss' sizes of the process. + + * If the process has used 'MAP_SHARED' and another process attaches + the same file also 'MAP_SHARED', some of the pages are shared with + this process and thus increase the 'shared' sizes of both + processes. + + * If the process has used 'MAP_PRIVATE' and writes to the 'mmap()'ed + pages, the only difference to reading from them is that they get + dirty and cannot be stolen any longer but will get swapped out. + + * When memory gets rare, clean pages are normally stolen, which + decreases the 'size', 'resident', 'shared' and 'rss' sizes of the + process. + + * When dirty pages are swapped out, this will not decrease the 'size' + of the process but only its 'resident' and 'rss' sizes (dirty pages + cannot be shared). + + * The 'vsize' of a process can _only_ be changed by the process + itself when it requests or frees memory but _never_ due to swapping + activity of the system. + + * If the 'shared' size changes, this _only_ means that the number of + pages that are currently shared with other processes has changed; + if this happens, this will _never_ affect any of the other sizes of + the process. + + The hints above describe how it works under Linux - but we should try +to make 'glibtop_get_proc_mem' show the same behavior under every other +system. + + +File: libgtop2.info, Node: glibtop_proc_time, Next: glibtop_proc_signal, Prev: glibtop_proc_mem, Up: System Dependent + +3.1.10 Process Time information +------------------------------- + +Library function 'glibtop_get_proc_time': + + void + glibtop_get_proc_time (glibtop_proc_time *buf, pid_t pid); + + void + glibtop_get_proc_time_l (glibtop *server, glibtop_proc_time *buf, + pid_t pid); + + Declaration of 'glibtop_proc_time' in '': + + typedef struct _glibtop_proc_time glibtop_proc_time; + + struct _glibtop_proc_time + { + guint64 flags, + start_time, + rtime, + utime, + stime, + cutime, + cstime, + timeout, + it_real_value, + frequency, + xcpu_utime [GLIBTOP_NCPU], + xcpu_stime [GLIBTOP_NCPU], + xcpu_flags; + }; + +'start_time' + Start time of process in seconds since the epoch +'rtime' + Real time accumulated by process (should be 'utime' + 'stime') +'utime' + User-mode CPU time accumulated by process +'stime' + Kernel-mode CPU time accumulated by process +'cutime' + Cumulative utime of process and reaped children +'cstime' + Cumulative stime of process and reaped children +'timeout' + The time (in jiffies) of the process's next timeout +'it_real_value' + The time (in jiffies) before the next SIGALRM is sent to the + process due to an interval timer. +'frequency' + Tick frequency +'xcpu_utime' + SMP user-mode CPU time accumulated by process +'xcpu_stime' + SMP kernel-mode CPU time accumulated by process + + Please note that under Linux, 'start_time' value may be strange. +Linux kernel defines 'INITIAL_JIFFIES' which implies a time shift. +Because 'INITIAL_JIFFIES' is not user-space defined, we cannot use it to +compute accurate 'start_time'. On Linux2.6, 'INITIAL_JIFFIES' is 300 so +'start_time' is always 3s different from real start time of the given +process. You may also get shift results if your system clock is not +synchronised with your hardware clock. See 'man hwclock'. + + +File: libgtop2.info, Node: glibtop_proc_signal, Next: glibtop_proc_kernel, Prev: glibtop_proc_time, Up: System Dependent + +3.1.11 Process Signal information +--------------------------------- + +Library function 'glibtop_get_proc_signal': + + void + glibtop_get_proc_signal (glibtop_proc_signal *buf, pid_t pid); + + void + glibtop_get_proc_signal_l (glibtop *server, glibtop_proc_signal *buf, + pid_t pid); + + Declaration of 'glibtop_proc_signal' in '': + + typedef struct _glibtop_proc_signal glibtop_proc_signal; + + struct _glibtop_proc_signal + { + guint64 flags, + signal [2], + blocked [2], + sigignore [2], + sigcatch [2]; + }; + +'signal' + Mask of pending signals +'blocked' + Mask of blocked signals +'sigignore' + Mask of ignored signals +'sigcatch' + Mask of caught signals + + All signal masks are interpreted as bit mask; it is an array of two +'guint64''s so we can save 128 signals there. + + +File: libgtop2.info, Node: glibtop_proc_kernel, Next: glibtop_proc_segment, Prev: glibtop_proc_signal, Up: System Dependent + +3.1.12 Process Kernel Data information +-------------------------------------- + +Library function 'glibtop_get_proc_kernel': + + void + glibtop_get_proc_kernel (glibtop_proc_kernel *buf, pid_t pid); + + void + glibtop_get_proc_kernel_l (glibtop *server, glibtop_proc_kernel *buf, + pid_t pid); + + Declaration of 'glibtop_proc_kernel' in '': + + typedef struct _glibtop_proc_kernel glibtop_proc_kernel; + + struct _glibtop_proc_kernel + { + guint64 flags; + guint64 k_flags, + min_flt, + maj_flt, + cmin_flt, + cmaj_flt, + kstk_esp, + kstk_eip, + nwchan; + char wchan [40]; + }; + +'k_flags' + Kernel flags of the process. See the constants defined below. +'min_flt' + The number of minor faults the process has made, those which have + not required loading a memory page from disk. +'maj_flt' + The number of major faults the process has made, those which have + required loading a memory page from disk. +'cmin_flt' + The number of minor faults that the process and its children have + made. +'cmaj_flt' + The number of major faults that the process and its children have + made. +'kstk_esp' + The current value of 'esp' (32-bit stack pointer), as found in the + kernel stack page for the process. +'kstk_eip' + The current 'eip' (32-bit instruction pointer). +'nwchan' + This is the "channel" in which the process is waiting. This is the + address of a system call, and can be looked up in a namelist if you + need a textual name. (If you have an up-to-date '/etc/psdatabase', + then try 'ps -l' to see the WCHAN field in action). +'wchan' + This is the textual name of the 'nwchan' field. + + There are some constants for the 'k_flags' field: + + #define GLIBTOP_KFLAGS_STARTING 1 + #define GLIBTOP_KFLAGS_EXITING 2 + #define GLIBTOP_KFLAGS_PTRACED 4 + #define GLIBTOP_KFLAGS_TRACESYS 8 + #define GLIBTOP_KFLAGS_FORKNOEXEC 16 + #define GLIBTOP_KFLAGS_SUPERPRIV 32 + #define GLIBTOP_KFLAGS_DUMPEDCORE 64 + #define GLIBTOP_KFLAGS_SIGNALED 128 + +'GLIBTOP_KFLAGS_STARTING' + Process is being created. +'GLIBTOP_KFLAGS_EXITING' + Process is exiting. +'GLIBTOP_KFLAGS_PTRACED' + Process is being traced (via 'ptrace ()'). +'GLIBTOP_KFLAGS_TRACESYS' + Process is tracing system calls. +'GLIBTOP_KFLAGS_FORKNOEXEC' + Process 'fork()'ed, but didn't 'exec()' yet. +'GLIBTOP_KFLAGS_SUPERPRIV' + Process used super-user privileges. +'GLIBTOP_KFLAGS_DUMPEDCORE' + Process dumped core. +'GLIBTOP_KFLAGS_SIGNALED' + Process was killed by a signal. + + +File: libgtop2.info, Node: glibtop_proc_segment, Next: glibtop_proc_args, Prev: glibtop_proc_kernel, Up: System Dependent + +3.1.13 Process Segment information +---------------------------------- + +Library function 'glibtop_get_proc_segment': + + void + glibtop_get_proc_segment (glibtop_proc_segment *buf, pid_t pid); + + void + glibtop_get_proc_segment_l (glibtop *server, glibtop_proc_segment *buf, + pid_t pid); + + Declaration of 'glibtop_proc_segment' in '': + + typedef struct _glibtop_proc_segment glibtop_proc_segment; + + struct _glibtop_proc_segment + { + guint64 flags, + text_rss, + shlib_rss, + data_rss, + stack_rss, + dirty_size, + start_code, + end_code, + start_stack; + }; + +'text_rss' + Text resident set size +'shlib_rss' + Shared-Lib resident set size +'data_rss' + Data resident set size +'stack_rss' + Stack resident set size +'dirty_size' + Total size of dirty pages +'start_code' + Address of beginning of code segment +'end_code' + Address of end of code segment +'start_stack' + Address of the bottom of stack segmen + + +File: libgtop2.info, Node: glibtop_proc_args, Next: glibtop_proc_map, Prev: glibtop_proc_segment, Up: System Dependent + +3.1.14 Process Arguments +------------------------ + +Library function 'glibtop_get_proc_args': + + char * + glibtop_get_proc_args(glibtop_proc_args *buf, pid_t pid, + unsigned max_len); + + char * + glibtop_get_proc_args_l (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len); + + Declaration of 'glibtop_proc_args' in '': + + typedef struct _glibtop_proc_args glibtop_proc_args; + + struct _glibtop_proc_args + { + guint64 flags, + size; + }; + + Returns a string with all command line arguments of process 'pid' (up +to 'max_len' characters, use zero to get all arguments). + + The command line arguments in the returned string are separated by +zero bytes; the lenght of this string is returned in the 'size' field. + + Remember to 'g_free' the returned string to avoid a memory leak. + + *New functions* + + char ** + glibtop_get_proc_argv(glibtop_proc_args *buf, pid_t pid, + unsigned max_len); + + char ** + glibtop_get_proc_argv_l (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len); + + Returns a NULL-terminated array of strings with all arguments of +process 'pid' (up to 'max_len' characters, use zero to get all +arguments). 'glibtop_get_proc_argv()' and 'glibtop_get_proc_argv_l()' +are wrappers to 'glibtop_get_proc_args()' and +'glibtop_get_proc_args_l()' that return process' arguments like the C +'argv'. + + Remember to 'g_strfreev' the returned array to avoid a memory leak. + + +File: libgtop2.info, Node: glibtop_proc_map, Next: glibtop_netload, Prev: glibtop_proc_args, Up: System Dependent + +3.1.15 Process Memory Maps +-------------------------- + +Library function 'glibtop_get_proc_map': + + glibtop_map_entry * + glibtop_get_proc_map (glibtop_proc_map *buf, pid_t pid); + + glibtop_map_entry * + glibtop_get_proc_map_l (glibtop *server, glibtop_proc_map *buf, + pid_t pid); + + Declaration of 'glibtop_proc_map' in '': + + typedef struct _glibtop_proc_map glibtop_proc_map; + + struct _glibtop_proc_map + { + guint64 flags, + number, + total, + size; + }; + + Returns a 'glibtop_map_entry *' list (which needs to be freed with +'g_free') of memory maps of process 'pid'. + +'number' + Number of entries in the returned list. + +'total' + Total size of the returned list (this equals 'number * size'). + +'size' + Size of a single entry in the returned list (this equals 'sizeof + (glibtop_map_entry)'). + + typedef struct _glibtop_map_entry glibtop_map_entry; + + struct _glibtop_map_entry + { + guint64 flags, start, end, offset, perm, inode, device; + char filename [GLIBTOP_MAP_FILENAME_LEN+1]; + }; + + The 'flags' member is a bit field and specifies which of the other +fields are valid: + + #define GLIBTOP_MAP_ENTRY_START 0 + #define GLIBTOP_MAP_ENTRY_END 1 + #define GLIBTOP_MAP_ENTRY_OFFSET 2 + #define GLIBTOP_MAP_ENTRY_PERM 3 + #define GLIBTOP_MAP_ENTRY_INODE 4 + #define GLIBTOP_MAP_ENTRY_DEVICE 5 + #define GLIBTOP_MAP_ENTRY_FILENAME 6 + + Constants for the 'perm' member: + + #define GLIBTOP_MAP_PERM_READ 1 + #define GLIBTOP_MAP_PERM_WRITE 2 + #define GLIBTOP_MAP_PERM_EXECUTE 4 + #define GLIBTOP_MAP_PERM_SHARED 8 + #define GLIBTOP_MAP_PERM_PRIVATE 16 + + +File: libgtop2.info, Node: glibtop_netload, Next: glibtop_ppp, Prev: glibtop_proc_map, Up: System Dependent + +3.1.16 Network Load +------------------- + +Library function 'glibtop_get_netload': + + void + glibtop_get_netload (glibtop_netload *buf, const char *interface); + + void + glibtop_get_netload_l (glibtop *server, glibtop_netload *buf, + const char *interface); + + Declaration of 'glibtop_netload' in '': + + typedef struct _glibtop_netload glibtop_netload; + + struct _glibtop_netload + { + guint64 flags, + if_flags, + mtu, + subnet, + address, + packets_in, + packets_out, + packets_total, + bytes_in, + bytes_out, + bytes_total, + errors_in, + errors_out, + errors_total, + collisions; + }; + + Returns network statistics for interface 'interface' (which is the +same than in 'ifconfig'). + +'if_flags' + Interface flags. See the contants defined below. +'mtu' + Maximum Transfer Unit (MTU) +'subnet' + Subnet Address +'address' + Interface Address +'packets_in' + Total number of incoming packets +'packets_out' + Total number of outgoing packets +'packets_total' + Total number of packets +'bytes_in' + Total number of incoming bytes +'bytes_out' + Total number of outgoing bytes +'bytes_total' + Total number of bytes +'errors_in' + Total number of errors in incoming direction +'errors_out' + Total number of errors in outgoing direction +'errors_total' + Total number of errors +'collisions' + Total number of collisions + + Please note that not all operating systems distinguish between +incoming/outgoing bytes/packets/errors - in this case only the '_total' +fields are valid. Otherwise, they're just '_in' plus '_out'. + + Constants for 'if_flags': + + enum { + GLIBTOP_IF_FLAGS_UP = 1, + GLIBTOP_IF_FLAGS_BROADCAST, + GLIBTOP_IF_FLAGS_DEBUG, + GLIBTOP_IF_FLAGS_LOOPBACK, + GLIBTOP_IF_FLAGS_POINTOPOINT, + GLIBTOP_IF_FLAGS_RUNNING, + GLIBTOP_IF_FLAGS_NOARP, + GLIBTOP_IF_FLAGS_PROMISC, + GLIBTOP_IF_FLAGS_ALLMULTI, + GLIBTOP_IF_FLAGS_OACTIVE, + GLIBTOP_IF_FLAGS_SIMPLEX, + GLIBTOP_IF_FLAGS_LINK0, + GLIBTOP_IF_FLAGS_LINK1, + GLIBTOP_IF_FLAGS_LINK2, + GLIBTOP_IF_FLAGS_ALTPHYS, + GLIBTOP_IF_FLAGS_MULTICAST + }; + + +File: libgtop2.info, Node: glibtop_ppp, Prev: glibtop_netload, Up: System Dependent + +3.1.17 PPP Statistics +--------------------- + +Library function 'glibtop_get_ppp': + + void + glibtop_get_ppp_l (glibtop *server, glibtop_ppp *buf, + unsigned short device); + + void + glibtop_get_ppp (glibtop_ppp *buf, unsigned short device); + + Declaration of 'glibtop_ppp' in '': + + typedef struct _glibtop_ppp glibtop_ppp; + + struct _glibtop_ppp + { + guint64 flags, + state, + bytes_in, + bytes_out; + }; + +'bytes_in' + Number of input bytes +'bytes_out' + Number of output bytes + + There are some constants for 'state': + + enum { + GLIBTOP_PPP_STATE_UNKNOWN = 0, + GLIBTOP_PPP_STATE_HANGUP, + GLIBTOP_PPP_STATE_ONLINE + }; + +'GLIBTOP_PPP_STATE_UNKNOWN' + LibGTop was unable to determine the current ppp state. +'GLIBTOP_PPP_STATE_HANGUP' + We're currently offline. +'GLIBTOP_PPP_STATE_ONLINE' + We're currently online. + + +File: libgtop2.info, Node: Common Functions, Next: Library Functions, Prev: System Dependent, Up: Reference Manual + +3.2 Common Functions +==================== + +This are functions which a common implementation for all systems; we +never use the server for them. + + The file system code is taken from GNU Fileutils. + +* Menu: + +* glibtop_mountlist:: Mount List. +* glibtop_fsusage:: File System Usage. + + +File: libgtop2.info, Node: glibtop_mountlist, Next: glibtop_fsusage, Prev: Common Functions, Up: Common Functions + +3.2.1 Mount List +---------------- + +Library function 'glibtop_get_mountlist': + + glibtop_mountentry * + glibtop_get_mountlist_l (glibtop *server, glibtop_mountlist *buf, + int all_fs); + + glibtop_mountentry * + glibtop_get_mountlist (glibtop_mountlist *buf, int all_fs); + + The 'all_fs' parameter specifies whether information about all +filesystems should be returned; this will include filesystem types like +'autofs' and 'procfs'. You should not use this in disk usage programs, +but it can be useful to get a list of all currently mounted filesystems. + + Declaration of 'glibtop_proc_map' in '': + + typedef struct _glibtop_mountlist glibtop_mountlist; + + struct _glibtop_mountlist + { + guint64 flags, + number, + total, + size; + }; + + Returns a 'glibtop_mountentry *' list (which needs to be freed with +'g_free') of mounted filesystems. + +'number' + Number of entries in the returned list. + +'total' + Total size of the returned list (this equals 'number * size'). + +'size' + Size of a single entry in the returned list (this equals 'sizeof + (glibtop_mountentry)'). + + typedef struct _glibtop_mountentry glibtop_mountentry; + + struct _glibtop_mountentry + { + guint64 dev; + char devname [GLIBTOP_MOUNTENTRY_LEN+1]; + char mountdir [GLIBTOP_MOUNTENTRY_LEN+1]; + char type [GLIBTOP_MOUNTENTRY_LEN+1]; + }; + + 'GLIBTOP_MOUNTENTRY_LEN' is defined in ''. + +'devname' + Full pathname (such as '/dev/sdb1' for instance) to the mounted + device. +'mountdir' + Full pathname of the mountpoint (such as '/usr/local' for + instance). +'type' + Filesystem type as a textual string (such as 'ext2fs'). + + +File: libgtop2.info, Node: glibtop_fsusage, Prev: glibtop_mountlist, Up: Common Functions + +3.2.2 File System Usage +----------------------- + +Library function 'glibtop_get_fsusage': + + void + glibtop_get_fsusage_l (glibtop *server, glibtop_fsusage *buf, + const char *mount_dir); + + void + glibtop_get_fsusage (glibtop_fsusage *buf, const char *mount_dir); + + Declaration of 'glibtop_fsusage' in '': + + typedef struct _glibtop_fsusage glibtop_fsusage; + + struct _glibtop_fsusage + { + guint64 flags, + blocks, + bfree, + bavail, + files, + ffree; + guint32 block_size; + guint64 read, + write; + }; + +'blocks' + Total blocks in the filesystem. +'bfree' + Free blocks available to the superuser. +'bavail' + Free blocks available to ordinary users. +'files' + Total file nodes. +'ffree' + Free file nodes. +'block_size' + Block size in bytes. +'read' + Total blocks read. +'write' + Total blocks written. + + +File: libgtop2.info, Node: Library Functions, Prev: Common Functions, Up: Reference Manual + +3.3 Library Functions +===================== + +This are general library functions which can be used to get information +about the library and to control its behavior. + +* Menu: + +* glibtop_init:: Server Initialization. +* glibtop_sysdeps:: Server Sysdeps. +* Library Parameters:: Library Parameters. + + +File: libgtop2.info, Node: glibtop_init, Next: glibtop_sysdeps, Prev: Library Functions, Up: Library Functions + +3.3.1 Server Initialization +--------------------------- + +You do not need to worry about the 'glibtop *' server structure if you +don't need - the library exports a 'glibtop_global_server' which you can +use everywhere a 'glibtop *' is expected. + + Most of the library and all of the sysdeps function also have an +alias (which is the function name without the '_l', '_s' or '_r' suffix) +which don't take a 'glibtop *' as argument but uses the +'glibtop_global_server' instead. + + extern glibtop *glibtop_global_server; + + Library function 'glibtop_init': + + glibtop * + glibtop_init_r (glibtop **server_ptr, unsigned long features, + unsigned flags); + + void + glibtop_init (void); + + This function initializes a LibGTop server. It is automatically +called when you use any of the LibGTop functions and will use the global +server in this case. + + However, it's appreciated to call 'glibtop_init' during the +initialization of your application. + + You can for instance use + + glibtop_init (); + +which is equivalent to + + glibtop_init_r (&glibtop_global_server, 0, 0); + + Please note that the 'server_ptr' argument is a pointer to a pointer +(and thus is of type 'glibtop **'). + + To control what 'glibtop_init' should actually do, you can use the +'features' and 'flags' arguments. + + The 'features' argument is a bit-mask (interpreted in the same way +than 'sysdeps.features') and tells the library which features you're +interested in. The library will only start the server if this is +required for any of those features. + + You can use the following constants for the 'flags' parameter to +control the behavior of the library: + +'GLIBTOP_INIT_NO_INIT' + Tells the library to do nothing. If the value pointed to by the + 'server_ptr' argument is 'NULL', it will set it to the + 'glibtop_global_server' and then return. +'GLIBTOP_INIT_NO_OPEN' + Do the initialization, but do not start the server. + + To modify the way the 'features' are interpretet, you can use the +following constants for 'flags' (as a bit mask): + +'GLIBTOP_FEATURES_NO_SERVER' + Never use the server, always call the sysdeps code directly. If + you require any privileges to get them and you don't have those + privileges, the this will obviously not work and the library will + fail to return some or all of the requested values. +'GLIBTOP_FEATURES_EXCEPT' + Inverts the matching of the 'features' parameter, i.e. if you use + this flag this means that 'features' are all the features you are + _not_ interested in. Might be useful to say something like "I want + everything but ppp". + + +File: libgtop2.info, Node: glibtop_sysdeps, Next: Library Parameters, Prev: glibtop_init, Up: Library Functions + +3.3.2 Server Sysdeps +-------------------- + +Library function 'glibtop_get_sysdeps': + + void + glibtop_get_sysdeps_r (glibtop *server, glibtop_sysdeps *buf); + + void + glibtop_get_sysdeps (glibtop_sysdeps *buf); + + Declaration of 'glibtop_sysdeps' in '': + + typedef struct _glibtop_sysdeps glibtop_sysdeps; + + struct _glibtop_sysdeps + { + guint64 flags, + features, + pointer_size, + cpu, + mem, + swap, + uptime, + loadavg, + shm_limits, + msg_limits, + sem_limits, + proclist, + proc_state, + proc_uid, + proc_mem, + proc_time, + proc_signal, + proc_kernel, + proc_segment, + proc_args, + proc_map, + mountlist, + fsusage, + netload, + ppp; + }; + +'features' + This is a bit field (the so-called "server features") stating for + which features we need to use the server. +'pointer_size' + This was added in LibGTop 1.1.0 and tells you the number of bits a + 'void*' has in the server (this may be different from the size on + the client machine if we're talking over the daemon to a remove + machine). + + The following constants from '' serve as +bit-indices for the 'features' field: + + #define GLIBTOP_SYSDEPS_CPU 0 + #define GLIBTOP_SYSDEPS_MEM 1 + #define GLIBTOP_SYSDEPS_SWAP 2 + #define GLIBTOP_SYSDEPS_UPTIME 3 + #define GLIBTOP_SYSDEPS_LOADAVG 4 + #define GLIBTOP_SYSDEPS_SHM_LIMITS 5 + #define GLIBTOP_SYSDEPS_MSG_LIMITS 6 + #define GLIBTOP_SYSDEPS_SEM_LIMITS 7 + #define GLIBTOP_SYSDEPS_PROCLIST 8 + #define GLIBTOP_SYSDEPS_PROC_STATE 9 + #define GLIBTOP_SYSDEPS_PROC_UID 10 + #define GLIBTOP_SYSDEPS_PROC_MEM 11 + #define GLIBTOP_SYSDEPS_PROC_TIME 12 + #define GLIBTOP_SYSDEPS_PROC_SIGNAL 13 + #define GLIBTOP_SYSDEPS_PROC_KERNEL 14 + #define GLIBTOP_SYSDEPS_PROC_SEGMENT 15 + #define GLIBTOP_SYSDEPS_PROC_ARGS 16 + #define GLIBTOP_SYSDEPS_PROC_MAP 17 + #define GLIBTOP_SYSDEPS_MOUNTLIST 18 + #define GLIBTOP_SYSDEPS_FSUSAGE 19 + #define GLIBTOP_SYSDEPS_NETLOAD 20 + #define GLIBTOP_SYSDEPS_PPP 21 + + +File: libgtop2.info, Node: Library Parameters, Prev: glibtop_sysdeps, Up: Library Functions + +3.3.3 Library Parameters +------------------------ + +Library function 'glibtop_get_parameter': + + size_t + glibtop_get_parameter_l (glibtop *server, const unsigned parameter, + void *data_ptr, size_t data_size); + + size_t + glibtop_get_parameter (const unsigned parameter, void *data_ptr, + size_t data_size); + + This function is used to retrieve a library parameter (see below for +a more detailed description). It returns the size of the retrieved +parameter on success, zero on failure or minus the actual size of the +parameter if 'data_size' was too small. + + You may call this function with 'data_ptr' set to 'NULL' to get the +actual size of a parameter (as a negative value). + +'parameter' + The parameter you want to retrieve (see below for constants). +'data_ptr' + Pointer to a place where the parameter should be stored. +'data_size' + Maximum size of the parameter. + + Library function 'glibtop_set_parameter': + + void + glibtop_set_parameter_l (glibtop *server, const unsigned parameter, + const void *data_ptr, size_t data_size); + + void + glibtop_set_parameter (const unsigned parameter, const void *data_ptr, + size_t data_size); + + This function is used to modify a library parameter. Please not that +you may not set all parameters since some of them are read-only. + +'parameter' + The parameter you want to modify (see below for constants). +'data_ptr' + Pointer to the value which should be set. +'data_size' + Size of the new value. For fixed-size parameters, this must match + the exact size of the parameter or you'll get an error. + + The following parameters are defined in '': + +'GLIBTOP_PARAM_FEATURES' + This is a read-only 'unsigned long' representing the 'features' + field of 'glibtop_sysdeps'. +'GLIBTOP_PARAM_REQUIRED' + This is a 'glibtop_sysdeps' structure specifying which features the + client requires the library return. If it fails to get any of + them, you'll get an error. +'GLIBTOP_PARAM_ERROR_METHOD' + This is an 'unsigned' telling the library what to do if it fails to + get any of the features that are marked as required via the + 'GLIBTOP_PARAM_REQUIRED' parameter (see below for constants). + + You can use the following constants for 'GLIBTOP_PARAM_ERROR_METHOD' +(defined in ''): + +'GLIBTOP_ERROR_METHOD_IGNORE' + Ignore the error condition. +'GLIBTOP_ERROR_METHOD_WARN_ONCE' + Warn once about the absense of some of the required features, then + modify 'GLIBTOP_PARAM_REQUIRED' so that the missing ones are no + longer required. This is the prefered value for applications since + it'll only print out the warning message once and not each time the + library tries to get one of those features. +'GLIBTOP_ERROR_METHOD_WARN' + Warn each time the library fails to get some of the required + features. +'GLIBTOP_ERROR_METHOD_ABORT' + Abort if the library fails to get some of the required features. + This should not be used by applications. + + + +Tag Table: +Node: Top1206 +Node: About3357 +Node: Availability4235 +Node: Supported Platforms4855 +Node: Mailing List6466 +Node: Thanks7238 +Node: White Paper7948 +Node: Introduction8181 +Node: Overview9896 +Node: Interface Design10263 +Node: Server Implementation11290 +Node: Reference Manual12007 +Node: System Dependent12311 +Node: glibtop_cpu13386 +Node: glibtop_mem16013 +Node: glibtop_swap17175 +Node: glibtop_uptime18407 +Node: glibtop_loadavg19702 +Node: glibtop_proclist20710 +Node: glibtop_proc_state23917 +Node: glibtop_proc_uid26483 +Node: glibtop_proc_mem28055 +Node: glibtop_proc_time31750 +Node: glibtop_proc_signal33902 +Node: glibtop_proc_kernel34947 +Node: glibtop_proc_segment37832 +Node: glibtop_proc_args39070 +Node: glibtop_proc_map40812 +Node: glibtop_netload42789 +Node: glibtop_ppp45297 +Node: Common Functions46355 +Node: glibtop_mountlist46780 +Node: glibtop_fsusage48696 +Node: Library Functions49789 +Node: glibtop_init50216 +Node: glibtop_sysdeps52967 +Node: Library Parameters55578 + +End Tag Table diff --git a/doc/libgtop2.texi b/doc/libgtop2.texi new file mode 100644 index 0000000..8ca6685 --- /dev/null +++ b/doc/libgtop2.texi @@ -0,0 +1,88 @@ +\input texinfo @c -*-texinfo-*- +@c %**start of header +@setfilename libgtop2.info +@settitle LibGTop Reference Manual +@setchapternewpage odd +@c %**end of header + +@include version.texi + +@ifinfo +This is the LibGTop Reference Manual version @value{VERSION} +(last modified @value{UPDATED}). + +Copyright 1999 Free Software Foundation, Inc. + +Permission is granted to make and distribute verbatim +copies of this manual provided the copyright notice and +this permission notice are preserved on all copies. + +@ignore +Permission is granted to process this file through TeX +and print the results, provided the printed document +carries a copying permission notice identical to this +one except for the removal of this paragraph (this +paragraph not being relevant to the printed manual). + +@end ignore +Permission is granted to copy and distribute modified +versions of this manual under the conditions for +verbatim copying, provided also that the sections +entitled ``Copying'' and ``GNU General Public License'' +are included exactly as in the original, and provided +that the entire resulting derived work is distributed +under the terms of a permission notice identical to this +one. + +Permission is granted to copy and distribute +translations of this manual into another language, +under the above conditions for modified versions, +except that this permission notice may be stated in a +translation approved by the Free Software Foundation. + +@format +@dircategory Libraries: +@direntry +* LibGTop2: (libgtop2). Library to get system specific data + such as cpu and memory usage, active + processes +@end direntry +@end format + +@end ifinfo + +@titlepage +@title LibGTop Reference Manual +@subtitle Version @value{VERSION} - @value{UPDATED} +@author Martin Baulig + +@page +@vskip 0pt plus 1filll +Copyright @copyright{} 1999 Free Software Foundation, Inc. + +Permission is granted to make and distribute verbatim +copies of this manual provided the copyright notice and +this permission notice are preserved on all copies. + +Permission is granted to copy and distribute modified +versions of this manual under the conditions for +verbatim copying, provided also that the sections +entitled ``Copying'' and ``GNU General Public License'' +are included exactly as in the original, and provided +that the entire resulting derived work is distributed +under the terms of a permission notice identical to this +one. + +Permission is granted to copy and distribute +translations of this manual into another language, +under the above conditions for modified versions, +except that this permission notice may be stated in a +translation approved by the Free Software Foundation. +@end titlepage + +@contents + +@include main.texi + +@bye + diff --git a/doc/main.texi b/doc/main.texi new file mode 100644 index 0000000..6945d65 --- /dev/null +++ b/doc/main.texi @@ -0,0 +1,68 @@ +@node Top, About, (dir), (dir) + +@menu +* About:: About LibGTop +* White Paper:: LibGTop White Paper +* Reference Manual:: LibGTop Reference Manual + + --- The Detailed Node Listing --- + +About LibGTop + +* Availability:: Where to get LibGTop +* Supported Platforms:: Supported Platforms +* Mailing List:: Helping with LibGTop development +* Thanks:: People who contributed to LibGTop + +LibGTop White Paper + +* Introduction:: Introduction +* Overview:: Overview + +Overview + +* Interface Design:: Things that need to be considered +* Server Implementation:: The LibGTop "server" + +LibGTop Reference Manual + +* System Dependent:: System Dependent Functions. +* Common Functions:: Common Functions. +* Library Functions:: Library Functions. + +System Dependent Functions + +* glibtop_cpu:: CPU Usage. +* glibtop_mem:: Memory Usage. +* glibtop_swap:: Swap Usage. +* glibtop_uptime:: System Uptime. +* glibtop_loadavg:: Load Average. +* glibtop_proclist:: Process List. +* glibtop_proc_state:: Process State. +* glibtop_proc_uid:: Process UID and TTY Information. +* glibtop_proc_mem:: Process Memory Information. +* glibtop_proc_time:: Process Time Information. +* glibtop_proc_signal:: Process Signal Information. +* glibtop_proc_kernel:: Process Kernel Data Information. +* glibtop_proc_segment:: Process Segment Information. +* glibtop_proc_args:: Process Arguments. +* glibtop_proc_map:: Process Memory Maps. +* glibtop_netload:: Network Load. +* glibtop_ppp:: PPP Usage. + +Common Functions + +* glibtop_mountlist:: Mount List. +* glibtop_fsusage:: File System Usage. + +Library Functions + +* glibtop_init:: Server Initialization. +* glibtop_sysdeps:: Server Sysdeps. +* Library Parameters:: Library Parameters. +@end menu + +@include about.texi +@include white-paper.texi +@include reference.texi + diff --git a/doc/mdate-sh b/doc/mdate-sh new file mode 100755 index 0000000..e8dfaca --- /dev/null +++ b/doc/mdate-sh @@ -0,0 +1,224 @@ +#!/bin/sh +# Get modification time of a file or directory and pretty-print it. + +scriptversion=2010-08-21.06; # UTC + +# Copyright (C) 1995-2014 Free Software Foundation, Inc. +# written by Ulrich Drepper , June 1995 +# +# 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, see . + +# 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. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +fi + +case $1 in + '') + echo "$0: No file. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: mdate-sh [--help] [--version] FILE + +Pretty-print the modification day of FILE, in the format: +1 January 1970 + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "mdate-sh $scriptversion" + exit $? + ;; +esac + +error () +{ + echo "$0: $1" >&2 + exit 1 +} + + +# Prevent date giving response in another language. +LANG=C +export LANG +LC_ALL=C +export LC_ALL +LC_TIME=C +export LC_TIME + +# GNU ls changes its time format in response to the TIME_STYLE +# variable. Since we cannot assume 'unset' works, revert this +# variable to its documented default. +if test "${TIME_STYLE+set}" = set; then + TIME_STYLE=posix-long-iso + export TIME_STYLE +fi + +save_arg1=$1 + +# Find out how to get the extended ls output of a file or directory. +if ls -L /dev/null 1>/dev/null 2>&1; then + ls_command='ls -L -l -d' +else + ls_command='ls -l -d' +fi +# Avoid user/group names that might have spaces, when possible. +if ls -n /dev/null 1>/dev/null 2>&1; then + ls_command="$ls_command -n" +fi + +# A 'ls -l' line looks as follows on OS/2. +# drwxrwx--- 0 Aug 11 2001 foo +# This differs from Unix, which adds ownership information. +# drwxrwx--- 2 root root 4096 Aug 11 2001 foo +# +# To find the date, we split the line on spaces and iterate on words +# until we find a month. This cannot work with files whose owner is a +# user named "Jan", or "Feb", etc. However, it's unlikely that '/' +# will be owned by a user whose name is a month. So we first look at +# the extended ls output of the root directory to decide how many +# words should be skipped to get the date. + +# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. +set x`$ls_command /` + +# Find which argument is the month. +month= +command= +until test $month +do + test $# -gt 0 || error "failed parsing '$ls_command /' output" + shift + # Add another shift to the command. + command="$command shift;" + case $1 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; + esac +done + +test -n "$month" || error "failed parsing '$ls_command /' output" + +# Get the extended ls output of the file or directory. +set dummy x`eval "$ls_command \"\\\$save_arg1\""` + +# Remove all preceding arguments +eval $command + +# Because of the dummy argument above, month is in $2. +# +# On a POSIX system, we should have +# +# $# = 5 +# $1 = file size +# $2 = month +# $3 = day +# $4 = year or time +# $5 = filename +# +# On Darwin 7.7.0 and 7.6.0, we have +# +# $# = 4 +# $1 = day +# $2 = month +# $3 = year or time +# $4 = filename + +# Get the month. +case $2 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; +esac + +case $3 in + ???*) day=$1;; + *) day=$3; shift;; +esac + +# Here we have to deal with the problem that the ls output gives either +# the time of day or the year. +case $3 in + *:*) set `date`; eval year=\$$# + case $2 in + Jan) nummonthtod=1;; + Feb) nummonthtod=2;; + Mar) nummonthtod=3;; + Apr) nummonthtod=4;; + May) nummonthtod=5;; + Jun) nummonthtod=6;; + Jul) nummonthtod=7;; + Aug) nummonthtod=8;; + Sep) nummonthtod=9;; + Oct) nummonthtod=10;; + Nov) nummonthtod=11;; + Dec) nummonthtod=12;; + esac + # For the first six month of the year the time notation can also + # be used for files modified in the last year. + if (expr $nummonth \> $nummonthtod) > /dev/null; + then + year=`expr $year - 1` + fi;; + *) year=$3;; +esac + +# The result. +echo $day $month $year + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/doc/reference.texi b/doc/reference.texi new file mode 100644 index 0000000..cdba688 --- /dev/null +++ b/doc/reference.texi @@ -0,0 +1,1846 @@ +@node Reference Manual, , White Paper, Top +@chapter LibGTop Reference Manual + +@menu +* System Dependent:: System Dependent Functions. +* Common Functions:: Common Functions. +* Library Functions:: Library Functions. +@end menu + +@node System Dependent, Common Functions, Reference Manual, Reference Manual +@section System Dependent Functions + +@menu +* glibtop_cpu:: CPU Usage. +* glibtop_mem:: Memory Usage. +* glibtop_swap:: Swap Usage. +* glibtop_uptime:: System Uptime. +* glibtop_loadavg:: Load Average. +* glibtop_proclist:: Process List. +* glibtop_proc_state:: Process State. +* glibtop_proc_uid:: Process UID and TTY Information. +* glibtop_proc_mem:: Process Memory Information. +* glibtop_proc_time:: Process Time Information. +* glibtop_proc_signal:: Process Signal Information. +* glibtop_proc_kernel:: Process Kernel Data Information. +* glibtop_proc_segment:: Process Segment Information. +* glibtop_proc_args:: Process Arguments. +* glibtop_proc_map:: Process Memory Maps. +* glibtop_netload:: Network Load. +* glibtop_ppp:: PPP Usage. +@end menu + +@node glibtop_cpu, glibtop_mem, System Dependent, System Dependent +@subsection CPU Usage + +Library function @code{glibtop_get_cpu}: + +@example +@cartouche +void glibtop_get_cpu (glibtop_cpu *buf); +void glibtop_get_cpu_l (glibtop *server, glibtop_cpu *buf); +@end cartouche +@end example + +Declaration of @code{glibtop_cpu} in @file{}: + +@example +@cartouche +typedef struct _glibtop_cpu glibtop_cpu; + +struct _glibtop_cpu +@{ + guint64 flags, + total, + user, + nice, + sys, + idle, + iowait, + irq, + softirq, + frequency, + xcpu_total [GLIBTOP_NCPU], + xcpu_user [GLIBTOP_NCPU], + xcpu_nice [GLIBTOP_NCPU], + xcpu_sys [GLIBTOP_NCPU], + xcpu_idle [GLIBTOP_NCPU], + xcpu_iowait [GLIBTOP_NCPU], + xcpu_irq [GLIBTOP_NCPU], + xcpu_softirq [GLIBTOP_NCPU], + xcpu_flags; +@}; +@end cartouche +@end example + +All CPU units are measured in @dfn{jiffies} which are normally 1/100th of a +second (in which case @code{frequency} equals 100), but can also be in any +other unit. To get seconds, divide them by @code{frequency}. + +@table @code +@item total +Number of clock ticks since system boot. + +@item user +Number of clock ticks the system spent in user mode. + +@item nice +Number of clock ticks the system spent in user mode (nice). + +@item sys +Number of clock ticks the system spent in system mode. + +@item idle +Number of clock ticks the system spent in the idle task. + +@item iowait +Number of clock ticks the system spent waiting for I/O to complete. + +@item irq +Number of clock ticks the system spent servicing interrupts. + +@item softirq +Number of clock ticks the system spent servicing softirqs. + +@item frequency +Tick frequency (default is 100). + +@end table + +The @samp{xcpu_} values are for SMP systems - they are the same than +@code{total}, @code{user}, @code{nice}, @code{sys}, @code{idle}, +@code{iowait}, @code{irq} and @code{softirq} +except that they are arrays of @code{GLIBTOP_NCPU} (defined in +@file{}) elements and contain one value for each CPU +in the system. + +@table @code +@item xcpu_flags +This is interpreted as a bit-field: on systems like Solaris, not all CPUs +need to be running all the time, so we set the corresponding bit for each +CPU that is currently running. +@end table + +Please note that all of the cpu values are absolute values measured in +certain units (to get seconds, divide them by @code{frequency}) since system +boot. To get percentual values, you need to call @code{glibtop_cpu}, save the +result, wait some time and then call it again and divide the differences of +the two values by the time you have waited. + +@page +@node glibtop_mem, glibtop_swap, glibtop_cpu, System Dependent +@subsection Memory Usage + +Library function @code{glibtop_get_mem}: + +@example +@cartouche +void glibtop_get_mem (glibtop_mem *buf); +void glibtop_get_mem_l (glibtop *server, glibtop_mem *buf); +@end cartouche +@end example + +Declaration of @code{glibtop_mem} in @file{}: + +@example +@cartouche +typedef struct _glibtop_mem glibtop_mem; + +struct _glibtop_mem +@{ + guint64 flags, + total, + used, + free, + shared, + buffer, + cached, + user, + locked; +@}; +@end cartouche +@end example + +Unless explicitly stated otherwise, all memory units are in bytes. + +@table @code +@item total +Total physical memory. + +@item used +Used memory size. + +@item free +Free memory size. + +@item shared +Shared memory size. + +This are both segments that are @code{mmap()}ed with @code{MAP_SHARED} and +IPC Shared Memory segments. + +@item buffer +Size of buffers. + +@item cached +Size of cached memory. + +@item user +Memory used from user processes. + +This is normally @code{total - free - shared - buffer - cached}. + +@item locked +Memory in locked segments. + +@end table + +@page +@node glibtop_swap, glibtop_uptime, glibtop_mem, System Dependent +@subsection Swap Usage + +Library function @code{glibtop_get_swap}: + +@example +@cartouche +void glibtop_get_swap (glibtop_swap *buf); +void glibtop_get_swap_l (glibtop *server, glibtop_swap *buf); +@end cartouche +@end example + +Declaration of @code{glibtop_swap} in @file{}: + +@example +@cartouche +typedef struct _glibtop_swap glibtop_swap; + +struct _glibtop_swap +@{ + guint64 flags, + total, + used, + free, + pagein, + pageout; +@}; +@end cartouche +@end example + +The following units are in bytes. + +@table @code +@item total +Total swap space in the system. + +@item used +Used swap space. + +@item free +Free swap space. +@end table + +You can use @code{pagein} and @code{pageout} to get some measure about how +much the system is swapping at the moment. They're increased each time a page +is swapped in or out, so you need to save this values, wait a little bit, get +them again and then compare the two results to find out how much the system +swapped in the meantime. + +@table @code +@item pagein +Total number of swap pages that have been brought in since system boot + +@item pageout +Total number of swap pages that have been brought out since system boot + +@end table + +@page +@node glibtop_uptime, glibtop_loadavg, glibtop_swap, System Dependent +@subsection Uptime + +Library function @code{glibtop_get_uptime}: + +@example +@cartouche +void glibtop_get_uptime (glibtop_uptime *buf); +void glibtop_get_uptime_l (glibtop *server, glibtop_uptime *buf); +@end cartouche +@end example + +Declaration of @code{glibtop_uptime} in @file{}: + +@example +@cartouche +typedef struct _glibtop_uptime glibtop_uptime; + +struct _glibtop_uptime +@{ + guint64 flags; + double uptime, + idletime; + guint64 boot_time; +@}; +@end cartouche +@end example + +When porting LibGTop to a new system, you only need to implement @code{uptime} +and @code{idletime} if there's a faster or better way to obtain them as using +@code{glibtop_cpu} for it. Look at @file{sysdeps/freebsd/uptime.c} for an +example on how to obtain them using @code{glibtop_cpu}. + +@table @code +@item uptime +Time in seconds since system boot. + +@item idletime +Time in seconds the system spent in the idle task since system boot. +@end table + +The following one was from a request on the @samp{linux-kernel} mailing list; +on a laptop with advanced power management @code{glibtop_cpu.total} may not +reflect the correct boot time of the system if the power was turned off by +means of APM in the meantime. + +@table @code +@item boot_time +Time of last system boot in seconds since the epoch. +@end table + +@page +@node glibtop_loadavg, glibtop_proclist, glibtop_uptime, System Dependent +@subsection Load Average + +Library function @code{glibtop_get_loadavg}: + +@example +@cartouche +void glibtop_get_loadavg (glibtop_loadavg *buf); +void glibtop_get_loadavg_l (glibtop *server, glibtop_loadavg *buf); +@end cartouche +@end example + +Declaration of @code{glibtop_loadavg} in @file{}: + +@example +@cartouche +typedef struct _glibtop_loadavg glibtop_loadavg; + +struct _glibtop_loadavg +@{ + guint64 flags; + double loadavg [3]; + guint64 nr_running, + nr_tasks, + last_pid; +@}; +@end cartouche +@end example + +@table @code +@item loadavg + +Number of jobs running simultaneously averaged over 1, 5 and 15 minutes. + +@end table + +The following fields are Linux specific and deprecated. You don't need to +implement them when porting LibGTop to a new system as they may be removed +in a future version. + +@table @code +@item nr_running +Number of tasks currently running. + +@item nr_tasks +Total number of tasks. + +@item last_pid +Last PID. +@end table + +@page +@node glibtop_proclist, glibtop_proc_state, glibtop_loadavg, System Dependent +@subsection Process List + +Library function @code{glibtop_get_proclist}: + +@example +@cartouche +unsigned * +glibtop_get_proclist (glibtop_proclist *buf, + gint64 which, gint64 arg); + +unsigned * +glibtop_get_proclist_l (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg); +@end cartouche +@end example + +Constants for the @code{which} argument: + +@example +@cartouche +#define GLIBTOP_KERN_PROC_ALL 0 +#define GLIBTOP_KERN_PROC_PID 1 +#define GLIBTOP_KERN_PROC_PGRP 2 +#define GLIBTOP_KERN_PROC_SESSION 3 +#define GLIBTOP_KERN_PROC_TTY 4 +#define GLIBTOP_KERN_PROC_UID 5 +#define GLIBTOP_KERN_PROC_RUID 6 + +#define GLIBTOP_KERN_PROC_MASK 15 + +#define GLIBTOP_EXCLUDE_IDLE 0x1000 +#define GLIBTOP_EXCLUDE_SYSTEM 0x2000 +#define GLIBTOP_EXCLUDE_NOTTY 0x4000 +@end cartouche +@end example + +Declaration of @code{glibtop_proclist} in @file{}: + +@example +@cartouche +typedef struct _glibtop_proclist glibtop_proclist; + +struct _glibtop_proclist +@{ + guint64 flags, + number, + total, + size; +@}; +@end cartouche +@end example + +This function returns a list of all or a selected subset of all running +processes. You can use the @code{which} and @code{arg} arguments to +specify which processes should be returned. + +You can use the following values for the @code{which} argument: + +@table @code +@item GLIBTOP_KERN_PROC_ALL +Return information about all processes (the @code{arg} argument is ignored). + +@item GLIBTOP_KERN_PROC_PID +Return information about all process with the pid @var{PID} which is passed +in @code{arg}. You can use this to find out whether some process still exists. + +@item GLIBTOP_KERN_PROC_PGRP +Return all processes in process group @var{PGRP} which is passed in +@code{arg}. + +@item GLIBTOP_KERN_PROC_SESSION +Return all processes in session @var{SESSION} which is passed in @code{arg}. + +@item GLIBTOP_KERN_PROC_TTY +Return all processes which have the controlling tty @var{TTY} which is passed +in @code{arg} (@var{TTY} is interpreted as device number). + +@item GLIBTOP_KERN_PROC_UID +Return all processes with effective uid @var{UID} which is passed in @code{arg}. + +@item GLIBTOP_KERN_PROC_RUID +Return all processes with real uid @var{RUID} which is passed in @code{arg}. + +@end table + +You can alter the list of returned processes by using a binary OR of +@code{which} and the following constants: + +@table @code +@item GLIBTOP_EXCLUDE_IDLE +Exclude idle processes. +@item GLIBTOP_EXCLUDE_SYSTEM +Exclude system processes. +@item GLIBTOP_EXCLUDE_NOTTY +Exclude processes without a controlling terminal. +@end table + +The return value of @code{glibtop_get_proclist} is either @code{NULL} on +error or a @code{unsigned *} list of pids. Additionally, the following fields +of @code{glibtop_proclist} are set: + +@table @code +@item number +Number of entries in the returned list. + +@item total +Total size of the returned list (this equals @code{number * size}). + +@item size +Size of a single entry in the returned list +(this equals @code{sizeof (unsigned)}). +@end table + +The returned list is allocated using @code{g_malloc} and must be freed +using @code{g_free} to avoid a memory leak. + +@page +@node glibtop_proc_state, glibtop_proc_uid, glibtop_proclist, System Dependent +@subsection Process State + +Library function @code{glibtop_get_proc_state}: + +@example +@cartouche +void +glibtop_get_proc_state (glibtop_proc_state *buf, pid_t pid); + +void +glibtop_get_proc_state_l (glibtop *server, glibtop_proc_state *buf, + pid_t pid); +@end cartouche +@end example + +Declaration of @code{glibtop_proc_state} in @file{}: + +@example +@cartouche +typedef struct _glibtop_proc_state glibtop_proc_state; + +struct _glibtop_proc_state +@{ + guint64 flags; + char cmd[40]; +@ifset LIBGTOP-1-1 + unsigned state; +@end ifset +@ifclear LIBGTOP-1-1 + char state; +@end ifclear + int uid, + gid, + ruid, + rgid; + int has_cpu, + processor, + last_processor; + +@}; +@end cartouche +@end example + +@table @code +@item cmd +Basename of the executable file in the call to @code{exec}. +@item state +@ifset LIBGTOP-1-1 +Process state (see the constants defined below). +@end ifset +@ifclear LIBGTOP-1-1 +Process state ('R' = running, 'S' = sleeping, 'D' = uninterruptible, +'Z' = zombie, 'T' = stopped, 'I' = idle). + +This was changed to an @code{unsigned} bitfield in LibGTop 1.1.x where there +are also some constants for it. +@end ifclear +@end table + +When porting LibGTop, please @emph{try hard} to implement the following +fields. For security reasons, it is @strong{very important} that you +@strong{only} set the @code{flags} bits for those fields if their +@strong{values are correct}. + +@table @code +@item uid +Effective UID of the process. +@item gid +Effective GID of the process. +@item ruid +Real UID of the process. +@item rgid +Read GID of the process. +@end table + +The following fields are for SMP systems: + +@table @code +@item has_cpu +This is either 0 or 1 depending on whether the process currently has a CPU +or not. + +@item processor +This is the processor id of the CPU this process is currently running on +(which can be used as index in the @samp{xcpu_} fields of @code{glibtop_cpu} +for instance; since zero is a valid processor id, you must check @code{has_cpu} +in this case to find out whether the process really has a CPU). + +@item last_processor +The is the processor id of the CPU the process was last running on. +@end table + +@ifset LIBGTOP-1-1 +There are some constants for the @code{state} field: + +@example +@cartouche +#define GLIBTOP_PROCESS_RUNNING 1 +#define GLIBTOP_PROCESS_INTERRUPTIBLE 2 +#define GLIBTOP_PROCESS_UNINTERRUPTIBLE 4 +#define GLIBTOP_PROCESS_ZOMBIE 8 +#define GLIBTOP_PROCESS_STOPPED 16 +#define GLIBTOP_PROCESS_SWAPPING 32 +#define GLIBTOP_PROCESS_DEAD 64 +@end cartouche +@end example +@end ifset + +@table @code +@item GLIBTOP_PROCESS_RUNNING +The process is currently running. +@item GLIBTOP_PROCESS_INTERRUPTIBLE +The process is currently in an interruptible sleep. +@item GLIBTOP_PROCESS_UNINTERRUPTIBLE +The process is currently in uninterruptible sleep +(the so-called @dfn{disk sleep}). +@item GLIBTOP_PROCESS_ZOMBIE +The process is a zombie. +@item GLIBTOP_PROCESS_STOPPED +The process is currently stopped (received @code{SIGSTOP} +or attached to a debugger). +@item GLIBTOP_PROCESS_SWAPPING +The process is currently swapping. +@end table + +@page +@node glibtop_proc_uid, glibtop_proc_mem, glibtop_proc_state, System Dependent +@subsection Process UID and TTY information + +Library function @code{glibtop_get_proc_uid}: + +@example +@cartouche +void +glibtop_get_proc_uid (glibtop_proc_uid *buf, pid_t pid); + +void +glibtop_get_proc_uid_l (glibtop *server, glibtop_proc_uid *buf, + pid_t pid); +@end cartouche +@end example + +Declaration of @code{glibtop_proc_uid} in @file{}: + +@example +@cartouche +typedef struct _glibtop_proc_uid glibtop_proc_uid; + +struct _glibtop_proc_uid +@{ + guint64 flags; + int uid, + euid, + gid, + egid, + suid, + sgid, + fsuid, + fsgid, + pid, + ppid, + pgrp, + session, + tty, + tpgid, + priority, + nice, + ngroups, + groups [GLIBTOP_MAX_GROUPS]; +@}; +@end cartouche +@end example + +@table @code +@item uid +User ID +@item euid +Effective User ID +@item gid +Group ID +@item egid +Effective Group ID +@item pid +Process ID +@item ppid +PID of parent process +@item pgrp +Process group ID +@item session +Session ID +@item tty +Full device number of controlling terminal +@item tpgid +Terminal process group ID +@item priority +Kernel scheduling priority. +@item nice +Standard unix nice level of process. +@item ngroups +Number of additional process groups. +@item groups +Array of additional process groups@* +(@code{GLIBTOP_MAX_GROUPS} is defined in @file{}). +@end table + +@page +@node glibtop_proc_mem, glibtop_proc_time, glibtop_proc_uid, System Dependent +@subsection Process Memory information + +Library function @code{glibtop_get_proc_mem}: + +@example +@cartouche +void +glibtop_get_proc_mem (glibtop_proc_mem *buf, pid_t pid); + +void +glibtop_get_proc_mem_l (glibtop *server, glibtop_proc_mem *buf, + pid_t pid); +@end cartouche +@end example + +Declaration of @code{glibtop_proc_mem} in @file{}: + +@example +@cartouche +typedef struct _glibtop_proc_mem glibtop_proc_mem; + +struct _glibtop_proc_mem +@{ + guint64 flags, + size, + vsize, + resident, + share, + rss, + rss_rlim; +@}; +@end cartouche +@end example + +@table @code +@item size +Total number of pages of memory. +@item vsize +Number of pages of virtual memory. +@item resident +Number of residnet set (non-swapped) pages. +@item share +Number of pages of shared (mmap\'d) memory. +@item rss +Number of pages the process has in real memory, minus 3 for administrative +purposes. + +This is just the pages which count towards text, data, or stack space. +This does not include pages which have not been demand-loaded in, or which +are swapped out. +@item rss_rlim +Current limit in bytes on the rss of the process (usually 2,147,483,647). +@end table + +The description above is taken from the manual page of the @file{/proc} +filesystem under Linux and is a little bit confusing, so I make this clear +here. + +@strong{A word for people porting LibGTop to other systems:} +Every operating system has its own idea about the memory usage of a process +and also system utilities like @code{ps} show different things on different +systems. + +Nevertheless, we should try to make LibGTop as system independent as possible, +so I give you some hints here how @code{glibtop_get_proc_mem} should work. + +@itemize @bullet +@item +When you use @code{mmap} with either @code{MAP_SHARED} or @code{MAP_PRIVATE}, +this should only affect the @code{vsize} of the process and none of its +@code{size}, @code{resident}, @code{shared} and @code{rss} sizes. + +@item +As soon as you read some of the @code{mmap()}ed pages, they will be demand- +oaded and thus count towards the @code{size} of the process. + +Also - we assume there is enough free memory - they are resident in memory +until they get stolen or swapped out and thus increase the @code{resident} and +@code{rss} sizes of the process. + +@item +If the process has used @code{MAP_SHARED} and another process attaches the +same file also @code{MAP_SHARED}, some of the pages are shared with this +process and thus increase the @code{shared} sizes of both processes. + +@item +If the process has used @code{MAP_PRIVATE} and writes to the @code{mmap()}ed +pages, the only difference to reading from them is that they get dirty and +cannot be stolen any longer but will get swapped out. + +@item +When memory gets rare, clean pages are normally stolen, which decreases the +@code{size}, @code{resident}, @code{shared} and @code{rss} sizes of the process. + +@item +When dirty pages are swapped out, this will not decrease the @code{size} of the +process but only its @code{resident} and @code{rss} sizes (dirty pages cannot +be shared). + +@item +The @code{vsize} of a process can @emph{only} be changed by the process +itself when it requests or frees memory but @emph{never} due to swapping +activity of the system. + +@item +If the @code{shared} size changes, this @emph{only} means that the number of +pages that are currently shared with other processes has changed; if this +happens, this will @emph{never} affect any of the other sizes of the process. +@end itemize + +The hints above describe how it works under Linux - but we should try to make +@code{glibtop_get_proc_mem} show the same behavior under every other system. + +@page +@node glibtop_proc_time, glibtop_proc_signal, glibtop_proc_mem, System Dependent +@subsection Process Time information + +Library function @code{glibtop_get_proc_time}: + +@example +@cartouche +void +glibtop_get_proc_time (glibtop_proc_time *buf, pid_t pid); + +void +glibtop_get_proc_time_l (glibtop *server, glibtop_proc_time *buf, + pid_t pid); +@end cartouche +@end example + +Declaration of @code{glibtop_proc_time} in @file{}: + +@example +@cartouche +typedef struct _glibtop_proc_time glibtop_proc_time; + +struct _glibtop_proc_time +@{ + guint64 flags, + start_time, + rtime, + utime, + stime, + cutime, + cstime, + timeout, + it_real_value, + frequency, + xcpu_utime [GLIBTOP_NCPU], + xcpu_stime [GLIBTOP_NCPU], + xcpu_flags; +@}; +@end cartouche +@end example + + +@table @code +@item start_time +Start time of process in seconds since the epoch +@item rtime +Real time accumulated by process (should be @code{utime} + @code{stime}) +@item utime +User-mode CPU time accumulated by process +@item stime +Kernel-mode CPU time accumulated by process +@item cutime +Cumulative utime of process and reaped children +@item cstime +Cumulative stime of process and reaped children +@item timeout +The time (in jiffies) of the process's next timeout +@item it_real_value +The time (in jiffies) before the next SIGALRM is sent to the process due +to an interval timer. +@item frequency +Tick frequency +@item xcpu_utime +SMP user-mode CPU time accumulated by process +@item xcpu_stime +SMP kernel-mode CPU time accumulated by process +@end table + + +Please note that under Linux, @code{start_time} value may be strange. +Linux kernel defines @code{INITIAL_JIFFIES} which implies a time +shift. Because @code{INITIAL_JIFFIES} is not user-space defined, we +cannot use it to compute accurate @code{start_time}. On Linux2.6, +@code{INITIAL_JIFFIES} is 300 so @code{start_time} is always 3s +different from real start time of the given process. You may also get +shift results if your system clock is not synchronised with your +hardware clock. See @samp{man hwclock}. + + + +@page +@node glibtop_proc_signal, glibtop_proc_kernel, glibtop_proc_time, System Dependent +@subsection Process Signal information + +Library function @code{glibtop_get_proc_signal}: + +@example +@cartouche +void +glibtop_get_proc_signal (glibtop_proc_signal *buf, pid_t pid); + +void +glibtop_get_proc_signal_l (glibtop *server, glibtop_proc_signal *buf, + pid_t pid); +@end cartouche +@end example + +Declaration of @code{glibtop_proc_signal} in @file{}: + +@example +@cartouche +typedef struct _glibtop_proc_signal glibtop_proc_signal; + +struct _glibtop_proc_signal +@{ + guint64 flags, + signal [2], + blocked [2], + sigignore [2], + sigcatch [2]; +@}; +@end cartouche +@end example + +@table @code +@item signal +Mask of pending signals +@item blocked +Mask of blocked signals +@item sigignore +Mask of ignored signals +@item sigcatch +Mask of caught signals +@end table + +All signal masks are interpreted as bit mask; it is an array of two +@code{guint64}'s so we can save 128 signals there. + +@page +@node glibtop_proc_kernel, glibtop_proc_segment, glibtop_proc_signal, System Dependent +@subsection Process Kernel Data information + +Library function @code{glibtop_get_proc_kernel}: + +@example +@cartouche +void +glibtop_get_proc_kernel (glibtop_proc_kernel *buf, pid_t pid); + +void +glibtop_get_proc_kernel_l (glibtop *server, glibtop_proc_kernel *buf, + pid_t pid); +@end cartouche +@end example + +Declaration of @code{glibtop_proc_kernel} in @file{}: + +@example +@cartouche +typedef struct _glibtop_proc_kernel glibtop_proc_kernel; + +struct _glibtop_proc_kernel +@{ + guint64 flags; + guint64 k_flags, + min_flt, + maj_flt, + cmin_flt, + cmaj_flt, + kstk_esp, + kstk_eip, + nwchan; + char wchan [40]; +@}; +@end cartouche +@end example + +@table @code +@item k_flags +Kernel flags of the process. See the constants defined below. +@item min_flt +The number of minor faults the process has made, those which have not required +loading a memory page from disk. +@item maj_flt +The number of major faults the process has made, those which have required loading +a memory page from disk. +@item cmin_flt +The number of minor faults that the process and its children have made. +@item cmaj_flt +The number of major faults that the process and its children have made. +@item kstk_esp +The current value of @code{esp} (32-bit stack pointer), as found in the kernel stack +page for the process. +@item kstk_eip +The current @code{eip} (32-bit instruction pointer). +@item nwchan +This is the "channel" in which the process is waiting. This is the address of a system +call, and can be looked up in a namelist if you need a textual name. +(If you have an up-to-date @file{/etc/psdatabase}, then try @code{ps -l} to see the +WCHAN field in action). +@item wchan +This is the textual name of the @code{nwchan} field. +@end table + +There are some constants for the @code{k_flags} field: + +@example +@cartouche +#define GLIBTOP_KFLAGS_STARTING 1 +#define GLIBTOP_KFLAGS_EXITING 2 +#define GLIBTOP_KFLAGS_PTRACED 4 +#define GLIBTOP_KFLAGS_TRACESYS 8 +#define GLIBTOP_KFLAGS_FORKNOEXEC 16 +#define GLIBTOP_KFLAGS_SUPERPRIV 32 +#define GLIBTOP_KFLAGS_DUMPEDCORE 64 +#define GLIBTOP_KFLAGS_SIGNALED 128 +@end cartouche +@end example + +@table @code +@item GLIBTOP_KFLAGS_STARTING +Process is being created. +@item GLIBTOP_KFLAGS_EXITING +Process is exiting. +@item GLIBTOP_KFLAGS_PTRACED +Process is being traced (via @code{ptrace ()}). +@item GLIBTOP_KFLAGS_TRACESYS +Process is tracing system calls. +@item GLIBTOP_KFLAGS_FORKNOEXEC +Process @code{fork()}ed, but didn't @code{exec()} yet. +@item GLIBTOP_KFLAGS_SUPERPRIV +Process used super-user privileges. +@item GLIBTOP_KFLAGS_DUMPEDCORE +Process dumped core. +@item GLIBTOP_KFLAGS_SIGNALED +Process was killed by a signal. +@end table + +@page +@node glibtop_proc_segment, glibtop_proc_args, glibtop_proc_kernel, System Dependent +@subsection Process Segment information + +Library function @code{glibtop_get_proc_segment}: + +@example +@cartouche +void +glibtop_get_proc_segment (glibtop_proc_segment *buf, pid_t pid); + +void +glibtop_get_proc_segment_l (glibtop *server, glibtop_proc_segment *buf, + pid_t pid); +@end cartouche +@end example + +Declaration of @code{glibtop_proc_segment} in @file{}: + +@example +@cartouche +typedef struct _glibtop_proc_segment glibtop_proc_segment; + +struct _glibtop_proc_segment +@{ + guint64 flags, + text_rss, + shlib_rss, + data_rss, + stack_rss, + dirty_size, + start_code, + end_code, + start_stack; +@}; +@end cartouche +@end example + +@table @code +@item text_rss +Text resident set size +@item shlib_rss +Shared-Lib resident set size +@item data_rss +Data resident set size +@item stack_rss +Stack resident set size +@item dirty_size +Total size of dirty pages +@item start_code +Address of beginning of code segment +@item end_code +Address of end of code segment +@item start_stack +Address of the bottom of stack segmen +@end table + +@page +@node glibtop_proc_args, glibtop_proc_map, glibtop_proc_segment, System Dependent +@subsection Process Arguments + +Library function @code{glibtop_get_proc_args}: + +@example +@cartouche +char * +glibtop_get_proc_args(glibtop_proc_args *buf, pid_t pid, + unsigned max_len); + +char * +glibtop_get_proc_args_l (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len); +@end cartouche +@end example + +Declaration of @code{glibtop_proc_args} in @file{}: + +@example +@cartouche +typedef struct _glibtop_proc_args glibtop_proc_args; + +struct _glibtop_proc_args +@{ + guint64 flags, + size; +@}; +@end cartouche +@end example + +Returns a string with all command line arguments of process @code{pid} +(up to @code{max_len} characters, use zero to get all arguments). + +The command line arguments in the returned string are separated by zero bytes; +the lenght of this string is returned in the @code{size} field. + +Remember to @code{g_free} the returned string to avoid a memory leak. + +@strong{New functions} + +@example +@cartouche +char ** +glibtop_get_proc_argv(glibtop_proc_args *buf, pid_t pid, + unsigned max_len); + +char ** +glibtop_get_proc_argv_l (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len); +@end cartouche +@end example + +Returns a NULL-terminated array of strings with all arguments of +process @code{pid} (up to @code{max_len} characters, use zero to get +all arguments). @code{glibtop_get_proc_argv()} and +@code{glibtop_get_proc_argv_l()} are wrappers to +@code{glibtop_get_proc_args()} and @code{glibtop_get_proc_args_l()} +that return process' arguments like the C @code{argv}. + +Remember to @code{g_strfreev} the returned array to avoid a memory +leak. + +@page +@node glibtop_proc_map, glibtop_netload, glibtop_proc_args, System Dependent +@subsection Process Memory Maps + +Library function @code{glibtop_get_proc_map}: + +@example +@cartouche +glibtop_map_entry * +glibtop_get_proc_map (glibtop_proc_map *buf, pid_t pid); + +glibtop_map_entry * +glibtop_get_proc_map_l (glibtop *server, glibtop_proc_map *buf, + pid_t pid); +@end cartouche +@end example + +Declaration of @code{glibtop_proc_map} in @file{}: + +@example +@cartouche +typedef struct _glibtop_proc_map glibtop_proc_map; + +struct _glibtop_proc_map +@{ + guint64 flags, + number, + total, + size; +@}; +@end cartouche +@end example + +Returns a @code{glibtop_map_entry *} list (which needs to be freed with +@code{g_free}) of memory maps of process @code{pid}. + +@table @code +@item number +Number of entries in the returned list. + +@item total +Total size of the returned list (this equals @code{number * size}). + +@item size +Size of a single entry in the returned list +(this equals @code{sizeof (glibtop_map_entry)}). +@end table + +@example +@cartouche +typedef struct _glibtop_map_entry glibtop_map_entry; + +struct _glibtop_map_entry +@{ + guint64 flags, start, end, offset, perm, inode, device; + char filename [GLIBTOP_MAP_FILENAME_LEN+1]; +@}; +@end cartouche +@end example + +The @code{flags} member is a bit field and specifies which of the other +fields are valid: + +@example +@cartouche +#define GLIBTOP_MAP_ENTRY_START 0 +#define GLIBTOP_MAP_ENTRY_END 1 +#define GLIBTOP_MAP_ENTRY_OFFSET 2 +#define GLIBTOP_MAP_ENTRY_PERM 3 +#define GLIBTOP_MAP_ENTRY_INODE 4 +#define GLIBTOP_MAP_ENTRY_DEVICE 5 +#define GLIBTOP_MAP_ENTRY_FILENAME 6 +@end cartouche +@end example + +Constants for the @code{perm} member: + +@example +@cartouche +#define GLIBTOP_MAP_PERM_READ 1 +#define GLIBTOP_MAP_PERM_WRITE 2 +#define GLIBTOP_MAP_PERM_EXECUTE 4 +#define GLIBTOP_MAP_PERM_SHARED 8 +#define GLIBTOP_MAP_PERM_PRIVATE 16 +@end cartouche +@end example + +@page +@node glibtop_netload, glibtop_ppp, glibtop_proc_map, System Dependent +@subsection Network Load + +Library function @code{glibtop_get_netload}: + +@example +@cartouche +void +glibtop_get_netload (glibtop_netload *buf, const char *interface); + +void +glibtop_get_netload_l (glibtop *server, glibtop_netload *buf, + const char *interface); +@end cartouche +@end example + +Declaration of @code{glibtop_netload} in @file{}: + +@example +@cartouche +typedef struct _glibtop_netload glibtop_netload; + +struct _glibtop_netload +@{ + guint64 flags, + if_flags, + mtu, + subnet, + address, + packets_in, + packets_out, + packets_total, + bytes_in, + bytes_out, + bytes_total, + errors_in, + errors_out, + errors_total, + collisions; +@}; +@end cartouche +@end example + +Returns network statistics for interface @code{interface} (which is the same +than in @code{ifconfig}). + +@table @code +@item if_flags +Interface flags. See the contants defined below. +@item mtu +Maximum Transfer Unit (MTU) +@item subnet +Subnet Address +@item address +Interface Address +@item packets_in +Total number of incoming packets +@item packets_out +Total number of outgoing packets +@item packets_total +Total number of packets +@item bytes_in +Total number of incoming bytes +@item bytes_out +Total number of outgoing bytes +@item bytes_total +Total number of bytes +@item errors_in +Total number of errors in incoming direction +@item errors_out +Total number of errors in outgoing direction +@item errors_total +Total number of errors +@item collisions +Total number of collisions +@end table + +Please note that not all operating systems distinguish between incoming/outgoing +bytes/packets/errors - in this case only the @samp{_total} fields are valid. +Otherwise, they're just @samp{_in} plus @samp{_out}. + +Constants for @code{if_flags}: + +@example +@cartouche +enum @{ + GLIBTOP_IF_FLAGS_UP = 1, + GLIBTOP_IF_FLAGS_BROADCAST, + GLIBTOP_IF_FLAGS_DEBUG, + GLIBTOP_IF_FLAGS_LOOPBACK, + GLIBTOP_IF_FLAGS_POINTOPOINT, + GLIBTOP_IF_FLAGS_RUNNING, + GLIBTOP_IF_FLAGS_NOARP, + GLIBTOP_IF_FLAGS_PROMISC, + GLIBTOP_IF_FLAGS_ALLMULTI, + GLIBTOP_IF_FLAGS_OACTIVE, + GLIBTOP_IF_FLAGS_SIMPLEX, + GLIBTOP_IF_FLAGS_LINK0, + GLIBTOP_IF_FLAGS_LINK1, + GLIBTOP_IF_FLAGS_LINK2, + GLIBTOP_IF_FLAGS_ALTPHYS, + GLIBTOP_IF_FLAGS_MULTICAST +@}; +@end cartouche +@end example + +@page +@node glibtop_ppp, , glibtop_netload, System Dependent +@subsection PPP Statistics + +Library function @code{glibtop_get_ppp}: + +@example +@cartouche +void +glibtop_get_ppp_l (glibtop *server, glibtop_ppp *buf, + unsigned short device); + +void +glibtop_get_ppp (glibtop_ppp *buf, unsigned short device); +@end cartouche +@end example + +Declaration of @code{glibtop_ppp} in @file{}: + +@example +@cartouche +typedef struct _glibtop_ppp glibtop_ppp; + +struct _glibtop_ppp +@{ + guint64 flags, + state, + bytes_in, + bytes_out; +@}; +@end cartouche +@end example + +@table @code +@item bytes_in +Number of input bytes +@item bytes_out +Number of output bytes +@end table + +There are some constants for @code{state}: + +@example +@cartouche +enum @{ + GLIBTOP_PPP_STATE_UNKNOWN = 0, + GLIBTOP_PPP_STATE_HANGUP, + GLIBTOP_PPP_STATE_ONLINE +@}; +@end cartouche +@end example + +@table @code +@item GLIBTOP_PPP_STATE_UNKNOWN +LibGTop was unable to determine the current ppp state. +@item GLIBTOP_PPP_STATE_HANGUP +We're currently offline. +@item GLIBTOP_PPP_STATE_ONLINE +We're currently online. +@end table + +@page +@node Common Functions, Library Functions, System Dependent, Reference Manual +@section Common Functions + +This are functions which a common implementation for all systems; we never +use the server for them. + +The file system code is taken from GNU Fileutils. + +@menu +* glibtop_mountlist:: Mount List. +* glibtop_fsusage:: File System Usage. +@end menu + +@node glibtop_mountlist, glibtop_fsusage, Common Functions, Common Functions +@subsection Mount List + +Library function @code{glibtop_get_mountlist}: + +@example +@cartouche +glibtop_mountentry * +glibtop_get_mountlist_l (glibtop *server, glibtop_mountlist *buf, + int all_fs); + +glibtop_mountentry * +glibtop_get_mountlist (glibtop_mountlist *buf, int all_fs); +@end cartouche +@end example + +The @code{all_fs} parameter specifies whether information about all +filesystems should be returned; this will include filesystem types like +@code{autofs} and @code{procfs}. You should not use this in disk usage +programs, but it can be useful to get a list of all currently mounted +filesystems. + +Declaration of @code{glibtop_proc_map} in @file{}: + +@example +@cartouche +typedef struct _glibtop_mountlist glibtop_mountlist; + +struct _glibtop_mountlist +@{ + guint64 flags, + number, + total, + size; +@}; +@end cartouche +@end example + +Returns a @code{glibtop_mountentry *} list (which needs to be freed with +@code{g_free}) of mounted filesystems. + +@table @code +@item number +Number of entries in the returned list. + +@item total +Total size of the returned list (this equals @code{number * size}). + +@item size +Size of a single entry in the returned list +(this equals @code{sizeof (glibtop_mountentry)}). +@end table + +@example +@cartouche +typedef struct _glibtop_mountentry glibtop_mountentry; + +struct _glibtop_mountentry +@{ + guint64 dev; + char devname [GLIBTOP_MOUNTENTRY_LEN+1]; + char mountdir [GLIBTOP_MOUNTENTRY_LEN+1]; + char type [GLIBTOP_MOUNTENTRY_LEN+1]; +@}; +@end cartouche +@end example + +@code{GLIBTOP_MOUNTENTRY_LEN} is defined in @file{}. + +@table @code +@item devname +Full pathname (such as @samp{/dev/sdb1} for instance) to the mounted device. +@item mountdir +Full pathname of the mountpoint (such as @samp{/usr/local} for instance). +@item type +Filesystem type as a textual string (such as @samp{ext2fs}). +@end table + +@page +@node glibtop_fsusage, , glibtop_mountlist, Common Functions +@subsection File System Usage + +Library function @code{glibtop_get_fsusage}: + +@example +@cartouche +void +glibtop_get_fsusage_l (glibtop *server, glibtop_fsusage *buf, + const char *mount_dir); + +void +glibtop_get_fsusage (glibtop_fsusage *buf, const char *mount_dir); +@end cartouche +@end example + +Declaration of @code{glibtop_fsusage} in @file{}: + +@example +@cartouche +typedef struct _glibtop_fsusage glibtop_fsusage; + +struct _glibtop_fsusage +@{ + guint64 flags, + blocks, + bfree, + bavail, + files, + ffree; + guint32 block_size; + guint64 read, + write; +@}; +@end cartouche +@end example + +@table @code +@item blocks +Total blocks in the filesystem. +@item bfree +Free blocks available to the superuser. +@item bavail +Free blocks available to ordinary users. +@item files +Total file nodes. +@item ffree +Free file nodes. +@item block_size +Block size in bytes. +@item read +Total blocks read. +@item write +Total blocks written. +@end table + +@page +@node Library Functions, , Common Functions, Reference Manual +@section Library Functions + +This are general library functions which can be used to get information +about the library and to control its behavior. + +@menu +* glibtop_init:: Server Initialization. +* glibtop_sysdeps:: Server Sysdeps. +* Library Parameters:: Library Parameters. +@end menu + +@node glibtop_init, glibtop_sysdeps, Library Functions, Library Functions +@subsection Server Initialization + +You do not need to worry about the @code{glibtop *} server structure if +you don't need - the library exports a @code{glibtop_global_server} +which you can use everywhere a @code{glibtop *} is expected. + +Most of the library and all of the sysdeps function also have an alias +(which is the function name without the @samp{_l}, @samp{_s} or @samp{_r} +suffix) which don't take a @code{glibtop *} as argument but uses the +@code{glibtop_global_server} instead. + +@example +@cartouche +extern glibtop *glibtop_global_server; +@end cartouche +@end example + +Library function @code{glibtop_init}: + +@example +@cartouche +glibtop * +glibtop_init_r (glibtop **server_ptr, unsigned long features, + unsigned flags); + +void +glibtop_init (void); +@end cartouche +@end example + +This function initializes a LibGTop server. It is automatically called +when you use any of the LibGTop functions and will use the global server +in this case. + +However, it's appreciated to call @code{glibtop_init} during the +initialization of your application. + +You can for instance use + +@example +glibtop_init (); +@end example + +@noindent +which is equivalent to + +@example +glibtop_init_r (&glibtop_global_server, 0, 0); +@end example + +Please note that the @code{server_ptr} argument is a pointer to a pointer +(and thus is of type @code{glibtop **}). + +To control what @code{glibtop_init} should actually do, you can use the +@code{features} and @code{flags} arguments. + +The @code{features} argument is a bit-mask (interpreted in the same way +than @samp{sysdeps.features}) and tells the library which features you're +interested in. The library will only start the server if this is required +for any of those features. + +You can use the following constants for the @code{flags} parameter to +control the behavior of the library: + +@table @code +@item GLIBTOP_INIT_NO_INIT +Tells the library to do nothing. If the value pointed to by the +@code{server_ptr} argument is @code{NULL}, it will set it to the +@code{glibtop_global_server} and then return. +@item GLIBTOP_INIT_NO_OPEN +Do the initialization, but do not start the server. +@end table + +To modify the way the @code{features} are interpretet, you can use the +following constants for @code{flags} (as a bit mask): + +@table @code +@item GLIBTOP_FEATURES_NO_SERVER +Never use the server, always call the sysdeps code directly. +If you require any privileges to get them and you don't have those +privileges, the this will obviously not work and the library will +fail to return some or all of the requested values. +@item GLIBTOP_FEATURES_EXCEPT +Inverts the matching of the @code{features} parameter, i.e. if you use +this flag this means that @code{features} are all the features you are +@emph{not} interested in. +Might be useful to say something like "I want everything but ppp". +@end table + +@node glibtop_sysdeps, Library Parameters, glibtop_init, Library Functions +@subsection Server Sysdeps + +Library function @code{glibtop_get_sysdeps}: + +@example +@cartouche +void +glibtop_get_sysdeps_r (glibtop *server, glibtop_sysdeps *buf); + +void +glibtop_get_sysdeps (glibtop_sysdeps *buf); +@end cartouche +@end example + +Declaration of @code{glibtop_sysdeps} in @file{}: + +@example +@cartouche +typedef struct _glibtop_sysdeps glibtop_sysdeps; + +struct _glibtop_sysdeps +@{ + guint64 flags, + features, + pointer_size, + cpu, + mem, + swap, + uptime, + loadavg, + shm_limits, + msg_limits, + sem_limits, + proclist, + proc_state, + proc_uid, + proc_mem, + proc_time, + proc_signal, + proc_kernel, + proc_segment, + proc_args, + proc_map, + mountlist, + fsusage, + netload, + ppp; +@}; +@end cartouche +@end example + +@table @code +@item features +This is a bit field (the so-called @dfn{server features}) stating +for which features we need to use the server. +@item pointer_size +This was added in LibGTop 1.1.0 and tells you the number of bits a +@code{void*} has in the server (this may be different from the +size on the client machine if we're talking over the daemon to a +remove machine). +@end table + +The following constants from @file{} serve as bit-indices +for the @code{features} field: + +@example +@cartouche +#define GLIBTOP_SYSDEPS_CPU 0 +#define GLIBTOP_SYSDEPS_MEM 1 +#define GLIBTOP_SYSDEPS_SWAP 2 +#define GLIBTOP_SYSDEPS_UPTIME 3 +#define GLIBTOP_SYSDEPS_LOADAVG 4 +#define GLIBTOP_SYSDEPS_SHM_LIMITS 5 +#define GLIBTOP_SYSDEPS_MSG_LIMITS 6 +#define GLIBTOP_SYSDEPS_SEM_LIMITS 7 +#define GLIBTOP_SYSDEPS_PROCLIST 8 +#define GLIBTOP_SYSDEPS_PROC_STATE 9 +#define GLIBTOP_SYSDEPS_PROC_UID 10 +#define GLIBTOP_SYSDEPS_PROC_MEM 11 +#define GLIBTOP_SYSDEPS_PROC_TIME 12 +#define GLIBTOP_SYSDEPS_PROC_SIGNAL 13 +#define GLIBTOP_SYSDEPS_PROC_KERNEL 14 +#define GLIBTOP_SYSDEPS_PROC_SEGMENT 15 +#define GLIBTOP_SYSDEPS_PROC_ARGS 16 +#define GLIBTOP_SYSDEPS_PROC_MAP 17 +#define GLIBTOP_SYSDEPS_MOUNTLIST 18 +#define GLIBTOP_SYSDEPS_FSUSAGE 19 +#define GLIBTOP_SYSDEPS_NETLOAD 20 +#define GLIBTOP_SYSDEPS_PPP 21 +@end cartouche +@end example + +@node Library Parameters, , glibtop_sysdeps, Library Functions +@subsection Library Parameters + +Library function @code{glibtop_get_parameter}: + +@example +@cartouche +size_t +glibtop_get_parameter_l (glibtop *server, const unsigned parameter, + void *data_ptr, size_t data_size); + +size_t +glibtop_get_parameter (const unsigned parameter, void *data_ptr, + size_t data_size); +@end cartouche +@end example + +This function is used to retrieve a library parameter (see below for a more +detailed description). It returns the size of the retrieved parameter on +success, zero on failure or minus the actual size of the parameter if +@code{data_size} was too small. + +You may call this function with @code{data_ptr} set to @code{NULL} to get the +actual size of a parameter (as a negative value). + +@table @code +@item parameter +The parameter you want to retrieve (see below for constants). +@item data_ptr +Pointer to a place where the parameter should be stored. +@item data_size +Maximum size of the parameter. +@end table + +Library function @code{glibtop_set_parameter}: + +@example +@cartouche +void +glibtop_set_parameter_l (glibtop *server, const unsigned parameter, + const void *data_ptr, size_t data_size); + +void +glibtop_set_parameter (const unsigned parameter, const void *data_ptr, + size_t data_size); +@end cartouche +@end example + +This function is used to modify a library parameter. Please not that you +may not set all parameters since some of them are read-only. + +@table @code +@item parameter +The parameter you want to modify (see below for constants). +@item data_ptr +Pointer to the value which should be set. +@item data_size +Size of the new value. For fixed-size parameters, this must match +the exact size of the parameter or you'll get an error. +@end table + +The following parameters are defined in @file{}: + +@table @code +@item GLIBTOP_PARAM_FEATURES +This is a read-only @code{unsigned long} representing the @code{features} +field of @code{glibtop_sysdeps}. +@item GLIBTOP_PARAM_REQUIRED +This is a @code{glibtop_sysdeps} structure specifying which features the +client requires the library return. If it fails to get any of them, you'll +get an error. +@item GLIBTOP_PARAM_ERROR_METHOD +This is an @code{unsigned} telling the library what to do if it fails to +get any of the features that are marked as required via the +@code{GLIBTOP_PARAM_REQUIRED} parameter (see below for constants). +@end table + +You can use the following constants for @code{GLIBTOP_PARAM_ERROR_METHOD} +(defined in @file{}): + +@table @code +@item GLIBTOP_ERROR_METHOD_IGNORE +Ignore the error condition. +@item GLIBTOP_ERROR_METHOD_WARN_ONCE +Warn once about the absense of some of the required features, then modify +@code{GLIBTOP_PARAM_REQUIRED} so that the missing ones are no longer +required. This is the prefered value for applications since it'll only +print out the warning message once and not each time the library tries to +get one of those features. +@item GLIBTOP_ERROR_METHOD_WARN +Warn each time the library fails to get some of the required features. +@item GLIBTOP_ERROR_METHOD_ABORT +Abort if the library fails to get some of the required features. This +should not be used by applications. +@end table + diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am new file mode 100644 index 0000000..042eb23 --- /dev/null +++ b/doc/reference/Makefile.am @@ -0,0 +1,59 @@ +AUTOMAKE_OPTIONS = 1.6 +## Process this file with automake to produce Makefile.in +# The name of the module, e.g. 'glib'. +DOC_MODULE=libgtop + +# The top-level SGML file. You can change this if you want to. +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml + +# Extra options to pass to gtkdoc-scangobj. Not normally needed. +# SCANGOBJ_OPTIONS= + +# Extra options to supply to gtkdoc-scan. +# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" +SCAN_OPTIONS= + +# Extra options to supply to gtkdoc-mkdb. +# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml +MKDB_OPTIONS=--sgml-mode --output-format=xml --source-dir=$(top_srcdir)/sysdeps/common + +# The directory containing the source code. Relative to $(srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting the functions and macros. +# e.g. DOC_SOURCE_DIR=../../../gtk +DOC_SOURCE_DIR=$(top_srcdir)/include/glibtop + +# Used for dependencies. The docs will be rebuilt if any of these change. +# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h +# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c +HFILE_GLOB=$(top_srcdir)/include/glibtop/*.h +CFILE_GLOB=$(top_srcdir)/sysdeps/common/*.c + +# Header files to ignore when scanning. +# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h +IGNORE_HFILES=error.h global.h gnuserv.h init_hooks.h write.h read.h read_data.h config.h libgtopconfig.h + +EXTRA_HFILES=$(top_srcdir)/glibtop.h + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +# e.g. content_files=running.sgml building.sgml changes-2.0.sgml +content_files=version.xml + +# Images to copy into HTML directory. +# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png +HTML_IMAGES= + +# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. +# Only needed if you are using gtkdoc-scangobj to dynamically query widget +# signals and properties. +# e.g. AM_CPPFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) +# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) +AM_CPPFLAGS= +GTKDOC_LIBS= + +# This includes the standard gtk-doc make rules, copied by gtkdocize. +include $(top_srcdir)/gtk-doc.make + +# Other files to distribute +# e.g. EXTRA_DIST += version.xml.in +EXTRA_DIST += version.xml.in diff --git a/doc/reference/Makefile.in b/doc/reference/Makefile.in new file mode 100644 index 0000000..8426527 --- /dev/null +++ b/doc/reference/Makefile.in @@ -0,0 +1,854 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- mode: makefile -*- + +#################################### +# Everything below here is generic # +#################################### +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = doc/reference +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = version.xml +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/version.xml.in \ + $(top_srcdir)/gtk-doc.make +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ + +# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. +# Only needed if you are using gtkdoc-scangobj to dynamically query widget +# signals and properties. +# e.g. AM_CPPFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) +# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) +AM_CPPFLAGS = +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.6 +# The name of the module, e.g. 'glib'. +DOC_MODULE = libgtop + +# The top-level SGML file. You can change this if you want to. +DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml + +# Extra options to pass to gtkdoc-scangobj. Not normally needed. +# SCANGOBJ_OPTIONS= + +# Extra options to supply to gtkdoc-scan. +# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" +SCAN_OPTIONS = + +# Extra options to supply to gtkdoc-mkdb. +# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml +MKDB_OPTIONS = --sgml-mode --output-format=xml --source-dir=$(top_srcdir)/sysdeps/common + +# The directory containing the source code. Relative to $(srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting the functions and macros. +# e.g. DOC_SOURCE_DIR=../../../gtk +DOC_SOURCE_DIR = $(top_srcdir)/include/glibtop + +# Used for dependencies. The docs will be rebuilt if any of these change. +# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h +# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c +HFILE_GLOB = $(top_srcdir)/include/glibtop/*.h +CFILE_GLOB = $(top_srcdir)/sysdeps/common/*.c + +# Header files to ignore when scanning. +# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h +IGNORE_HFILES = error.h global.h gnuserv.h init_hooks.h write.h read.h read_data.h config.h libgtopconfig.h +EXTRA_HFILES = $(top_srcdir)/glibtop.h + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +# e.g. content_files=running.sgml building.sgml changes-2.0.sgml +content_files = version.xml + +# Images to copy into HTML directory. +# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png +HTML_IMAGES = +GTKDOC_LIBS = +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) +TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) +SETUP_FILES = \ + $(content_files) \ + $(expand_content_files) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + + +# This includes the standard gtk-doc make rules, copied by gtkdocize. + +# Other files to distribute +# e.g. EXTRA_DIST += version.xml.in +EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) version.xml.in +DOC_STAMPS = setup-build.stamp scan-build.stamp sgml-build.stamp \ + html-build.stamp pdf-build.stamp \ + sgml.stamp html.stamp pdf.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test +@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = +@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp +@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = +@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp + +#### setup #### +GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_$(V)) +GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; + +#### scan #### +GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_$(V)) +GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; +GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_$(V)) +GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; + +#### xml #### +GTK_DOC_V_XML = $(GTK_DOC_V_XML_$(V)) +GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_XML_0 = @echo " DOC Building XML"; + +#### html #### +GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_$(V)) +GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; +GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_$(V)) +GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; + +#### pdf #### +GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_$(V)) +GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/reference/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/reference/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/gtk-doc.make $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +version.xml: $(top_builddir)/config.status $(srcdir)/version.xml.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook +check-am: all-am +check: check-am +@ENABLE_GTK_DOC_FALSE@all-local: +all-am: Makefile all-local +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-local + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic \ + maintainer-clean-local + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-local + +.MAKE: install-am install-strip + +.PHONY: all all-am all-local check check-am clean clean-generic \ + clean-libtool clean-local cscopelist-am ctags-am dist-hook \ + distclean distclean-generic distclean-libtool distclean-local \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-data-local \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + maintainer-clean-local mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-local + +.PRECIOUS: Makefile + + +gtkdoc-check.test: Makefile + $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ + echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ + chmod +x $@ + +all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) +.PHONY: all-gtk-doc + +@ENABLE_GTK_DOC_TRUE@all-local: all-gtk-doc + +docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) + +$(REPORT_FILES): sgml-build.stamp + +setup-build.stamp: + -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ + if test "x$$files" != "x" ; then \ + for file in $$files ; do \ + destdir=`dirname $(abs_builddir)/$$file`; \ + test -d "$$destdir" || mkdir -p "$$destdir"; \ + test -f $(abs_srcdir)/$$file && \ + cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ + done; \ + fi; \ + fi + $(AM_V_at)touch setup-build.stamp + +scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) + $(GTK_DOC_V_SCAN)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) + $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ + scanobj_options=""; \ + gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ + fi; \ + fi; \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ + else \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + $(AM_V_at)touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent + $(GTK_DOC_V_XML)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) + $(AM_V_at)touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +xml/gtkdocentities.ent: Makefile + $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + ) > $@ + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ + mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$$?" = "0"; then \ + mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + -@test "x$(HTML_IMAGES)" = "x" || \ + for file in $(HTML_IMAGES) ; do \ + if test -f $(abs_srcdir)/$$file ; then \ + cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ + fi; \ + if test -f $(abs_builddir)/$$file ; then \ + cp $(abs_builddir)/$$file $(abs_builddir)/html; \ + fi; \ + done; + $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + $(AM_V_at)touch html-build.stamp + +pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ + mkpdf_options=""; \ + gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkpdf_options="$$mkpdf_options --verbose"; \ + fi; \ + fi; \ + if test "x$(HTML_IMAGES)" != "x"; then \ + for img in $(HTML_IMAGES); do \ + part=`dirname $$img`; \ + echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ + if test $$? != 0; then \ + mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ + fi; \ + done; \ + fi; \ + gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) + $(AM_V_at)touch pdf-build.stamp + +############## + +clean-local: + @rm -f *~ *.bak + @rm -rf .libs + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ + rm -f $(DOC_MODULE).types; \ + fi + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ + rm -f $(DOC_MODULE)-sections.txt; \ + fi + +distclean-local: + @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ + fi + +maintainer-clean-local: + @rm -rf xml html + +install-data-local: + @installfiles=`echo $(builddir)/html/*`; \ + if test "$$installfiles" = '$(builddir)/html/*'; \ + then echo 1>&2 'Nothing to install' ; \ + else \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + $(mkinstalldirs) $${installdir} ; \ + for i in $$installfiles; do \ + echo ' $(INSTALL_DATA) '$$i ; \ + $(INSTALL_DATA) $$i $${installdir}; \ + done; \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ + fi + +uninstall-local: + @if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + rm -rf $${installdir} + +# +# Require gtk-doc when making dist +# +@HAVE_GTK_DOC_TRUE@dist-check-gtkdoc: docs +@HAVE_GTK_DOC_FALSE@dist-check-gtkdoc: +@HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc is needed to run 'make dist'. ***" +@HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc was not found when 'configure' ran. ***" +@HAVE_GTK_DOC_FALSE@ @echo "*** please install gtk-doc and rerun 'configure'. ***" +@HAVE_GTK_DOC_FALSE@ @false + +dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local + @mkdir $(distdir)/html + @cp ./html/* $(distdir)/html + @-cp ./$(DOC_MODULE).pdf $(distdir)/ + @-cp ./$(DOC_MODULE).types $(distdir)/ + @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ + @cd $(distdir) && rm -f $(DISTCLEANFILES) + @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs + +# 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: diff --git a/doc/reference/html/home.png b/doc/reference/html/home.png new file mode 100644 index 0000000..9346b33 Binary files /dev/null and b/doc/reference/html/home.png differ diff --git a/doc/reference/html/index.html b/doc/reference/html/index.html new file mode 100644 index 0000000..3a362b1 --- /dev/null +++ b/doc/reference/html/index.html @@ -0,0 +1,197 @@ + + + + +Libgtop Reference Manual: Libgtop Reference Manual + + + + + + + + +
+
+
+
+
+
+

+Martin Baulig +

+


+     
+   

+
+
+

+Germán Poó-Caamaño +

+


+     
+   

+
+
+

for libgtop 2.38.0

+
+

Permission is granted to copy, distribute and/or modify + this document under the terms of the GNU Free + Documentation License, Version 1.1 or any later + version published by the Free Software Foundation with no + Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. You may obtain a copy of the GNU Free + Documentation License from the Free Software + Foundation by visiting their Web site or by writing + to: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA.

+

Many of the names used by companies to distinguish their + products and services are claimed as trademarks. Where those + names appear in any GNOME documentation, and those trademarks + are made aware to the members of the GNOME Documentation + Project, the names have been printed in caps or initial + caps.

+
+
+

Abstract

+

+ LibGTop is a library to get system specific data such as CPU and + Memory Usage and information about running Processes.

+

On Systems like Solaris or Digital Unix where you need special + privileges to get those data, it uses a setuid/setgid server to do + so.

+

Even if LibGTop is a part of the GNOME desktop environment + (@uref{http://www.gnome.org}), the main interface of LibGTop is totally + independent from any particular desktop environment, so you can also + use it as a standalone library in any piece of GPLed software.

+

This manual documents the interfaces of the libgtop + library and has some short notes to help get you up to speed + with using the library.

+
+
+
+
+
+
White paper
+
+
Introduction
+
Overview
+
+
Interface Design: Things that need to be considered
+
Server Implementation: The LibGTop "server"
+
+
+
Libgtop Library Reference
+
+
+GlibTop — Server initilization +
+
+Close +
+
+Command +
+
+GlibTop Server +
+
+Net Load — Network Load. +
+
+PPP — PPP Usage. +
+
+Shared Memory Limits +
+
+Uptime +
+
+Net List — Network Devices List. +
+
+open +
+
+parameter +
+
+Process Arguments — Get process command line arguments +
+
+procmem +
+
+procopenfiles +
+
+procsegment +
+
+procsignal +
+
+sysdeps +
+
+procstate +
+
+procuid +
+
+Process Time — Get process time information +
+
+signal +
+
+procmap +
+
+sysinfo +
+
+union +
+
+version +
+
+Process List — List running processes +
+
+sem_limits +
+
+prockernel +
+
+fsusage +
+
+loadavg +
+
+mem +
+
+mountlist +
+
+msg_limits +
+
+cpu +
+
+swap +
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/left-insensitive.png b/doc/reference/html/left-insensitive.png new file mode 100644 index 0000000..3269393 Binary files /dev/null and b/doc/reference/html/left-insensitive.png differ diff --git a/doc/reference/html/left.png b/doc/reference/html/left.png new file mode 100644 index 0000000..2abde03 Binary files /dev/null and b/doc/reference/html/left.png differ diff --git a/doc/reference/html/libgtop-Close.html b/doc/reference/html/libgtop-Close.html new file mode 100644 index 0000000..8917112 --- /dev/null +++ b/doc/reference/html/libgtop-Close.html @@ -0,0 +1,119 @@ + + + + +Close: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Close

+

Close

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_close () +
+void + +glibtop_close_r () +
+void + +glibtop_close_s () +
+void + +glibtop_close_p () +
+
+
+

Includes

+
#include <glibtop/close.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_close ()

+
void
+glibtop_close (void);
+

Close the connection to the server.

+
+
+
+

glibtop_close_r ()

+
void
+glibtop_close_r (glibtop *server);
+
+
+
+

glibtop_close_s ()

+
void
+glibtop_close_s (glibtop *server);
+
+
+
+

glibtop_close_p ()

+
void
+glibtop_close_p (glibtop *server);
+
+
+
+

Types and Values

+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-Command.html b/doc/reference/html/libgtop-Command.html new file mode 100644 index 0000000..b27f11e --- /dev/null +++ b/doc/reference/html/libgtop-Command.html @@ -0,0 +1,428 @@ + + + + +Command: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Command

+

Command

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + +
#define +glibtop_call() +
+void * + +glibtop_call_l () +
+void * + +glibtop_call_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_CMND_QUIT
#defineGLIBTOP_CMND_SYSDEPS
#defineGLIBTOP_CMND_CPU
#defineGLIBTOP_CMND_MEM
#defineGLIBTOP_CMND_SWAP
#defineGLIBTOP_CMND_UPTIME
#defineGLIBTOP_CMND_LOADAVG
#defineGLIBTOP_CMND_SHM_LIMITS
#defineGLIBTOP_CMND_MSG_LIMITS
#defineGLIBTOP_CMND_SEM_LIMITS
#defineGLIBTOP_CMND_PROCLIST
#defineGLIBTOP_CMND_PROC_STATE
#defineGLIBTOP_CMND_PROC_UID
#defineGLIBTOP_CMND_PROC_MEM
#defineGLIBTOP_CMND_PROC_TIME
#defineGLIBTOP_CMND_PROC_SIGNAL
#defineGLIBTOP_CMND_PROC_KERNEL
#defineGLIBTOP_CMND_PROC_SEGMENT
#defineGLIBTOP_CMND_PROC_ARGS
#defineGLIBTOP_CMND_PROC_MAP
#defineGLIBTOP_CMND_MOUNTLIST
#defineGLIBTOP_CMND_FSUSAGE
#defineGLIBTOP_CMND_NETLOAD
#defineGLIBTOP_CMND_PPP
#defineGLIBTOP_CMND_NETLIST
#defineGLIBTOP_CMND_PROC_OPEN_FILES
#defineGLIBTOP_MAX_CMND
structglibtop_command
structglibtop_response
unionglibtop_response_union
+
+
+

Includes

+
#include <glibtop/command.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_call()

+
#define glibtop_call(p1, p2, p3, p4) glibtop_call_r(glibtop_global_server, p1, p2, p3, p4)
+
+
+
+
+

glibtop_call_l ()

+
void *
+glibtop_call_l (glibtop *server,
+                unsigned  command,
+                size_t send_size,
+                const void *send_buf,
+                size_t recv_size,
+                void *recv_buf);
+
+
+
+

glibtop_call_s ()

+
void *
+glibtop_call_s (glibtop *server,
+                unsigned  command,
+                size_t send_size,
+                const void *send_buf,
+                size_t recv_size,
+                void *recv_buf);
+
+
+
+

Types and Values

+
+

GLIBTOP_CMND_QUIT

+
#define GLIBTOP_CMND_QUIT		0
+
+
+
+
+

GLIBTOP_CMND_SYSDEPS

+
#define GLIBTOP_CMND_SYSDEPS		1
+
+
+
+
+

GLIBTOP_CMND_CPU

+
#define GLIBTOP_CMND_CPU		2
+
+
+
+
+

GLIBTOP_CMND_MEM

+
#define GLIBTOP_CMND_MEM		3
+
+
+
+
+

GLIBTOP_CMND_SWAP

+
#define GLIBTOP_CMND_SWAP		4
+
+
+
+
+

GLIBTOP_CMND_UPTIME

+
#define GLIBTOP_CMND_UPTIME		5
+
+
+
+
+

GLIBTOP_CMND_LOADAVG

+
#define GLIBTOP_CMND_LOADAVG		6
+
+
+
+
+

GLIBTOP_CMND_SHM_LIMITS

+
#define GLIBTOP_CMND_SHM_LIMITS		7
+
+
+
+
+

GLIBTOP_CMND_MSG_LIMITS

+
#define GLIBTOP_CMND_MSG_LIMITS		8
+
+
+
+
+

GLIBTOP_CMND_SEM_LIMITS

+
#define GLIBTOP_CMND_SEM_LIMITS		9
+
+
+
+
+

GLIBTOP_CMND_PROCLIST

+
#define GLIBTOP_CMND_PROCLIST		10
+
+
+
+
+

GLIBTOP_CMND_PROC_STATE

+
#define GLIBTOP_CMND_PROC_STATE		11
+
+
+
+
+

GLIBTOP_CMND_PROC_UID

+
#define GLIBTOP_CMND_PROC_UID		12
+
+
+
+
+

GLIBTOP_CMND_PROC_MEM

+
#define GLIBTOP_CMND_PROC_MEM		13
+
+
+
+
+

GLIBTOP_CMND_PROC_TIME

+
#define GLIBTOP_CMND_PROC_TIME		14
+
+
+
+
+

GLIBTOP_CMND_PROC_SIGNAL

+
#define GLIBTOP_CMND_PROC_SIGNAL 15
+
+
+
+
+

GLIBTOP_CMND_PROC_KERNEL

+
#define GLIBTOP_CMND_PROC_KERNEL 16
+
+
+
+
+

GLIBTOP_CMND_PROC_SEGMENT

+
#define GLIBTOP_CMND_PROC_SEGMENT 17
+
+
+
+
+

GLIBTOP_CMND_PROC_ARGS

+
#define GLIBTOP_CMND_PROC_ARGS		18
+
+
+
+
+

GLIBTOP_CMND_PROC_MAP

+
#define GLIBTOP_CMND_PROC_MAP		19
+
+
+
+
+

GLIBTOP_CMND_MOUNTLIST

+
#define GLIBTOP_CMND_MOUNTLIST		20
+
+
+
+
+

GLIBTOP_CMND_FSUSAGE

+
#define GLIBTOP_CMND_FSUSAGE		21
+
+
+
+
+

GLIBTOP_CMND_NETLOAD

+
#define GLIBTOP_CMND_NETLOAD		22
+
+
+
+
+

GLIBTOP_CMND_PPP

+
#define GLIBTOP_CMND_PPP		23
+
+
+
+
+

GLIBTOP_CMND_NETLIST

+
#define GLIBTOP_CMND_NETLIST		24
+
+
+
+
+

GLIBTOP_CMND_PROC_OPEN_FILES

+
#define GLIBTOP_CMND_PROC_OPEN_FILES 25
+
+
+
+
+

GLIBTOP_MAX_CMND

+
#define GLIBTOP_MAX_CMND		29
+
+
+
+
+

struct glibtop_command

+
struct glibtop_command {
+	guint64 command;
+	guint64 size, data_size;
+	char		parameter [_GLIBTOP_PARAM_SIZE];
+};
+
+
+
+
+

struct glibtop_response

+
struct glibtop_response {
+	gint64 offset;
+	guint64 size, data_size;
+	glibtop_response_union u;
+};
+
+
+
+
+

union glibtop_response_union

+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-GlibTop-Server.html b/doc/reference/html/libgtop-GlibTop-Server.html new file mode 100644 index 0000000..21d51a3 --- /dev/null +++ b/doc/reference/html/libgtop-GlibTop-Server.html @@ -0,0 +1,53 @@ + + + + +GlibTop Server: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GlibTop Server

+

GlibTop Server

+
+
+

Includes

+
#include <glibtop/glibtop-server.h>
+
+
+
+

Description

+
+
+

Functions

+

+
+
+

Types and Values

+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-GlibTop.html b/doc/reference/html/libgtop-GlibTop.html new file mode 100644 index 0000000..c9b6283 --- /dev/null +++ b/doc/reference/html/libgtop-GlibTop.html @@ -0,0 +1,213 @@ + + + + +GlibTop: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GlibTop

+

GlibTop — Server initilization

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
#define +LIBGTOP_CHECK_VERSION() +
+glibtop * + +glibtop_init () +
+glibtop * + +glibtop_init_r () +
+glibtop * + +glibtop_init_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_MOUNTENTRY_LEN
structglibtop
extern glibtop *glibtop_global_server
extern const unsigned long glibtop_server_features
+
+
+

Includes

+
#include <glibtop.h>
+
+
+
+

Description

+

You do not need to worry about the glibtop * server structure if +you don't need - the library exports a glibtop_global_server +which you can use everywhere a glibtop * is expected.

+

Most of the library and all of the sysdeps function also have an alias +(which is the function name without the <suffix>_l</suffix>,

+<suffix>_s</suffix> or <suffix>_r</suffix> suffix) which don't +

take a glibtop * as argument but uses the glibtop_global_server +instead.

+
+
+

Functions

+
+

LIBGTOP_CHECK_VERSION()

+
#define             LIBGTOP_CHECK_VERSION(major, minor, micro)
+
+
+
+

glibtop_init ()

+
glibtop *
+glibtop_init (void);
+

Server initialization.

+
+

Returns

+

A glibtop reference.

+
+
+
+
+

glibtop_init_r ()

+
glibtop *
+glibtop_init_r (glibtop **server_ptr,
+                unsigned long  features,
+                unsigned  flags);
+
+
+
+

glibtop_init_s ()

+
glibtop *
+glibtop_init_s (glibtop **server_ptr,
+                unsigned long  features,
+                unsigned  flags);
+
+
+
+

Types and Values

+
+

GLIBTOP_MOUNTENTRY_LEN

+
#define GLIBTOP_MOUNTENTRY_LEN 79
+
+
+
+
+

struct glibtop

+
struct glibtop {
+	unsigned flags;
+	unsigned method;		/* Server Method */
+	unsigned error_method;		/* Error Method */
+	int input [2];			/* Pipe client <- server */
+	int output [2];			/* Pipe client -> server */
+	int socket;			/* Accepted connection of a socket */
+	int ncpu;			/* Number of CPUs, zero if single-processor */
+	int real_ncpu;			/* Real number of CPUs. Only ncpu are monitored */
+	unsigned long os_version_code; /* Version code of the operating system */
+	const char *name;		/* Program name for error messages */
+	const char *server_command; /* Command used to invoke server */
+	const char *server_host; /* Host the server should run on */
+	const char *server_user; /* Name of the user on the target host */
+	const char *server_rsh;		/* Command used to connect to the target host */
+	unsigned long features;		/* Server is required for this features */
+	unsigned long server_port; /* Port on which daemon is listening */
+	glibtop_sysdeps sysdeps; /* Detailed feature list */
+	glibtop_sysdeps required; /* Required feature list */
+	pid_t pid;			/* PID of the server */
+
+	uid_t uid;
+	uid_t euid;
+	gid_t gid;
+	gid_t egid;
+
+	glibtop_machine *machine; /* Machine dependent data */
+};
+
+
+
+
+

glibtop_global_server

+
extern glibtop *glibtop_global_server;
+
+
+
+
+

glibtop_server_features

+
extern const unsigned long glibtop_server_features;
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-Net-List.html b/doc/reference/html/libgtop-Net-List.html new file mode 100644 index 0000000..7482bad --- /dev/null +++ b/doc/reference/html/libgtop-Net-List.html @@ -0,0 +1,310 @@ + + + + +Net List: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Net List

+

Net List — Network Devices List.

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+char ** + +glibtop_get_netlist () +
+char ** + +glibtop_get_netlist_l () +
+char ** + +glibtop_get_netlist_p () +
+char ** + +glibtop_get_netlist_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_NETLIST_NUMBER
#defineGLIBTOP_MAX_NETLIST
structglibtop_netlist
#defineglibtop_get_netlist_r
+
+
+

Includes

+
#include <glibtop/netlist.h>
+
+
+
+

Description

+

The application class handles ...

+
+
+

Functions

+
+

glibtop_get_netlist ()

+
char **
+glibtop_get_netlist (glibtop_netlist *buf);
+
+

Parameters

+
+++++ + + + + + +

buf

a glibtop_netlist

 
+
+
+

Returns

+

an array of network +interface names.

+

[array zero-terminated=1][transfer none]

+
+
+
+
+

glibtop_get_netlist_l ()

+
char **
+glibtop_get_netlist_l (glibtop *server,
+                       glibtop_netlist *buf);
+
+

Parameters

+
+++++ + + + + + + + + + + + + +

server

a glibtop server

 

buf

a glibtop_netlist

 
+
+
+

Returns

+

an array of network +interface names.

+

[array zero-terminated=1][transfer none]

+
+
+
+
+

glibtop_get_netlist_p ()

+
char **
+glibtop_get_netlist_p (glibtop *server,
+                       glibtop_netlist *buf);
+
+

Parameters

+
+++++ + + + + + + + + + + + + +

server

a glibtop server

 

buf

a glibtop_netlist

 
+
+
+

Returns

+

an array of network +interface names.

+

[array zero-terminated=1][transfer none]

+
+
+
+
+

glibtop_get_netlist_s ()

+
char **
+glibtop_get_netlist_s (glibtop *server,
+                       glibtop_netlist *buf);
+
+

Parameters

+
+++++ + + + + + + + + + + + + +

server

a glibtop server

 

buf

a glibtop_netlist

 
+
+
+

Returns

+

an array of network +interface names.

+

[array zero-terminated=1][transfer none]

+
+
+
+
+

Types and Values

+
+

GLIBTOP_NETLIST_NUMBER

+
#define GLIBTOP_NETLIST_NUMBER		0
+
+
+
+
+

GLIBTOP_MAX_NETLIST

+
#define GLIBTOP_MAX_NETLIST		1
+
+
+
+
+

struct glibtop_netlist

+
struct glibtop_netlist {
+	guint64 flags;
+	guint32 number;
+};
+
+
+

Members

+
+++++ + + + + + + + + + + + + +

guint64 flags;

  

guint32 number;

Number of entries in the returned list.

 
+
+
+
+
+

glibtop_get_netlist_r

+
#define glibtop_get_netlist_r		glibtop_get_netlist_p
+
+
+
+
+

See Also

+

libgtop-netload

+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-Net-Load.html b/doc/reference/html/libgtop-Net-Load.html new file mode 100644 index 0000000..eff37b8 --- /dev/null +++ b/doc/reference/html/libgtop-Net-Load.html @@ -0,0 +1,405 @@ + + + + +Net Load: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Net Load

+

Net Load — Network Load.

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_netload () +
+void + +glibtop_get_netload_l () +
+void + +glibtop_get_netload_p () +
+void + +glibtop_get_netload_s () +
+
+
+

Types and Values

+ +
+
+

Includes

+
#include <glibtop/netload.h>
+
+
+
+

Description

+

The application class handles ...

+
+
+

Functions

+
+

glibtop_get_netload ()

+
void
+glibtop_get_netload (glibtop_netload *buf,
+                     const char *interface);
+

Recolects network statistics for interface + +(which is the same than in ifconfig). +The values are returned into buf +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

buf

The variable where the results will be assigned.

 

interface

The name of the network interface.

 
+
+
+
+
+

glibtop_get_netload_l ()

+
void
+glibtop_get_netload_l (glibtop *server,
+                       glibtop_netload *buf,
+                       const char *interface);
+
+
+
+

glibtop_get_netload_p ()

+
void
+glibtop_get_netload_p (glibtop *server,
+                       glibtop_netload *buf,
+                       const char *interface);
+
+
+
+

glibtop_get_netload_s ()

+
void
+glibtop_get_netload_s (glibtop *server,
+                       glibtop_netload *buf,
+                       const char *interface);
+
+
+
+

Types and Values

+
+

GLIBTOP_NETLOAD_IF_FLAGS

+
#define GLIBTOP_NETLOAD_IF_FLAGS 0
+
+
+
+
+

GLIBTOP_NETLOAD_MTU

+
#define GLIBTOP_NETLOAD_MTU		1
+
+
+
+
+

GLIBTOP_NETLOAD_SUBNET

+
#define GLIBTOP_NETLOAD_SUBNET		2
+
+
+
+
+

GLIBTOP_NETLOAD_ADDRESS

+
#define GLIBTOP_NETLOAD_ADDRESS		3
+
+
+
+
+

GLIBTOP_NETLOAD_PACKETS_IN

+
#define GLIBTOP_NETLOAD_PACKETS_IN 4
+
+
+
+
+

GLIBTOP_NETLOAD_PACKETS_OUT

+
#define GLIBTOP_NETLOAD_PACKETS_OUT 5
+
+
+
+
+

GLIBTOP_NETLOAD_PACKETS_TOTAL

+
#define GLIBTOP_NETLOAD_PACKETS_TOTAL 6
+
+
+
+
+

GLIBTOP_NETLOAD_BYTES_IN

+
#define GLIBTOP_NETLOAD_BYTES_IN 7
+
+
+
+
+

GLIBTOP_NETLOAD_BYTES_OUT

+
#define GLIBTOP_NETLOAD_BYTES_OUT 8
+
+
+
+
+

GLIBTOP_NETLOAD_BYTES_TOTAL

+
#define GLIBTOP_NETLOAD_BYTES_TOTAL 9
+
+
+
+
+

GLIBTOP_NETLOAD_ERRORS_IN

+
#define GLIBTOP_NETLOAD_ERRORS_IN 10
+
+
+
+
+

GLIBTOP_NETLOAD_ERRORS_OUT

+
#define GLIBTOP_NETLOAD_ERRORS_OUT 11
+
+
+
+
+

GLIBTOP_NETLOAD_ERRORS_TOTAL

+
#define GLIBTOP_NETLOAD_ERRORS_TOTAL 12
+
+
+
+
+

GLIBTOP_NETLOAD_COLLISIONS

+
#define GLIBTOP_NETLOAD_COLLISIONS 13
+
+
+
+
+

GLIBTOP_NETLOAD_ADDRESS6

+
#define GLIBTOP_NETLOAD_ADDRESS6 14
+
+
+
+
+

GLIBTOP_NETLOAD_PREFIX6

+
#define GLIBTOP_NETLOAD_PREFIX6		15
+
+
+
+
+

GLIBTOP_NETLOAD_SCOPE6

+
#define GLIBTOP_NETLOAD_SCOPE6		16
+
+
+
+
+

GLIBTOP_NETLOAD_HWADDRESS

+
#define GLIBTOP_NETLOAD_HWADDRESS 17
+
+
+
+
+

GLIBTOP_MAX_NETLOAD

+
#define GLIBTOP_MAX_NETLOAD		18
+
+
+
+
+

struct glibtop_netload

+
struct glibtop_netload {
+	guint64 flags;
+	guint64 if_flags;		/* GLIBTOP_NETLOAD_IF_FLAGS */
+
+	guint32 mtu;			/* GLIBTOP_NETLOAD_MTU		*/
+	guint32 subnet;			/* GLIBTOP_NETLOAD_SUBNET */
+	guint32 address;		/* GLIBTOP_NETLOAD_ADDRESS */
+
+	guint64 packets_in;		/* GLIBTOP_NETLOAD_PACKETS_IN */
+	guint64 packets_out;		/* GLIBTOP_NETLOAD_PACKETS_OUT */
+	guint64 packets_total;		/* GLIBTOP_NETLOAD_PACKETS_TOTAL*/
+	guint64 bytes_in;		/* GLIBTOP_NETLOAD_BYTES_IN */
+	guint64 bytes_out;		/* GLIBTOP_NETLOAD_BYTES_OUT */
+	guint64 bytes_total;		/* GLIBTOP_NETLOAD_BYTES_TOTAL */
+	guint64 errors_in;		/* GLIBTOP_NETLOAD_ERRORS_IN */
+	guint64 errors_out;		/* GLIBTOP_NETLOAD_ERRORS_OUT */
+	guint64 errors_total;		/* GLIBTOP_NETLOAD_ERRORS_TOTAL */
+	guint64 collisions;		/* GLIBTOP_NETLOAD_COLLISIONS */
+
+	guint8 address6[16];		/* GLIBTOP_NETLOAD_ADDRESS6     */
+	guint8 prefix6[16];		/* GLIBTOP_NETLOAD_PREXIF6      */
+	guint8 scope6;			/* GLIBTOP_NETLOAD_SCOPE6       */
+
+	guint8 hwaddress[8];		/* GLIBTOP_NETLOAD_HWADDRESS    */
+};
+
+
+
+
+

glibtop_get_netload_r

+
#define glibtop_get_netload_r glibtop_get_netload_p
+
+
+
+
+

See Also

+

libtop-netlist

+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-PPP.html b/doc/reference/html/libgtop-PPP.html new file mode 100644 index 0000000..157694d --- /dev/null +++ b/doc/reference/html/libgtop-PPP.html @@ -0,0 +1,227 @@ + + + + +PPP: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

PPP

+

PPP — PPP Usage.

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_ppp () +
+void + +glibtop_get_ppp_l () +
+void + +glibtop_get_ppp_p () +
+void + +glibtop_get_ppp_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_PPP_STATE
#defineGLIBTOP_PPP_BYTES_IN
#defineGLIBTOP_PPP_BYTES_OUT
#defineGLIBTOP_MAX_PPP
structglibtop_ppp
#defineglibtop_get_ppp_r
+
+
+

Includes

+
#include <glibtop/ppp.h>
+
+
+
+

Description

+

Management of a PPP device.

+
+
+

Functions

+
+

glibtop_get_ppp ()

+
void
+glibtop_get_ppp (glibtop_ppp *buf,
+                 unsigned short  device);
+

Get the PPP usage.

+
+

Parameters

+
+++++ + + + + + +

buf

A location to return the PPP usage +short +device: The device to ask information

 
+
+
+
+
+

glibtop_get_ppp_l ()

+
void
+glibtop_get_ppp_l (glibtop *server,
+                   glibtop_ppp *buf,
+                   unsigned short  device);
+
+
+
+

glibtop_get_ppp_p ()

+
void
+glibtop_get_ppp_p (glibtop *server,
+                   glibtop_ppp *buf,
+                   unsigned short  device);
+
+
+
+

glibtop_get_ppp_s ()

+
void
+glibtop_get_ppp_s (glibtop *server,
+                   glibtop_ppp *buf,
+                   unsigned short  device);
+
+
+
+

Types and Values

+
+

GLIBTOP_PPP_STATE

+
#define GLIBTOP_PPP_STATE 0
+
+
+
+
+

GLIBTOP_PPP_BYTES_IN

+
#define GLIBTOP_PPP_BYTES_IN 1
+
+
+
+
+

GLIBTOP_PPP_BYTES_OUT

+
#define GLIBTOP_PPP_BYTES_OUT 2
+
+
+
+
+

GLIBTOP_MAX_PPP

+
#define GLIBTOP_MAX_PPP		3
+
+
+
+
+

struct glibtop_ppp

+
struct glibtop_ppp {
+	guint64 flags;
+	guint64 state;			/* GLIBTOP_PPP_STATE		*/
+	guint64 bytes_in;		/* GLIBTOP_PPP_BYTES_IN		*/
+	guint64 bytes_out;		/* GLIBTOP_PPP_BYTES_OUT */
+};
+
+
+
+
+

glibtop_get_ppp_r

+
#define glibtop_get_ppp_r glibtop_get_ppp_p
+
+
+
+
+

See Also

+

libgtop-netload, libgtop-netlist

+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-Process-Arguments.html b/doc/reference/html/libgtop-Process-Arguments.html new file mode 100644 index 0000000..58ba108 --- /dev/null +++ b/doc/reference/html/libgtop-Process-Arguments.html @@ -0,0 +1,196 @@ + + + + +Process Arguments: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Process Arguments

+

Process Arguments — Get process command line arguments

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + +
+char * + +glibtop_get_proc_args () +
+char ** + +glibtop_get_proc_argv () +
+
+
+

Types and Values

+
++++ + + + + +
structglibtop_proc_args
+
+
+

Includes

+
#include <glibtop/procargs.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_proc_args ()

+
char *
+glibtop_get_proc_args (glibtop_proc_args *buf,
+                       pid_t pid,
+                       unsigned  max_len);
+

Get process command line arguments.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

buf

Struct with size +of returned string.

 

pid

Process id

 

max_len

Maximum length of string to return (use zero to get all arguments).

 
+
+
+

Returns

+

pid +'s command line arguments separated by null bytes; the length of +this string is returned in the buf +size field. You are required to free +the string when done.

+
+
+
+
+

glibtop_get_proc_argv ()

+
char **
+glibtop_get_proc_argv (glibtop_proc_args *buf,
+                       pid_t pid,
+                       unsigned  max_len);
+

Get process command line arguments.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

buf

Struct with size +of combined returned arguments.

 

pid

Process id

 

max_len

Maximum length of all arguments combined (use zero to get all arguments).

 
+
+
+

Returns

+

A NULL-terminated array of strings with all arguments of process pid +(up to max_len +characters). Remember to g_strfreev +the returned array to avoid a memory leak.

+
+
+
+
+

Types and Values

+
+

struct glibtop_proc_args

+
struct glibtop_proc_args {
+	guint64 flags;
+	guint64 size;			/* GLIBTOP_PROC_ARGS_SIZE */
+};
+
+
+
+
+

See Also

+

libgtop-Process-List

+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-Process-List.html b/doc/reference/html/libgtop-Process-List.html new file mode 100644 index 0000000..a46124e --- /dev/null +++ b/doc/reference/html/libgtop-Process-List.html @@ -0,0 +1,302 @@ + + + + +Process List: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Process List

+

Process List — List running processes

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + +
+pid_t * + +glibtop_get_proclist () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_KERN_PROC_ALL
#defineGLIBTOP_KERN_PROC_PID
#defineGLIBTOP_KERN_PROC_PGRP
#defineGLIBTOP_KERN_PROC_SESSION
#defineGLIBTOP_KERN_PROC_TTY
#defineGLIBTOP_KERN_PROC_UID
#defineGLIBTOP_KERN_PROC_RUID
#defineGLIBTOP_KERN_PROC_MASK
#defineGLIBTOP_EXCLUDE_IDLE
#defineGLIBTOP_EXCLUDE_SYSTEM
#defineGLIBTOP_EXCLUDE_NOTTY
structglibtop_proclist
+
+
+

Includes

+
#include <glibtop/proclist.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_proclist ()

+
pid_t *
+glibtop_get_proclist (glibtop_proclist *buf,
+                      gint64 which,
+                      gint64 arg);
+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

buf

Extra return information, see glibtop_proclist.

 

which

Criteria for processes in returned list. See the GLIBTOP_KERN_PROC_* and GLIBTOP_EXCLUDE_* constants.

 

arg

Extra arguments applied to which +. Only GLIBTOP_KERN_PROC_* constants take arguments, see each constant definition for particular arg +description.

 
+
+
+

Returns

+

A list of running processes or NULL on error. The +returned list is allocated using g_malloc and must be +freed using g_free to avoid a memory leak.

+
+
+
+
+

Types and Values

+
+

GLIBTOP_KERN_PROC_ALL

+
#define GLIBTOP_KERN_PROC_ALL		0
+
+

Return information about all processes

+
+
+
+

GLIBTOP_KERN_PROC_PID

+
#define GLIBTOP_KERN_PROC_PID		1
+
+

Return all processes with the pid which is passed in arg +. You can use this to find out whether some process still exists.

+
+
+
+

GLIBTOP_KERN_PROC_PGRP

+
#define GLIBTOP_KERN_PROC_PGRP		2
+
+

Return all processes in the process group passed in arg +.

+
+
+
+

GLIBTOP_KERN_PROC_SESSION

+
#define GLIBTOP_KERN_PROC_SESSION 3
+
+

Return all processes in the session passed in arg +.

+
+
+
+

GLIBTOP_KERN_PROC_TTY

+
#define GLIBTOP_KERN_PROC_TTY		4
+
+

Return all processes which have the controlling tty passed in arg + +(which is interpreted as the device number).

+
+
+
+

GLIBTOP_KERN_PROC_UID

+
#define GLIBTOP_KERN_PROC_UID		5
+
+

Return all processes with the effective uid passed in arg +.

+
+
+
+

GLIBTOP_KERN_PROC_RUID

+
#define GLIBTOP_KERN_PROC_RUID		6
+
+

Return all processes with the real uid passed in arg +.

+
+
+
+

GLIBTOP_KERN_PROC_MASK

+
#define GLIBTOP_KERN_PROC_MASK		15
+
+
+
+
+

GLIBTOP_EXCLUDE_IDLE

+
#define GLIBTOP_EXCLUDE_IDLE		0x1000
+
+

Exclude idle processes.

+
+
+
+

GLIBTOP_EXCLUDE_SYSTEM

+
#define GLIBTOP_EXCLUDE_SYSTEM		0x2000
+
+

Exclude system (on most UNIXes root's) processes.

+
+
+
+

GLIBTOP_EXCLUDE_NOTTY

+
#define GLIBTOP_EXCLUDE_NOTTY		0x4000
+
+

Exclude processes without a controlling terminal.

+
+
+
+

struct glibtop_proclist

+
struct glibtop_proclist {
+	guint64 flags;
+	guint64 number;			/* GLIBTOP_PROCLIST_NUMBER */
+	guint64 total;			/* GLIBTOP_PROCLIST_TOTAL */
+	guint64 size;			/* GLIBTOP_PROCLIST_SIZE */
+};
+
+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

guint64 flags;

  

guint64 number;

Number of entries in the returned list.

 

guint64 total;

Total size of the returned list (this equals number +* size +).

 

guint64 size;

Size of a single entry in the returned list +(this equals sizeof(unsigned)).

 
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-Process-Time.html b/doc/reference/html/libgtop-Process-Time.html new file mode 100644 index 0000000..d2f3ca4 --- /dev/null +++ b/doc/reference/html/libgtop-Process-Time.html @@ -0,0 +1,214 @@ + + + + +Process Time: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Process Time

+

Process Time — Get process time information

+
+
+

Stability Level

+Stable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + +
+void + +glibtop_get_proc_time () +
+
+
+

Types and Values

+
++++ + + + + +
structglibtop_proc_time
+
+
+

Includes

+
#include <glibtop/proctime.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_proc_time ()

+
void
+glibtop_get_proc_time (glibtop_proc_time *buf,
+                       pid_t pid);
+

Get process time information.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

buf

Returned process time information - see glibtop_proc_time.

 

pid

Process id

 
+
+
+
+
+

Types and Values

+
+

struct glibtop_proc_time

+
struct glibtop_proc_time {
+	guint64 start_time;
+	guint64 rtime;
+	guint64 utime;
+	guint64 stime;
+	guint64 cutime;
+	guint64 cstime;
+	guint64 timeout;
+	guint64 it_real_value;
+	guint64 frequency;
+	guint64 xcpu_utime [GLIBTOP_NCPU];
+	guint64 xcpu_stime [GLIBTOP_NCPU];
+};
+
+

Process time data filled by glibtop_get_proc_time().

+

Under Linux the start_time + value may be wrong due to the information +available from the kernel.

+

The Linux kernel defines INITIAL_JIFFIES which implies a time +shift. Because INITIAL_JIFFIES is not user-space defined, +we cannot use it to compute an accurate start_time +. On Linux 2.6,

+INITIAL_JIFFIES is 300 so start_time is +

always 3s different from the real start time of the given process. You +may also get shift results if your system clock is not synchronised +with your hardware clock. See man hwclock.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

guint64 start_time;

Start time of process in seconds since the epoch.

 

guint64 rtime;

Real time accumulated by process (should be utime ++ stime +).

 

guint64 utime;

User-mode CPU time accumulated by process.

 

guint64 stime;

Kernel-mode CPU time accumulated by process.

 

guint64 cutime;

Cumulative utime of process and reaped children.

 

guint64 cstime;

Cumulative stime of process and reaped children.

 

guint64 timeout;

The time (in jiffies) of the process’s next timeout.

 

guint64 it_real_value;

The time (in jiffies) before the next SIGALRM +is sent to the process due to an interval timer.

 

guint64 frequency;

Tick frequency.

 

guint64 xcpu_utime[GLIBTOP_NCPU];

SMP user-mode CPU time accumulated by process.

 

guint64 xcpu_stime[GLIBTOP_NCPU];

SMP kernel-mode CPU time accumulated by process

 
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-Shared-Memory-Limits.html b/doc/reference/html/libgtop-Shared-Memory-Limits.html new file mode 100644 index 0000000..ae305c8 --- /dev/null +++ b/doc/reference/html/libgtop-Shared-Memory-Limits.html @@ -0,0 +1,299 @@ + + + + +Shared Memory Limits: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Shared Memory Limits

+

Shared Memory Limits

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_shm_limits () +
+void + +glibtop_get_shm_limits_l () +
+void + +glibtop_get_shm_limits_p () +
+void + +glibtop_get_shm_limits_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_IPC_SHMMAX
#defineGLIBTOP_IPC_SHMMIN
#defineGLIBTOP_IPC_SHMMNI
#defineGLIBTOP_IPC_SHMSEG
#defineGLIBTOP_IPC_SHMALL
#defineGLIBTOP_MAX_SHM_LIMITS
structglibtop_shm_limits
#defineglibtop_get_shm_limits_r
+
+
+

Includes

+
#include <glibtop/shm_limits.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_shm_limits ()

+
void
+glibtop_get_shm_limits (glibtop_shm_limits *buf);
+
+

Parameters

+
+++++ + + + + + +

buf

a glibtop_shm_limits

 
+
+
+
+
+

glibtop_get_shm_limits_l ()

+
void
+glibtop_get_shm_limits_l (glibtop *server,
+                          glibtop_shm_limits *buf);
+
+

Parameters

+
+++++ + + + + + + + + + + + + +

server

a glibtop server

 

buf

a glibtop_shm_limits

 
+
+
+
+
+

glibtop_get_shm_limits_p ()

+
void
+glibtop_get_shm_limits_p (glibtop *Param1,
+                          glibtop_shm_limits *buf);
+
+

Parameters

+
+++++ + + + + + + + + + + + + +

server

a glibtop server

 

buf

a glibtop_shm_limits

 
+
+
+
+
+

glibtop_get_shm_limits_s ()

+
void
+glibtop_get_shm_limits_s (glibtop *server,
+                          glibtop_shm_limits *buf);
+
+

Parameters

+
+++++ + + + + + + + + + + + + +

server

a glibtop server

 

buf

a glibtop_shm_limits

 
+
+
+
+
+

Types and Values

+
+

GLIBTOP_IPC_SHMMAX

+
#define GLIBTOP_IPC_SHMMAX 0
+
+
+
+
+

GLIBTOP_IPC_SHMMIN

+
#define GLIBTOP_IPC_SHMMIN 1
+
+
+
+
+

GLIBTOP_IPC_SHMMNI

+
#define GLIBTOP_IPC_SHMMNI 2
+
+
+
+
+

GLIBTOP_IPC_SHMSEG

+
#define GLIBTOP_IPC_SHMSEG 3
+
+
+
+
+

GLIBTOP_IPC_SHMALL

+
#define GLIBTOP_IPC_SHMALL 4
+
+
+
+
+

GLIBTOP_MAX_SHM_LIMITS

+
#define GLIBTOP_MAX_SHM_LIMITS 5
+
+
+
+
+

struct glibtop_shm_limits

+
struct glibtop_shm_limits {
+	guint64 flags;
+	guint64 shmmax;		/* GLIBTOP_IPC_SHMMAX */
+	guint64 shmmin;		/* GLIBTOP_IPC_SHMMIN */
+	guint64 shmmni;		/* GLIBTOP_IPC_SHMMNI */
+	guint64 shmseg;		/* GLIBTOP_IPC_SHMSEG */
+	guint64 shmall;		/* GLIBTOP_IPC_SHMALL */
+};
+
+
+
+
+

glibtop_get_shm_limits_r

+
#define glibtop_get_shm_limits_r glibtop_get_shm_limits_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-Uptime.html b/doc/reference/html/libgtop-Uptime.html new file mode 100644 index 0000000..d706cbe --- /dev/null +++ b/doc/reference/html/libgtop-Uptime.html @@ -0,0 +1,216 @@ + + + + +Uptime: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Uptime

+

Uptime

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_uptime () +
+void + +glibtop_get_uptime_l () +
+void + +glibtop_get_uptime_p () +
+void + +glibtop_get_uptime_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_UPTIME_UPTIME
#defineGLIBTOP_UPTIME_IDLETIME
#defineGLIBTOP_UPTIME_BOOT_TIME
#defineGLIBTOP_MAX_UPTIME
structglibtop_uptime
#defineglibtop_get_uptime_r
+
+
+

Includes

+
#include <glibtop/uptime.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_uptime ()

+
void
+glibtop_get_uptime (glibtop_uptime *buf);
+

When porting LibGTop to a new system, you only need to implement +uptime and idletime if there's a faster or better way to obtain them +as using function(glibtop_cpu) for it. Look at +sysdeps/freebsd/uptime.c for an +example on how to obtain them using function(glibtop_cpu).

+
+

Parameters

+
+++++ + + + + + +

buf

A location to return the system uptime

 
+
+
+
+
+

glibtop_get_uptime_l ()

+
void
+glibtop_get_uptime_l (glibtop *server,
+                      glibtop_uptime *buf);
+
+
+
+

glibtop_get_uptime_p ()

+
void
+glibtop_get_uptime_p (glibtop *server,
+                      glibtop_uptime *buf);
+
+
+
+

glibtop_get_uptime_s ()

+
void
+glibtop_get_uptime_s (glibtop *server,
+                      glibtop_uptime *buf);
+
+
+
+

Types and Values

+
+

GLIBTOP_UPTIME_UPTIME

+
#define GLIBTOP_UPTIME_UPTIME		0
+
+
+
+
+

GLIBTOP_UPTIME_IDLETIME

+
#define GLIBTOP_UPTIME_IDLETIME		1
+
+
+
+
+

GLIBTOP_UPTIME_BOOT_TIME

+
#define GLIBTOP_UPTIME_BOOT_TIME    2
+
+
+
+
+

GLIBTOP_MAX_UPTIME

+
#define GLIBTOP_MAX_UPTIME		3
+
+
+
+
+

struct glibtop_uptime

+
struct glibtop_uptime {
+	guint64 flags;
+	double uptime;		/* GLIBTOP_UPTIME_UPTIME */
+	double idletime; /* GLIBTOP_UPTIME_IDLETIME */
+	guint64 boot_time;
+};
+
+
+
+
+

glibtop_get_uptime_r

+
#define glibtop_get_uptime_r		glibtop_get_uptime_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-cpu.html b/doc/reference/html/libgtop-cpu.html new file mode 100644 index 0000000..f954926 --- /dev/null +++ b/doc/reference/html/libgtop-cpu.html @@ -0,0 +1,391 @@ + + + + +cpu: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

cpu

+

cpu

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_cpu () +
+void + +glibtop_get_cpu_l () +
+void + +glibtop_get_cpu_p () +
+void + +glibtop_get_cpu_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_CPU_TOTAL
#defineGLIBTOP_CPU_USER
#defineGLIBTOP_CPU_NICE
#defineGLIBTOP_CPU_SYS
#defineGLIBTOP_CPU_IDLE
#defineGLIBTOP_CPU_FREQUENCY
#defineGLIBTOP_XCPU_TOTAL
#defineGLIBTOP_XCPU_USER
#defineGLIBTOP_XCPU_NICE
#defineGLIBTOP_XCPU_SYS
#defineGLIBTOP_XCPU_IDLE
#defineGLIBTOP_XCPU_FLAGS
#defineGLIBTOP_CPU_IOWAIT
#defineGLIBTOP_CPU_IRQ
#defineGLIBTOP_CPU_SOFTIRQ
#defineGLIBTOP_XCPU_IOWAIT
#defineGLIBTOP_XCPU_IRQ
#defineGLIBTOP_XCPU_SOFTIRQ
#defineGLIBTOP_MAX_CPU
#defineGLIBTOP_NCPU
structglibtop_cpu
#defineglibtop_get_cpu_r
+
+
+

Includes

+
#include <glibtop/cpu.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_cpu ()

+
void
+glibtop_get_cpu (glibtop_cpu *buf);
+

Get the CPU usage.

+

All CPU units are measured in jiffies which are normally +1/100th of a second (in which case frequency equals 100), +but can also be in any other unit. To get seconds, divide them by

+frequency. +
+

Parameters

+
+++++ + + + + + +

buf

A location to return the CPU usage.

 
+
+
+
+
+

glibtop_get_cpu_l ()

+
void
+glibtop_get_cpu_l (glibtop *server,
+                   glibtop_cpu *buf);
+
+
+
+

glibtop_get_cpu_p ()

+
void
+glibtop_get_cpu_p (glibtop *server,
+                   glibtop_cpu *buf);
+
+
+
+

glibtop_get_cpu_s ()

+
void
+glibtop_get_cpu_s (glibtop *server,
+                   glibtop_cpu *buf);
+
+
+
+

Types and Values

+
+

GLIBTOP_CPU_TOTAL

+
#define GLIBTOP_CPU_TOTAL 0
+
+
+
+
+

GLIBTOP_CPU_USER

+
#define GLIBTOP_CPU_USER 1
+
+
+
+
+

GLIBTOP_CPU_NICE

+
#define GLIBTOP_CPU_NICE 2
+
+
+
+
+

GLIBTOP_CPU_SYS

+
#define GLIBTOP_CPU_SYS		3
+
+
+
+
+

GLIBTOP_CPU_IDLE

+
#define GLIBTOP_CPU_IDLE 4
+
+
+
+
+

GLIBTOP_CPU_FREQUENCY

+
#define GLIBTOP_CPU_FREQUENCY 5
+
+
+
+
+

GLIBTOP_XCPU_TOTAL

+
#define GLIBTOP_XCPU_TOTAL 6
+
+
+
+
+

GLIBTOP_XCPU_USER

+
#define GLIBTOP_XCPU_USER 7
+
+
+
+
+

GLIBTOP_XCPU_NICE

+
#define GLIBTOP_XCPU_NICE 8
+
+
+
+
+

GLIBTOP_XCPU_SYS

+
#define GLIBTOP_XCPU_SYS 9
+
+
+
+
+

GLIBTOP_XCPU_IDLE

+
#define GLIBTOP_XCPU_IDLE 10
+
+
+
+
+

GLIBTOP_XCPU_FLAGS

+
#define GLIBTOP_XCPU_FLAGS 11
+
+
+
+
+

GLIBTOP_CPU_IOWAIT

+
#define GLIBTOP_CPU_IOWAIT 12
+
+
+
+
+

GLIBTOP_CPU_IRQ

+
#define GLIBTOP_CPU_IRQ		13
+
+
+
+
+

GLIBTOP_CPU_SOFTIRQ

+
#define GLIBTOP_CPU_SOFTIRQ 14
+
+
+
+
+

GLIBTOP_XCPU_IOWAIT

+
#define GLIBTOP_XCPU_IOWAIT 15
+
+
+
+
+

GLIBTOP_XCPU_IRQ

+
#define GLIBTOP_XCPU_IRQ 16
+
+
+
+
+

GLIBTOP_XCPU_SOFTIRQ

+
#define GLIBTOP_XCPU_SOFTIRQ 17
+
+
+
+
+

GLIBTOP_MAX_CPU

+
#define GLIBTOP_MAX_CPU		18
+
+
+
+
+

GLIBTOP_NCPU

+
#define GLIBTOP_NCPU		1024
+
+
+
+
+

struct glibtop_cpu

+
struct glibtop_cpu {
+	guint64 flags;
+	guint64 total;				/* GLIBTOP_CPU_TOTAL		*/
+	guint64 user;				/* GLIBTOP_CPU_USER		*/
+	guint64 nice;				/* GLIBTOP_CPU_NICE		*/
+	guint64 sys;				/* GLIBTOP_CPU_SYS		*/
+	guint64 idle;				/* GLIBTOP_CPU_IDLE		*/
+	guint64 iowait;				/* GLIBTOP_CPU_IOWAIT		*/
+	guint64 irq;				/* GLIBTOP_CPU_IRQ		*/
+	guint64 softirq;			/* GLIBTOP_CPU_SOFTIRQ		*/
+	guint64 frequency;			/* GLIBTOP_CPU_FREQUENCY */
+	guint64 xcpu_total [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_TOTAL		*/
+	guint64 xcpu_user [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_USER		*/
+	guint64 xcpu_nice [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_NICE		*/
+	guint64 xcpu_sys  [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_SYS		*/
+	guint64 xcpu_idle [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_IDLE		*/
+	guint64 xcpu_iowait [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_IOWAIT		*/
+	guint64 xcpu_irq [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_IRQ		*/
+	guint64 xcpu_softirq  [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_SOFTIRQ		*/
+	guint64 xcpu_flags;	                /* GLIBTOP_XCPU_IDLE		*/
+};
+
+
+
+
+

glibtop_get_cpu_r

+
#define glibtop_get_cpu_r glibtop_get_cpu_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-fsusage.html b/doc/reference/html/libgtop-fsusage.html new file mode 100644 index 0000000..48676b9 --- /dev/null +++ b/doc/reference/html/libgtop-fsusage.html @@ -0,0 +1,262 @@ + + + + +fsusage: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

fsusage

+

fsusage

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + +
+void + +glibtop_get_fsusage () +
+void + +glibtop_get_fsusage_l () +
+void + +glibtop_get_fsusage_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_FSUSAGE_BLOCKS
#defineGLIBTOP_FSUSAGE_BFREE
#defineGLIBTOP_FSUSAGE_BAVAIL
#defineGLIBTOP_FSUSAGE_FILES
#defineGLIBTOP_FSUSAGE_FFREE
#defineGLIBTOP_FSUSAGE_BLOCK_SIZE
#defineGLIBTOP_FSUSAGE_READ
#defineGLIBTOP_FSUSAGE_WRITE
#defineGLIBTOP_MAX_FSUSAGE
structglibtop_fsusage
#defineglibtop_get_fsusage_r
+
+
+

Includes

+
#include <glibtop/fsusage.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_fsusage ()

+
void
+glibtop_get_fsusage (glibtop_fsusage *buf,
+                     const char *mount_dir);
+

Get the file system usage for an specific mount_dir +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

buf

A location to return the file system usage.

 

mount_dir

mount dir where to get the information of usage.

 
+
+
+
+
+

glibtop_get_fsusage_l ()

+
void
+glibtop_get_fsusage_l (glibtop *server,
+                       glibtop_fsusage *buf,
+                       const char *mount_dir);
+
+
+
+

glibtop_get_fsusage_s ()

+
void
+glibtop_get_fsusage_s (glibtop *server,
+                       glibtop_fsusage *buf,
+                       const char *mount_dir);
+
+
+
+

Types and Values

+
+

GLIBTOP_FSUSAGE_BLOCKS

+
#define GLIBTOP_FSUSAGE_BLOCKS		0
+
+
+
+
+

GLIBTOP_FSUSAGE_BFREE

+
#define GLIBTOP_FSUSAGE_BFREE		1
+
+
+
+
+

GLIBTOP_FSUSAGE_BAVAIL

+
#define GLIBTOP_FSUSAGE_BAVAIL		2
+
+
+
+
+

GLIBTOP_FSUSAGE_FILES

+
#define GLIBTOP_FSUSAGE_FILES		3
+
+
+
+
+

GLIBTOP_FSUSAGE_FFREE

+
#define GLIBTOP_FSUSAGE_FFREE		4
+
+
+
+
+

GLIBTOP_FSUSAGE_BLOCK_SIZE

+
#define GLIBTOP_FSUSAGE_BLOCK_SIZE 5
+
+
+
+
+

GLIBTOP_FSUSAGE_READ

+
#define GLIBTOP_FSUSAGE_READ           6
+
+
+
+
+

GLIBTOP_FSUSAGE_WRITE

+
#define GLIBTOP_FSUSAGE_WRITE          7
+
+
+
+
+

GLIBTOP_MAX_FSUSAGE

+
#define GLIBTOP_MAX_FSUSAGE		8
+
+
+
+
+

struct glibtop_fsusage

+
struct glibtop_fsusage {
+	guint64 flags;
+	guint64 blocks;		/* Total number of blocks. */
+	guint64 bfree;		/* Free blocks available to superuser. */
+	guint64 bavail;		/* Free blocks available to non-superuser. */
+	guint64 files;		/* Total file nodes. */
+	guint64 ffree;		/* Free file nodes. */
+	guint32 block_size; /* Size of a block in bytes. */
+	guint64 read, write;    /* Total blocks read and written */
+};
+
+
+
+
+

glibtop_get_fsusage_r

+
#define glibtop_get_fsusage_r		glibtop_get_fsusage_s
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-lib.html b/doc/reference/html/libgtop-lib.html new file mode 100644 index 0000000..586c226 --- /dev/null +++ b/doc/reference/html/libgtop-lib.html @@ -0,0 +1,138 @@ + + + + +Libgtop Library Reference: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+

+Libgtop Library Reference

+
+
+GlibTop — Server initilization +
+
+Close +
+
+Command +
+
+GlibTop Server +
+
+Net Load — Network Load. +
+
+PPP — PPP Usage. +
+
+Shared Memory Limits +
+
+Uptime +
+
+Net List — Network Devices List. +
+
+open +
+
+parameter +
+
+Process Arguments — Get process command line arguments +
+
+procmem +
+
+procopenfiles +
+
+procsegment +
+
+procsignal +
+
+sysdeps +
+
+procstate +
+
+procuid +
+
+Process Time — Get process time information +
+
+signal +
+
+procmap +
+
+sysinfo +
+
+union +
+
+version +
+
+Process List — List running processes +
+
+sem_limits +
+
+prockernel +
+
+fsusage +
+
+loadavg +
+
+mem +
+
+mountlist +
+
+msg_limits +
+
+cpu +
+
+swap +
+
+

This section contains the API reference for libgtop. All + the public interfaces are documented here.

+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-loadavg.html b/doc/reference/html/libgtop-loadavg.html new file mode 100644 index 0000000..a949af6 --- /dev/null +++ b/doc/reference/html/libgtop-loadavg.html @@ -0,0 +1,207 @@ + + + + +loadavg: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

loadavg

+

loadavg

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_loadavg () +
+void + +glibtop_get_loadavg_l () +
+void + +glibtop_get_loadavg_p () +
+void + +glibtop_get_loadavg_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_LOADAVG_LOADAVG
#defineGLIBTOP_LOADAVG_NR_RUNNING
#defineGLIBTOP_LOADAVG_NR_TASKS
#defineGLIBTOP_LOADAVG_LAST_PID
#defineGLIBTOP_MAX_LOADAVG
structglibtop_loadavg
#defineglibtop_get_loadavg_r
+
+
+

Includes

+
#include <glibtop/loadavg.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_loadavg ()

+
void
+glibtop_get_loadavg (glibtop_loadavg *buf);
+
+
+
+

glibtop_get_loadavg_l ()

+
void
+glibtop_get_loadavg_l (glibtop *server,
+                       glibtop_loadavg *buf);
+
+
+
+

glibtop_get_loadavg_p ()

+
void
+glibtop_get_loadavg_p (glibtop *server,
+                       glibtop_loadavg *buf);
+
+
+
+

glibtop_get_loadavg_s ()

+
void
+glibtop_get_loadavg_s (glibtop *server,
+                       glibtop_loadavg *buf);
+
+
+
+

Types and Values

+
+

GLIBTOP_LOADAVG_LOADAVG

+
#define GLIBTOP_LOADAVG_LOADAVG		0
+
+
+
+
+

GLIBTOP_LOADAVG_NR_RUNNING

+
#define GLIBTOP_LOADAVG_NR_RUNNING 1
+
+
+
+
+

GLIBTOP_LOADAVG_NR_TASKS

+
#define GLIBTOP_LOADAVG_NR_TASKS 2
+
+
+
+
+

GLIBTOP_LOADAVG_LAST_PID

+
#define GLIBTOP_LOADAVG_LAST_PID 3
+
+
+
+
+

GLIBTOP_MAX_LOADAVG

+
#define GLIBTOP_MAX_LOADAVG		4
+
+
+
+
+

struct glibtop_loadavg

+
struct glibtop_loadavg {
+	guint64 flags;
+	double loadavg [3];		/* GLIBTOP_LOADAVG_LOADAVG */
+	guint64 nr_running;		/* GLIBTOP_LOADAVG_NR_RUNNING */
+	guint64 nr_tasks;		/* GLIBTOP_LOADAVG_NR_TASKS */
+	guint64 last_pid;		/* GLIBTOP_LOADAVG_LAST_PID */
+};
+
+
+
+
+

glibtop_get_loadavg_r

+
#define glibtop_get_loadavg_r		glibtop_get_loadavg_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-mem.html b/doc/reference/html/libgtop-mem.html new file mode 100644 index 0000000..8d07729 --- /dev/null +++ b/doc/reference/html/libgtop-mem.html @@ -0,0 +1,268 @@ + + + + +mem: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

mem

+

mem

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_mem () +
+void + +glibtop_get_mem_l () +
+void + +glibtop_get_mem_p () +
+void + +glibtop_get_mem_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_MEM_TOTAL
#defineGLIBTOP_MEM_USED
#defineGLIBTOP_MEM_FREE
#defineGLIBTOP_MEM_SHARED
#defineGLIBTOP_MEM_BUFFER
#defineGLIBTOP_MEM_CACHED
#defineGLIBTOP_MEM_USER
#defineGLIBTOP_MEM_LOCKED
#defineGLIBTOP_MAX_MEM
structglibtop_mem
#defineglibtop_get_mem_r
+
+
+

Includes

+
#include <glibtop/mem.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_mem ()

+
void
+glibtop_get_mem (glibtop_mem *buf);
+

Get the memory usage. Unless explicitly stated otherwise, all memory +units are in bytes.

+
+

Parameters

+
+++++ + + + + + +

buf

Buffer where the output will be given.

 
+
+
+
+
+

glibtop_get_mem_l ()

+
void
+glibtop_get_mem_l (glibtop *server,
+                   glibtop_mem *buf);
+
+
+
+

glibtop_get_mem_p ()

+
void
+glibtop_get_mem_p (glibtop *server,
+                   glibtop_mem *buf);
+
+
+
+

glibtop_get_mem_s ()

+
void
+glibtop_get_mem_s (glibtop *server,
+                   glibtop_mem *buf);
+
+
+
+

Types and Values

+
+

GLIBTOP_MEM_TOTAL

+
#define GLIBTOP_MEM_TOTAL 0
+
+
+
+
+

GLIBTOP_MEM_USED

+
#define GLIBTOP_MEM_USED 1
+
+
+
+
+

GLIBTOP_MEM_FREE

+
#define GLIBTOP_MEM_FREE 2
+
+
+
+
+

GLIBTOP_MEM_SHARED

+
#define GLIBTOP_MEM_SHARED 3
+
+
+
+
+

GLIBTOP_MEM_BUFFER

+
#define GLIBTOP_MEM_BUFFER 4
+
+
+
+
+

GLIBTOP_MEM_CACHED

+
#define GLIBTOP_MEM_CACHED 5
+
+
+
+
+

GLIBTOP_MEM_USER

+
#define GLIBTOP_MEM_USER 6
+
+
+
+
+

GLIBTOP_MEM_LOCKED

+
#define GLIBTOP_MEM_LOCKED 7
+
+
+
+
+

GLIBTOP_MAX_MEM

+
#define GLIBTOP_MAX_MEM		8
+
+
+
+
+

struct glibtop_mem

+
struct glibtop_mem {
+	guint64 flags;
+	guint64 total;		/* GLIBTOP_MEM_TOTAL */
+	guint64 used;		/* GLIBTOP_MEM_USED */
+	guint64 free;		/* GLIBTOP_MEM_FREE */
+	guint64 shared;		/* GLIBTOP_MEM_SHARED */
+	guint64 buffer;		/* GLIBTOP_MEM_BUFFER */
+	guint64 cached;		/* GLIBTOP_MEM_CACHED */
+	guint64 user;		/* GLIBTOP_MEM_USER */
+	guint64 locked;		/* GLIBTOP_MEM_LOCKED */
+};
+
+
+
+
+

glibtop_get_mem_r

+
#define glibtop_get_mem_r		glibtop_get_mem_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-mountlist.html b/doc/reference/html/libgtop-mountlist.html new file mode 100644 index 0000000..eb2ad93 --- /dev/null +++ b/doc/reference/html/libgtop-mountlist.html @@ -0,0 +1,264 @@ + + + + +mountlist: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

mountlist

+

mountlist

+
+
+

Functions

+ +
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_MOUNTLIST_NUMBER
#defineGLIBTOP_MOUNTLIST_TOTAL
#defineGLIBTOP_MOUNTLIST_SIZE
#defineGLIBTOP_MAX_MOUNTLIST
structglibtop_mountentry
structglibtop_mountlist
#defineglibtop_get_mountlist_r
+
+
+

Includes

+
#include <glibtop/mountlist.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_mountlist ()

+
glibtop_mountentry *
+glibtop_get_mountlist (glibtop_mountlist *buf,
+                       int all_fs);
+
+

Returns

+

.

+

[transfer full]

+
+
+
+
+

glibtop_get_mountlist_l ()

+
glibtop_mountentry *
+glibtop_get_mountlist_l (glibtop *server,
+                         glibtop_mountlist *buf,
+                         int all_fs);
+
+

Parameters

+
+++++ + + + + + +

buf

.

[out]
+
+
+

Returns

+

.

+

[transfer none]

+
+
+
+
+

glibtop_get_mountlist_s ()

+
glibtop_mountentry *
+glibtop_get_mountlist_s (glibtop *server,
+                         glibtop_mountlist *buf,
+                         int all_fs);
+
+

Parameters

+
+++++ + + + + + +

buf

.

[out]
+
+
+

Returns

+

.

+

[transfer none]

+
+
+
+
+

Types and Values

+
+

GLIBTOP_MOUNTLIST_NUMBER

+
#define GLIBTOP_MOUNTLIST_NUMBER 0
+
+
+
+
+

GLIBTOP_MOUNTLIST_TOTAL

+
#define GLIBTOP_MOUNTLIST_TOTAL		1
+
+
+
+
+

GLIBTOP_MOUNTLIST_SIZE

+
#define GLIBTOP_MOUNTLIST_SIZE		2
+
+
+
+
+

GLIBTOP_MAX_MOUNTLIST

+
#define GLIBTOP_MAX_MOUNTLIST		3
+
+
+
+
+

struct glibtop_mountentry

+
struct glibtop_mountentry {
+	guint64 dev;
+	char devname [GLIBTOP_MOUNTENTRY_LEN+1];
+	char mountdir [GLIBTOP_MOUNTENTRY_LEN+1];
+	char type [GLIBTOP_MOUNTENTRY_LEN+1];
+};
+
+
+
+
+

struct glibtop_mountlist

+
struct glibtop_mountlist {
+	guint64 flags;
+	guint64 number;			/* GLIBTOP_MOUNTLIST_NUMBER */
+	guint64 total;			/* GLIBTOP_MOUNTLIST_TOTAL */
+	guint64 size;			/* GLIBTOP_MOUNTLIST_SIZE */
+};
+
+
+
+
+

glibtop_get_mountlist_r

+
#define glibtop_get_mountlist_r		glibtop_get_mountlist_s
+
+
+

Parameters

+
+++++ + + + + + +

buf

.

[out]
+
+
+

Returns

+

.

+

[transfer none]

+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-msg-limits.html b/doc/reference/html/libgtop-msg-limits.html new file mode 100644 index 0000000..a55ce0a --- /dev/null +++ b/doc/reference/html/libgtop-msg-limits.html @@ -0,0 +1,240 @@ + + + + +msg_limits: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

msg_limits

+

msg_limits

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_msg_limits () +
+void + +glibtop_get_msg_limits_l () +
+void + +glibtop_get_msg_limits_p () +
+void + +glibtop_get_msg_limits_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_IPC_MSGPOOL
#defineGLIBTOP_IPC_MSGMAP
#defineGLIBTOP_IPC_MSGMAX
#defineGLIBTOP_IPC_MSGMNB
#defineGLIBTOP_IPC_MSGMNI
#defineGLIBTOP_IPC_MSGSSZ
#defineGLIBTOP_IPC_MSGTQL
#defineGLIBTOP_MAX_MSG_LIMITS
structglibtop_msg_limits
#defineglibtop_get_msg_limits_r
+
+
+

Includes

+
#include <glibtop/msg_limits.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_msg_limits ()

+
void
+glibtop_get_msg_limits (glibtop_msg_limits *buf);
+
+
+
+

glibtop_get_msg_limits_l ()

+
void
+glibtop_get_msg_limits_l (glibtop *server,
+                          glibtop_msg_limits *buf);
+
+
+
+

glibtop_get_msg_limits_p ()

+
void
+glibtop_get_msg_limits_p (glibtop *server,
+                          glibtop_msg_limits *buf);
+
+
+
+

glibtop_get_msg_limits_s ()

+
void
+glibtop_get_msg_limits_s (glibtop *server,
+                          glibtop_msg_limits *buf);
+
+
+
+

Types and Values

+
+

GLIBTOP_IPC_MSGPOOL

+
#define GLIBTOP_IPC_MSGPOOL 0
+
+
+
+
+

GLIBTOP_IPC_MSGMAP

+
#define GLIBTOP_IPC_MSGMAP 1
+
+
+
+
+

GLIBTOP_IPC_MSGMAX

+
#define GLIBTOP_IPC_MSGMAX 2
+
+
+
+
+

GLIBTOP_IPC_MSGMNB

+
#define GLIBTOP_IPC_MSGMNB 3
+
+
+
+
+

GLIBTOP_IPC_MSGMNI

+
#define GLIBTOP_IPC_MSGMNI 4
+
+
+
+
+

GLIBTOP_IPC_MSGSSZ

+
#define GLIBTOP_IPC_MSGSSZ 5
+
+
+
+
+

GLIBTOP_IPC_MSGTQL

+
#define GLIBTOP_IPC_MSGTQL 6
+
+
+
+
+

GLIBTOP_MAX_MSG_LIMITS

+
#define GLIBTOP_MAX_MSG_LIMITS 7
+
+
+
+
+

struct glibtop_msg_limits

+
struct glibtop_msg_limits {
+	guint64 flags;
+	guint64 msgpool; /* GLIBTOP_IPC_MSGPOOL */
+	guint64 msgmap;		/* GLIBTOP_IPC_MSGMAP */
+	guint64 msgmax;		/* GLIBTOP_IPC_MSGMAX */
+	guint64 msgmnb;		/* GLIBTOP_IPC_MSGMNB */
+	guint64 msgmni;		/* GLIBTOP_IPC_MSGMNI */
+	guint64 msgssz;		/* GLIBTOP_IPC_MSGSSZ */
+	guint64 msgtql;		/* GLIBTOP_IPC_MSGTQL */
+};
+
+
+
+
+

glibtop_get_msg_limits_r

+
#define glibtop_get_msg_limits_r glibtop_get_msg_limits_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-open.html b/doc/reference/html/libgtop-open.html new file mode 100644 index 0000000..666225c --- /dev/null +++ b/doc/reference/html/libgtop-open.html @@ -0,0 +1,269 @@ + + + + +open: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

open

+

open

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_open_l () +
+void + +glibtop_init_p () +
+void + +glibtop_open_p () +
+void + +glibtop_open_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_INIT_NO_OPEN
#defineGLIBTOP_INIT_NO_INIT
#defineGLIBTOP_FEATURES_NO_SERVER
#defineGLIBTOP_FEATURES_EXCEPT
#defineGLIBTOP_METHOD_DIRECT
#defineGLIBTOP_METHOD_PIPE
#defineGLIBTOP_METHOD_INET
#defineGLIBTOP_METHOD_UNIX
#defineGLIBTOP_ERROR_METHOD_IGNORE
#defineGLIBTOP_ERROR_METHOD_WARN_ONCE
#defineGLIBTOP_ERROR_METHOD_WARN
#defineGLIBTOP_ERROR_METHOD_ABORT
#defineGLIBTOP_ERROR_METHOD_DEFAULT
+
+
+

Includes

+
#include <glibtop/open.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_open_l ()

+
void
+glibtop_open_l (glibtop *server,
+                const char *program_name,
+                const unsigned long features Param3,
+                const unsigned flags Param4);
+
+
+
+

glibtop_init_p ()

+
void
+glibtop_init_p (glibtop *server,
+                const unsigned long features Param2,
+                const unsigned flags Param3);
+
+
+
+

glibtop_open_p ()

+
void
+glibtop_open_p (glibtop *server,
+                const char *program_name,
+                const unsigned long features Param3,
+                const unsigned flags Param4);
+
+
+
+

glibtop_open_s ()

+
void
+glibtop_open_s (glibtop *server,
+                const char *program_name,
+                const unsigned long features Param3,
+                const unsigned flags Param4);
+
+
+
+

Types and Values

+
+

GLIBTOP_INIT_NO_OPEN

+
#define GLIBTOP_INIT_NO_OPEN		1
+
+
+
+
+

GLIBTOP_INIT_NO_INIT

+
#define GLIBTOP_INIT_NO_INIT		2
+
+
+
+
+

GLIBTOP_FEATURES_NO_SERVER

+
#define GLIBTOP_FEATURES_NO_SERVER 4
+
+
+
+
+

GLIBTOP_FEATURES_EXCEPT

+
#define GLIBTOP_FEATURES_EXCEPT		8
+
+
+
+
+

GLIBTOP_METHOD_DIRECT

+
#define GLIBTOP_METHOD_DIRECT		1
+
+
+
+
+

GLIBTOP_METHOD_PIPE

+
#define GLIBTOP_METHOD_PIPE		2
+
+
+
+
+

GLIBTOP_METHOD_INET

+
#define GLIBTOP_METHOD_INET		3
+
+
+
+
+

GLIBTOP_METHOD_UNIX

+
#define GLIBTOP_METHOD_UNIX		4
+
+
+
+
+

GLIBTOP_ERROR_METHOD_IGNORE

+
#define GLIBTOP_ERROR_METHOD_IGNORE 0
+
+
+
+
+

GLIBTOP_ERROR_METHOD_WARN_ONCE

+
#define GLIBTOP_ERROR_METHOD_WARN_ONCE 1
+
+
+
+
+

GLIBTOP_ERROR_METHOD_WARN

+
#define GLIBTOP_ERROR_METHOD_WARN 2
+
+
+
+
+

GLIBTOP_ERROR_METHOD_ABORT

+
#define GLIBTOP_ERROR_METHOD_ABORT 3
+
+
+
+
+

GLIBTOP_ERROR_METHOD_DEFAULT

+
#define GLIBTOP_ERROR_METHOD_DEFAULT GLIBTOP_ERROR_METHOD_WARN_ONCE
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-parameter.html b/doc/reference/html/libgtop-parameter.html new file mode 100644 index 0000000..1190c57 --- /dev/null +++ b/doc/reference/html/libgtop-parameter.html @@ -0,0 +1,200 @@ + + + + +parameter: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

parameter

+

parameter

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
#define +glibtop_get_parameter() +
#define +glibtop_set_parameter() +
+size_t + +glibtop_get_parameter_l () +
+void + +glibtop_set_parameter_l () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_PARAM_METHOD
#defineGLIBTOP_PARAM_FEATURES
#defineGLIBTOP_PARAM_COMMAND
#defineGLIBTOP_PARAM_HOST
#defineGLIBTOP_PARAM_PORT
#defineGLIBTOP_PARAM_ERROR_METHOD
#defineGLIBTOP_PARAM_REQUIRED
+
+
+

Includes

+
#include <glibtop/parameter.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_parameter()

+
#define glibtop_get_parameter(p1,p2,p3) glibtop_get_parameter_l(glibtop_global_server,p1,p2,p3)
+
+
+
+
+

glibtop_set_parameter()

+
#define glibtop_set_parameter(p1,p2,p3) glibtop_set_parameter_l(glibtop_global_server,p1,p2,p3)
+
+
+
+
+

glibtop_get_parameter_l ()

+
size_t
+glibtop_get_parameter_l (glibtop *server,
+                         const unsigned parameter Param2,
+                         void *data_ptr,
+                         size_t data_size);
+
+
+
+

glibtop_set_parameter_l ()

+
void
+glibtop_set_parameter_l (glibtop *server,
+                         const unsigned parameter Param2,
+                         const void *data_ptr,
+                         size_t data_size);
+
+
+
+

Types and Values

+
+

GLIBTOP_PARAM_METHOD

+
#define GLIBTOP_PARAM_METHOD		1
+
+
+
+
+

GLIBTOP_PARAM_FEATURES

+
#define GLIBTOP_PARAM_FEATURES		2
+
+
+
+
+

GLIBTOP_PARAM_COMMAND

+
#define GLIBTOP_PARAM_COMMAND		3
+
+
+
+
+

GLIBTOP_PARAM_HOST

+
#define GLIBTOP_PARAM_HOST		4
+
+
+
+
+

GLIBTOP_PARAM_PORT

+
#define GLIBTOP_PARAM_PORT		5
+
+
+
+
+

GLIBTOP_PARAM_ERROR_METHOD

+
#define GLIBTOP_PARAM_ERROR_METHOD 6
+
+
+
+
+

GLIBTOP_PARAM_REQUIRED

+
#define GLIBTOP_PARAM_REQUIRED		7
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-prockernel.html b/doc/reference/html/libgtop-prockernel.html new file mode 100644 index 0000000..b082aa1 --- /dev/null +++ b/doc/reference/html/libgtop-prockernel.html @@ -0,0 +1,271 @@ + + + + +prockernel: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

prockernel

+

prockernel

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_proc_kernel () +
+void + +glibtop_get_proc_kernel_l () +
+void + +glibtop_get_proc_kernel_p () +
+void + +glibtop_get_proc_kernel_s () +
+
+
+

Types and Values

+ +
+
+

Includes

+
#include <glibtop/prockernel.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_proc_kernel ()

+
void
+glibtop_get_proc_kernel (glibtop_proc_kernel *buf,
+                         pid_t pid);
+
+
+
+

glibtop_get_proc_kernel_l ()

+
void
+glibtop_get_proc_kernel_l (glibtop *server,
+                           glibtop_proc_kernel *buf,
+                           pid_t pid);
+
+
+
+

glibtop_get_proc_kernel_p ()

+
void
+glibtop_get_proc_kernel_p (glibtop *server,
+                           glibtop_proc_kernel *buf,
+                           pid_t pid);
+
+
+
+

glibtop_get_proc_kernel_s ()

+
void
+glibtop_get_proc_kernel_s (glibtop *server,
+                           glibtop_proc_kernel *buf,
+                           pid_t pid);
+
+
+
+

Types and Values

+
+

GLIBTOP_PROC_KERNEL_K_FLAGS

+
#define GLIBTOP_PROC_KERNEL_K_FLAGS 0
+
+
+
+
+

GLIBTOP_PROC_KERNEL_MIN_FLT

+
#define GLIBTOP_PROC_KERNEL_MIN_FLT 1
+
+
+
+
+

GLIBTOP_PROC_KERNEL_MAJ_FLT

+
#define GLIBTOP_PROC_KERNEL_MAJ_FLT 2
+
+
+
+
+

GLIBTOP_PROC_KERNEL_CMIN_FLT

+
#define GLIBTOP_PROC_KERNEL_CMIN_FLT 3
+
+
+
+
+

GLIBTOP_PROC_KERNEL_CMAJ_FLT

+
#define GLIBTOP_PROC_KERNEL_CMAJ_FLT 4
+
+
+
+
+

GLIBTOP_PROC_KERNEL_KSTK_ESP

+
#define GLIBTOP_PROC_KERNEL_KSTK_ESP 5
+
+
+
+
+

GLIBTOP_PROC_KERNEL_KSTK_EIP

+
#define GLIBTOP_PROC_KERNEL_KSTK_EIP 6
+
+
+
+
+

GLIBTOP_PROC_KERNEL_NWCHAN

+
#define GLIBTOP_PROC_KERNEL_NWCHAN 7
+
+
+
+
+

GLIBTOP_PROC_KERNEL_WCHAN

+
#define GLIBTOP_PROC_KERNEL_WCHAN 8
+
+
+
+
+

GLIBTOP_MAX_PROC_KERNEL

+
#define GLIBTOP_MAX_PROC_KERNEL		9
+
+
+
+
+

struct glibtop_proc_kernel

+
struct glibtop_proc_kernel {
+	guint64 flags;
+	guint64 k_flags; /* kernel flags for the process */
+	guint64 min_flt; /* number of minor page faults since
+				 * process start */
+	guint64 maj_flt; /* number of major page faults since
+				 * process start */
+	guint64 cmin_flt; /* cumulative min_flt of process and
+				 * child processes */
+	guint64 cmaj_flt; /* cumulative maj_flt of process and
+				 * child processes */
+	guint64 kstk_esp; /* kernel stack pointer */
+	guint64 kstk_eip; /* kernel stack pointer */
+	guint64 nwchan;		/* address of kernel wait channel
+				 * proc is sleeping in */
+	char wchan [40];
+};
+
+
+
+
+

glibtop_get_proc_kernel_r

+
#define glibtop_get_proc_kernel_r glibtop_get_proc_kernel_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-procmap.html b/doc/reference/html/libgtop-procmap.html new file mode 100644 index 0000000..fce5c4a --- /dev/null +++ b/doc/reference/html/libgtop-procmap.html @@ -0,0 +1,492 @@ + + + + +procmap: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

procmap

+

procmap

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+glibtop_map_entry * + +glibtop_get_proc_map () +
+glibtop_map_entry * + +glibtop_get_proc_map_l () +
+glibtop_map_entry * + +glibtop_get_proc_map_p () +
+glibtop_map_entry * + +glibtop_get_proc_map_s () +
+
+
+

Types and Values

+ +
+
+

Includes

+
#include <glibtop/procmap.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_proc_map ()

+
glibtop_map_entry *
+glibtop_get_proc_map (glibtop_proc_map *buf,
+                      pid_t pid);
+
+

Returns

+

.

+

[transfer none]

+
+
+
+
+

glibtop_get_proc_map_l ()

+
glibtop_map_entry *
+glibtop_get_proc_map_l (glibtop *server,
+                        glibtop_proc_map *buf,
+                        pid_t pid);
+
+

Parameters

+
+++++ + + + + + +

buf

.

[out]
+
+
+

Returns

+

.

+

[transfer none]

+
+
+
+
+

glibtop_get_proc_map_p ()

+
glibtop_map_entry *
+glibtop_get_proc_map_p (glibtop *server,
+                        glibtop_proc_map *buf,
+                        pid_t pid);
+
+

Parameters

+
+++++ + + + + + +

buf

.

[out]
+
+
+

Returns

+

.

+

[transfer none]

+
+
+
+
+

glibtop_get_proc_map_s ()

+
glibtop_map_entry *
+glibtop_get_proc_map_s (glibtop *server,
+                        glibtop_proc_map *buf,
+                        pid_t pid);
+
+

Parameters

+
+++++ + + + + + +

buf

.

[out]
+
+
+

Returns

+

.

+

[transfer none]

+
+
+
+
+

Types and Values

+
+

GLIBTOP_PROC_MAP_NUMBER

+
#define GLIBTOP_PROC_MAP_NUMBER		0
+
+
+
+
+

GLIBTOP_PROC_MAP_TOTAL

+
#define GLIBTOP_PROC_MAP_TOTAL		1
+
+
+
+
+

GLIBTOP_PROC_MAP_SIZE

+
#define GLIBTOP_PROC_MAP_SIZE		2
+
+
+
+
+

GLIBTOP_MAX_PROC_MAP

+
#define GLIBTOP_MAX_PROC_MAP		3
+
+
+
+
+

GLIBTOP_MAP_ENTRY_START

+
#define GLIBTOP_MAP_ENTRY_START		0
+
+
+
+
+

GLIBTOP_MAP_ENTRY_END

+
#define GLIBTOP_MAP_ENTRY_END		1
+
+
+
+
+

GLIBTOP_MAP_ENTRY_OFFSET

+
#define GLIBTOP_MAP_ENTRY_OFFSET 2
+
+
+
+
+

GLIBTOP_MAP_ENTRY_PERM

+
#define GLIBTOP_MAP_ENTRY_PERM		3
+
+
+
+
+

GLIBTOP_MAP_ENTRY_INODE

+
#define GLIBTOP_MAP_ENTRY_INODE		4
+
+
+
+
+

GLIBTOP_MAP_ENTRY_DEVICE

+
#define GLIBTOP_MAP_ENTRY_DEVICE 5
+
+
+
+
+

GLIBTOP_MAP_ENTRY_FILENAME

+
#define GLIBTOP_MAP_ENTRY_FILENAME 6
+
+
+
+
+

GLIBTOP_MAP_ENTRY_SIZE

+
#define GLIBTOP_MAP_ENTRY_SIZE			 7
+
+
+
+
+

GLIBTOP_MAP_ENTRY_RSS

+
#define GLIBTOP_MAP_ENTRY_RSS			 8
+
+
+
+
+

GLIBTOP_MAP_ENTRY_SHARED_CLEAN

+
#define GLIBTOP_MAP_ENTRY_SHARED_CLEAN		 9
+
+
+
+
+

GLIBTOP_MAP_ENTRY_SHARED_DIRTY

+
#define GLIBTOP_MAP_ENTRY_SHARED_DIRTY		10
+
+
+
+
+

GLIBTOP_MAP_ENTRY_PRIVATE_CLEAN

+
#define GLIBTOP_MAP_ENTRY_PRIVATE_CLEAN		11
+
+
+
+
+

GLIBTOP_MAP_ENTRY_PRIVATE_DIRTY

+
#define GLIBTOP_MAP_ENTRY_PRIVATE_DIRTY		12
+
+
+
+
+

GLIBTOP_MAX_MAP_ENTRY

+
#define GLIBTOP_MAX_MAP_ENTRY		15
+
+
+
+
+

GLIBTOP_MAP_FILENAME_LEN

+
#define GLIBTOP_MAP_FILENAME_LEN 215
+
+
+
+
+

GLIBTOP_MAP_PERM_READ

+
#define GLIBTOP_MAP_PERM_READ		1
+
+
+
+
+

GLIBTOP_MAP_PERM_WRITE

+
#define GLIBTOP_MAP_PERM_WRITE		2
+
+
+
+
+

GLIBTOP_MAP_PERM_EXECUTE

+
#define GLIBTOP_MAP_PERM_EXECUTE 4
+
+
+
+
+

GLIBTOP_MAP_PERM_SHARED

+
#define GLIBTOP_MAP_PERM_SHARED		8
+
+
+
+
+

GLIBTOP_MAP_PERM_PRIVATE

+
#define GLIBTOP_MAP_PERM_PRIVATE 16
+
+
+
+
+

struct glibtop_map_entry

+
struct glibtop_map_entry {
+	guint64 flags; 
+	guint64 start; 
+	guint64 end; 
+	guint64 offset; 
+	guint64 perm; 
+	guint64 inode; 
+	guint64 device;
+	guint64 size;
+	guint64 rss;
+	guint64 shared_clean; 
+	guint64 shared_dirty;
+	guint64 private_clean; 
+	guint64 private_dirty;
+	guint64 pss;
+	guint64 swap;
+	char filename [GLIBTOP_MAP_FILENAME_LEN+1];
+};
+
+
+
+
+

struct glibtop_proc_map

+
struct glibtop_proc_map {
+	guint64 flags;
+	guint64 number;			/* GLIBTOP_PROC_MAP_NUMBER */
+	guint64 total;			/* GLIBTOP_PROC_MAP_TOTAL */
+	guint64 size;			/* GLIBTOP_PROC_MAP_SIZE */
+};
+
+
+
+
+

glibtop_get_proc_map_r

+
#define glibtop_get_proc_map_r		glibtop_get_proc_map_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-procmem.html b/doc/reference/html/libgtop-procmem.html new file mode 100644 index 0000000..db28bf9 --- /dev/null +++ b/doc/reference/html/libgtop-procmem.html @@ -0,0 +1,235 @@ + + + + +procmem: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

procmem

+

procmem

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_proc_mem () +
+void + +glibtop_get_proc_mem_l () +
+void + +glibtop_get_proc_mem_p () +
+void + +glibtop_get_proc_mem_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_PROC_MEM_SIZE
#defineGLIBTOP_PROC_MEM_VSIZE
#defineGLIBTOP_PROC_MEM_RESIDENT
#defineGLIBTOP_PROC_MEM_SHARE
#defineGLIBTOP_PROC_MEM_RSS
#defineGLIBTOP_PROC_MEM_RSS_RLIM
#defineGLIBTOP_MAX_PROC_MEM
structglibtop_proc_mem
#defineglibtop_get_proc_mem_r
+
+
+

Includes

+
#include <glibtop/procmem.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_proc_mem ()

+
void
+glibtop_get_proc_mem (glibtop_proc_mem *buf,
+                      pid_t pid);
+
+
+
+

glibtop_get_proc_mem_l ()

+
void
+glibtop_get_proc_mem_l (glibtop *server,
+                        glibtop_proc_mem *buf,
+                        pid_t pid);
+
+
+
+

glibtop_get_proc_mem_p ()

+
void
+glibtop_get_proc_mem_p (glibtop *server,
+                        glibtop_proc_mem *buf,
+                        pid_t pid);
+
+
+
+

glibtop_get_proc_mem_s ()

+
void
+glibtop_get_proc_mem_s (glibtop *server,
+                        glibtop_proc_mem *buf,
+                        pid_t pid);
+
+
+
+

Types and Values

+
+

GLIBTOP_PROC_MEM_SIZE

+
#define GLIBTOP_PROC_MEM_SIZE		0
+
+
+
+
+

GLIBTOP_PROC_MEM_VSIZE

+
#define GLIBTOP_PROC_MEM_VSIZE		1
+
+
+
+
+

GLIBTOP_PROC_MEM_RESIDENT

+
#define GLIBTOP_PROC_MEM_RESIDENT 2
+
+
+
+
+

GLIBTOP_PROC_MEM_SHARE

+
#define GLIBTOP_PROC_MEM_SHARE		3
+
+
+
+
+

GLIBTOP_PROC_MEM_RSS

+
#define GLIBTOP_PROC_MEM_RSS		4
+
+
+
+
+

GLIBTOP_PROC_MEM_RSS_RLIM

+
#define GLIBTOP_PROC_MEM_RSS_RLIM 5
+
+
+
+
+

GLIBTOP_MAX_PROC_MEM

+
#define GLIBTOP_MAX_PROC_MEM		6
+
+
+
+
+

struct glibtop_proc_mem

+
struct glibtop_proc_mem {
+	guint64 flags;
+	guint64 size;		/* total # of pages of memory */
+	guint64 vsize;		/* number of pages of virtual memory ... */
+	guint64 resident; /* number of resident set
+				 * (non-swapped) pages (4k) */
+	guint64 share;		/* number of pages of shared (mmap'd) memory */
+	guint64 rss;		/* resident set size */
+	guint64 rss_rlim; /* current limit (in bytes) of the rss
+				 * of the process; usually 2,147,483,647 */
+};
+
+
+
+
+

glibtop_get_proc_mem_r

+
#define glibtop_get_proc_mem_r		glibtop_get_proc_mem_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-procopenfiles.html b/doc/reference/html/libgtop-procopenfiles.html new file mode 100644 index 0000000..bd1520e --- /dev/null +++ b/doc/reference/html/libgtop-procopenfiles.html @@ -0,0 +1,357 @@ + + + + +procopenfiles: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

procopenfiles

+

procopenfiles

+
+ + +
+

Includes

+
#include <glibtop/procopenfiles.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_proc_open_files ()

+
glibtop_open_files_entry *
+glibtop_get_proc_open_files (glibtop_proc_open_files *buf,
+                             pid_t pid);
+
+

Returns

+

.

+

[transfer none]

+
+
+
+
+

glibtop_get_proc_open_files_l ()

+
glibtop_open_files_entry *
+glibtop_get_proc_open_files_l (glibtop *server,
+                               glibtop_proc_open_files *buf,
+                               pid_t pid);
+
+

Parameters

+
+++++ + + + + + +

buf

.

[out]
+
+
+

Returns

+

.

+

[transfer none]

+
+
+
+
+

glibtop_get_proc_open_files_p ()

+
glibtop_open_files_entry *
+glibtop_get_proc_open_files_p (glibtop *server,
+                               glibtop_proc_open_files *buf,
+                               pid_t pid);
+
+

Parameters

+
+++++ + + + + + +

buf

.

[out]
+
+
+

Returns

+

.

+

[transfer none]

+
+
+
+
+

glibtop_get_proc_open_files_s ()

+
glibtop_open_files_entry *
+glibtop_get_proc_open_files_s (glibtop *server,
+                               glibtop_proc_open_files *buf,
+                               pid_t pid);
+
+
+
+

Types and Values

+
+

GLIBTOP_PROC_OPEN_FILES_NUMBER

+
#define GLIBTOP_PROC_OPEN_FILES_NUMBER		0
+
+
+
+
+

GLIBTOP_PROC_OPEN_FILES_TOTAL

+
#define GLIBTOP_PROC_OPEN_FILES_TOTAL		1
+
+
+
+
+

GLIBTOP_PROC_OPEN_FILES_SIZE

+
#define GLIBTOP_PROC_OPEN_FILES_SIZE		2
+
+
+
+
+

GLIBTOP_MAX_PROC_OPEN_FILES

+
#define GLIBTOP_MAX_PROC_OPEN_FILES		3
+
+
+
+
+

GLIBTOP_FILE_ENTRY_FD

+
#define GLIBTOP_FILE_ENTRY_FD				0
+
+
+
+
+

GLIBTOP_FILE_ENTRY_NAME

+
#define GLIBTOP_FILE_ENTRY_NAME				1
+
+
+
+
+

GLIBTOP_FILE_ENTRY_TYPE

+
#define GLIBTOP_FILE_ENTRY_TYPE				2
+
+
+
+
+

GLIBTOP_FILE_ENTRY_INETSOCKET_DST_HOST

+
#define GLIBTOP_FILE_ENTRY_INETSOCKET_DST_HOST		3
+
+
+
+
+

GLIBTOP_FILE_ENTRY_INETSOCKET_DST_PORT

+
#define GLIBTOP_FILE_ENTRY_INETSOCKET_DST_PORT		4
+
+
+
+
+

GLIBTOP_MAX_OPEN_FILE_ENTRY

+
#define GLIBTOP_MAX_OPEN_FILE_ENTRY		5
+
+
+
+
+

GLIBTOP_OPEN_FILENAME_LEN

+
#define GLIBTOP_OPEN_FILENAME_LEN 215
+
+
+
+
+

GLIBTOP_OPEN_DEST_HOST_LEN

+
#define GLIBTOP_OPEN_DEST_HOST_LEN 46
+
+
+
+
+

struct glibtop_open_files_entry

+
struct glibtop_open_files_entry {
+	int fd;
+	guint16 type; /* An "enum glibtop_file_type" value. */
+	union {
+		/* When type == GLIBTOP_FILE_TYPE_INETSOCKET or
+		 * when type == GLIBTOP_FILE_TYPE_INET6SOCKET */
+		struct {
+			char dest_host[GLIBTOP_OPEN_DEST_HOST_LEN+1];
+			int dest_port;
+		} sock;
+
+		/* When type == GLIBTOP_FILE_TYPE_FILE */
+		struct {
+			char name[GLIBTOP_OPEN_FILENAME_LEN+1];
+		} file;
+
+		/* When type == GLIBTOP_FILE_TYPE_LOCALSOCKET */
+		struct {
+			char name[GLIBTOP_OPEN_FILENAME_LEN+1];
+		} localsock;
+
+	} info;
+};
+
+
+
+
+

struct glibtop_proc_open_files

+
struct glibtop_proc_open_files {
+	guint64 flags;
+	guint64 number;			/* GLIBTOP_PROC_OPEN_FILES_NUMBER */
+	guint64 total;			/* GLIBTOP_PROC_OPEN_FILES_TOTAL  */
+	guint64 size;			/* GLIBTOP_PROC_OPEN_FILES_SIZE   */
+};
+
+
+
+
+

glibtop_get_proc_open_files_r

+
#define glibtop_get_proc_open_files_r		glibtop_get_proc_open_files_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-procsegment.html b/doc/reference/html/libgtop-procsegment.html new file mode 100644 index 0000000..f3ef231 --- /dev/null +++ b/doc/reference/html/libgtop-procsegment.html @@ -0,0 +1,256 @@ + + + + +procsegment: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

procsegment

+

procsegment

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_proc_segment () +
+void + +glibtop_get_proc_segment_l () +
+void + +glibtop_get_proc_segment_p () +
+void + +glibtop_get_proc_segment_s () +
+
+ +
+

Includes

+
#include <glibtop/procsegment.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_proc_segment ()

+
void
+glibtop_get_proc_segment (glibtop_proc_segment *buf,
+                          pid_t pid);
+
+
+
+

glibtop_get_proc_segment_l ()

+
void
+glibtop_get_proc_segment_l (glibtop *server,
+                            glibtop_proc_segment *buf,
+                            pid_t pid);
+
+
+
+

glibtop_get_proc_segment_p ()

+
void
+glibtop_get_proc_segment_p (glibtop *server,
+                            glibtop_proc_segment *buf,
+                            pid_t pid);
+
+
+
+

glibtop_get_proc_segment_s ()

+
void
+glibtop_get_proc_segment_s (glibtop *server,
+                            glibtop_proc_segment *buf,
+                            pid_t pid);
+
+
+
+

Types and Values

+
+

GLIBTOP_PROC_SEGMENT_TEXT_RSS

+
#define GLIBTOP_PROC_SEGMENT_TEXT_RSS		0
+
+
+
+
+

GLIBTOP_PROC_SEGMENT_SHLIB_RSS

+
#define GLIBTOP_PROC_SEGMENT_SHLIB_RSS		1
+
+
+
+
+

GLIBTOP_PROC_SEGMENT_DATA_RSS

+
#define GLIBTOP_PROC_SEGMENT_DATA_RSS		2
+
+
+
+
+

GLIBTOP_PROC_SEGMENT_STACK_RSS

+
#define GLIBTOP_PROC_SEGMENT_STACK_RSS		3
+
+
+
+
+

GLIBTOP_PROC_SEGMENT_DIRTY_SIZE

+
#define GLIBTOP_PROC_SEGMENT_DIRTY_SIZE		4
+
+
+
+
+

GLIBTOP_PROC_SEGMENT_START_CODE

+
#define GLIBTOP_PROC_SEGMENT_START_CODE		5
+
+
+
+
+

GLIBTOP_PROC_SEGMENT_END_CODE

+
#define GLIBTOP_PROC_SEGMENT_END_CODE		6
+
+
+
+
+

GLIBTOP_PROC_SEGMENT_START_STACK

+
#define GLIBTOP_PROC_SEGMENT_START_STACK 7
+
+
+
+
+

GLIBTOP_MAX_PROC_SEGMENT

+
#define GLIBTOP_MAX_PROC_SEGMENT		8
+
+
+
+
+

struct glibtop_proc_segment

+
struct glibtop_proc_segment {
+	guint64 flags;
+	guint64 text_rss; /* text resident set size */
+	guint64 shlib_rss; /* shared-lib resident set size */
+	guint64 data_rss; /* data resident set size */
+	guint64 stack_rss; /* stack resident set size */
+	guint64 dirty_size; /* size of dirty pages */
+	guint64 start_code;
+				/* address of beginning of code segment */
+	guint64 end_code; /* address of end of code segment */
+	guint64 start_stack; /* address of the bottom of stack segment */
+};
+
+
+
+
+

glibtop_get_proc_segment_r

+
#define glibtop_get_proc_segment_r glibtop_get_proc_segment_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-procsignal.html b/doc/reference/html/libgtop-procsignal.html new file mode 100644 index 0000000..079d615 --- /dev/null +++ b/doc/reference/html/libgtop-procsignal.html @@ -0,0 +1,211 @@ + + + + +procsignal: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

procsignal

+

procsignal

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_proc_signal () +
+void + +glibtop_get_proc_signal_l () +
+void + +glibtop_get_proc_signal_p () +
+void + +glibtop_get_proc_signal_s () +
+
+
+

Types and Values

+ +
+
+

Includes

+
#include <glibtop/procsignal.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_proc_signal ()

+
void
+glibtop_get_proc_signal (glibtop_proc_signal *buf,
+                         pid_t pid);
+
+
+
+

glibtop_get_proc_signal_l ()

+
void
+glibtop_get_proc_signal_l (glibtop *server,
+                           glibtop_proc_signal *buf,
+                           pid_t pid);
+
+
+
+

glibtop_get_proc_signal_p ()

+
void
+glibtop_get_proc_signal_p (glibtop *server,
+                           glibtop_proc_signal *buf,
+                           pid_t pid);
+
+
+
+

glibtop_get_proc_signal_s ()

+
void
+glibtop_get_proc_signal_s (glibtop *server,
+                           glibtop_proc_signal *buf,
+                           pid_t pid);
+
+
+
+

Types and Values

+
+

GLIBTOP_PROC_SIGNAL_SIGNAL

+
#define GLIBTOP_PROC_SIGNAL_SIGNAL 0
+
+
+
+
+

GLIBTOP_PROC_SIGNAL_BLOCKED

+
#define GLIBTOP_PROC_SIGNAL_BLOCKED 1
+
+
+
+
+

GLIBTOP_PROC_SIGNAL_SIGIGNORE

+
#define GLIBTOP_PROC_SIGNAL_SIGIGNORE 2
+
+
+
+
+

GLIBTOP_PROC_SIGNAL_SIGCATCH

+
#define GLIBTOP_PROC_SIGNAL_SIGCATCH 3
+
+
+
+
+

GLIBTOP_MAX_PROC_SIGNAL

+
#define GLIBTOP_MAX_PROC_SIGNAL		4
+
+
+
+
+

struct glibtop_proc_signal

+
struct glibtop_proc_signal {
+	guint64 flags;
+	guint64 signal [2];		/* mask of pending signals */
+	guint64 blocked [2];		/* mask of blocked signals */
+	guint64 sigignore [2];		/* mask of ignored signals */
+	guint64 sigcatch [2];		/* mask of caught  signals */
+};
+
+
+
+
+

glibtop_get_proc_signal_r

+
#define glibtop_get_proc_signal_r glibtop_get_proc_signal_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-procstate.html b/doc/reference/html/libgtop-procstate.html new file mode 100644 index 0000000..49836f4 --- /dev/null +++ b/doc/reference/html/libgtop-procstate.html @@ -0,0 +1,342 @@ + + + + +procstate: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

procstate

+

procstate

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_proc_state () +
+void + +glibtop_get_proc_state_l () +
+void + +glibtop_get_proc_state_p () +
+void + +glibtop_get_proc_state_s () +
+
+
+

Types and Values

+ +
+
+

Includes

+
#include <glibtop/procstate.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_proc_state ()

+
void
+glibtop_get_proc_state (glibtop_proc_state *buf,
+                        pid_t pid);
+
+
+
+

glibtop_get_proc_state_l ()

+
void
+glibtop_get_proc_state_l (glibtop *server,
+                          glibtop_proc_state *buf,
+                          pid_t pid);
+
+
+
+

glibtop_get_proc_state_p ()

+
void
+glibtop_get_proc_state_p (glibtop *server,
+                          glibtop_proc_state *buf,
+                          pid_t pid);
+
+
+
+

glibtop_get_proc_state_s ()

+
void
+glibtop_get_proc_state_s (glibtop *server,
+                          glibtop_proc_state *buf,
+                          pid_t pid);
+
+
+
+

Types and Values

+
+

GLIBTOP_PROC_STATE_CMD

+
#define GLIBTOP_PROC_STATE_CMD		0
+
+
+
+
+

GLIBTOP_PROC_STATE_STATE

+
#define GLIBTOP_PROC_STATE_STATE 1
+
+
+
+
+

GLIBTOP_PROC_STATE_UID

+
#define GLIBTOP_PROC_STATE_UID		2
+
+
+
+
+

GLIBTOP_PROC_STATE_GID

+
#define GLIBTOP_PROC_STATE_GID		3
+
+
+
+
+

GLIBTOP_PROC_STATE_RUID

+
#define GLIBTOP_PROC_STATE_RUID     4
+
+
+
+
+

GLIBTOP_PROC_STATE_RGID

+
#define GLIBTOP_PROC_STATE_RGID     5
+
+
+
+
+

GLIBTOP_PROC_STATE_HAS_CPU

+
#define GLIBTOP_PROC_STATE_HAS_CPU  6
+
+
+
+
+

GLIBTOP_PROC_STATE_PROCESSOR

+
#define GLIBTOP_PROC_STATE_PROCESSOR 7
+
+
+
+
+

GLIBTOP_PROC_STATE_LAST_PROCESSOR

+
#define GLIBTOP_PROC_STATE_LAST_PROCESSOR 8
+
+
+
+
+

GLIBTOP_MAX_PROC_STATE

+
#define GLIBTOP_MAX_PROC_STATE		9
+
+
+
+
+

GLIBTOP_PROCESS_RUNNING

+
#define GLIBTOP_PROCESS_RUNNING                 1
+
+
+
+
+

GLIBTOP_PROCESS_INTERRUPTIBLE

+
#define GLIBTOP_PROCESS_INTERRUPTIBLE           2
+
+
+
+
+

GLIBTOP_PROCESS_UNINTERRUPTIBLE

+
#define GLIBTOP_PROCESS_UNINTERRUPTIBLE         4
+
+
+
+
+

GLIBTOP_PROCESS_ZOMBIE

+
#define GLIBTOP_PROCESS_ZOMBIE                  8
+
+
+
+
+

GLIBTOP_PROCESS_STOPPED

+
#define GLIBTOP_PROCESS_STOPPED                 16
+
+
+
+
+

GLIBTOP_PROCESS_SWAPPING

+
#define GLIBTOP_PROCESS_SWAPPING                32
+
+
+
+
+

GLIBTOP_PROCESS_DEAD

+
#define GLIBTOP_PROCESS_DEAD                    64
+
+
+
+
+

struct glibtop_proc_state

+
struct glibtop_proc_state {
+	guint64 flags;
+	char cmd[40];		/* basename of executable file in
+				 * call to exec(2) */
+	unsigned state;
+	/* NOTE: when porting the library, TRY HARD to implement the
+	 *       following two fields. */
+	/* IMPORTANT NOTICE: For security reasons, it is extremely important
+	 *                   only to set the flags value for those two
+	 *                   fields if their values are corrent ! */
+	int uid;		/* UID of process */
+	int gid;		/* GID of process */
+    int ruid;
+    int rgid;
+    int has_cpu;
+    int processor;
+    int last_processor;
+};
+
+
+
+
+

glibtop_get_proc_state_r

+
#define glibtop_get_proc_state_r glibtop_get_proc_state_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-procuid.html b/doc/reference/html/libgtop-procuid.html new file mode 100644 index 0000000..1c2e879 --- /dev/null +++ b/doc/reference/html/libgtop-procuid.html @@ -0,0 +1,398 @@ + + + + +procuid: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

procuid

+

procuid

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_proc_uid () +
+void + +glibtop_get_proc_uid_l () +
+void + +glibtop_get_proc_uid_p () +
+void + +glibtop_get_proc_uid_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_PROC_UID_UID
#defineGLIBTOP_PROC_UID_EUID
#defineGLIBTOP_PROC_UID_GID
#defineGLIBTOP_PROC_UID_EGID
#defineGLIBTOP_PROC_UID_SUID
#defineGLIBTOP_PROC_UID_SGID
#defineGLIBTOP_PROC_UID_FSUID
#defineGLIBTOP_PROC_UID_FSGID
#defineGLIBTOP_PROC_UID_PID
#defineGLIBTOP_PROC_UID_PPID
#defineGLIBTOP_PROC_UID_PGRP
#defineGLIBTOP_PROC_UID_SESSION
#defineGLIBTOP_PROC_UID_TTY
#defineGLIBTOP_PROC_UID_TPGID
#defineGLIBTOP_PROC_UID_PRIORITY
#defineGLIBTOP_PROC_UID_NICE
#defineGLIBTOP_PROC_UID_NGROUPS
#defineGLIBTOP_PROC_UID_GROUPS
#defineGLIBTOP_MAX_PROC_UID
structglibtop_proc_uid
#defineGLIBTOP_MAX_GROUPS
#defineglibtop_get_proc_uid_r
+
+
+

Includes

+
#include <glibtop/procuid.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_proc_uid ()

+
void
+glibtop_get_proc_uid (glibtop_proc_uid *buf,
+                      pid_t pid);
+

Get the process user id and tty information.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

buf

A location to return a glibtop_proc_uid

 

pid

Process id to get the user and tty information

 
+
+
+
+
+

glibtop_get_proc_uid_l ()

+
void
+glibtop_get_proc_uid_l (glibtop *server,
+                        glibtop_proc_uid *buf,
+                        pid_t pid);
+
+
+
+

glibtop_get_proc_uid_p ()

+
void
+glibtop_get_proc_uid_p (glibtop *server,
+                        glibtop_proc_uid *buf,
+                        pid_t pid);
+
+
+
+

glibtop_get_proc_uid_s ()

+
void
+glibtop_get_proc_uid_s (glibtop *server,
+                        glibtop_proc_uid *buf,
+                        pid_t pid);
+
+
+
+

Types and Values

+
+

GLIBTOP_PROC_UID_UID

+
#define GLIBTOP_PROC_UID_UID		0
+
+
+
+
+

GLIBTOP_PROC_UID_EUID

+
#define GLIBTOP_PROC_UID_EUID		1
+
+
+
+
+

GLIBTOP_PROC_UID_GID

+
#define GLIBTOP_PROC_UID_GID		2
+
+
+
+
+

GLIBTOP_PROC_UID_EGID

+
#define GLIBTOP_PROC_UID_EGID		3
+
+
+
+
+

GLIBTOP_PROC_UID_SUID

+
#define GLIBTOP_PROC_UID_SUID		4
+
+
+
+
+

GLIBTOP_PROC_UID_SGID

+
#define GLIBTOP_PROC_UID_SGID		5
+
+
+
+
+

GLIBTOP_PROC_UID_FSUID

+
#define GLIBTOP_PROC_UID_FSUID		6
+
+
+
+
+

GLIBTOP_PROC_UID_FSGID

+
#define GLIBTOP_PROC_UID_FSGID		7
+
+
+
+
+

GLIBTOP_PROC_UID_PID

+
#define GLIBTOP_PROC_UID_PID		8
+
+
+
+
+

GLIBTOP_PROC_UID_PPID

+
#define GLIBTOP_PROC_UID_PPID		9
+
+
+
+
+

GLIBTOP_PROC_UID_PGRP

+
#define GLIBTOP_PROC_UID_PGRP		10
+
+
+
+
+

GLIBTOP_PROC_UID_SESSION

+
#define GLIBTOP_PROC_UID_SESSION 11
+
+
+
+
+

GLIBTOP_PROC_UID_TTY

+
#define GLIBTOP_PROC_UID_TTY		12
+
+
+
+
+

GLIBTOP_PROC_UID_TPGID

+
#define GLIBTOP_PROC_UID_TPGID		13
+
+
+
+
+

GLIBTOP_PROC_UID_PRIORITY

+
#define GLIBTOP_PROC_UID_PRIORITY 14
+
+
+
+
+

GLIBTOP_PROC_UID_NICE

+
#define GLIBTOP_PROC_UID_NICE		15
+
+
+
+
+

GLIBTOP_PROC_UID_NGROUPS

+
#define GLIBTOP_PROC_UID_NGROUPS    16
+
+
+
+
+

GLIBTOP_PROC_UID_GROUPS

+
#define GLIBTOP_PROC_UID_GROUPS     17
+
+
+
+
+

GLIBTOP_MAX_PROC_UID

+
#define GLIBTOP_MAX_PROC_UID		18
+
+
+
+
+

struct glibtop_proc_uid

+
struct glibtop_proc_uid {
+	guint64 flags;
+	gint32 uid;		/* user id */
+	gint32 euid;		/* effective user id */
+	gint32 gid;		/* group id */
+	gint32 egid;		/* effective group id */
+	gint32 suid;       /* set user id */
+	gint32 sgid;       /* set group id */
+	gint32 fsuid;      /* ??? user id */
+	gint32 fsgid;      /* ??? group id */
+	gint32 pid;		/* process id */
+	gint32 ppid;		/* pid of parent process */
+	gint32 pgrp;		/* process group id */
+	gint32 session; /* session id */
+	gint32 tty;		/* full device number of controlling terminal */
+	gint32 tpgid;		/* terminal process group id */
+	gint32 priority; /* kernel scheduling priority */
+	gint32 nice;		/* standard unix nice level of process */
+	gint32 ngroups;
+	gint32 groups [GLIBTOP_MAX_GROUPS];
+};
+
+
+
+
+

GLIBTOP_MAX_GROUPS

+
#define GLIBTOP_MAX_GROUPS          64
+
+
+
+
+

glibtop_get_proc_uid_r

+
#define glibtop_get_proc_uid_r		glibtop_get_proc_uid_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-sem-limits.html b/doc/reference/html/libgtop-sem-limits.html new file mode 100644 index 0000000..5b63ac6 --- /dev/null +++ b/doc/reference/html/libgtop-sem-limits.html @@ -0,0 +1,273 @@ + + + + +sem_limits: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

sem_limits

+

sem_limits

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_sem_limits () +
+void + +glibtop_get_sem_limits_l () +
+void + +glibtop_get_sem_limits_p () +
+void + +glibtop_get_sem_limits_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_IPC_SEMMAP
#defineGLIBTOP_IPC_SEMMNI
#defineGLIBTOP_IPC_SEMMNS
#defineGLIBTOP_IPC_SEMMNU
#defineGLIBTOP_IPC_SEMMSL
#defineGLIBTOP_IPC_SEMOPM
#defineGLIBTOP_IPC_SEMUME
#defineGLIBTOP_IPC_SEMUSZ
#defineGLIBTOP_IPC_SEMVMX
#defineGLIBTOP_IPC_SEMAEM
#defineGLIBTOP_MAX_SEM_LIMITS
structglibtop_sem_limits
#defineglibtop_get_sem_limits_r
+
+
+

Includes

+
#include <glibtop/sem_limits.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_sem_limits ()

+
void
+glibtop_get_sem_limits (glibtop_sem_limits *buf);
+
+
+
+

glibtop_get_sem_limits_l ()

+
void
+glibtop_get_sem_limits_l (glibtop *server,
+                          glibtop_sem_limits *buf);
+
+
+
+

glibtop_get_sem_limits_p ()

+
void
+glibtop_get_sem_limits_p (glibtop *server,
+                          glibtop_sem_limits *buf);
+
+
+
+

glibtop_get_sem_limits_s ()

+
void
+glibtop_get_sem_limits_s (glibtop *server,
+                          glibtop_sem_limits *buf);
+
+
+
+

Types and Values

+
+

GLIBTOP_IPC_SEMMAP

+
#define GLIBTOP_IPC_SEMMAP 0
+
+
+
+
+

GLIBTOP_IPC_SEMMNI

+
#define GLIBTOP_IPC_SEMMNI 1
+
+
+
+
+

GLIBTOP_IPC_SEMMNS

+
#define GLIBTOP_IPC_SEMMNS 2
+
+
+
+
+

GLIBTOP_IPC_SEMMNU

+
#define GLIBTOP_IPC_SEMMNU 3
+
+
+
+
+

GLIBTOP_IPC_SEMMSL

+
#define GLIBTOP_IPC_SEMMSL 4
+
+
+
+
+

GLIBTOP_IPC_SEMOPM

+
#define GLIBTOP_IPC_SEMOPM 5
+
+
+
+
+

GLIBTOP_IPC_SEMUME

+
#define GLIBTOP_IPC_SEMUME 6
+
+
+
+
+

GLIBTOP_IPC_SEMUSZ

+
#define GLIBTOP_IPC_SEMUSZ 7
+
+
+
+
+

GLIBTOP_IPC_SEMVMX

+
#define GLIBTOP_IPC_SEMVMX 8
+
+
+
+
+

GLIBTOP_IPC_SEMAEM

+
#define GLIBTOP_IPC_SEMAEM 9
+
+
+
+
+

GLIBTOP_MAX_SEM_LIMITS

+
#define GLIBTOP_MAX_SEM_LIMITS 10
+
+
+
+
+

struct glibtop_sem_limits

+
struct glibtop_sem_limits {
+	guint64 flags;
+	guint64 semmap;		/* GLIBTOP_IPC_SEMMAP */
+	guint64 semmni;		/* GLIBTOP_IPC_SEMMNI */
+	guint64 semmns;		/* GLIBTOP_IPC_SEMMNS */
+	guint64 semmnu;		/* GLIBTOP_IPC_SEMMNU */
+	guint64 semmsl;		/* GLIBTOP_IPC_SEMMSL */
+	guint64 semopm;		/* GLIBTOP_IPC_SEMOPM */
+	guint64 semume;		/* GLIBTOP_IPC_SEMUME */
+	guint64 semusz;		/* GLIBTOP_IPC_SEMUSZ */
+	guint64 semvmx;		/* GLIBTOP_IPC_SEMVMX */
+	guint64 semaem;		/* GLIBTOP_IPC_SEMAEM */
+};
+
+
+
+
+

glibtop_get_sem_limits_r

+
#define glibtop_get_sem_limits_r glibtop_get_sem_limits_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-signal.html b/doc/reference/html/libgtop-signal.html new file mode 100644 index 0000000..a8f56d8 --- /dev/null +++ b/doc/reference/html/libgtop-signal.html @@ -0,0 +1,74 @@ + + + + +signal: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

signal

+

signal

+
+
+

Types and Values

+
++++ + + + + +
structglibtop_signame
+
+
+

Includes

+
#include <glibtop/signal.h>
+
+
+
+

Description

+
+
+

Functions

+

+
+
+

Types and Values

+
+

struct glibtop_signame

+
struct glibtop_signame {
+	const int number;
+	const char *name, *label;
+};
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-swap.html b/doc/reference/html/libgtop-swap.html new file mode 100644 index 0000000..0ebfdc8 --- /dev/null +++ b/doc/reference/html/libgtop-swap.html @@ -0,0 +1,233 @@ + + + + +swap: Libgtop Reference Manual + + + + + + + + + + + + + + + +
+
+
+ + +
+

swap

+

swap

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +glibtop_get_swap () +
+void + +glibtop_get_swap_l () +
+void + +glibtop_get_swap_p () +
+void + +glibtop_get_swap_s () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_SWAP_TOTAL
#defineGLIBTOP_SWAP_USED
#defineGLIBTOP_SWAP_FREE
#defineGLIBTOP_SWAP_PAGEIN
#defineGLIBTOP_SWAP_PAGEOUT
#defineGLIBTOP_MAX_SWAP
structglibtop_swap
#defineglibtop_get_swap_r
+
+
+

Includes

+
#include <glibtop/swap.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_swap ()

+
void
+glibtop_get_swap (glibtop_swap *buf);
+

Get the swap usage.

+
+

Parameters

+
+++++ + + + + + +

buf

A location to return a glibtop_swap.

 
+
+
+
+
+

glibtop_get_swap_l ()

+
void
+glibtop_get_swap_l (glibtop *server,
+                    glibtop_swap *buf);
+
+
+
+

glibtop_get_swap_p ()

+
void
+glibtop_get_swap_p (glibtop *server,
+                    glibtop_swap *buf);
+
+
+
+

glibtop_get_swap_s ()

+
void
+glibtop_get_swap_s (glibtop *server,
+                    glibtop_swap *buf);
+
+
+
+

Types and Values

+
+

GLIBTOP_SWAP_TOTAL

+
#define GLIBTOP_SWAP_TOTAL 0
+
+
+
+
+

GLIBTOP_SWAP_USED

+
#define GLIBTOP_SWAP_USED 1
+
+
+
+
+

GLIBTOP_SWAP_FREE

+
#define GLIBTOP_SWAP_FREE 2
+
+
+
+
+

GLIBTOP_SWAP_PAGEIN

+
#define GLIBTOP_SWAP_PAGEIN 3
+
+
+
+
+

GLIBTOP_SWAP_PAGEOUT

+
#define GLIBTOP_SWAP_PAGEOUT 4
+
+
+
+
+

GLIBTOP_MAX_SWAP

+
#define GLIBTOP_MAX_SWAP 5
+
+
+
+
+

struct glibtop_swap

+
struct glibtop_swap {
+	guint64 flags;
+	guint64 total;		/* GLIBTOP_SWAP_TOTAL */
+	guint64 used;		/* GLIBTOP_SWAP_USED */
+	guint64 free;		/* GLIBTOP_SWAP_FREE */
+	guint64 pagein;		/* GLIBTOP_SWAP_PAGEIN */
+	guint64 pageout; /* GLIBTOP_SWAP_PAGEOUT */
+};
+
+
+
+
+

glibtop_get_swap_r

+
#define glibtop_get_swap_r		glibtop_get_swap_p
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-sysdeps.html b/doc/reference/html/libgtop-sysdeps.html new file mode 100644 index 0000000..b66e02f --- /dev/null +++ b/doc/reference/html/libgtop-sysdeps.html @@ -0,0 +1,419 @@ + + + + +sysdeps: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

sysdeps

+

sysdeps

+
+
+

Functions

+
++++ + + + + + + + + + + +
+void + +glibtop_get_sysdeps () +
+void + +glibtop_get_sysdeps_r () +
+
+
+

Types and Values

+ +
+
+

Includes

+
#include <glibtop/sysdeps.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_sysdeps ()

+
void
+glibtop_get_sysdeps (glibtop_sysdeps *buf);
+
+
+
+

glibtop_get_sysdeps_r ()

+
void
+glibtop_get_sysdeps_r (glibtop *server,
+                       glibtop_sysdeps *buf);
+
+
+
+

Types and Values

+
+

GLIBTOP_SYSDEPS_FEATURES

+
#define GLIBTOP_SYSDEPS_FEATURES 0
+
+
+
+
+

GLIBTOP_SYSDEPS_CPU

+
#define GLIBTOP_SYSDEPS_CPU		1
+
+
+
+
+

GLIBTOP_SYSDEPS_MEM

+
#define GLIBTOP_SYSDEPS_MEM		2
+
+
+
+
+

GLIBTOP_SYSDEPS_SWAP

+
#define GLIBTOP_SYSDEPS_SWAP		3
+
+
+
+
+

GLIBTOP_SYSDEPS_UPTIME

+
#define GLIBTOP_SYSDEPS_UPTIME		4
+
+
+
+
+

GLIBTOP_SYSDEPS_LOADAVG

+
#define GLIBTOP_SYSDEPS_LOADAVG		5
+
+
+
+
+

GLIBTOP_SYSDEPS_SHM_LIMITS

+
#define GLIBTOP_SYSDEPS_SHM_LIMITS 6
+
+
+
+
+

GLIBTOP_SYSDEPS_MSG_LIMITS

+
#define GLIBTOP_SYSDEPS_MSG_LIMITS 7
+
+
+
+
+

GLIBTOP_SYSDEPS_SEM_LIMITS

+
#define GLIBTOP_SYSDEPS_SEM_LIMITS 8
+
+
+
+
+

GLIBTOP_SYSDEPS_PROCLIST

+
#define GLIBTOP_SYSDEPS_PROCLIST 9
+
+
+
+
+

GLIBTOP_SYSDEPS_PROC_STATE

+
#define GLIBTOP_SYSDEPS_PROC_STATE 10
+
+
+
+
+

GLIBTOP_SYSDEPS_PROC_UID

+
#define GLIBTOP_SYSDEPS_PROC_UID 11
+
+
+
+
+

GLIBTOP_SYSDEPS_PROC_MEM

+
#define GLIBTOP_SYSDEPS_PROC_MEM 12
+
+
+
+
+

GLIBTOP_SYSDEPS_PROC_TIME

+
#define GLIBTOP_SYSDEPS_PROC_TIME 13
+
+
+
+
+

GLIBTOP_SYSDEPS_PROC_SIGNAL

+
#define GLIBTOP_SYSDEPS_PROC_SIGNAL 14
+
+
+
+
+

GLIBTOP_SYSDEPS_PROC_KERNEL

+
#define GLIBTOP_SYSDEPS_PROC_KERNEL 15
+
+
+
+
+

GLIBTOP_SYSDEPS_PROC_SEGMENT

+
#define GLIBTOP_SYSDEPS_PROC_SEGMENT 16
+
+
+
+
+

GLIBTOP_SYSDEPS_PROC_ARGS

+
#define GLIBTOP_SYSDEPS_PROC_ARGS 17
+
+
+
+
+

GLIBTOP_SYSDEPS_PROC_MAP

+
#define GLIBTOP_SYSDEPS_PROC_MAP 18
+
+
+
+
+

GLIBTOP_SYSDEPS_MOUNTLIST

+
#define GLIBTOP_SYSDEPS_MOUNTLIST 19
+
+
+
+
+

GLIBTOP_SYSDEPS_FSUSAGE

+
#define GLIBTOP_SYSDEPS_FSUSAGE		20
+
+
+
+
+

GLIBTOP_SYSDEPS_NETLOAD

+
#define GLIBTOP_SYSDEPS_NETLOAD		21
+
+
+
+
+

GLIBTOP_SYSDEPS_PPP

+
#define GLIBTOP_SYSDEPS_PPP		22
+
+
+
+
+

GLIBTOP_SYSDEPS_NETLIST

+
#define GLIBTOP_SYSDEPS_NETLIST		23
+
+
+
+
+

GLIBTOP_SYSDEPS_PROC_OPEN_FILES

+
#define GLIBTOP_SYSDEPS_PROC_OPEN_FILES 24
+
+
+
+
+

GLIBTOP_MAX_SYSDEPS

+
#define GLIBTOP_MAX_SYSDEPS		28
+
+
+
+
+

GLIBTOP_SYSDEPS_ALL

+
#define GLIBTOP_SYSDEPS_ALL		((1 << GLIBTOP_MAX_SYSDEPS) - 1)
+
+
+
+
+

struct glibtop_sysdeps

+
struct glibtop_sysdeps {
+	guint64 flags;
+	guint64 features;		/* server features */
+	guint64 cpu;			/* glibtop_cpu		*/
+	guint64 mem;			/* glibtop_mem		*/
+	guint64 swap;			/* glibtop_swap		*/
+	guint64 uptime;			/* glibtop_uptime */
+	guint64 loadavg;		/* glibtop_loadavg */
+	guint64 shm_limits;		/* glibtop_shm_limits */
+	guint64 msg_limits;		/* glibtop_msg_limits */
+	guint64 sem_limits;		/* glibtop_sem_limits */
+	guint64 proclist;		/* glibtop_proclist */
+	guint64 proc_state;		/* glibtop_proc_state */
+	guint64 proc_uid;		/* glibtop_proc_uid */
+	guint64 proc_mem;		/* glibtop_proc_mem */
+	guint64 proc_time;		/* glibtop_proc_time */
+	guint64 proc_signal;		/* glibtop_proc_signal */
+	guint64 proc_kernel;		/* glibtop_proc_kernel */
+	guint64 proc_segment;		/* glibtop_proc_segment */
+	guint64 proc_args;		/* glibtop_proc_args */
+	guint64 proc_map;		/* glibtop_proc_map */
+	guint64 proc_open_files; /* glibtop_proc_open_files */
+	guint64 mountlist;		/* glibtop_mountlist */
+	guint64 fsusage;		/* glibtop_fsusage */
+	guint64 netlist;		/* glibtop_netlist */
+	guint64 netload;		/* glibtop_netload */
+	guint64 ppp;			/* glibtop_ppp		*/
+	guint64 proc_wd;		/* glibtop_proc_wd */
+	guint64 proc_affinity;		/* glibtop_proc_affinity */
+	guint64 proc_io;		/* glibtop_proc_io */
+	guint64 reserved0;
+	guint64 reserved1;
+	guint64 reserved2;
+	guint64 reserved3;
+	guint64 reserved4;
+	guint64 reserved5;
+	guint64 reserved6;
+	guint64 reserved7;
+};
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-sysinfo.html b/doc/reference/html/libgtop-sysinfo.html new file mode 100644 index 0000000..8f0abf5 --- /dev/null +++ b/doc/reference/html/libgtop-sysinfo.html @@ -0,0 +1,193 @@ + + + + +sysinfo: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

sysinfo

+

sysinfo

+
+
+

Functions

+
++++ + + + + + + + + + + +
const glibtop_sysinfo * + +glibtop_get_sysinfo_s () +
const glibtop_sysinfo * + +glibtop_get_sysinfo () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGLIBTOP_SYSINFO_NCPU
#defineGLIBTOP_SYSINFO_CPUINFO
#defineGLIBTOP_MAX_SYSINFO
structglibtop_sysinfo
structglibtop_entry
#defineglibtop_get_sysinfo_r
+
+
+

Includes

+
#include <glibtop/sysinfo.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_get_sysinfo_s ()

+
const glibtop_sysinfo *
+glibtop_get_sysinfo_s (glibtop *server);
+
+
+
+

glibtop_get_sysinfo ()

+
const glibtop_sysinfo *
+glibtop_get_sysinfo (void);
+
+
+
+

Types and Values

+
+

GLIBTOP_SYSINFO_NCPU

+
#define GLIBTOP_SYSINFO_NCPU		0
+
+
+
+
+

GLIBTOP_SYSINFO_CPUINFO

+
#define GLIBTOP_SYSINFO_CPUINFO		1
+
+
+
+
+

GLIBTOP_MAX_SYSINFO

+
#define GLIBTOP_MAX_SYSINFO		2
+
+
+
+
+

struct glibtop_sysinfo

+
struct glibtop_sysinfo {
+	guint64 flags;
+	guint64 ncpu;
+	glibtop_entry cpuinfo [GLIBTOP_NCPU];
+};
+
+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

guint64 flags;

  

guint64 ncpu;

  

glibtop_entry cpuinfo[GLIBTOP_NCPU];

  
+
+
+
+
+

struct glibtop_entry

+
struct glibtop_entry {
+	GPtrArray *labels;
+	GHashTable *values; /* key -> description */
+	GHashTable *descriptions; /* unused */
+};
+
+
+
+
+

glibtop_get_sysinfo_r

+
#define glibtop_get_sysinfo_r glibtop_get_sysinfo_s
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-union.html b/doc/reference/html/libgtop-union.html new file mode 100644 index 0000000..90c72d7 --- /dev/null +++ b/doc/reference/html/libgtop-union.html @@ -0,0 +1,69 @@ + + + + +union: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

union

+

union

+
+
+

Types and Values

+
++++ + + + + +
unionglibtop_union
+
+
+

Includes

+
#include <glibtop/union.h>
+
+
+
+

Description

+
+
+

Functions

+

+
+
+

Types and Values

+
+

union glibtop_union

+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-version.html b/doc/reference/html/libgtop-version.html new file mode 100644 index 0000000..9d1f497 --- /dev/null +++ b/doc/reference/html/libgtop-version.html @@ -0,0 +1,93 @@ + + + + +version: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

version

+

version

+
+
+

Functions

+
++++ + + + + +
+void + +glibtop_send_version () +
+
+
+

Types and Values

+
++++ + + + + +
#defineLIBGTOP_VERSION_STRING
+
+
+

Includes

+
#include <glibtop/version.h>
+
+
+
+

Description

+
+
+

Functions

+
+

glibtop_send_version ()

+
void
+glibtop_send_version (glibtop *server,
+                      int fd);
+
+
+
+

Types and Values

+
+

LIBGTOP_VERSION_STRING

+
#define LIBGTOP_VERSION_STRING "Libgtop %s server version %s (%u,%u,%u,%u)."
+
+
+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-white-paper-overview.html b/doc/reference/html/libgtop-white-paper-overview.html new file mode 100644 index 0000000..cdb9e38 --- /dev/null +++ b/doc/reference/html/libgtop-white-paper-overview.html @@ -0,0 +1,65 @@ + + + + +Overview: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+

+Overview

+

This section should give you a short overview on how LibGTop + was developed, which things needed to be considered and how it + works.

+
+

+Interface Design: Things that need to be considered

+

+At the very beginning, it was necessary to collect all the data the library part +should provide and put them into some C structures. This was not that easiy as it +might sound since LibGTop should be portable to any modern UNIX system with a common +library part on all those systems, but the data that should be returned vary from +system to system. For instance some systems support shared memory, but some others +may not.

+

+The header files where we define these C structures (which are system-independent) are +shared between client and server. This way we can call the system dependent code +directly where we do not need any special privileges to do so.

+

+All of those structures contain a @code{flags} member which is interpreted as a bit +mask and tells the caller of the library functions which of the fields in the returned +structure are valid and which are not.

+
+
+

+Server Implementation: The LibGTop "server"

+

+The LibGTop @dfn{server} is a setgid/setuid binary which contains all the system +dependent code which needs special privileges. It is only build if it's required +on the current system (for instance, the Linux kernel provides all the required +data via its @file{/proc} filesystem so we do not need the server at all) and it +only contains the @dfn{features} which need privileges.

+

+Whenever we do not need any privileges to get all the data for some of the requested +structures (here called @dfn{features}) the library calls the sysdeps code directly +rather than using the server.

+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop-white-paper.html b/doc/reference/html/libgtop-white-paper.html new file mode 100644 index 0000000..e53cd9b --- /dev/null +++ b/doc/reference/html/libgtop-white-paper.html @@ -0,0 +1,74 @@ + + + + +White paper: Libgtop Reference Manual + + + + + + + + + + + + + + + + +
+

+White paper

+ +
+

+Introduction

+

Many modern UNIX systems like Solaris, BSD or Digitial Unix + only allow priviledged processes to read information like CPU and + Memory Usage or information about running processes.

+
    +
  • + BSD, for instance, doesn't have any other way to get those data than reading + directly from @file{/dev/kmem} and you need to be in the @code{kmem} group to + be able to read this.

  • +
  • + Other systems, like Digital Unix, allow all users to get things like CPU and + Memory statistics, but only root may read information about any process other + than the current one (you may not even get information about your own processes + if you're not root).

  • +
  • + Linux has a very nice @file{/proc} filesystem, but reading and parsing + @file{/proc} is very slow and inefficient.

  • +
  • + Solaris is a bit better, but you still need to be in the @code{sys} group or + even root to get some data.

  • +
+

+ Because of this system utilities like @code{ps}, @code{uptime} or @code{top} + often are setgid kmem or setuid root. Usually, they're also very specific to + the system they're written for and not easily portable to other systems without + a lot of work.

+

+ This, of cause, becomes a problem for graphical tools like @code{gtop} - making + a GTK+ program setgid or even setuid would be a security hole as big as you can + drive the entire X11 source code through. For the GNOME project, we also needed + some kind of library which provides all the required information in a portable + since there's more than just one single program that wants to use them - for + instance @code{gtop} and the @code{multiload}, @code{cpumemusage} and + @code{netload} panel applets.

+
+
+ + + \ No newline at end of file diff --git a/doc/reference/html/libgtop.devhelp2 b/doc/reference/html/libgtop.devhelp2 new file mode 100644 index 0000000..5477455 --- /dev/null +++ b/doc/reference/html/libgtop.devhelp2 @@ -0,0 +1,539 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/reference/html/right-insensitive.png b/doc/reference/html/right-insensitive.png new file mode 100644 index 0000000..4c95785 Binary files /dev/null and b/doc/reference/html/right-insensitive.png differ diff --git a/doc/reference/html/right.png b/doc/reference/html/right.png new file mode 100644 index 0000000..76260ec Binary files /dev/null and b/doc/reference/html/right.png differ diff --git a/doc/reference/html/style.css b/doc/reference/html/style.css new file mode 100644 index 0000000..3675420 --- /dev/null +++ b/doc/reference/html/style.css @@ -0,0 +1,479 @@ +body +{ + font-family: cantarell, sans-serif; +} +.synopsis, .classsynopsis +{ + /* tango:aluminium 1/2 */ + background: #eeeeec; + background: rgba(238, 238, 236, 0.5); + border: solid 1px rgb(238, 238, 236); + padding: 0.5em; +} +.programlisting +{ + /* tango:sky blue 0/1 */ + /* fallback for no rgba support */ + background: #e6f3ff; + border: solid 1px #729fcf; + background: rgba(114, 159, 207, 0.1); + border: solid 1px rgba(114, 159, 207, 0.2); + padding: 0.5em; +} +.variablelist +{ + padding: 4px; + margin-left: 3em; +} +.variablelist td:first-child +{ + vertical-align: top; +} + +div.gallery-float +{ + float: left; + padding: 10px; +} +div.gallery-float img +{ + border-style: none; +} +div.gallery-spacer +{ + clear: both; +} + +a, a:visited +{ + text-decoration: none; + /* tango:sky blue 2 */ + color: #3465a4; +} +a:hover +{ + text-decoration: underline; + /* tango:sky blue 1 */ + color: #729fcf; +} + +div.informaltable table +{ + border-collapse: separate; + border-spacing: 1em 0.3em; + border: none; +} + +div.informaltable table td, div.informaltable table th +{ + vertical-align: top; +} + +.function_type, +.variable_type, +.property_type, +.signal_type, +.parameter_name, +.struct_member_name, +.union_member_name, +.define_keyword, +.datatype_keyword, +.typedef_keyword +{ + text-align: right; +} + +/* dim non-primary columns */ +.c_punctuation, +.function_type, +.variable_type, +.property_type, +.signal_type, +.define_keyword, +.datatype_keyword, +.typedef_keyword, +.property_flags, +.signal_flags, +.parameter_annotations, +.enum_member_annotations, +.struct_member_annotations, +.union_member_annotations +{ + color: #888a85; +} + +.function_type a, +.function_type a:visited, +.function_type a:hover, +.property_type a, +.property_type a:visited, +.property_type a:hover, +.signal_type a, +.signal_type a:visited, +.signal_type a:hover, +.signal_flags a, +.signal_flags a:visited, +.signal_flags a:hover +{ + color: #729fcf; +} + +td p +{ + margin: 0.25em; +} + +div.table table +{ + border-collapse: collapse; + border-spacing: 0px; + /* tango:aluminium 3 */ + border: solid 1px #babdb6; +} + +div.table table td, div.table table th +{ + /* tango:aluminium 3 */ + border: solid 1px #babdb6; + padding: 3px; + vertical-align: top; +} + +div.table table th +{ + /* tango:aluminium 2 */ + background-color: #d3d7cf; +} + +h4 +{ + color: #555753; + margin-top: 1em; + margin-bottom: 1em; +} + +hr +{ + /* tango:aluminium 1 */ + color: #d3d7cf; + background: #d3d7cf; + border: none 0px; + height: 1px; + clear: both; + margin: 2.0em 0em 2.0em 0em; +} + +dl.toc dt +{ + padding-bottom: 0.25em; +} + +dl.toc > dt +{ + padding-top: 0.25em; + padding-bottom: 0.25em; + font-weight: bold; +} + +dl.toc > dl +{ + padding-bottom: 0.5em; +} + +.parameter +{ + font-style: normal; +} + +.footer +{ + padding-top: 3.5em; + /* tango:aluminium 3 */ + color: #babdb6; + text-align: center; + font-size: 80%; +} + +.informalfigure, +.figure +{ + margin: 1em; +} + +.informalexample, +.example +{ + margin-top: 1em; + margin-bottom: 1em; +} + +.warning +{ + /* tango:orange 0/1 */ + background: #ffeed9; + background: rgba(252, 175, 62, 0.1); + border-color: #ffb04f; + border-color: rgba(252, 175, 62, 0.2); +} +.note +{ + /* tango:chameleon 0/0.5 */ + background: #d8ffb2; + background: rgba(138, 226, 52, 0.1); + border-color: #abf562; + border-color: rgba(138, 226, 52, 0.2); +} +div.blockquote +{ + border-color: #eeeeec; +} +.note, .warning, div.blockquote +{ + padding: 0.5em; + border-width: 1px; + border-style: solid; + margin: 2em; +} +.note p, .warning p +{ + margin: 0; +} + +div.warning h3.title, +div.note h3.title +{ + display: none; +} + +p + div.section +{ + margin-top: 1em; +} + +div.refnamediv, +div.refsynopsisdiv, +div.refsect1, +div.refsect2, +div.toc, +div.section +{ + margin-bottom: 1em; +} + +/* blob links */ +h2 .extralinks, h3 .extralinks +{ + float: right; + /* tango:aluminium 3 */ + color: #babdb6; + font-size: 80%; + font-weight: normal; +} + +.lineart +{ + color: #d3d7cf; + font-weight: normal; +} + +.annotation +{ + /* tango:aluminium 5 */ + color: #555753; + font-weight: normal; +} + +.structfield +{ + font-style: normal; + font-weight: normal; +} + +acronym,abbr +{ + border-bottom: 1px dotted gray; +} + +/* code listings */ + +.listing_code .programlisting .normal, +.listing_code .programlisting .normal a, +.listing_code .programlisting .number, +.listing_code .programlisting .cbracket, +.listing_code .programlisting .symbol { color: #555753; } +.listing_code .programlisting .comment, +.listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ +.listing_code .programlisting .function, +.listing_code .programlisting .function a, +.listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ +.listing_code .programlisting .string { color: #ad7fa8; } /* tango: plum */ +.listing_code .programlisting .keyword, +.listing_code .programlisting .usertype, +.listing_code .programlisting .type, +.listing_code .programlisting .type a { color: #4e9a06; } /* tango: chameleon 3 */ + +.listing_frame { + /* tango:sky blue 1 */ + border: solid 1px #729fcf; + border: solid 1px rgba(114, 159, 207, 0.2); + padding: 0px; +} + +.listing_lines, .listing_code { + margin-top: 0px; + margin-bottom: 0px; + padding: 0.5em; +} +.listing_lines { + /* tango:sky blue 0.5 */ + background: #a6c5e3; + background: rgba(114, 159, 207, 0.2); + /* tango:aluminium 6 */ + color: #2e3436; +} +.listing_code { + /* tango:sky blue 0 */ + background: #e6f3ff; + background: rgba(114, 159, 207, 0.1); +} +.listing_code .programlisting { + /* override from previous */ + border: none 0px; + padding: 0px; + background: none; +} +.listing_lines pre, .listing_code pre { + margin: 0px; +} + +@media screen { + /* these have a as a first child, but since there are no parent selectors + * we can't use that. */ + a.footnote + { + position: relative; + top: 0em ! important; + } + /* this is needed so that the local anchors are displayed below the naviagtion */ + div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] + { + display: inline-block; + position: relative; + top:-5em; + } + /* this seems to be a bug in the xsl style sheets when generating indexes */ + div.index div.index + { + top: 0em; + } + /* make space for the fixed navigation bar and add space at the bottom so that + * link targets appear somewhat close to top + */ + body + { + padding-top: 2.5em; + padding-bottom: 500px; + max-width: 60em; + } + p + { + max-width: 60em; + } + /* style and size the navigation bar */ + table.navigation#top + { + position: fixed; + background: #e2e2e2; + border-bottom: solid 1px #babdb6; + border-spacing: 5px; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + z-index: 10; + } + table.navigation#top td + { + padding-left: 6px; + padding-right: 6px; + } + .navigation a, .navigation a:visited + { + /* tango:sky blue 3 */ + color: #204a87; + } + .navigation a:hover + { + /* tango:sky blue 2 */ + color: #3465a4; + } + td.shortcuts + { + /* tango:sky blue 2 */ + color: #3465a4; + font-size: 80%; + white-space: nowrap; + } + td.shortcuts .dim + { + color: #babdb6; + } + .navigation .title + { + font-size: 80%; + max-width: none; + margin: 0px; + font-weight: normal; + } +} +@media screen and (min-width: 60em) { + /* screen larger than 60em */ + body { margin: auto; } +} +@media screen and (max-width: 60em) { + /* screen less than 60em */ + #nav_hierarchy { display: none; } + #nav_interfaces { display: none; } + #nav_prerequisites { display: none; } + #nav_derived_interfaces { display: none; } + #nav_implementations { display: none; } + #nav_child_properties { display: none; } + #nav_style_properties { display: none; } + #nav_index { display: none; } + #nav_glossary { display: none; } + .gallery_image { display: none; } + .property_flags { display: none; } + .signal_flags { display: none; } + .parameter_annotations { display: none; } + .enum_member_annotations { display: none; } + .struct_member_annotations { display: none; } + .union_member_annotations { display: none; } + /* now that a column is hidden, optimize space */ + col.parameters_name { width: auto; } + col.parameters_description { width: auto; } + col.struct_members_name { width: auto; } + col.struct_members_description { width: auto; } + col.enum_members_name { width: auto; } + col.enum_members_description { width: auto; } + col.union_members_name { width: auto; } + col.union_members_description { width: auto; } + .listing_lines { display: none; } +} +@media print { + table.navigation { + visibility: collapse; + display: none; + } + div.titlepage table.navigation { + visibility: visible; + display: table; + background: #e2e2e2; + border: solid 1px #babdb6; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + height: 3em; + } +} + diff --git a/doc/reference/html/up-insensitive.png b/doc/reference/html/up-insensitive.png new file mode 100644 index 0000000..f404986 Binary files /dev/null and b/doc/reference/html/up-insensitive.png differ diff --git a/doc/reference/html/up.png b/doc/reference/html/up.png new file mode 100644 index 0000000..80b4b37 Binary files /dev/null and b/doc/reference/html/up.png differ diff --git a/doc/reference/libgtop-docs.xml b/doc/reference/libgtop-docs.xml new file mode 100644 index 0000000..f58649b --- /dev/null +++ b/doc/reference/libgtop-docs.xml @@ -0,0 +1,206 @@ + + + + + Libgtop Reference Manual + for libgtop + + + Martin + Baulig + +
+ martin@home-of-linux.org +
+
+
+ + Germán + Poó-Caamaño + +
+ gpoo@ubiobio.cl +
+
+
+
+ + + Permission is granted to copy, distribute and/or modify + this document under the terms of the GNU Free + Documentation License, Version 1.1 or any later + version published by the Free Software Foundation with no + Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. You may obtain a copy of the GNU Free + Documentation License from the Free Software + Foundation by visiting their Web site or by writing + to: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + Many of the names used by companies to distinguish their + products and services are claimed as trademarks. Where those + names appear in any GNOME documentation, and those trademarks + are made aware to the members of the GNOME Documentation + Project, the names have been printed in caps or initial + caps. + + + + + LibGTop is a library to get system specific data such as CPU and + Memory Usage and information about running Processes. + + On Systems like Solaris or Digital Unix where you need special + privileges to get those data, it uses a setuid/setgid server to do + so. + + Even if LibGTop is a part of the GNOME desktop environment + (@uref{http://www.gnome.org}), the main interface of LibGTop is totally + independent from any particular desktop environment, so you can also + use it as a standalone library in any piece of GPLed software. + + This manual documents the interfaces of the libgtop + library and has some short notes to help get you up to speed + with using the library. + +
+ + + + + White paper + + + Introduction + Many modern UNIX systems like Solaris, BSD or Digitial Unix + only allow priviledged processes to read information like CPU and + Memory Usage or information about running processes. + + + + BSD, for instance, doesn't have any other way to get those data than reading + directly from @file{/dev/kmem} and you need to be in the @code{kmem} group to + be able to read this. + + + Other systems, like Digital Unix, allow all users to get things like CPU and + Memory statistics, but only root may read information about any process other + than the current one (you may not even get information about your own processes + if you're not root). + + + Linux has a very nice @file{/proc} filesystem, but reading and parsing + @file{/proc} is very slow and inefficient. + + + Solaris is a bit better, but you still need to be in the @code{sys} group or + even root to get some data. + + + + Because of this system utilities like @code{ps}, @code{uptime} or @code{top} + often are setgid kmem or setuid root. Usually, they're also very specific to + the system they're written for and not easily portable to other systems without + a lot of work. + + + This, of cause, becomes a problem for graphical tools like @code{gtop} - making + a GTK+ program setgid or even setuid would be a security hole as big as you can + drive the entire X11 source code through. For the GNOME project, we also needed + some kind of library which provides all the required information in a portable + since there's more than just one single program that wants to use them - for + instance @code{gtop} and the @code{multiload}, @code{cpumemusage} and + @code{netload} panel applets. + + + + + Overview + This section should give you a short overview on how LibGTop + was developed, which things needed to be considered and how it + works. + + + Interface Design: Things that need to be considered + +At the very beginning, it was necessary to collect all the data the library part +should provide and put them into some C structures. This was not that easiy as it +might sound since LibGTop should be portable to any modern UNIX system with a common +library part on all those systems, but the data that should be returned vary from +system to system. For instance some systems support shared memory, but some others +may not. + + +The header files where we define these C structures (which are system-independent) are +shared between client and server. This way we can call the system dependent code +directly where we do not need any special privileges to do so. + + +All of those structures contain a @code{flags} member which is interpreted as a bit +mask and tells the caller of the library functions which of the fields in the returned +structure are valid and which are not. + + + + Server Implementation: The LibGTop "server" + +The LibGTop @dfn{server} is a setgid/setuid binary which contains all the system +dependent code which needs special privileges. It is only build if it's required +on the current system (for instance, the Linux kernel provides all the required +data via its @file{/proc} filesystem so we do not need the server at all) and it +only contains the @dfn{features} which need privileges. + + +Whenever we do not need any privileges to get all the data for some of the requested +structures (here called @dfn{features}) the library calls the sysdeps code directly +rather than using the server. + + + + + + + Libgtop Library Reference + + This section contains the API reference for libgtop. All + the public interfaces are documented here. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/doc/reference/libgtop-overrides.txt b/doc/reference/libgtop-overrides.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/doc/reference/libgtop-overrides.txt diff --git a/doc/reference/libgtop-sections.txt b/doc/reference/libgtop-sections.txt new file mode 100644 index 0000000..ba87894 --- /dev/null +++ b/doc/reference/libgtop-sections.txt @@ -0,0 +1,699 @@ +glibtop.h +
+glibtop +GlibTop +GLIBTOP_MOUNTENTRY_LEN +LIBGTOP_CHECK_VERSION +glibtop +glibtop_global_server +glibtop_init +glibtop_init_r +glibtop_init_s +glibtop_server_features +
+ +glibtop/close.h +
+close +Close +glibtop_close +glibtop_close_r +glibtop_close_s +glibtop_close_p +
+ +glibtop/command.h +
+command +Command +GLIBTOP_CMND_QUIT +GLIBTOP_CMND_SYSDEPS +GLIBTOP_CMND_CPU +GLIBTOP_CMND_MEM +GLIBTOP_CMND_SWAP +GLIBTOP_CMND_UPTIME +GLIBTOP_CMND_LOADAVG +GLIBTOP_CMND_SHM_LIMITS +GLIBTOP_CMND_MSG_LIMITS +GLIBTOP_CMND_SEM_LIMITS +GLIBTOP_CMND_PROCLIST +GLIBTOP_CMND_PROC_STATE +GLIBTOP_CMND_PROC_UID +GLIBTOP_CMND_PROC_MEM +GLIBTOP_CMND_PROC_TIME +GLIBTOP_CMND_PROC_SIGNAL +GLIBTOP_CMND_PROC_KERNEL +GLIBTOP_CMND_PROC_SEGMENT +GLIBTOP_CMND_PROC_ARGS +GLIBTOP_CMND_PROC_MAP +GLIBTOP_CMND_MOUNTLIST +GLIBTOP_CMND_FSUSAGE +GLIBTOP_CMND_NETLOAD +GLIBTOP_CMND_PPP +GLIBTOP_CMND_NETLIST +GLIBTOP_CMND_PROC_OPEN_FILES +GLIBTOP_MAX_CMND +glibtop_command +glibtop_response +glibtop_response_union +glibtop_call +glibtop_call_l +glibtop_call_s +
+ +glibtop/glibtop-server.h +
+glibtop-server +GlibTop Server +glibtop_server +glibtop_server_info +glibtop_closure +glibtop_server_new +glibtop_server_ref +glibtop_server_unref +
+ +glibtop/netload.h +
+netload +Net Load +GLIBTOP_NETLOAD_IF_FLAGS +GLIBTOP_NETLOAD_MTU +GLIBTOP_NETLOAD_SUBNET +GLIBTOP_NETLOAD_ADDRESS +GLIBTOP_NETLOAD_PACKETS_IN +GLIBTOP_NETLOAD_PACKETS_OUT +GLIBTOP_NETLOAD_PACKETS_TOTAL +GLIBTOP_NETLOAD_BYTES_IN +GLIBTOP_NETLOAD_BYTES_OUT +GLIBTOP_NETLOAD_BYTES_TOTAL +GLIBTOP_NETLOAD_ERRORS_IN +GLIBTOP_NETLOAD_ERRORS_OUT +GLIBTOP_NETLOAD_ERRORS_TOTAL +GLIBTOP_NETLOAD_COLLISIONS +GLIBTOP_NETLOAD_ADDRESS6 +GLIBTOP_NETLOAD_PREFIX6 +GLIBTOP_NETLOAD_SCOPE6 +GLIBTOP_NETLOAD_HWADDRESS +GLIBTOP_MAX_NETLOAD +glibtop_netload +glibtop_get_netload +glibtop_get_netload_r +glibtop_get_netload_l +glibtop_init_netload_p +glibtop_get_netload_p +glibtop_init_netload_s +glibtop_get_netload_s +
+ +glibtop/ppp.h +
+ppp +PPP +GLIBTOP_PPP_STATE +GLIBTOP_PPP_BYTES_IN +GLIBTOP_PPP_BYTES_OUT +GLIBTOP_MAX_PPP +glibtop_ppp +glibtop_get_ppp +glibtop_get_ppp_r +glibtop_get_ppp_l +glibtop_init_ppp_p +glibtop_get_ppp_p +glibtop_init_ppp_s +glibtop_get_ppp_s +
+ +glibtop/shm_limits.h +
+shm_limits +Shared Memory Limits +GLIBTOP_IPC_SHMMAX +GLIBTOP_IPC_SHMMIN +GLIBTOP_IPC_SHMMNI +GLIBTOP_IPC_SHMSEG +GLIBTOP_IPC_SHMALL +GLIBTOP_MAX_SHM_LIMITS +glibtop_shm_limits +glibtop_get_shm_limits +glibtop_get_shm_limits_r +glibtop_get_shm_limits_l +glibtop_init_shm_limits_p +glibtop_get_shm_limits_p +glibtop_init_shm_limits_s +glibtop_get_shm_limits_s +
+ +glibtop/uptime.h +
+uptime +Uptime +GLIBTOP_UPTIME_UPTIME +GLIBTOP_UPTIME_IDLETIME +GLIBTOP_UPTIME_BOOT_TIME +GLIBTOP_MAX_UPTIME +glibtop_uptime +glibtop_get_uptime +glibtop_get_uptime_r +glibtop_get_uptime_l +glibtop_init_uptime_p +glibtop_get_uptime_p +glibtop_init_uptime_s +glibtop_get_uptime_s +
+ +glibtop/netlist.h +
+netlist +Net List +GLIBTOP_NETLIST_NUMBER +GLIBTOP_MAX_NETLIST +glibtop_netlist +glibtop_get_netlist +glibtop_get_netlist_r +glibtop_get_netlist_l +glibtop_init_netlist_p +glibtop_get_netlist_p +glibtop_init_netlist_s +glibtop_get_netlist_s +
+ +glibtop/open.h +
+open +GLIBTOP_INIT_NO_OPEN +GLIBTOP_INIT_NO_INIT +GLIBTOP_FEATURES_NO_SERVER +GLIBTOP_FEATURES_EXCEPT +GLIBTOP_METHOD_DIRECT +GLIBTOP_METHOD_PIPE +GLIBTOP_METHOD_INET +GLIBTOP_METHOD_UNIX +GLIBTOP_ERROR_METHOD_IGNORE +GLIBTOP_ERROR_METHOD_WARN_ONCE +GLIBTOP_ERROR_METHOD_WARN +GLIBTOP_ERROR_METHOD_ABORT +GLIBTOP_ERROR_METHOD_DEFAULT +glibtop_open_l +glibtop_init_p +glibtop_open_p +glibtop_open_s +
+ +glibtop/parameter.h +
+parameter +GLIBTOP_PARAM_METHOD +GLIBTOP_PARAM_FEATURES +GLIBTOP_PARAM_COMMAND +GLIBTOP_PARAM_HOST +GLIBTOP_PARAM_PORT +GLIBTOP_PARAM_ERROR_METHOD +GLIBTOP_PARAM_REQUIRED +glibtop_get_parameter +glibtop_set_parameter +glibtop_get_parameter_l +glibtop_set_parameter_l +
+ +glibtop/procargs.h +
+procargs +glibtop_proc_args +glibtop_get_proc_args +glibtop_get_proc_argv +
+ +glibtop/procmem.h +
+procmem +GLIBTOP_PROC_MEM_SIZE +GLIBTOP_PROC_MEM_VSIZE +GLIBTOP_PROC_MEM_RESIDENT +GLIBTOP_PROC_MEM_SHARE +GLIBTOP_PROC_MEM_RSS +GLIBTOP_PROC_MEM_RSS_RLIM +GLIBTOP_MAX_PROC_MEM +glibtop_proc_mem +glibtop_get_proc_mem +glibtop_get_proc_mem_r +glibtop_get_proc_mem_l +glibtop_init_proc_mem_p +glibtop_get_proc_mem_p +glibtop_init_proc_mem_s +glibtop_get_proc_mem_s +
+ +glibtop/procopenfiles.h +
+procopenfiles +GLIBTOP_PROC_OPEN_FILES_NUMBER +GLIBTOP_PROC_OPEN_FILES_TOTAL +GLIBTOP_PROC_OPEN_FILES_SIZE +GLIBTOP_MAX_PROC_OPEN_FILES +GLIBTOP_FILE_ENTRY_FD +GLIBTOP_FILE_ENTRY_NAME +GLIBTOP_FILE_ENTRY_TYPE +GLIBTOP_FILE_ENTRY_INETSOCKET_DST_HOST +GLIBTOP_FILE_ENTRY_INETSOCKET_DST_PORT +GLIBTOP_MAX_OPEN_FILE_ENTRY +GLIBTOP_OPEN_FILENAME_LEN +GLIBTOP_OPEN_DEST_HOST_LEN +glibtop_open_files_entry +glibtop_proc_open_files +glibtop_get_proc_open_files +glibtop_get_proc_open_files_r +glibtop_get_proc_open_files_l +glibtop_init_proc_open_files_p +glibtop_get_proc_open_files_p +glibtop_init_proc_open_files_s +glibtop_get_proc_open_files_s +
+ +glibtop/procsegment.h +
+procsegment +GLIBTOP_PROC_SEGMENT_TEXT_RSS +GLIBTOP_PROC_SEGMENT_SHLIB_RSS +GLIBTOP_PROC_SEGMENT_DATA_RSS +GLIBTOP_PROC_SEGMENT_STACK_RSS +GLIBTOP_PROC_SEGMENT_DIRTY_SIZE +GLIBTOP_PROC_SEGMENT_START_CODE +GLIBTOP_PROC_SEGMENT_END_CODE +GLIBTOP_PROC_SEGMENT_START_STACK +GLIBTOP_MAX_PROC_SEGMENT +glibtop_proc_segment +glibtop_get_proc_segment +glibtop_get_proc_segment_r +glibtop_get_proc_segment_l +glibtop_init_proc_segment_p +glibtop_get_proc_segment_p +glibtop_init_proc_segment_s +glibtop_get_proc_segment_s +
+ +glibtop/procsignal.h +
+procsignal +GLIBTOP_PROC_SIGNAL_SIGNAL +GLIBTOP_PROC_SIGNAL_BLOCKED +GLIBTOP_PROC_SIGNAL_SIGIGNORE +GLIBTOP_PROC_SIGNAL_SIGCATCH +GLIBTOP_MAX_PROC_SIGNAL +glibtop_proc_signal +glibtop_get_proc_signal +glibtop_get_proc_signal_r +glibtop_get_proc_signal_l +glibtop_init_proc_signal_p +glibtop_get_proc_signal_p +glibtop_init_proc_signal_s +glibtop_get_proc_signal_s +
+ +glibtop/sysdeps.h +
+sysdeps +GLIBTOP_SYSDEPS_FEATURES +GLIBTOP_SYSDEPS_CPU +GLIBTOP_SYSDEPS_MEM +GLIBTOP_SYSDEPS_SWAP +GLIBTOP_SYSDEPS_UPTIME +GLIBTOP_SYSDEPS_LOADAVG +GLIBTOP_SYSDEPS_SHM_LIMITS +GLIBTOP_SYSDEPS_MSG_LIMITS +GLIBTOP_SYSDEPS_SEM_LIMITS +GLIBTOP_SYSDEPS_PROCLIST +GLIBTOP_SYSDEPS_PROC_STATE +GLIBTOP_SYSDEPS_PROC_UID +GLIBTOP_SYSDEPS_PROC_MEM +GLIBTOP_SYSDEPS_PROC_TIME +GLIBTOP_SYSDEPS_PROC_SIGNAL +GLIBTOP_SYSDEPS_PROC_KERNEL +GLIBTOP_SYSDEPS_PROC_SEGMENT +GLIBTOP_SYSDEPS_PROC_ARGS +GLIBTOP_SYSDEPS_PROC_MAP +GLIBTOP_SYSDEPS_MOUNTLIST +GLIBTOP_SYSDEPS_FSUSAGE +GLIBTOP_SYSDEPS_NETLOAD +GLIBTOP_SYSDEPS_PPP +GLIBTOP_SYSDEPS_NETLIST +GLIBTOP_SYSDEPS_PROC_OPEN_FILES +GLIBTOP_MAX_SYSDEPS +GLIBTOP_SYSDEPS_ALL +glibtop_sysdeps +glibtop_get_sysdeps +glibtop_get_sysdeps_r +
+ +glibtop/procstate.h +
+procstate +GLIBTOP_PROC_STATE_CMD +GLIBTOP_PROC_STATE_STATE +GLIBTOP_PROC_STATE_UID +GLIBTOP_PROC_STATE_GID +GLIBTOP_PROC_STATE_RUID +GLIBTOP_PROC_STATE_RGID +GLIBTOP_PROC_STATE_HAS_CPU +GLIBTOP_PROC_STATE_PROCESSOR +GLIBTOP_PROC_STATE_LAST_PROCESSOR +GLIBTOP_MAX_PROC_STATE +GLIBTOP_PROCESS_RUNNING +GLIBTOP_PROCESS_INTERRUPTIBLE +GLIBTOP_PROCESS_UNINTERRUPTIBLE +GLIBTOP_PROCESS_ZOMBIE +GLIBTOP_PROCESS_STOPPED +GLIBTOP_PROCESS_SWAPPING +GLIBTOP_PROCESS_DEAD +glibtop_proc_state +glibtop_get_proc_state +glibtop_get_proc_state_r +glibtop_get_proc_state_l +glibtop_init_proc_state_p +glibtop_get_proc_state_p +glibtop_init_proc_state_s +glibtop_get_proc_state_s +
+ +glibtop/procuid.h +
+procuid +GLIBTOP_PROC_UID_UID +GLIBTOP_PROC_UID_EUID +GLIBTOP_PROC_UID_GID +GLIBTOP_PROC_UID_EGID +GLIBTOP_PROC_UID_SUID +GLIBTOP_PROC_UID_SGID +GLIBTOP_PROC_UID_FSUID +GLIBTOP_PROC_UID_FSGID +GLIBTOP_PROC_UID_PID +GLIBTOP_PROC_UID_PPID +GLIBTOP_PROC_UID_PGRP +GLIBTOP_PROC_UID_SESSION +GLIBTOP_PROC_UID_TTY +GLIBTOP_PROC_UID_TPGID +GLIBTOP_PROC_UID_PRIORITY +GLIBTOP_PROC_UID_NICE +GLIBTOP_PROC_UID_NGROUPS +GLIBTOP_PROC_UID_GROUPS +GLIBTOP_MAX_PROC_UID +glibtop_proc_uid +GLIBTOP_MAX_GROUPS +glibtop_get_proc_uid +glibtop_get_proc_uid_r +glibtop_get_proc_uid_l +glibtop_init_proc_uid_p +glibtop_get_proc_uid_p +glibtop_init_proc_uid_s +glibtop_get_proc_uid_s +
+ +glibtop/proctime.h +
+proctime +glibtop_proc_time +glibtop_get_proc_time +
+ +glibtop/signal.h +
+signal +glibtop_signame +
+ +glibtop/procmap.h +
+procmap +GLIBTOP_PROC_MAP_NUMBER +GLIBTOP_PROC_MAP_TOTAL +GLIBTOP_PROC_MAP_SIZE +GLIBTOP_MAX_PROC_MAP +GLIBTOP_MAP_ENTRY_START +GLIBTOP_MAP_ENTRY_END +GLIBTOP_MAP_ENTRY_OFFSET +GLIBTOP_MAP_ENTRY_PERM +GLIBTOP_MAP_ENTRY_INODE +GLIBTOP_MAP_ENTRY_DEVICE +GLIBTOP_MAP_ENTRY_FILENAME +GLIBTOP_MAP_ENTRY_SIZE +GLIBTOP_MAP_ENTRY_RSS +GLIBTOP_MAP_ENTRY_SHARED_CLEAN +GLIBTOP_MAP_ENTRY_SHARED_DIRTY +GLIBTOP_MAP_ENTRY_PRIVATE_CLEAN +GLIBTOP_MAP_ENTRY_PRIVATE_DIRTY +GLIBTOP_MAX_MAP_ENTRY +GLIBTOP_MAP_FILENAME_LEN +GLIBTOP_MAP_PERM_READ +GLIBTOP_MAP_PERM_WRITE +GLIBTOP_MAP_PERM_EXECUTE +GLIBTOP_MAP_PERM_SHARED +GLIBTOP_MAP_PERM_PRIVATE +glibtop_map_entry +glibtop_proc_map +glibtop_get_proc_map +glibtop_get_proc_map_r +glibtop_get_proc_map_l +glibtop_init_proc_map_p +glibtop_get_proc_map_p +glibtop_init_proc_map_s +glibtop_get_proc_map_s +
+ +glibtop/sysinfo.h +
+sysinfo +GLIBTOP_SYSINFO_NCPU +GLIBTOP_SYSINFO_CPUINFO +GLIBTOP_MAX_SYSINFO +glibtop_sysinfo +glibtop_entry +glibtop_get_sysinfo_r +glibtop_get_sysinfo_s +glibtop_get_sysinfo +
+ +glibtop/union.h +
+union +glibtop_union +
+ +glibtop/version.h +
+version +LIBGTOP_VERSION_STRING +glibtop_send_version +
+ +glibtop/proclist.h +
+proclist +GLIBTOP_KERN_PROC_ALL +GLIBTOP_KERN_PROC_PID +GLIBTOP_KERN_PROC_PGRP +GLIBTOP_KERN_PROC_SESSION +GLIBTOP_KERN_PROC_TTY +GLIBTOP_KERN_PROC_UID +GLIBTOP_KERN_PROC_RUID +GLIBTOP_KERN_PROC_MASK +GLIBTOP_EXCLUDE_IDLE +GLIBTOP_EXCLUDE_SYSTEM +GLIBTOP_EXCLUDE_NOTTY +glibtop_proclist +glibtop_get_proclist +
+ +glibtop/sem_limits.h +
+sem_limits +GLIBTOP_IPC_SEMMAP +GLIBTOP_IPC_SEMMNI +GLIBTOP_IPC_SEMMNS +GLIBTOP_IPC_SEMMNU +GLIBTOP_IPC_SEMMSL +GLIBTOP_IPC_SEMOPM +GLIBTOP_IPC_SEMUME +GLIBTOP_IPC_SEMUSZ +GLIBTOP_IPC_SEMVMX +GLIBTOP_IPC_SEMAEM +GLIBTOP_MAX_SEM_LIMITS +glibtop_sem_limits +glibtop_get_sem_limits +glibtop_get_sem_limits_r +glibtop_get_sem_limits_l +glibtop_init_sem_limits_p +glibtop_get_sem_limits_p +glibtop_init_sem_limits_s +glibtop_get_sem_limits_s +
+ +glibtop/prockernel.h +
+prockernel +GLIBTOP_PROC_KERNEL_K_FLAGS +GLIBTOP_PROC_KERNEL_MIN_FLT +GLIBTOP_PROC_KERNEL_MAJ_FLT +GLIBTOP_PROC_KERNEL_CMIN_FLT +GLIBTOP_PROC_KERNEL_CMAJ_FLT +GLIBTOP_PROC_KERNEL_KSTK_ESP +GLIBTOP_PROC_KERNEL_KSTK_EIP +GLIBTOP_PROC_KERNEL_NWCHAN +GLIBTOP_PROC_KERNEL_WCHAN +GLIBTOP_MAX_PROC_KERNEL +glibtop_proc_kernel +glibtop_get_proc_kernel +glibtop_get_proc_kernel_r +glibtop_get_proc_kernel_l +glibtop_init_proc_kernel_p +glibtop_get_proc_kernel_p +glibtop_init_proc_kernel_s +glibtop_get_proc_kernel_s +
+ +glibtop/fsusage.h +
+fsusage +GLIBTOP_FSUSAGE_BLOCKS +GLIBTOP_FSUSAGE_BFREE +GLIBTOP_FSUSAGE_BAVAIL +GLIBTOP_FSUSAGE_FILES +GLIBTOP_FSUSAGE_FFREE +GLIBTOP_FSUSAGE_BLOCK_SIZE +GLIBTOP_FSUSAGE_READ +GLIBTOP_FSUSAGE_WRITE +GLIBTOP_MAX_FSUSAGE +glibtop_fsusage +glibtop_get_fsusage +glibtop_get_fsusage_r +glibtop_get_fsusage_l +glibtop_get_fsusage_s +
+ +glibtop/loadavg.h +
+loadavg +GLIBTOP_LOADAVG_LOADAVG +GLIBTOP_LOADAVG_NR_RUNNING +GLIBTOP_LOADAVG_NR_TASKS +GLIBTOP_LOADAVG_LAST_PID +GLIBTOP_MAX_LOADAVG +glibtop_loadavg +glibtop_get_loadavg +glibtop_get_loadavg_r +glibtop_get_loadavg_l +glibtop_init_loadavg_p +glibtop_get_loadavg_p +glibtop_init_loadavg_s +glibtop_get_loadavg_s +
+ +glibtop/mem.h +
+mem +GLIBTOP_MEM_TOTAL +GLIBTOP_MEM_USED +GLIBTOP_MEM_FREE +GLIBTOP_MEM_SHARED +GLIBTOP_MEM_BUFFER +GLIBTOP_MEM_CACHED +GLIBTOP_MEM_USER +GLIBTOP_MEM_LOCKED +GLIBTOP_MAX_MEM +glibtop_mem +glibtop_get_mem +glibtop_get_mem_r +glibtop_get_mem_l +glibtop_init_mem_p +glibtop_get_mem_p +glibtop_init_mem_s +glibtop_get_mem_s +
+ +glibtop/mountlist.h +
+mountlist +GLIBTOP_MOUNTLIST_NUMBER +GLIBTOP_MOUNTLIST_TOTAL +GLIBTOP_MOUNTLIST_SIZE +GLIBTOP_MAX_MOUNTLIST +glibtop_mountentry +glibtop_mountlist +glibtop_get_mountlist +glibtop_get_mountlist_r +glibtop_get_mountlist_l +glibtop_get_mountlist_s +
+ +glibtop/msg_limits.h +
+msg_limits +GLIBTOP_IPC_MSGPOOL +GLIBTOP_IPC_MSGMAP +GLIBTOP_IPC_MSGMAX +GLIBTOP_IPC_MSGMNB +GLIBTOP_IPC_MSGMNI +GLIBTOP_IPC_MSGSSZ +GLIBTOP_IPC_MSGTQL +GLIBTOP_MAX_MSG_LIMITS +glibtop_msg_limits +glibtop_get_msg_limits +glibtop_get_msg_limits_r +glibtop_get_msg_limits_l +glibtop_init_msg_limits_p +glibtop_get_msg_limits_p +glibtop_init_msg_limits_s +glibtop_get_msg_limits_s +
+ +glibtop/cpu.h +
+cpu +GLIBTOP_CPU_TOTAL +GLIBTOP_CPU_USER +GLIBTOP_CPU_NICE +GLIBTOP_CPU_SYS +GLIBTOP_CPU_IDLE +GLIBTOP_CPU_FREQUENCY +GLIBTOP_XCPU_TOTAL +GLIBTOP_XCPU_USER +GLIBTOP_XCPU_NICE +GLIBTOP_XCPU_SYS +GLIBTOP_XCPU_IDLE +GLIBTOP_XCPU_FLAGS +GLIBTOP_CPU_IOWAIT +GLIBTOP_CPU_IRQ +GLIBTOP_CPU_SOFTIRQ +GLIBTOP_XCPU_IOWAIT +GLIBTOP_XCPU_IRQ +GLIBTOP_XCPU_SOFTIRQ +GLIBTOP_MAX_CPU +GLIBTOP_NCPU +glibtop_cpu +glibtop_get_cpu +glibtop_get_cpu_r +glibtop_get_cpu_l +glibtop_init_cpu_p +glibtop_get_cpu_p +glibtop_init_cpu_s +glibtop_get_cpu_s +
+ +glibtop/swap.h +
+swap +GLIBTOP_SWAP_TOTAL +GLIBTOP_SWAP_USED +GLIBTOP_SWAP_FREE +GLIBTOP_SWAP_PAGEIN +GLIBTOP_SWAP_PAGEOUT +GLIBTOP_MAX_SWAP +glibtop_swap +glibtop_get_swap +glibtop_get_swap_r +glibtop_get_swap_l +glibtop_init_swap_p +glibtop_get_swap_p +glibtop_init_swap_s +glibtop_get_swap_s +
+ diff --git a/doc/reference/version.xml b/doc/reference/version.xml new file mode 100644 index 0000000..f7db79b --- /dev/null +++ b/doc/reference/version.xml @@ -0,0 +1,4 @@ + + +2.38.0 diff --git a/doc/reference/version.xml.in b/doc/reference/version.xml.in new file mode 100644 index 0000000..927ab96 --- /dev/null +++ b/doc/reference/version.xml.in @@ -0,0 +1,4 @@ + + +@PACKAGE_VERSION@ diff --git a/doc/stamp-vti b/doc/stamp-vti new file mode 100644 index 0000000..3820806 --- /dev/null +++ b/doc/stamp-vti @@ -0,0 +1,4 @@ +@set UPDATED 27 November 2016 +@set UPDATED-MONTH November 2016 +@set EDITION 2.38.0 +@set VERSION 2.38.0 diff --git a/doc/texinfo.tex b/doc/texinfo.tex new file mode 100644 index 0000000..85f184c --- /dev/null +++ b/doc/texinfo.tex @@ -0,0 +1,10079 @@ +% texinfo.tex -- TeX macros to handle Texinfo files. +% +% Load plain if necessary, i.e., if running under initex. +\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi +% +\def\texinfoversion{2013-02-01.11} +% +% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. +% +% This texinfo.tex 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 3 of the +% License, or (at your option) any later version. +% +% This texinfo.tex file 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, see . +% +% As a special exception, when this file is read by TeX when processing +% a Texinfo source document, you may use the result without +% restriction. This Exception is an additional permission under section 7 +% of the GNU General Public License, version 3 ("GPLv3"). +% +% Please try the latest version of texinfo.tex before submitting bug +% reports; you can get the latest version from: +% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or +% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or +% http://www.gnu.org/software/texinfo/ (the Texinfo home page) +% The texinfo.tex in any given distribution could well be out +% of date, so if that's what you're using, please check. +% +% Send bug reports to bug-texinfo@gnu.org. Please include including a +% complete document in each bug report with which we can reproduce the +% problem. Patches are, of course, greatly appreciated. +% +% To process a Texinfo manual with TeX, it's most reliable to use the +% texi2dvi shell script that comes with the distribution. For a simple +% manual foo.texi, however, you can get away with this: +% tex foo.texi +% texindex foo.?? +% tex foo.texi +% tex foo.texi +% dvips foo.dvi -o # or whatever; this makes foo.ps. +% The extra TeX runs get the cross-reference information correct. +% Sometimes one run after texindex suffices, and sometimes you need more +% than two; texi2dvi does it as many times as necessary. +% +% It is possible to adapt texinfo.tex for other languages, to some +% extent. You can get the existing language-specific files from the +% full Texinfo distribution. +% +% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. + + +\message{Loading texinfo [version \texinfoversion]:} + +% If in a .fmt file, print the version number +% and turn on active characters that we couldn't do earlier because +% they might have appeared in the input file name. +\everyjob{\message{[Texinfo version \texinfoversion]}% + \catcode`+=\active \catcode`\_=\active} + +\chardef\other=12 + +% We never want plain's \outer definition of \+ in Texinfo. +% For @tex, we can use \tabalign. +\let\+ = \relax + +% Save some plain tex macros whose names we will redefine. +\let\ptexb=\b +\let\ptexbullet=\bullet +\let\ptexc=\c +\let\ptexcomma=\, +\let\ptexdot=\. +\let\ptexdots=\dots +\let\ptexend=\end +\let\ptexequiv=\equiv +\let\ptexexclam=\! +\let\ptexfootnote=\footnote +\let\ptexgtr=> +\let\ptexhat=^ +\let\ptexi=\i +\let\ptexindent=\indent +\let\ptexinsert=\insert +\let\ptexlbrace=\{ +\let\ptexless=< +\let\ptexnewwrite\newwrite +\let\ptexnoindent=\noindent +\let\ptexplus=+ +\let\ptexraggedright=\raggedright +\let\ptexrbrace=\} +\let\ptexslash=\/ +\let\ptexstar=\* +\let\ptext=\t +\let\ptextop=\top +{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode + +% If this character appears in an error message or help string, it +% starts a new line in the output. +\newlinechar = `^^J + +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber = \empty % Pre-3.0. +\else + \def\linenumber{l.\the\inputlineno:\space} +\fi + +% Set up fixed words for English if not already set. +\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi +\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi +\ifx\putworderror\undefined \gdef\putworderror{error}\fi +\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi +\ifx\putwordin\undefined \gdef\putwordin{in}\fi +\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi +\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi +\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi +\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi +\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi +\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi +\ifx\putwordof\undefined \gdef\putwordof{of}\fi +\ifx\putwordon\undefined \gdef\putwordon{on}\fi +\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi +\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi +\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi +\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi +\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi +\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi +\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi +% +\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi +\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi +\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi +\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi +\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi +\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi +\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi +\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi +\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi +\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi +\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi +\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi +% +\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi +\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi +\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi +\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi +\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi + +% Since the category of space is not known, we have to be careful. +\chardef\spacecat = 10 +\def\spaceisspace{\catcode`\ =\spacecat} + +% sometimes characters are active, so we need control sequences. +\chardef\ampChar = `\& +\chardef\colonChar = `\: +\chardef\commaChar = `\, +\chardef\dashChar = `\- +\chardef\dotChar = `\. +\chardef\exclamChar= `\! +\chardef\hashChar = `\# +\chardef\lquoteChar= `\` +\chardef\questChar = `\? +\chardef\rquoteChar= `\' +\chardef\semiChar = `\; +\chardef\slashChar = `\/ +\chardef\underChar = `\_ + +% Ignore a token. +% +\def\gobble#1{} + +% The following is used inside several \edef's. +\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} + +% Hyphenation fixes. +\hyphenation{ + Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script + ap-pen-dix bit-map bit-maps + data-base data-bases eshell fall-ing half-way long-est man-u-script + man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm + par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces + spell-ing spell-ings + stand-alone strong-est time-stamp time-stamps which-ever white-space + wide-spread wrap-around +} + +% Margin to add to right of even pages, to left of odd pages. +\newdimen\bindingoffset +\newdimen\normaloffset +\newdimen\pagewidth \newdimen\pageheight + +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt } + +% Sometimes it is convenient to have everything in the transcript file +% and nothing on the terminal. We don't just call \tracingall here, +% since that produces some useless output on the terminal. We also make +% some effort to order the tracing commands to reduce output in the log +% file; cf. trace.sty in LaTeX. +% +\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% +\def\loggingall{% + \tracingstats2 + \tracingpages1 + \tracinglostchars2 % 2 gives us more in etex + \tracingparagraphs1 + \tracingoutput1 + \tracingmacros2 + \tracingrestores1 + \showboxbreadth\maxdimen \showboxdepth\maxdimen + \ifx\eTeXversion\thisisundefined\else % etex gives us more logging + \tracingscantokens1 + \tracingifs1 + \tracinggroups1 + \tracingnesting2 + \tracingassigns1 + \fi + \tracingcommands3 % 3 gives us more in etex + \errorcontextlines16 +}% + +% @errormsg{MSG}. Do the index-like expansions on MSG, but if things +% aren't perfect, it's not the end of the world, being an error message, +% after all. +% +\def\errormsg{\begingroup \indexnofonts \doerrormsg} +\def\doerrormsg#1{\errmessage{#1}} + +% add check for \lastpenalty to plain's definitions. If the last thing +% we did was a \nobreak, we don't want to insert more space. +% +\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount + \removelastskip\penalty-50\smallskip\fi\fi} +\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount + \removelastskip\penalty-100\medskip\fi\fi} +\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount + \removelastskip\penalty-200\bigskip\fi\fi} + +% Do @cropmarks to get crop marks. +% +\newif\ifcropmarks +\let\cropmarks = \cropmarkstrue +% +% Dimensions to add cropmarks at corners. +% Added by P. A. MacKay, 12 Nov. 1986 +% +\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines +\newdimen\cornerlong \cornerlong=1pc +\newdimen\cornerthick \cornerthick=.3pt +\newdimen\topandbottommargin \topandbottommargin=.75in + +% Output a mark which sets \thischapter, \thissection and \thiscolor. +% We dump everything together because we only have one kind of mark. +% This works because we only use \botmark / \topmark, not \firstmark. +% +% A mark contains a subexpression of the \ifcase ... \fi construct. +% \get*marks macros below extract the needed part using \ifcase. +% +% Another complication is to let the user choose whether \thischapter +% (\thissection) refers to the chapter (section) in effect at the top +% of a page, or that at the bottom of a page. The solution is +% described on page 260 of The TeXbook. It involves outputting two +% marks for the sectioning macros, one before the section break, and +% one after. I won't pretend I can describe this better than DEK... +\def\domark{% + \toks0=\expandafter{\lastchapterdefs}% + \toks2=\expandafter{\lastsectiondefs}% + \toks4=\expandafter{\prevchapterdefs}% + \toks6=\expandafter{\prevsectiondefs}% + \toks8=\expandafter{\lastcolordefs}% + \mark{% + \the\toks0 \the\toks2 + \noexpand\or \the\toks4 \the\toks6 + \noexpand\else \the\toks8 + }% +} +% \topmark doesn't work for the very first chapter (after the title +% page or the contents), so we use \firstmark there -- this gets us +% the mark with the chapter defs, unless the user sneaks in, e.g., +% @setcolor (or @url, or @link, etc.) between @contents and the very +% first @chapter. +\def\gettopheadingmarks{% + \ifcase0\topmark\fi + \ifx\thischapter\empty \ifcase0\firstmark\fi \fi +} +\def\getbottomheadingmarks{\ifcase1\botmark\fi} +\def\getcolormarks{\ifcase2\topmark\fi} + +% Avoid "undefined control sequence" errors. +\def\lastchapterdefs{} +\def\lastsectiondefs{} +\def\prevchapterdefs{} +\def\prevsectiondefs{} +\def\lastcolordefs{} + +% Main output routine. +\chardef\PAGE = 255 +\output = {\onepageout{\pagecontents\PAGE}} + +\newbox\headlinebox +\newbox\footlinebox + +% \onepageout takes a vbox as an argument. Note that \pagecontents +% does insertions, but you have to call it yourself. +\def\onepageout#1{% + \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi + % + \ifodd\pageno \advance\hoffset by \bindingoffset + \else \advance\hoffset by -\bindingoffset\fi + % + % Do this outside of the \shipout so @code etc. will be expanded in + % the headline as they should be, not taken literally (outputting ''code). + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi + \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% + \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi + \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% + % + {% + % Have to do this stuff outside the \shipout because we want it to + % take effect in \write's, yet the group defined by the \vbox ends + % before the \shipout runs. + % + \indexdummies % don't expand commands in the output. + \normalturnoffactive % \ in index entries must not stay \, e.g., if + % the page break happens to be in the middle of an example. + % We don't want .vr (or whatever) entries like this: + % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} + % "\acronym" won't work when it's read back in; + % it needs to be + % {\code {{\tt \backslashcurfont }acronym} + \shipout\vbox{% + % Do this early so pdf references go to the beginning of the page. + \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi + % + \ifcropmarks \vbox to \outervsize\bgroup + \hsize = \outerhsize + \vskip-\topandbottommargin + \vtop to0pt{% + \line{\ewtop\hfil\ewtop}% + \nointerlineskip + \line{% + \vbox{\moveleft\cornerthick\nstop}% + \hfill + \vbox{\moveright\cornerthick\nstop}% + }% + \vss}% + \vskip\topandbottommargin + \line\bgroup + \hfil % center the page within the outer (page) hsize. + \ifodd\pageno\hskip\bindingoffset\fi + \vbox\bgroup + \fi + % + \unvbox\headlinebox + \pagebody{#1}% + \ifdim\ht\footlinebox > 0pt + % Only leave this space if the footline is nonempty. + % (We lessened \vsize for it in \oddfootingyyy.) + % The \baselineskip=24pt in plain's \makefootline has no effect. + \vskip 24pt + \unvbox\footlinebox + \fi + % + \ifcropmarks + \egroup % end of \vbox\bgroup + \hfil\egroup % end of (centering) \line\bgroup + \vskip\topandbottommargin plus1fill minus1fill + \boxmaxdepth = \cornerthick + \vbox to0pt{\vss + \line{% + \vbox{\moveleft\cornerthick\nsbot}% + \hfill + \vbox{\moveright\cornerthick\nsbot}% + }% + \nointerlineskip + \line{\ewbot\hfil\ewbot}% + }% + \egroup % \vbox from first cropmarks clause + \fi + }% end of \shipout\vbox + }% end of group with \indexdummies + \advancepageno + \ifnum\outputpenalty>-20000 \else\dosupereject\fi +} + +\newinsert\margin \dimen\margin=\maxdimen + +\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} +{\catcode`\@ =11 +\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi +% marginal hacks, juha@viisa.uucp (Juha Takala) +\ifvoid\margin\else % marginal info is present + \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi +\dimen@=\dp#1\relax \unvbox#1\relax +\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi +\ifr@ggedbottom \kern-\dimen@ \vfil \fi} +} + +% Here are the rules for the cropmarks. Note that they are +% offset so that the space between them is truly \outerhsize or \outervsize +% (P. A. MacKay, 12 November, 1986) +% +\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} +\def\nstop{\vbox + {\hrule height\cornerthick depth\cornerlong width\cornerthick}} +\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} +\def\nsbot{\vbox + {\hrule height\cornerlong depth\cornerthick width\cornerthick}} + +% Parse an argument, then pass it to #1. The argument is the rest of +% the input line (except we remove a trailing comment). #1 should be a +% macro which expects an ordinary undelimited TeX argument. +% +\def\parsearg{\parseargusing{}} +\def\parseargusing#1#2{% + \def\argtorun{#2}% + \begingroup + \obeylines + \spaceisspace + #1% + \parseargline\empty% Insert the \empty token, see \finishparsearg below. +} + +{\obeylines % + \gdef\parseargline#1^^M{% + \endgroup % End of the group started in \parsearg. + \argremovecomment #1\comment\ArgTerm% + }% +} + +% First remove any @comment, then any @c comment. +\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} + +% Each occurrence of `\^^M' or `\^^M' is replaced by a single space. +% +% \argremovec might leave us with trailing space, e.g., +% @end itemize @c foo +% This space token undergoes the same procedure and is eventually removed +% by \finishparsearg. +% +\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} +\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} +\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% + \def\temp{#3}% + \ifx\temp\empty + % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: + \let\temp\finishparsearg + \else + \let\temp\argcheckspaces + \fi + % Put the space token in: + \temp#1 #3\ArgTerm +} + +% If a _delimited_ argument is enclosed in braces, they get stripped; so +% to get _exactly_ the rest of the line, we had to prevent such situation. +% We prepended an \empty token at the very beginning and we expand it now, +% just before passing the control to \argtorun. +% (Similarly, we have to think about #3 of \argcheckspacesY above: it is +% either the null string, or it ends with \^^M---thus there is no danger +% that a pair of braces would be stripped. +% +% But first, we have to remove the trailing space token. +% +\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} + +% \parseargdef\foo{...} +% is roughly equivalent to +% \def\foo{\parsearg\Xfoo} +% \def\Xfoo#1{...} +% +% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my +% favourite TeX trick. --kasal, 16nov03 + +\def\parseargdef#1{% + \expandafter \doparseargdef \csname\string#1\endcsname #1% +} +\def\doparseargdef#1#2{% + \def#2{\parsearg#1}% + \def#1##1% +} + +% Several utility definitions with active space: +{ + \obeyspaces + \gdef\obeyedspace{ } + + % Make each space character in the input produce a normal interword + % space in the output. Don't allow a line break at this space, as this + % is used only in environments like @example, where each line of input + % should produce a line of output anyway. + % + \gdef\sepspaces{\obeyspaces\let =\tie} + + % If an index command is used in an @example environment, any spaces + % therein should become regular spaces in the raw index file, not the + % expansion of \tie (\leavevmode \penalty \@M \ ). + \gdef\unsepspaces{\let =\space} +} + + +\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} + +% Define the framework for environments in texinfo.tex. It's used like this: +% +% \envdef\foo{...} +% \def\Efoo{...} +% +% It's the responsibility of \envdef to insert \begingroup before the +% actual body; @end closes the group after calling \Efoo. \envdef also +% defines \thisenv, so the current environment is known; @end checks +% whether the environment name matches. The \checkenv macro can also be +% used to check whether the current environment is the one expected. +% +% Non-false conditionals (@iftex, @ifset) don't fit into this, so they +% are not treated as environments; they don't open a group. (The +% implementation of @end takes care not to call \endgroup in this +% special case.) + + +% At run-time, environments start with this: +\def\startenvironment#1{\begingroup\def\thisenv{#1}} +% initialize +\let\thisenv\empty + +% ... but they get defined via ``\envdef\foo{...}'': +\long\def\envdef#1#2{\def#1{\startenvironment#1#2}} +\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} + +% Check whether we're in the right environment: +\def\checkenv#1{% + \def\temp{#1}% + \ifx\thisenv\temp + \else + \badenverr + \fi +} + +% Environment mismatch, #1 expected: +\def\badenverr{% + \errhelp = \EMsimple + \errmessage{This command can appear only \inenvironment\temp, + not \inenvironment\thisenv}% +} +\def\inenvironment#1{% + \ifx#1\empty + outside of any environment% + \else + in environment \expandafter\string#1% + \fi +} + +% @end foo executes the definition of \Efoo. +% But first, it executes a specialized version of \checkenv +% +\parseargdef\end{% + \if 1\csname iscond.#1\endcsname + \else + % The general wording of \badenverr may not be ideal. + \expandafter\checkenv\csname#1\endcsname + \csname E#1\endcsname + \endgroup + \fi +} + +\newhelp\EMsimple{Press RETURN to continue.} + + +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ = 11 + % Avoid using \@M directly, because that causes trouble + % if the definition is written into an index file. + \global\let\tiepenalty = \@M + \gdef\tie{\leavevmode\penalty\tiepenalty\ } +} + +% @: forces normal size whitespace following. +\def\:{\spacefactor=1000 } + +% @* forces a line break. +\def\*{\unskip\hfil\break\hbox{}\ignorespaces} + +% @/ allows a line break. +\let\/=\allowbreak + +% @. is an end-of-sentence period. +\def\.{.\spacefactor=\endofsentencespacefactor\space} + +% @! is an end-of-sentence bang. +\def\!{!\spacefactor=\endofsentencespacefactor\space} + +% @? is an end-of-sentence query. +\def\?{?\spacefactor=\endofsentencespacefactor\space} + +% @frenchspacing on|off says whether to put extra space after punctuation. +% +\def\onword{on} +\def\offword{off} +% +\parseargdef\frenchspacing{% + \def\temp{#1}% + \ifx\temp\onword \plainfrenchspacing + \else\ifx\temp\offword \plainnonfrenchspacing + \else + \errhelp = \EMsimple + \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% + \fi\fi +} + +% @w prevents a word break. Without the \leavevmode, @w at the +% beginning of a paragraph, when TeX is still in vertical mode, would +% produce a whole line of output instead of starting the paragraph. +\def\w#1{\leavevmode\hbox{#1}} + +% @group ... @end group forces ... to be all on one page, by enclosing +% it in a TeX vbox. We use \vtop instead of \vbox to construct the box +% to keep its height that of a normal line. According to the rules for +% \topskip (p.114 of the TeXbook), the glue inserted is +% max (\topskip - \ht (first item), 0). If that height is large, +% therefore, no glue is inserted, and the space between the headline and +% the text is small, which looks bad. +% +% Another complication is that the group might be very large. This can +% cause the glue on the previous page to be unduly stretched, because it +% does not have much material. In this case, it's better to add an +% explicit \vfill so that the extra space is at the bottom. The +% threshold for doing this is if the group is more than \vfilllimit +% percent of a page (\vfilllimit can be changed inside of @tex). +% +\newbox\groupbox +\def\vfilllimit{0.7} +% +\envdef\group{% + \ifnum\catcode`\^^M=\active \else + \errhelp = \groupinvalidhelp + \errmessage{@group invalid in context where filling is enabled}% + \fi + \startsavinginserts + % + \setbox\groupbox = \vtop\bgroup + % Do @comment since we are called inside an environment such as + % @example, where each end-of-line in the input causes an + % end-of-line in the output. We don't want the end-of-line after + % the `@group' to put extra space in the output. Since @group + % should appear on a line by itself (according to the Texinfo + % manual), we don't worry about eating any user text. + \comment +} +% +% The \vtop produces a box with normal height and large depth; thus, TeX puts +% \baselineskip glue before it, and (when the next line of text is done) +% \lineskip glue after it. Thus, space below is not quite equal to space +% above. But it's pretty close. +\def\Egroup{% + % To get correct interline space between the last line of the group + % and the first line afterwards, we have to propagate \prevdepth. + \endgraf % Not \par, as it may have been set to \lisppar. + \global\dimen1 = \prevdepth + \egroup % End the \vtop. + % \dimen0 is the vertical size of the group's box. + \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox + % \dimen2 is how much space is left on the page (more or less). + \dimen2 = \pageheight \advance\dimen2 by -\pagetotal + % if the group doesn't fit on the current page, and it's a big big + % group, force a page break. + \ifdim \dimen0 > \dimen2 + \ifdim \pagetotal < \vfilllimit\pageheight + \page + \fi + \fi + \box\groupbox + \prevdepth = \dimen1 + \checkinserts +} +% +% TeX puts in an \escapechar (i.e., `@') at the beginning of the help +% message, so this ends up printing `@group can only ...'. +% +\newhelp\groupinvalidhelp{% +group can only be used in environments such as @example,^^J% +where each line of input produces a line of output.} + +% @need space-in-mils +% forces a page break if there is not space-in-mils remaining. + +\newdimen\mil \mil=0.001in + +\parseargdef\need{% + % Ensure vertical mode, so we don't make a big box in the middle of a + % paragraph. + \par + % + % If the @need value is less than one line space, it's useless. + \dimen0 = #1\mil + \dimen2 = \ht\strutbox + \advance\dimen2 by \dp\strutbox + \ifdim\dimen0 > \dimen2 + % + % Do a \strut just to make the height of this box be normal, so the + % normal leading is inserted relative to the preceding line. + % And a page break here is fine. + \vtop to #1\mil{\strut\vfil}% + % + % TeX does not even consider page breaks if a penalty added to the + % main vertical list is 10000 or more. But in order to see if the + % empty box we just added fits on the page, we must make it consider + % page breaks. On the other hand, we don't want to actually break the + % page after the empty box. So we use a penalty of 9999. + % + % There is an extremely small chance that TeX will actually break the + % page at this \penalty, if there are no other feasible breakpoints in + % sight. (If the user is using lots of big @group commands, which + % almost-but-not-quite fill up a page, TeX will have a hard time doing + % good page breaking, for example.) However, I could not construct an + % example where a page broke at this \penalty; if it happens in a real + % document, then we can reconsider our strategy. + \penalty9999 + % + % Back up by the size of the box, whether we did a page break or not. + \kern -#1\mil + % + % Do not allow a page break right after this kern. + \nobreak + \fi +} + +% @br forces paragraph break (and is undocumented). + +\let\br = \par + +% @page forces the start of a new page. +% +\def\page{\par\vfill\supereject} + +% @exdent text.... +% outputs text on separate line in roman font, starting at standard page margin + +% This records the amount of indent in the innermost environment. +% That's how much \exdent should take out. +\newskip\exdentamount + +% This defn is used inside fill environments such as @defun. +\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} + +% This defn is used inside nofill environments such as @example. +\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount + \leftline{\hskip\leftskip{\rm#1}}}} + +% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current +% paragraph. For more general purposes, use the \margin insertion +% class. WHICH is `l' or `r'. Not documented, written for gawk manual. +% +\newskip\inmarginspacing \inmarginspacing=1cm +\def\strutdepth{\dp\strutbox} +% +\def\doinmargin#1#2{\strut\vadjust{% + \nobreak + \kern-\strutdepth + \vtop to \strutdepth{% + \baselineskip=\strutdepth + \vss + % if you have multiple lines of stuff to put here, you'll need to + % make the vbox yourself of the appropriate size. + \ifx#1l% + \llap{\ignorespaces #2\hskip\inmarginspacing}% + \else + \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% + \fi + \null + }% +}} +\def\inleftmargin{\doinmargin l} +\def\inrightmargin{\doinmargin r} +% +% @inmargin{TEXT [, RIGHT-TEXT]} +% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; +% else use TEXT for both). +% +\def\inmargin#1{\parseinmargin #1,,\finish} +\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \def\lefttext{#1}% have both texts + \def\righttext{#2}% + \else + \def\lefttext{#1}% have only one text + \def\righttext{#1}% + \fi + % + \ifodd\pageno + \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin + \else + \def\temp{\inleftmargin\lefttext}% + \fi + \temp +} + +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). This command +% is not documented, not supported, and doesn't work. +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the output. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + +% @include FILE -- \input text of FILE. +% +\def\include{\parseargusing\filenamecatcodes\includezzz} +\def\includezzz#1{% + \pushthisfilestack + \def\thisfile{#1}% + {% + \makevalueexpandable % we want to expand any @value in FILE. + \turnoffactive % and allow special characters in the expansion + \indexnofonts % Allow `@@' and other weird things in file names. + \wlog{texinfo.tex: doing @include of #1^^J}% + \edef\temp{\noexpand\input #1 }% + % + % This trickery is to read FILE outside of a group, in case it makes + % definitions, etc. + \expandafter + }\temp + \popthisfilestack +} +\def\filenamecatcodes{% + \catcode`\\=\other + \catcode`~=\other + \catcode`^=\other + \catcode`_=\other + \catcode`|=\other + \catcode`<=\other + \catcode`>=\other + \catcode`+=\other + \catcode`-=\other + \catcode`\`=\other + \catcode`\'=\other +} + +\def\pushthisfilestack{% + \expandafter\pushthisfilestackX\popthisfilestack\StackTerm +} +\def\pushthisfilestackX{% + \expandafter\pushthisfilestackY\thisfile\StackTerm +} +\def\pushthisfilestackY #1\StackTerm #2\StackTerm {% + \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% +} + +\def\popthisfilestack{\errthisfilestackempty} +\def\errthisfilestackempty{\errmessage{Internal error: + the stack of filenames is empty.}} +% +\def\thisfile{} + +% @center line +% outputs that line, centered. +% +\parseargdef\center{% + \ifhmode + \let\centersub\centerH + \else + \let\centersub\centerV + \fi + \centersub{\hfil \ignorespaces#1\unskip \hfil}% + \let\centersub\relax % don't let the definition persist, just in case +} +\def\centerH#1{{% + \hfil\break + \advance\hsize by -\leftskip + \advance\hsize by -\rightskip + \line{#1}% + \break +}} +% +\newcount\centerpenalty +\def\centerV#1{% + % The idea here is the same as in \startdefun, \cartouche, etc.: if + % @center is the first thing after a section heading, we need to wipe + % out the negative parskip inserted by \sectionheading, but still + % prevent a page break here. + \centerpenalty = \lastpenalty + \ifnum\centerpenalty>10000 \vskip\parskip \fi + \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi + \line{\kern\leftskip #1\kern\rightskip}% +} + +% @sp n outputs n lines of vertical space +% +\parseargdef\sp{\vskip #1\baselineskip} + +% @comment ...line which is ignored... +% @c is the same as @comment +% @ignore ... @end ignore is another way to write a comment +% +\def\comment{\begingroup \catcode`\^^M=\other% +\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% +\commentxxx} +{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} +% +\let\c=\comment + +% @paragraphindent NCHARS +% We'll use ems for NCHARS, close enough. +% NCHARS can also be the word `asis' or `none'. +% We cannot feasibly implement @paragraphindent asis, though. +% +\def\asisword{asis} % no translation, these are keywords +\def\noneword{none} +% +\parseargdef\paragraphindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \defaultparindent = 0pt + \else + \defaultparindent = #1em + \fi + \fi + \parindent = \defaultparindent +} + +% @exampleindent NCHARS +% We'll use ems for NCHARS like @paragraphindent. +% It seems @exampleindent asis isn't necessary, but +% I preserve it to make it similar to @paragraphindent. +\parseargdef\exampleindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \lispnarrowing = 0pt + \else + \lispnarrowing = #1em + \fi + \fi +} + +% @firstparagraphindent WORD +% If WORD is `none', then suppress indentation of the first paragraph +% after a section heading. If WORD is `insert', then do indent at such +% paragraphs. +% +% The paragraph indentation is suppressed or not by calling +% \suppressfirstparagraphindent, which the sectioning commands do. +% We switch the definition of this back and forth according to WORD. +% By default, we suppress indentation. +% +\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} +\def\insertword{insert} +% +\parseargdef\firstparagraphindent{% + \def\temp{#1}% + \ifx\temp\noneword + \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent + \else\ifx\temp\insertword + \let\suppressfirstparagraphindent = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @firstparagraphindent option `\temp'}% + \fi\fi +} + +% Here is how we actually suppress indentation. Redefine \everypar to +% \kern backwards by \parindent, and then reset itself to empty. +% +% We also make \indent itself not actually do anything until the next +% paragraph. +% +\gdef\dosuppressfirstparagraphindent{% + \gdef\indent{% + \restorefirstparagraphindent + \indent + }% + \gdef\noindent{% + \restorefirstparagraphindent + \noindent + }% + \global\everypar = {% + \kern -\parindent + \restorefirstparagraphindent + }% +} + +\gdef\restorefirstparagraphindent{% + \global \let \indent = \ptexindent + \global \let \noindent = \ptexnoindent + \global \everypar = {}% +} + + +% @refill is a no-op. +\let\refill=\relax + +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test runs. +% This is done with @novalidate (before @setfilename). +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + +% @setfilename is done at the beginning of every texinfo file. +% So open here the files we need to have open while reading the input. +% This makes it possible to make a .fmt file for texinfo. +\def\setfilename{% + \fixbackslash % Turn off hack to swallow `\input texinfo'. + \iflinks + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux + \fi % \openindices needs to do some work in any case. + \openindices + \let\setfilename=\comment % Ignore extra @setfilename cmds. + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. + \openin 1 texinfo.cnf + \ifeof 1 \else \input texinfo.cnf \fi + \closein 1 + % + \comment % Ignore the actual filename. +} + +% Called from \setfilename. +% +\def\openindices{% + \newindex{cp}% + \newcodeindex{fn}% + \newcodeindex{vr}% + \newcodeindex{tp}% + \newcodeindex{ky}% + \newcodeindex{pg}% +} + +% @bye. +\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} + + +\message{pdf,} +% adobe `portable' document format +\newcount\tempnum +\newcount\lnkcount +\newtoks\filename +\newcount\filenamelength +\newcount\pgn +\newtoks\toksA +\newtoks\toksB +\newtoks\toksC +\newtoks\toksD +\newbox\boxA +\newcount\countA +\newif\ifpdf +\newif\ifpdfmakepagedest + +% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 +% can be set). So we test for \relax and 0 as well as being undefined. +\ifx\pdfoutput\thisisundefined +\else + \ifx\pdfoutput\relax + \else + \ifcase\pdfoutput + \else + \pdftrue + \fi + \fi +\fi + +% PDF uses PostScript string constants for the names of xref targets, +% for display in the outlines, and in other places. Thus, we have to +% double any backslashes. Otherwise, a name like "\node" will be +% interpreted as a newline (\n), followed by o, d, e. Not good. +% +% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and +% related messages. The final outcome is that it is up to the TeX user +% to double the backslashes and otherwise make the string valid, so +% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to +% do this reliably, so we use it. + +% #1 is a control sequence in which to do the replacements, +% which we \xdef. +\def\txiescapepdf#1{% + \ifx\pdfescapestring\thisisundefined + % No primitive available; should we give a warning or log? + % Many times it won't matter. + \else + % The expandable \pdfescapestring primitive escapes parentheses, + % backslashes, and other special chars. + \xdef#1{\pdfescapestring{#1}}% + \fi +} + +\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images +with PDF output, and none of those formats could be found. (.eps cannot +be supported due to the design of the PDF format; use regular TeX (DVI +output) for that.)} + +\ifpdf + % + % Color manipulation macros based on pdfcolor.tex, + % except using rgb instead of cmyk; the latter is said to render as a + % very dark gray on-screen and a very dark halftone in print, instead + % of actual black. + \def\rgbDarkRed{0.50 0.09 0.12} + \def\rgbBlack{0 0 0} + % + % k sets the color for filling (usual text, etc.); + % K sets the color for stroking (thin rules, e.g., normal _'s). + \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} + % + % Set color, and create a mark which defines \thiscolor accordingly, + % so that \makeheadline knows which color to restore. + \def\setcolor#1{% + \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% + \domark + \pdfsetcolor{#1}% + } + % + \def\maincolor{\rgbBlack} + \pdfsetcolor{\maincolor} + \edef\thiscolor{\maincolor} + \def\lastcolordefs{} + % + \def\makefootline{% + \baselineskip24pt + \line{\pdfsetcolor{\maincolor}\the\footline}% + } + % + \def\makeheadline{% + \vbox to 0pt{% + \vskip-22.5pt + \line{% + \vbox to8.5pt{}% + % Extract \thiscolor definition from the marks. + \getcolormarks + % Typeset the headline with \maincolor, then restore the color. + \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% + }% + \vss + }% + \nointerlineskip + } + % + % + \pdfcatalog{/PageMode /UseOutlines} + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). + \def\dopdfimage#1#2#3{% + \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % pdftex (and the PDF format) support .pdf, .png, .jpg (among + % others). Let's try in that order, PDF first since if + % someone has a scalable image, presumably better to use that than a + % bitmap. + \let\pdfimgext=\empty + \begingroup + \openin 1 #1.pdf \ifeof 1 + \openin 1 #1.PDF \ifeof 1 + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \errhelp = \nopdfimagehelp + \errmessage{Could not find image file #1 for pdf}% + \else \gdef\pdfimgext{JPG}% + \fi + \else \gdef\pdfimgext{jpeg}% + \fi + \else \gdef\pdfimgext{jpg}% + \fi + \else \gdef\pdfimgext{png}% + \fi + \else \gdef\pdfimgext{PDF}% + \fi + \else \gdef\pdfimgext{pdf}% + \fi + \closein 1 + \endgroup + % + % without \immediate, ancient pdftex seg faults when the same image is + % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) + \ifnum\pdftexversion < 14 + \immediate\pdfimage + \else + \immediate\pdfximage + \fi + \ifdim \wd0 >0pt width \pdfimagewidth \fi + \ifdim \wd2 >0pt height \pdfimageheight \fi + \ifnum\pdftexversion<13 + #1.\pdfimgext + \else + {#1.\pdfimgext}% + \fi + \ifnum\pdftexversion < 14 \else + \pdfrefximage \pdflastximage + \fi} + % + \def\pdfmkdest#1{{% + % We have to set dummies so commands such as @code, and characters + % such as \, aren't expanded when present in a section title. + \indexnofonts + \turnoffactive + \makevalueexpandable + \def\pdfdestname{#1}% + \txiescapepdf\pdfdestname + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + }} + % + % used to mark target names; must be expandable. + \def\pdfmkpgn#1{#1} + % + % by default, use a color that is dark enough to print on paper as + % nearly black, but still distinguishable for online viewing. + \def\urlcolor{\rgbDarkRed} + \def\linkcolor{\rgbDarkRed} + \def\endlink{\setcolor{\maincolor}\pdfendlink} + % + % Adding outlines to PDF; macros for calculating structure of outlines + % come from Petr Olsak + \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% + \else \csname#1\endcsname \fi} + \def\advancenumber#1{\tempnum=\expnumber{#1}\relax + \advance\tempnum by 1 + \expandafter\xdef\csname#1\endcsname{\the\tempnum}} + % + % #1 is the section text, which is what will be displayed in the + % outline by the pdf viewer. #2 is the pdf expression for the number + % of subentries (or empty, for subsubsections). #3 is the node text, + % which might be empty if this toc entry had no corresponding node. + % #4 is the page number + % + \def\dopdfoutline#1#2#3#4{% + % Generate a link to the node text if that exists; else, use the + % page number. We could generate a destination for the section + % text in the case where a section has no node, but it doesn't + % seem worth the trouble, since most documents are normally structured. + \edef\pdfoutlinedest{#3}% + \ifx\pdfoutlinedest\empty + \def\pdfoutlinedest{#4}% + \else + \txiescapepdf\pdfoutlinedest + \fi + % + % Also escape PDF chars in the display string. + \edef\pdfoutlinetext{#1}% + \txiescapepdf\pdfoutlinetext + % + \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% + } + % + \def\pdfmakeoutlines{% + \begingroup + % Read toc silently, to get counts of subentries for \pdfoutline. + \def\partentry##1##2##3##4{}% ignore parts in the outlines + \def\numchapentry##1##2##3##4{% + \def\thischapnum{##2}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + }% + \def\numsecentry##1##2##3##4{% + \advancenumber{chap\thischapnum}% + \def\thissecnum{##2}% + \def\thissubsecnum{0}% + }% + \def\numsubsecentry##1##2##3##4{% + \advancenumber{sec\thissecnum}% + \def\thissubsecnum{##2}% + }% + \def\numsubsubsecentry##1##2##3##4{% + \advancenumber{subsec\thissubsecnum}% + }% + \def\thischapnum{0}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + % + % use \def rather than \let here because we redefine \chapentry et + % al. a second time, below. + \def\appentry{\numchapentry}% + \def\appsecentry{\numsecentry}% + \def\appsubsecentry{\numsubsecentry}% + \def\appsubsubsecentry{\numsubsubsecentry}% + \def\unnchapentry{\numchapentry}% + \def\unnsecentry{\numsecentry}% + \def\unnsubsecentry{\numsubsecentry}% + \def\unnsubsubsecentry{\numsubsubsecentry}% + \readdatafile{toc}% + % + % Read toc second time, this time actually producing the outlines. + % The `-' means take the \expnumber as the absolute number of + % subentries, which we calculated on our first read of the .toc above. + % + % We use the node names as the destinations. + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% count is always zero + \dopdfoutline{##1}{}{##3}{##4}}% + % + % PDF outlines are displayed using system fonts, instead of + % document fonts. Therefore we cannot use special characters, + % since the encoding is unknown. For example, the eogonek from + % Latin 2 (0xea) gets translated to a | character. Info from + % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. + % + % TODO this right, we have to translate 8-bit characters to + % their "best" equivalent, based on the @documentencoding. Too + % much work for too little return. Just use the ASCII equivalents + % we use for the index sort strings. + % + \indexnofonts + \setupdatafile + % We can have normal brace characters in the PDF outlines, unlike + % Texinfo index files. So set that up. + \def\{{\lbracecharliteral}% + \def\}{\rbracecharliteral}% + \catcode`\\=\active \otherbackslash + \input \tocreadfilename + \endgroup + } + {\catcode`[=1 \catcode`]=2 + \catcode`{=\other \catcode`}=\other + \gdef\lbracecharliteral[{]% + \gdef\rbracecharliteral[}]% + ] + % + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \nextsp} + \def\getfilename#1{% + \filenamelength=0 + % If we don't expand the argument now, \skipspaces will get + % snagged on things like "@value{foo}". + \edef\temp{#1}% + \expandafter\skipspaces\temp|\relax + } + \ifnum\pdftexversion < 14 + \let \startlink \pdfannotlink + \else + \let \startlink \pdfstartlink + \fi + % make a live url in pdf output. + \def\pdfurl#1{% + \begingroup + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=\empty + \makevalueexpandable + % do we want to go so far as to use \indexnofonts instead of just + % special-casing \var here? + \def\var##1{##1}% + % + \leavevmode\setcolor{\urlcolor}% + \startlink attr{/Border [0 0 0]}% + user{/Subtype /Link /A << /S /URI /URI (#1) >>}% + \endgroup} + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdflink#1{% + \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} + \setcolor{\linkcolor}#1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +\else + % non-pdf mode + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\setcolor = \gobble + \let\pdfsetcolor = \gobble + \let\pdfmakeoutlines = \relax +\fi % \ifx\pdfoutput + + +\message{fonts,} + +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname ten#1\endcsname % change the current font +} + +% Select #1 fonts with the current style. +% +\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} +\def\tt{\fam=\ttfam \setfontstyle{tt}} + +% Unfortunately, we have to override this for titles and the like, since +% in those cases "rm" is bold. Sigh. +\def\rmisbold{\rm\def\curfontstyle{bf}} + +% Texinfo sort of supports the sans serif font style, which plain TeX does not. +% So we set up a \sf. +\newfam\sffam +\def\sf{\fam=\sffam \setfontstyle{sf}} +\let\li = \sf % Sometimes we call it \li, not \sf. + +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} + + +% Set the baselineskip to #1, and the lineskip and strut size +% correspondingly. There is no deep meaning behind these magic numbers +% used as factors; they just match (closely enough) what Knuth defined. +% +\def\lineskipfactor{.08333} +\def\strutheightpercent{.70833} +\def\strutdepthpercent {.29167} +% +% can get a sort of poor man's double spacing by redefining this. +\def\baselinefactor{1} +% +\newdimen\textleading +\def\setleading#1{% + \dimen0 = #1\relax + \normalbaselineskip = \baselinefactor\dimen0 + \normallineskip = \lineskipfactor\normalbaselineskip + \normalbaselines + \setbox\strutbox =\hbox{% + \vrule width0pt height\strutheightpercent\baselineskip + depth \strutdepthpercent \baselineskip + }% +} + +% PDF CMaps. See also LaTeX's t1.cmap. +% +% do nothing with this by default. +\expandafter\let\csname cmapOT1\endcsname\gobble +\expandafter\let\csname cmapOT1IT\endcsname\gobble +\expandafter\let\csname cmapOT1TT\endcsname\gobble + +% if we are producing pdf, and we have \pdffontattr, then define cmaps. +% (\pdffontattr was introduced many years ago, but people still run +% older pdftex's; it's easy to conditionalize, so we do.) +\ifpdf \ifx\pdffontattr\thisisundefined \else + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1-0) +%%Title: (TeX-OT1-0 TeX OT1 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1) +/Supplement 0 +>> def +/CMapName /TeX-OT1-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<23> <26> <0023> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +40 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1IT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1IT-0) +%%Title: (TeX-OT1IT-0 TeX OT1IT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1IT) +/Supplement 0 +>> def +/CMapName /TeX-OT1IT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<25> <26> <0025> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +42 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<23> <0023> +<24> <00A3> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1IT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1TT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1TT-0) +%%Title: (TeX-OT1TT-0 TeX OT1TT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1TT) +/Supplement 0 +>> def +/CMapName /TeX-OT1TT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +5 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<21> <26> <0021> +<28> <5F> <0028> +<61> <7E> <0061> +endbfrange +32 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <2191> +<0C> <2193> +<0D> <0027> +<0E> <00A1> +<0F> <00BF> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<20> <2423> +<27> <2019> +<60> <2018> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1TT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +\fi\fi + + +% Set the font macro #1 to the font named \fontprefix#2. +% #3 is the font's design size, #4 is a scale factor, #5 is the CMap +% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit). +% Example: +% #1 = \textrm +% #2 = \rmshape +% #3 = 10 +% #4 = \mainmagstep +% #5 = OT1 +% +\def\setfont#1#2#3#4#5{% + \font#1=\fontprefix#2#3 scaled #4 + \csname cmap#5\endcsname#1% +} +% This is what gets called when #5 of \setfont is empty. +\let\cmap\gobble +% +% (end of cmaps) + +% Use cm as the default font prefix. +% To specify the font prefix, you must define \fontprefix +% before you read in texinfo.tex. +\ifx\fontprefix\thisisundefined +\def\fontprefix{cm} +\fi +% Support font families that don't use the same naming scheme as CM. +\def\rmshape{r} +\def\rmbshape{bx} % where the normal face is bold +\def\bfshape{b} +\def\bxshape{bx} +\def\ttshape{tt} +\def\ttbshape{tt} +\def\ttslshape{sltt} +\def\itshape{ti} +\def\itbshape{bxti} +\def\slshape{sl} +\def\slbshape{bxsl} +\def\sfshape{ss} +\def\sfbshape{ss} +\def\scshape{csc} +\def\scbshape{csc} + +% Definitions for a main text size of 11pt. (The default in Texinfo.) +% +\def\definetextfontsizexi{% +% Text fonts (11.2pt, magstep1). +\def\textnominalsize{11pt} +\edef\mainmagstep{\magstephalf} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1095} + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstep1}{OT1} +\setfont\deftt\ttshape{10}{\magstep1}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 +\def\smallecsize{0900} + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\titleecsize{2074} + +% Chapter (and unnumbered) fonts (17.28pt). +\def\chapnominalsize{17pt} +\setfont\chaprm\rmbshape{12}{\magstep2}{OT1} +\setfont\chapit\itbshape{10}{\magstep3}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep3}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} +\setfont\chapsf\sfbshape{17}{1000}{OT1} +\let\chapbf=\chaprm +\setfont\chapsc\scbshape{10}{\magstep3}{OT1} +\font\chapi=cmmi12 scaled \magstep2 +\font\chapsy=cmsy10 scaled \magstep3 +\def\chapecsize{1728} + +% Section fonts (14.4pt). +\def\secnominalsize{14pt} +\setfont\secrm\rmbshape{12}{\magstep1}{OT1} +\setfont\secit\itbshape{10}{\magstep2}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep2}{OT1} +\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\secsf\sfbshape{12}{\magstep1}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep2}{OT1} +\font\seci=cmmi12 scaled \magstep1 +\font\secsy=cmsy10 scaled \magstep2 +\def\sececsize{1440} + +% Subsection fonts (13.15pt). +\def\ssecnominalsize{13pt} +\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} +\setfont\ssecit\itbshape{10}{1315}{OT1IT} +\setfont\ssecsl\slbshape{10}{1315}{OT1} +\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} +\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1315}{OT1} +\font\sseci=cmmi12 scaled \magstephalf +\font\ssecsy=cmsy10 scaled 1315 +\def\ssececsize{1200} + +% Reduced fonts for @acro in text (10pt). +\def\reducednominalsize{10pt} +\setfont\reducedrm\rmshape{10}{1000}{OT1} +\setfont\reducedtt\ttshape{10}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{1000}{OT1} +\setfont\reducedit\itshape{10}{1000}{OT1IT} +\setfont\reducedsl\slshape{10}{1000}{OT1} +\setfont\reducedsf\sfshape{10}{1000}{OT1} +\setfont\reducedsc\scshape{10}{1000}{OT1} +\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} +\font\reducedi=cmmi10 +\font\reducedsy=cmsy10 +\def\reducedecsize{1000} + +\textleading = 13.2pt % line spacing for 11pt CM +\textfonts % reset the current fonts +\rm +} % end of 11pt text font size definitions, \definetextfontsizexi + + +% Definitions to make the main text be 10pt Computer Modern, with +% section, chapter, etc., sizes following suit. This is for the GNU +% Press printing of the Emacs 22 manual. Maybe other manuals in the +% future. Used with @smallbook, which sets the leading to 12pt. +% +\def\definetextfontsizex{% +% Text fonts (10pt). +\def\textnominalsize{10pt} +\edef\mainmagstep{1000} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1000} + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstephalf}{OT1} +\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 +\def\smallecsize{0900} + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\titleecsize{2074} + +% Chapter fonts (14.4pt). +\def\chapnominalsize{14pt} +\setfont\chaprm\rmbshape{12}{\magstep1}{OT1} +\setfont\chapit\itbshape{10}{\magstep2}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep2}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\chapsf\sfbshape{12}{\magstep1}{OT1} +\let\chapbf\chaprm +\setfont\chapsc\scbshape{10}{\magstep2}{OT1} +\font\chapi=cmmi12 scaled \magstep1 +\font\chapsy=cmsy10 scaled \magstep2 +\def\chapecsize{1440} + +% Section fonts (12pt). +\def\secnominalsize{12pt} +\setfont\secrm\rmbshape{12}{1000}{OT1} +\setfont\secit\itbshape{10}{\magstep1}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep1}{OT1} +\setfont\sectt\ttbshape{12}{1000}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} +\setfont\secsf\sfbshape{12}{1000}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep1}{OT1} +\font\seci=cmmi12 +\font\secsy=cmsy10 scaled \magstep1 +\def\sececsize{1200} + +% Subsection fonts (10pt). +\def\ssecnominalsize{10pt} +\setfont\ssecrm\rmbshape{10}{1000}{OT1} +\setfont\ssecit\itbshape{10}{1000}{OT1IT} +\setfont\ssecsl\slbshape{10}{1000}{OT1} +\setfont\ssectt\ttbshape{10}{1000}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} +\setfont\ssecsf\sfbshape{10}{1000}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1000}{OT1} +\font\sseci=cmmi10 +\font\ssecsy=cmsy10 +\def\ssececsize{1000} + +% Reduced fonts for @acro in text (9pt). +\def\reducednominalsize{9pt} +\setfont\reducedrm\rmshape{9}{1000}{OT1} +\setfont\reducedtt\ttshape{9}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{900}{OT1} +\setfont\reducedit\itshape{9}{1000}{OT1IT} +\setfont\reducedsl\slshape{9}{1000}{OT1} +\setfont\reducedsf\sfshape{9}{1000}{OT1} +\setfont\reducedsc\scshape{10}{900}{OT1} +\setfont\reducedttsl\ttslshape{10}{900}{OT1TT} +\font\reducedi=cmmi9 +\font\reducedsy=cmsy9 +\def\reducedecsize{0900} + +\divide\parskip by 2 % reduce space between paragraphs +\textleading = 12pt % line spacing for 10pt CM +\textfonts % reset the current fonts +\rm +} % end of 10pt text font size definitions, \definetextfontsizex + + +% We provide the user-level command +% @fonttextsize 10 +% (or 11) to redefine the text font size. pt is assumed. +% +\def\xiword{11} +\def\xword{10} +\def\xwordpt{10pt} +% +\parseargdef\fonttextsize{% + \def\textsizearg{#1}% + %\wlog{doing @fonttextsize \textsizearg}% + % + % Set \globaldefs so that documents can use this inside @tex, since + % makeinfo 4.8 does not support it, but we need it nonetheless. + % + \begingroup \globaldefs=1 + \ifx\textsizearg\xword \definetextfontsizex + \else \ifx\textsizearg\xiword \definetextfontsizexi + \else + \errhelp=\EMsimple + \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} + \fi\fi + \endgroup +} + + +% In order for the font changes to affect most math symbols and letters, +% we have to define the \textfont of the standard families. Since +% texinfo doesn't allow for producing subscripts and superscripts except +% in the main text, we don't bother to reset \scriptfont and +% \scriptscriptfont (which would also require loading a lot more fonts). +% +\def\resetmathfonts{% + \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy + \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf + \textfont\ttfam=\tentt \textfont\sffam=\tensf +} + +% The font-changing commands redefine the meanings of \tenSTYLE, instead +% of just \STYLE. We do this because \STYLE needs to also set the +% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire +% \tenSTYLE to set the current font. +% +% Each font-changing command also sets the names \lsize (one size lower) +% and \lllsize (three sizes lower). These relative commands are used in +% the LaTeX logo and acronyms. +% +% This all needs generalizing, badly. +% +\def\textfonts{% + \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl + \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy + \let\tenttsl=\textttsl + \def\curfontsize{text}% + \def\lsize{reduced}\def\lllsize{smaller}% + \resetmathfonts \setleading{\textleading}} +\def\titlefonts{% + \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl + \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc + \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy + \let\tenttsl=\titlettsl + \def\curfontsize{title}% + \def\lsize{chap}\def\lllsize{subsec}% + \resetmathfonts \setleading{27pt}} +\def\titlefont#1{{\titlefonts\rmisbold #1}} +\def\chapfonts{% + \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl + \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc + \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy + \let\tenttsl=\chapttsl + \def\curfontsize{chap}% + \def\lsize{sec}\def\lllsize{text}% + \resetmathfonts \setleading{19pt}} +\def\secfonts{% + \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl + \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy + \let\tenttsl=\secttsl + \def\curfontsize{sec}% + \def\lsize{subsec}\def\lllsize{reduced}% + \resetmathfonts \setleading{16pt}} +\def\subsecfonts{% + \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl + \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy + \let\tenttsl=\ssecttsl + \def\curfontsize{ssec}% + \def\lsize{text}\def\lllsize{small}% + \resetmathfonts \setleading{15pt}} +\let\subsubsecfonts = \subsecfonts +\def\reducedfonts{% + \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl + \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc + \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy + \let\tenttsl=\reducedttsl + \def\curfontsize{reduced}% + \def\lsize{small}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallfonts{% + \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl + \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc + \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy + \let\tenttsl=\smallttsl + \def\curfontsize{small}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallerfonts{% + \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl + \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc + \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy + \let\tenttsl=\smallerttsl + \def\curfontsize{smaller}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{9.5pt}} + +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000}{OT1} +\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 +\setfont\shortcontsl\slshape{12}{1000}{OT1} +\setfont\shortconttt\ttshape{12}{1000}{OT1TT} + +% Define these just so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + +% Set the fonts to use with the @small... environments. +\let\smallexamplefonts = \smallfonts + +% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample +% can fit this many characters: +% 8.5x11=86 smallbook=72 a4=90 a5=69 +% If we use \scriptfonts (8pt), then we can fit this many characters: +% 8.5x11=90+ smallbook=80 a4=90+ a5=77 +% For me, subjectively, the few extra characters that fit aren't worth +% the additional smallness of 8pt. So I'm making the default 9pt. +% +% By the way, for comparison, here's what fits with @example (10pt): +% 8.5x11=71 smallbook=60 a4=75 a5=58 +% --karl, 24jan03. + +% Set up the default fonts, so we can use them for creating boxes. +% +\definetextfontsizexi + + +\message{markup,} + +% Check if we are currently using a typewriter font. Since all the +% Computer Modern typewriter fonts have zero interword stretch (and +% shrink), and it is reasonable to expect all typewriter fonts to have +% this property, we can check that font parameter. +% +\def\ifmonospace{\ifdim\fontdimen3\font=0pt } + +% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will +% define and register \INITMACRO to be called on markup style changes. +% \INITMACRO can check \currentmarkupstyle for the innermost +% style and the set of \ifmarkupSTYLE switches for all styles +% currently in effect. +\newif\ifmarkupvar +\newif\ifmarkupsamp +\newif\ifmarkupkey +%\newif\ifmarkupfile % @file == @samp. +%\newif\ifmarkupoption % @option == @samp. +\newif\ifmarkupcode +\newif\ifmarkupkbd +%\newif\ifmarkupenv % @env == @code. +%\newif\ifmarkupcommand % @command == @code. +\newif\ifmarkuptex % @tex (and part of @math, for now). +\newif\ifmarkupexample +\newif\ifmarkupverb +\newif\ifmarkupverbatim + +\let\currentmarkupstyle\empty + +\def\setupmarkupstyle#1{% + \csname markup#1true\endcsname + \def\currentmarkupstyle{#1}% + \markupstylesetup +} + +\let\markupstylesetup\empty + +\def\defmarkupstylesetup#1{% + \expandafter\def\expandafter\markupstylesetup + \expandafter{\markupstylesetup #1}% + \def#1% +} + +% Markup style setup for left and right quotes. +\defmarkupstylesetup\markupsetuplq{% + \expandafter\let\expandafter \temp + \csname markupsetuplq\currentmarkupstyle\endcsname + \ifx\temp\relax \markupsetuplqdefault \else \temp \fi +} + +\defmarkupstylesetup\markupsetuprq{% + \expandafter\let\expandafter \temp + \csname markupsetuprq\currentmarkupstyle\endcsname + \ifx\temp\relax \markupsetuprqdefault \else \temp \fi +} + +{ +\catcode`\'=\active +\catcode`\`=\active + +\gdef\markupsetuplqdefault{\let`\lq} +\gdef\markupsetuprqdefault{\let'\rq} + +\gdef\markupsetcodequoteleft{\let`\codequoteleft} +\gdef\markupsetcodequoteright{\let'\codequoteright} +} + +\let\markupsetuplqcode \markupsetcodequoteleft +\let\markupsetuprqcode \markupsetcodequoteright +% +\let\markupsetuplqexample \markupsetcodequoteleft +\let\markupsetuprqexample \markupsetcodequoteright +% +\let\markupsetuplqkbd \markupsetcodequoteleft +\let\markupsetuprqkbd \markupsetcodequoteright +% +\let\markupsetuplqsamp \markupsetcodequoteleft +\let\markupsetuprqsamp \markupsetcodequoteright +% +\let\markupsetuplqverb \markupsetcodequoteleft +\let\markupsetuprqverb \markupsetcodequoteright +% +\let\markupsetuplqverbatim \markupsetcodequoteleft +\let\markupsetuprqverbatim \markupsetcodequoteright + +% Allow an option to not use regular directed right quote/apostrophe +% (char 0x27), but instead the undirected quote from cmtt (char 0x0d). +% The undirected quote is ugly, so don't make it the default, but it +% works for pasting with more pdf viewers (at least evince), the +% lilypond developers report. xpdf does work with the regular 0x27. +% +\def\codequoteright{% + \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else \char'15 \fi + \else \char'15 \fi +} +% +% and a similar option for the left quote char vs. a grave accent. +% Modern fonts display ASCII 0x60 as a grave accent, so some people like +% the code environments to do likewise. +% +\def\codequoteleft{% + \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + % [Knuth] pp. 380,381,391 + % \relax disables Spanish ligatures ?` and !` of \tt font. + \relax`% + \else \char'22 \fi + \else \char'22 \fi +} + +% Commands to set the quote options. +% +\parseargdef\codequoteundirected{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxicodequoteundirected\endcsname + = t% + \else\ifx\temp\offword + \expandafter\let\csname SETtxicodequoteundirected\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% + \fi\fi +} +% +\parseargdef\codequotebacktick{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxicodequotebacktick\endcsname + = t% + \else\ifx\temp\offword + \expandafter\let\csname SETtxicodequotebacktick\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% + \fi\fi +} + +% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. +\def\noligaturesquoteleft{\relax\lq} + +% Count depth in font-changes, for error checks +\newcount\fontdepth \fontdepth=0 + +% Font commands. + +% #1 is the font command (\sl or \it), #2 is the text to slant. +% If we are in a monospaced environment, however, 1) always use \ttsl, +% and 2) do not add an italic correction. +\def\dosmartslant#1#2{% + \ifusingtt + {{\ttsl #2}\let\next=\relax}% + {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% + \next +} +\def\smartslanted{\dosmartslant\sl} +\def\smartitalic{\dosmartslant\it} + +% Output an italic correction unless \next (presumed to be the following +% character) is such as not to need one. +\def\smartitaliccorrection{% + \ifx\next,% + \else\ifx\next-% + \else\ifx\next.% + \else\ptexslash + \fi\fi\fi + \aftersmartic +} + +% Unconditional use \ttsl, and no ic. @var is set to this for defuns. +\def\ttslanted#1{{\ttsl #1}} + +% @cite is like \smartslanted except unconditionally use \sl. We never want +% ttsl for book titles, do we? +\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} + +\def\aftersmartic{} +\def\var#1{% + \let\saveaftersmartic = \aftersmartic + \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% + \smartslanted{#1}% +} + +\let\i=\smartitalic +\let\slanted=\smartslanted +\let\dfn=\smartslanted +\let\emph=\smartitalic + +% Explicit font changes: @r, @sc, undocumented @ii. +\def\r#1{{\rm #1}} % roman font +\def\sc#1{{\smallcaps#1}} % smallcaps font +\def\ii#1{{\it #1}} % italic font + +% @b, explicit bold. Also @strong. +\def\b#1{{\bf #1}} +\let\strong=\b + +% @sansserif, explicit sans. +\def\sansserif#1{{\sf #1}} + +% We can't just use \exhyphenpenalty, because that only has effect at +% the end of a paragraph. Restore normal hyphenation at the end of the +% group within which \nohyphenation is presumably called. +% +\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} +\def\restorehyphenation{\hyphenchar\font = `- } + +% Set sfcode to normal for the chars that usually have another value. +% Can't use plain's \frenchspacing because it uses the `\x notation, and +% sometimes \x has an active definition that messes things up. +% +\catcode`@=11 + \def\plainfrenchspacing{% + \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m + \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m + \def\endofsentencespacefactor{1000}% for @. and friends + } + \def\plainnonfrenchspacing{% + \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 + \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 + \def\endofsentencespacefactor{3000}% for @. and friends + } +\catcode`@=\other +\def\endofsentencespacefactor{3000}% default + +% @t, explicit typewriter. +\def\t#1{% + {\tt \rawbackslash \plainfrenchspacing #1}% + \null +} + +% @samp. +\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} + +% @indicateurl is \samp, that is, with quotes. +\let\indicateurl=\samp + +% @code (and similar) prints in typewriter, but with spaces the same +% size as normal in the surrounding text, without hyphenation, etc. +% This is a subroutine for that. +\def\tclose#1{% + {% + % Change normal interword space to be same as for the current font. + \spaceskip = \fontdimen2\font + % + % Switch to typewriter. + \tt + % + % But `\ ' produces the large typewriter interword space. + \def\ {{\spaceskip = 0pt{} }}% + % + % Turn off hyphenation. + \nohyphenation + % + \rawbackslash + \plainfrenchspacing + #1% + }% + \null % reset spacefactor to 1000 +} + +% We *must* turn on hyphenation at `-' and `_' in @code. +% Otherwise, it is too hard to avoid overfull hboxes +% in the Emacs manual, the Library manual, etc. +% +% Unfortunately, TeX uses one parameter (\hyphenchar) to control +% both hyphenation at - and hyphenation within words. +% We must therefore turn them both off (\tclose does that) +% and arrange explicitly to hyphenate at a dash. +% -- rms. +{ + \catcode`\-=\active \catcode`\_=\active + \catcode`\'=\active \catcode`\`=\active + \global\let'=\rq \global\let`=\lq % default definitions + % + \global\def\code{\begingroup + \setupmarkupstyle{code}% + % The following should really be moved into \setupmarkupstyle handlers. + \catcode\dashChar=\active \catcode\underChar=\active + \ifallowcodebreaks + \let-\codedash + \let_\codeunder + \else + \let-\normaldash + \let_\realunder + \fi + \codex + } +} + +\def\codex #1{\tclose{#1}\endgroup} + +\def\normaldash{-} +\def\codedash{-\discretionary{}{}{}} +\def\codeunder{% + % this is all so @math{@code{var_name}+1} can work. In math mode, _ + % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) + % will therefore expand the active definition of _, which is us + % (inside @code that is), therefore an endless loop. + \ifusingtt{\ifmmode + \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. + \else\normalunderscore \fi + \discretionary{}{}{}}% + {\_}% +} + +% An additional complication: the above will allow breaks after, e.g., +% each of the four underscores in __typeof__. This is bad. +% @allowcodebreaks provides a document-level way to turn breaking at - +% and _ on and off. +% +\newif\ifallowcodebreaks \allowcodebreakstrue + +\def\keywordtrue{true} +\def\keywordfalse{false} + +\parseargdef\allowcodebreaks{% + \def\txiarg{#1}% + \ifx\txiarg\keywordtrue + \allowcodebreakstrue + \else\ifx\txiarg\keywordfalse + \allowcodebreaksfalse + \else + \errhelp = \EMsimple + \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% + \fi\fi +} + +% For @command, @env, @file, @option quotes seem unnecessary, +% so use \code rather than \samp. +\let\command=\code +\let\env=\code +\let\file=\code +\let\option=\code + +% @uref (abbreviation for `urlref') takes an optional (comma-separated) +% second argument specifying the text to display and an optional third +% arg as text to display instead of (rather than in addition to) the url +% itself. First (mandatory) arg is the url. +% (This \urefnobreak definition isn't used now, leaving it for a while +% for comparison.) +\def\urefnobreak#1{\dourefnobreak #1,,,\finish} +\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \ifpdf + \unhbox0 % PDF: 2nd arg given, show only it + \else + \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url + \fi + \else + \code{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% This \urefbreak definition is the active one. +\def\urefbreak{\begingroup \urefcatcodes \dourefbreak} +\let\uref=\urefbreak +\def\dourefbreak#1{\urefbreakfinish #1,,,\finish} +\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \ifpdf + \unhbox0 % PDF: 2nd arg given, show only it + \else + \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url + \fi + \else + \urefcode{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% Allow line breaks around only a few characters (only). +\def\urefcatcodes{% + \catcode\ampChar=\active \catcode\dotChar=\active + \catcode\hashChar=\active \catcode\questChar=\active + \catcode\slashChar=\active +} +{ + \urefcatcodes + % + \global\def\urefcode{\begingroup + \setupmarkupstyle{code}% + \urefcatcodes + \let&\urefcodeamp + \let.\urefcodedot + \let#\urefcodehash + \let?\urefcodequest + \let/\urefcodeslash + \codex + } + % + % By default, they are just regular characters. + \global\def&{\normalamp} + \global\def.{\normaldot} + \global\def#{\normalhash} + \global\def?{\normalquest} + \global\def/{\normalslash} +} + +% we put a little stretch before and after the breakable chars, to help +% line breaking of long url's. The unequal skips make look better in +% cmtt at least, especially for dots. +\def\urefprestretch{\urefprebreak \hskip0pt plus.13em } +\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em } +% +\def\urefcodeamp{\urefprestretch \&\urefpoststretch} +\def\urefcodedot{\urefprestretch .\urefpoststretch} +\def\urefcodehash{\urefprestretch \#\urefpoststretch} +\def\urefcodequest{\urefprestretch ?\urefpoststretch} +\def\urefcodeslash{\futurelet\next\urefcodeslashfinish} +{ + \catcode`\/=\active + \global\def\urefcodeslashfinish{% + \urefprestretch \slashChar + % Allow line break only after the final / in a sequence of + % slashes, to avoid line break between the slashes in http://. + \ifx\next/\else \urefpoststretch \fi + } +} + +% One more complication: by default we'll break after the special +% characters, but some people like to break before the special chars, so +% allow that. Also allow no breaking at all, for manual control. +% +\parseargdef\urefbreakstyle{% + \def\txiarg{#1}% + \ifx\txiarg\wordnone + \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} + \else\ifx\txiarg\wordbefore + \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} + \else\ifx\txiarg\wordafter + \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} + \else + \errhelp = \EMsimple + \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% + \fi\fi\fi +} +\def\wordafter{after} +\def\wordbefore{before} +\def\wordnone{none} + +\urefbreakstyle after + +% @url synonym for @uref, since that's how everyone uses it. +% +\let\url=\uref + +% rms does not like angle brackets --karl, 17may97. +% So now @email is just like @uref, unless we are pdf. +% +%\def\email#1{\angleleft{\tt #1}\angleright} +\ifpdf + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} +\else + \let\email=\uref +\fi + +% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), +% `example' (@kbd uses ttsl only inside of @example and friends), +% or `code' (@kbd uses normal tty font always). +\parseargdef\kbdinputstyle{% + \def\txiarg{#1}% + \ifx\txiarg\worddistinct + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% + \else\ifx\txiarg\wordexample + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% + \else\ifx\txiarg\wordcode + \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% + \else + \errhelp = \EMsimple + \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% + \fi\fi\fi +} +\def\worddistinct{distinct} +\def\wordexample{example} +\def\wordcode{code} + +% Default is `distinct'. +\kbdinputstyle distinct + +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. +\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} + +\def\xkey{\key} +\def\kbdsub#1#2#3\par{% + \def\one{#1}\def\three{#3}\def\threex{??}% + \ifx\one\xkey\ifx\threex\three \key{#2}% + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi +} + +% definition of @key that produces a lozenge. Doesn't adjust to text size. +%\setfont\keyrm\rmshape{8}{1000}{OT1} +%\font\keysy=cmsy9 +%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% +% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% +% \vbox{\hrule\kern-0.4pt +% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% +% \kern-0.4pt\hrule}% +% \kern-.06em\raise0.4pt\hbox{\angleright}}}} + +% definition of @key with no lozenge. If the current font is already +% monospace, don't change it; that way, we respect @kbdinputstyle. But +% if it isn't monospace, then use \tt. +% +\def\key#1{{\setupmarkupstyle{key}% + \nohyphenation + \ifmonospace\else\tt\fi + #1}\null} + +% @clicksequence{File @click{} Open ...} +\def\clicksequence#1{\begingroup #1\endgroup} + +% @clickstyle @arrow (by default) +\parseargdef\clickstyle{\def\click{#1}} +\def\click{\arrow} + +% Typeset a dimension, e.g., `in' or `pt'. The only reason for the +% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. +% +\def\dmn#1{\thinspace #1} + +% @l was never documented to mean ``switch to the Lisp font'', +% and it is not used as such in any manual I can find. We need it for +% Polish suppressed-l. --karl, 22sep96. +%\def\l#1{{\li #1}\null} + +% @acronym for "FBI", "NATO", and the like. +% We print this one point size smaller, since it's intended for +% all-uppercase. +% +\def\acronym#1{\doacronym #1,,\finish} +\def\doacronym#1,#2,#3\finish{% + {\selectfonts\lsize #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi + \null % reset \spacefactor=1000 +} + +% @abbr for "Comput. J." and the like. +% No font change, but don't do end-of-sentence spacing. +% +\def\abbr#1{\doabbr #1,,\finish} +\def\doabbr#1,#2,#3\finish{% + {\plainfrenchspacing #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi + \null % reset \spacefactor=1000 +} + +% @asis just yields its argument. Used with @table, for example. +% +\def\asis#1{#1} + +% @math outputs its argument in math mode. +% +% One complication: _ usually means subscripts, but it could also mean +% an actual _ character, as in @math{@var{some_variable} + 1}. So make +% _ active, and distinguish by seeing if the current family is \slfam, +% which is what @var uses. +{ + \catcode`\_ = \active + \gdef\mathunderscore{% + \catcode`\_=\active + \def_{\ifnum\fam=\slfam \_\else\sb\fi}% + } +} +% Another complication: we want \\ (and @\) to output a math (or tt) \. +% FYI, plain.tex uses \\ as a temporary control sequence (for no +% particular reason), but this is not advertised and we don't care. +% +% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. +\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} +% +\def\math{% + \tex + \mathunderscore + \let\\ = \mathbackslash + \mathactive + % make the texinfo accent commands work in math mode + \let\"=\ddot + \let\'=\acute + \let\==\bar + \let\^=\hat + \let\`=\grave + \let\u=\breve + \let\v=\check + \let\~=\tilde + \let\dotaccent=\dot + $\finishmath +} +\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. + +% Some active characters (such as <) are spaced differently in math. +% We have to reset their definitions in case the @math was an argument +% to a command which sets the catcodes (such as @item or @section). +% +{ + \catcode`^ = \active + \catcode`< = \active + \catcode`> = \active + \catcode`+ = \active + \catcode`' = \active + \gdef\mathactive{% + \let^ = \ptexhat + \let< = \ptexless + \let> = \ptexgtr + \let+ = \ptexplus + \let' = \ptexquoteright + } +} + +% ctrl is no longer a Texinfo command, but leave this definition for fun. +\def\ctrl #1{{\tt \rawbackslash \hat}#1} + +% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. +% Ignore unless FMTNAME == tex; then it is like @iftex and @tex, +% except specified as a normal braced arg, so no newlines to worry about. +% +\def\outfmtnametex{tex} +% +\long\def\inlinefmt#1{\doinlinefmt #1,\finish} +\long\def\doinlinefmt#1,#2,\finish{% + \def\inlinefmtname{#1}% + \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi +} +% For raw, must switch into @tex before parsing the argument, to avoid +% setting catcodes prematurely. Doing it this way means that, for +% example, @inlineraw{html, foo{bar} gets a parse error instead of being +% ignored. But this isn't important because if people want a literal +% *right* brace they would have to use a command anyway, so they may as +% well use a command to get a left brace too. We could re-use the +% delimiter character idea from \verb, but it seems like overkill. +% +\long\def\inlineraw{\tex \doinlineraw} +\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} +\def\doinlinerawtwo#1,#2,\finish{% + \def\inlinerawname{#1}% + \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi + \endgroup % close group opened by \tex. +} + + +\message{glyphs,} +% and logos. + +% @@ prints an @, as does @atchar{}. +\def\@{\char64 } +\let\atchar=\@ + +% @{ @} @lbracechar{} @rbracechar{} all generate brace characters. +% Unless we're in typewriter, use \ecfont because the CM text fonts do +% not have braces, and we don't want to switch into math. +\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} +\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} +\let\{=\mylbrace \let\lbracechar=\{ +\let\}=\myrbrace \let\rbracechar=\} +\begingroup + % Definitions to produce \{ and \} commands for indices, + % and @{ and @} for the aux/toc files. + \catcode`\{ = \other \catcode`\} = \other + \catcode`\[ = 1 \catcode`\] = 2 + \catcode`\! = 0 \catcode`\\ = \other + !gdef!lbracecmd[\{]% + !gdef!rbracecmd[\}]% + !gdef!lbraceatcmd[@{]% + !gdef!rbraceatcmd[@}]% +!endgroup + +% @comma{} to avoid , parsing problems. +\let\comma = , + +% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent +% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. +\let\, = \ptexc +\let\dotaccent = \ptexdot +\def\ringaccent#1{{\accent23 #1}} +\let\tieaccent = \ptext +\let\ubaraccent = \ptexb +\let\udotaccent = \d + +% Other special characters: @questiondown @exclamdown @ordf @ordm +% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. +\def\questiondown{?`} +\def\exclamdown{!`} +\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} + +% Dotless i and dotless j, used for accents. +\def\imacro{i} +\def\jmacro{j} +\def\dotless#1{% + \def\temp{#1}% + \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi + \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi + \else \errmessage{@dotless can be used only with i or j}% + \fi\fi +} + +% The \TeX{} logo, as in plain, but resetting the spacing so that a +% period following counts as ending a sentence. (Idea found in latex.) +% +\edef\TeX{\TeX \spacefactor=1000 } + +% @LaTeX{} logo. Not quite the same results as the definition in +% latex.ltx, since we use a different font for the raised A; it's most +% convenient for us to use an explicitly smaller font, rather than using +% the \scriptstyle font (since we don't reset \scriptstyle and +% \scriptscriptstyle). +% +\def\LaTeX{% + L\kern-.36em + {\setbox0=\hbox{T}% + \vbox to \ht0{\hbox{% + \ifx\textnominalsize\xwordpt + % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. + % Revert to plain's \scriptsize, which is 7pt. + \count255=\the\fam $\fam\count255 \scriptstyle A$% + \else + % For 11pt, we can use our lllsize. + \selectfonts\lllsize A% + \fi + }% + \vss + }}% + \kern-.15em + \TeX +} + +% Some math mode symbols. +\def\bullet{$\ptexbullet$} +\def\geq{\ifmmode \ge\else $\ge$\fi} +\def\leq{\ifmmode \le\else $\le$\fi} +\def\minus{\ifmmode -\else $-$\fi} + +% @dots{} outputs an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in the cm +% typewriter fonts as three actual period characters; on the other hand, +% in other typewriter fonts three periods are wider than 1.5em. So do +% whichever is larger. +% +\def\dots{% + \leavevmode + \setbox0=\hbox{...}% get width of three periods + \ifdim\wd0 > 1.5em + \dimen0 = \wd0 + \else + \dimen0 = 1.5em + \fi + \hbox to \dimen0{% + \hskip 0pt plus.25fil + .\hskip 0pt plus1fil + .\hskip 0pt plus1fil + .\hskip 0pt plus.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \dots + \spacefactor=\endofsentencespacefactor +} + +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% +% Since these characters are used in examples, they should be an even number of +% \tt widths. Each \tt character is 1en, so two makes it 1em. +% +\def\point{$\star$} +\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} +\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} +\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} + +% The @error{} command. +% Adapted from the TeXbook's \boxit. +% +\newbox\errorbox +% +{\tentt \global\dimen0 = 3em}% Width of the box. +\dimen2 = .55pt % Thickness of rules +% The text. (`r' is open on the right, `e' somewhat less so on the left.) +\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} +% +\setbox\errorbox=\hbox to \dimen0{\hfil + \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. + \advance\hsize by -2\dimen2 % Rules. + \vbox{% + \hrule height\dimen2 + \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. + \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. + \kern3pt\vrule width\dimen2}% Space to right. + \hrule height\dimen2} + \hfil} +% +\def\error{\leavevmode\lower.7ex\copy\errorbox} + +% @pounds{} is a sterling sign, which Knuth put in the CM italic font. +% +\def\pounds{{\it\$}} + +% @euro{} comes from a separate font, depending on the current style. +% We use the free feym* fonts from the eurosym package by Henrik +% Theiling, which support regular, slanted, bold and bold slanted (and +% "outlined" (blackboard board, sort of) versions, which we don't need). +% It is available from http://www.ctan.org/tex-archive/fonts/eurosym. +% +% Although only regular is the truly official Euro symbol, we ignore +% that. The Euro is designed to be slightly taller than the regular +% font height. +% +% feymr - regular +% feymo - slanted +% feybr - bold +% feybo - bold slanted +% +% There is no good (free) typewriter version, to my knowledge. +% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. +% Hmm. +% +% Also doesn't work in math. Do we need to do math with euro symbols? +% Hope not. +% +% +\def\euro{{\eurofont e}} +\def\eurofont{% + % We set the font at each command, rather than predefining it in + % \textfonts and the other font-switching commands, so that + % installations which never need the symbol don't have to have the + % font installed. + % + % There is only one designed size (nominal 10pt), so we always scale + % that to the current nominal size. + % + % By the way, simply using "at 1em" works for cmr10 and the like, but + % does not work for cmbx10 and other extended/shrunken fonts. + % + \def\eurosize{\csname\curfontsize nominalsize\endcsname}% + % + \ifx\curfontstyle\bfstylename + % bold: + \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize + \else + % regular: + \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize + \fi + \thiseurofont +} + +% Glyphs from the EC fonts. We don't use \let for the aliases, because +% sometimes we redefine the original macro, and the alias should reflect +% the redefinition. +% +% Use LaTeX names for the Icelandic letters. +\def\DH{{\ecfont \char"D0}} % Eth +\def\dh{{\ecfont \char"F0}} % eth +\def\TH{{\ecfont \char"DE}} % Thorn +\def\th{{\ecfont \char"FE}} % thorn +% +\def\guillemetleft{{\ecfont \char"13}} +\def\guillemotleft{\guillemetleft} +\def\guillemetright{{\ecfont \char"14}} +\def\guillemotright{\guillemetright} +\def\guilsinglleft{{\ecfont \char"0E}} +\def\guilsinglright{{\ecfont \char"0F}} +\def\quotedblbase{{\ecfont \char"12}} +\def\quotesinglbase{{\ecfont \char"0D}} +% +% This positioning is not perfect (see the ogonek LaTeX package), but +% we have the precomposed glyphs for the most common cases. We put the +% tests to use those glyphs in the single \ogonek macro so we have fewer +% dummy definitions to worry about for index entries, etc. +% +% ogonek is also used with other letters in Lithuanian (IOU), but using +% the precomposed glyphs for those is not so easy since they aren't in +% the same EC font. +\def\ogonek#1{{% + \def\temp{#1}% + \ifx\temp\macrocharA\Aogonek + \else\ifx\temp\macrochara\aogonek + \else\ifx\temp\macrocharE\Eogonek + \else\ifx\temp\macrochare\eogonek + \else + \ecfont \setbox0=\hbox{#1}% + \ifdim\ht0=1ex\accent"0C #1% + \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% + \fi + \fi\fi\fi\fi + }% +} +\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} +\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} +\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} +\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} +% +% Use the ec* fonts (cm-super in outline format) for non-CM glyphs. +\def\ecfont{% + % We can't distinguish serif/sans and italic/slanted, but this + % is used for crude hacks anyway (like adding French and German + % quotes to documents typeset with CM, where we lose kerning), so + % hopefully nobody will notice/care. + \edef\ecsize{\csname\curfontsize ecsize\endcsname}% + \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% + \ifmonospace + % typewriter: + \font\thisecfont = ectt\ecsize \space at \nominalsize + \else + \ifx\curfontstyle\bfstylename + % bold: + \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \else + % regular: + \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \fi + \fi + \thisecfont +} + +% @registeredsymbol - R in a circle. The font for the R should really +% be smaller yet, but lllsize is the best we can do for now. +% Adapted from the plain.tex definition of \copyright. +% +\def\registeredsymbol{% + $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% + \hfil\crcr\Orb}}% + }$% +} + +% @textdegree - the normal degrees sign. +% +\def\textdegree{$^\circ$} + +% Laurent Siebenmann reports \Orb undefined with: +% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 +% so we'll define it if necessary. +% +\ifx\Orb\thisisundefined +\def\Orb{\mathhexbox20D} +\fi + +% Quotes. +\chardef\quotedblleft="5C +\chardef\quotedblright=`\" +\chardef\quoteleft=`\` +\chardef\quoteright=`\' + + +\message{page headings,} + +\newskip\titlepagetopglue \titlepagetopglue = 1.5in +\newskip\titlepagebottomglue \titlepagebottomglue = 2pc + +% First the title page. Must do @settitle before @titlepage. +\newif\ifseenauthor +\newif\iffinishedtitlepage + +% Do an implicit @contents or @shortcontents after @end titlepage if the +% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. +% +\newif\ifsetcontentsaftertitlepage + \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue +\newif\ifsetshortcontentsaftertitlepage + \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue + +\parseargdef\shorttitlepage{% + \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% + \endgroup\page\hbox{}\page} + +\envdef\titlepage{% + % Open one extra group, as we want to close it in the middle of \Etitlepage. + \begingroup + \parindent=0pt \textfonts + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the second. + \let\oldpage = \page + \def\page{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + \let\page = \oldpage + \page + \null + }% +} + +\def\Etitlepage{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + % + % Need this before the \...aftertitlepage checks so that if they are + % in effect the toc pages will come out with page numbers. + \HEADINGSon + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi +} + +\def\finishtitlepage{% + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue +} + +% Settings used for typesetting titles: no hyphenation, no indentation, +% don't worry much about spacing, ragged right. This should be used +% inside a \vbox, and fonts need to be set appropriately first. Because +% it is always used for titles, nothing else, we call \rmisbold. \par +% should be specified before the end of the \vbox, since a vbox is a group. +% +\def\raggedtitlesettings{% + \rmisbold + \hyphenpenalty=10000 + \parindent=0pt + \tolerance=5000 + \ptexraggedright +} + +% Macros to be used within @titlepage: + +\let\subtitlerm=\tenrm +\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} + +\parseargdef\title{% + \checkenv\titlepage + \vbox{\titlefonts \raggedtitlesettings #1\par}% + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt +} + +\parseargdef\subtitle{% + \checkenv\titlepage + {\subtitlefont \rightline{#1}}% +} + +% @author should come last, but may come many times. +% It can also be used inside @quotation. +% +\parseargdef\author{% + \def\temp{\quotation}% + \ifx\thisenv\temp + \def\quotationauthor{#1}% printed in \Equotation. + \else + \checkenv\titlepage + \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi + {\secfonts\rmisbold \leftline{#1}}% + \fi +} + + +% Set up page headings and footings. + +\let\thispage=\folio + +\newtoks\evenheadline % headline on even pages +\newtoks\oddheadline % headline on odd pages +\newtoks\evenfootline % footline on even pages +\newtoks\oddfootline % footline on odd pages + +% Now make TeX use those variables +\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline + \else \the\evenheadline \fi}} +\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline + \else \the\evenfootline \fi}\HEADINGShook} +\let\HEADINGShook=\relax + +% Commands to set those variables. +% For example, this is what @headings on does +% @evenheading @thistitle|@thispage|@thischapter +% @oddheading @thischapter|@thispage|@thistitle +% @evenfooting @thisfile|| +% @oddfooting ||@thisfile + + +\def\evenheading{\parsearg\evenheadingxxx} +\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} +\def\evenheadingyyy #1\|#2\|#3\|#4\finish{% +\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddheading{\parsearg\oddheadingxxx} +\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} +\def\oddheadingyyy #1\|#2\|#3\|#4\finish{% +\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% + +\def\evenfooting{\parsearg\evenfootingxxx} +\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} +\def\evenfootingyyy #1\|#2\|#3\|#4\finish{% +\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddfooting{\parsearg\oddfootingxxx} +\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} +\def\oddfootingyyy #1\|#2\|#3\|#4\finish{% + \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% + % + % Leave some space for the footline. Hopefully ok to assume + % @evenfooting will not be used by itself. + \global\advance\pageheight by -12pt + \global\advance\vsize by -12pt +} + +\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} + +% @evenheadingmarks top \thischapter <- chapter at the top of a page +% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page +% +% The same set of arguments for: +% +% @oddheadingmarks +% @evenfootingmarks +% @oddfootingmarks +% @everyheadingmarks +% @everyfootingmarks + +\def\evenheadingmarks{\headingmarks{even}{heading}} +\def\oddheadingmarks{\headingmarks{odd}{heading}} +\def\evenfootingmarks{\headingmarks{even}{footing}} +\def\oddfootingmarks{\headingmarks{odd}{footing}} +\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} + \headingmarks{odd}{heading}{#1} } +\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} + \headingmarks{odd}{footing}{#1} } +% #1 = even/odd, #2 = heading/footing, #3 = top/bottom. +\def\headingmarks#1#2#3 {% + \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname + \global\expandafter\let\csname get#1#2marks\endcsname \temp +} + +\everyheadingmarks bottom +\everyfootingmarks bottom + +% @headings double turns headings on for double-sided printing. +% @headings single turns headings on for single-sided printing. +% @headings off turns them off. +% @headings on same as @headings double, retained for compatibility. +% @headings after turns on double-sided headings after this page. +% @headings doubleafter turns on double-sided headings after this page. +% @headings singleafter turns on single-sided headings after this page. +% By default, they are off at the start of a document, +% and turned `on' after @end titlepage. + +\def\headings #1 {\csname HEADINGS#1\endcsname} + +\def\headingsoff{% non-global headings elimination + \evenheadline={\hfil}\evenfootline={\hfil}% + \oddheadline={\hfil}\oddfootline={\hfil}% +} + +\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting +\HEADINGSoff % it's the default + +% When we turn headings on, set the page number to 1. +% For double-sided printing, put current file name in lower left corner, +% chapter name on inside top of right hand pages, document +% title on inside top of left hand pages, and page numbers on outside top +% edge of all pages. +\def\HEADINGSdouble{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} +\let\contentsalignmacro = \chappager + +% For single-sided printing, chapter title goes across top left of page, +% page number on top right. +\def\HEADINGSsingle{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} +\def\HEADINGSon{\HEADINGSdouble} + +\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} +\let\HEADINGSdoubleafter=\HEADINGSafter +\def\HEADINGSdoublex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} + +\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} +\def\HEADINGSsinglex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} + +% Subroutines used in generating headings +% This produces Day Month Year style of output. +% Only define if not already defined, in case a txi-??.tex file has set +% up a different format (e.g., txi-cs.tex does this). +\ifx\today\thisisundefined +\def\today{% + \number\day\space + \ifcase\month + \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr + \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug + \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec + \fi + \space\number\year} +\fi + +% @settitle line... specifies the title of the document, for headings. +% It generates no output of its own. +\def\thistitle{\putwordNoTitle} +\def\settitle{\parsearg{\gdef\thistitle}} + + +\message{tables,} +% Tables -- @table, @ftable, @vtable, @item(x). + +% default indentation of table text +\newdimen\tableindent \tableindent=.8in +% default indentation of @itemize and @enumerate text +\newdimen\itemindent \itemindent=.3in +% margin between end of table item and start of table text. +\newdimen\itemmargin \itemmargin=.1in + +% used internally for \itemindent minus \itemmargin +\newdimen\itemmax + +% Note @table, @ftable, and @vtable define @item, @itemx, etc., with +% these defs. +% They also define \itemindex +% to index the item name in whatever manner is desired (perhaps none). + +\newif\ifitemxneedsnegativevskip + +\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} + +\def\internalBitem{\smallbreak \parsearg\itemzzz} +\def\internalBitemx{\itemxpar \parsearg\itemzzz} + +\def\itemzzz #1{\begingroup % + \advance\hsize by -\rightskip + \advance\hsize by -\tableindent + \setbox0=\hbox{\itemindicate{#1}}% + \itemindex{#1}% + \nobreak % This prevents a break before @itemx. + % + % If the item text does not fit in the space we have, put it on a line + % by itself, and do not allow a page break either before or after that + % line. We do not start a paragraph here because then if the next + % command is, e.g., @kindex, the whatsit would get put into the + % horizontal list on a line by itself, resulting in extra blank space. + \ifdim \wd0>\itemmax + % + % Make this a paragraph so we get the \parskip glue and wrapping, + % but leave it ragged-right. + \begingroup + \advance\leftskip by-\tableindent + \advance\hsize by\tableindent + \advance\rightskip by0pt plus1fil\relax + \leavevmode\unhbox0\par + \endgroup + % + % We're going to be starting a paragraph, but we don't want the + % \parskip glue -- logically it's part of the @item we just started. + \nobreak \vskip-\parskip + % + % Stop a page break at the \parskip glue coming up. However, if + % what follows is an environment such as @example, there will be no + % \parskip glue; then the negative vskip we just inserted would + % cause the example and the item to crash together. So we use this + % bizarre value of 10001 as a signal to \aboveenvbreak to insert + % \parskip glue after all. Section titles are handled this way also. + % + \penalty 10001 + \endgroup + \itemxneedsnegativevskipfalse + \else + % The item text fits into the space. Start a paragraph, so that the + % following text (if any) will end up on the same line. + \noindent + % Do this with kerns and \unhbox so that if there is a footnote in + % the item text, it can migrate to the main vertical list and + % eventually be printed. + \nobreak\kern-\tableindent + \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 + \unhbox0 + \nobreak\kern\dimen0 + \endgroup + \itemxneedsnegativevskiptrue + \fi +} + +\def\item{\errmessage{@item while not in a list environment}} +\def\itemx{\errmessage{@itemx while not in a list environment}} + +% @table, @ftable, @vtable. +\envdef\table{% + \let\itemindex\gobble + \tablecheck{table}% +} +\envdef\ftable{% + \def\itemindex ##1{\doind {fn}{\code{##1}}}% + \tablecheck{ftable}% +} +\envdef\vtable{% + \def\itemindex ##1{\doind {vr}{\code{##1}}}% + \tablecheck{vtable}% +} +\def\tablecheck#1{% + \ifnum \the\catcode`\^^M=\active + \endgroup + \errmessage{This command won't work in this context; perhaps the problem is + that we are \inenvironment\thisenv}% + \def\next{\doignore{#1}}% + \else + \let\next\tablex + \fi + \next +} +\def\tablex#1{% + \def\itemindicate{#1}% + \parsearg\tabley +} +\def\tabley#1{% + {% + \makevalueexpandable + \edef\temp{\noexpand\tablez #1\space\space\space}% + \expandafter + }\temp \endtablez +} +\def\tablez #1 #2 #3 #4\endtablez{% + \aboveenvbreak + \ifnum 0#1>0 \advance \leftskip by #1\mil \fi + \ifnum 0#2>0 \tableindent=#2\mil \fi + \ifnum 0#3>0 \advance \rightskip by #3\mil \fi + \itemmax=\tableindent + \advance \itemmax by -\itemmargin + \advance \leftskip by \tableindent + \exdentamount=\tableindent + \parindent = 0pt + \parskip = \smallskipamount + \ifdim \parskip=0pt \parskip=2pt \fi + \let\item = \internalBitem + \let\itemx = \internalBitemx +} +\def\Etable{\endgraf\afterenvbreak} +\let\Eftable\Etable +\let\Evtable\Etable +\let\Eitemize\Etable +\let\Eenumerate\Etable + +% This is the counter used by @enumerate, which is really @itemize + +\newcount \itemno + +\envdef\itemize{\parsearg\doitemize} + +\def\doitemize#1{% + \aboveenvbreak + \itemmax=\itemindent + \advance\itemmax by -\itemmargin + \advance\leftskip by \itemindent + \exdentamount=\itemindent + \parindent=0pt + \parskip=\smallskipamount + \ifdim\parskip=0pt \parskip=2pt \fi + % + % Try typesetting the item mark that if the document erroneously says + % something like @itemize @samp (intending @table), there's an error + % right away at the @itemize. It's not the best error message in the + % world, but it's better than leaving it to the @item. This means if + % the user wants an empty mark, they have to say @w{} not just @w. + \def\itemcontents{#1}% + \setbox0 = \hbox{\itemcontents}% + % + % @itemize with no arg is equivalent to @itemize @bullet. + \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi + % + \let\item=\itemizeitem +} + +% Definition of @item while inside @itemize and @enumerate. +% +\def\itemizeitem{% + \advance\itemno by 1 % for enumerations + {\let\par=\endgraf \smallbreak}% reasonable place to break + {% + % If the document has an @itemize directly after a section title, a + % \nobreak will be last on the list, and \sectionheading will have + % done a \vskip-\parskip. In that case, we don't want to zero + % parskip, or the item text will crash with the heading. On the + % other hand, when there is normal text preceding the item (as there + % usually is), we do want to zero parskip, or there would be too much + % space. In that case, we won't have a \nobreak before. At least + % that's the theory. + \ifnum\lastpenalty<10000 \parskip=0in \fi + \noindent + \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% + % + \vadjust{\penalty 1200}}% not good to break after first line of item. + \flushcr +} + +% \splitoff TOKENS\endmark defines \first to be the first token in +% TOKENS, and \rest to be the remainder. +% +\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% + +% Allow an optional argument of an uppercase letter, lowercase letter, +% or number, to specify the first label in the enumerated list. No +% argument is the same as `1'. +% +\envparseargdef\enumerate{\enumeratey #1 \endenumeratey} +\def\enumeratey #1 #2\endenumeratey{% + % If we were given no argument, pretend we were given `1'. + \def\thearg{#1}% + \ifx\thearg\empty \def\thearg{1}\fi + % + % Detect if the argument is a single token. If so, it might be a + % letter. Otherwise, the only valid thing it can be is a number. + % (We will always have one token, because of the test we just made. + % This is a good thing, since \splitoff doesn't work given nothing at + % all -- the first parameter is undelimited.) + \expandafter\splitoff\thearg\endmark + \ifx\rest\empty + % Only one token in the argument. It could still be anything. + % A ``lowercase letter'' is one whose \lccode is nonzero. + % An ``uppercase letter'' is one whose \lccode is both nonzero, and + % not equal to itself. + % Otherwise, we assume it's a number. + % + % We need the \relax at the end of the \ifnum lines to stop TeX from + % continuing to look for a . + % + \ifnum\lccode\expandafter`\thearg=0\relax + \numericenumerate % a number (we hope) + \else + % It's a letter. + \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax + \lowercaseenumerate % lowercase letter + \else + \uppercaseenumerate % uppercase letter + \fi + \fi + \else + % Multiple tokens in the argument. We hope it's a number. + \numericenumerate + \fi +} + +% An @enumerate whose labels are integers. The starting integer is +% given in \thearg. +% +\def\numericenumerate{% + \itemno = \thearg + \startenumeration{\the\itemno}% +} + +% The starting (lowercase) letter is in \thearg. +\def\lowercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more lowercase letters in @enumerate; get a bigger + alphabet}% + \fi + \char\lccode\itemno + }% +} + +% The starting (uppercase) letter is in \thearg. +\def\uppercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more uppercase letters in @enumerate; get a bigger + alphabet} + \fi + \char\uccode\itemno + }% +} + +% Call \doitemize, adding a period to the first argument and supplying the +% common last two arguments. Also subtract one from the initial value in +% \itemno, since @item increments \itemno. +% +\def\startenumeration#1{% + \advance\itemno by -1 + \doitemize{#1.}\flushcr +} + +% @alphaenumerate and @capsenumerate are abbreviations for giving an arg +% to @enumerate. +% +\def\alphaenumerate{\enumerate{a}} +\def\capsenumerate{\enumerate{A}} +\def\Ealphaenumerate{\Eenumerate} +\def\Ecapsenumerate{\Eenumerate} + + +% @multitable macros +% Amy Hendrickson, 8/18/94, 3/6/96 +% +% @multitable ... @end multitable will make as many columns as desired. +% Contents of each column will wrap at width given in preamble. Width +% can be specified either with sample text given in a template line, +% or in percent of \hsize, the current width of text on page. + +% Table can continue over pages but will only break between lines. + +% To make preamble: +% +% Either define widths of columns in terms of percent of \hsize: +% @multitable @columnfractions .25 .3 .45 +% @item ... +% +% Numbers following @columnfractions are the percent of the total +% current hsize to be used for each column. You may use as many +% columns as desired. + + +% Or use a template: +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item ... +% using the widest term desired in each column. + +% Each new table line starts with @item, each subsequent new column +% starts with @tab. Empty columns may be produced by supplying @tab's +% with nothing between them for as many times as empty columns are needed, +% ie, @tab@tab@tab will produce two empty columns. + +% @item, @tab do not need to be on their own lines, but it will not hurt +% if they are. + +% Sample multitable: + +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item first col stuff @tab second col stuff @tab third col +% @item +% first col stuff +% @tab +% second col stuff +% @tab +% third col +% @item first col stuff @tab second col stuff +% @tab Many paragraphs of text may be used in any column. +% +% They will wrap at the width determined by the template. +% @item@tab@tab This will be in third column. +% @end multitable + +% Default dimensions may be reset by user. +% @multitableparskip is vertical space between paragraphs in table. +% @multitableparindent is paragraph indent in table. +% @multitablecolmargin is horizontal space to be left between columns. +% @multitablelinespace is space to leave between table items, baseline +% to baseline. +% 0pt means it depends on current normal line spacing. +% +\newskip\multitableparskip +\newskip\multitableparindent +\newdimen\multitablecolspace +\newskip\multitablelinespace +\multitableparskip=0pt +\multitableparindent=6pt +\multitablecolspace=12pt +\multitablelinespace=0pt + +% Macros used to set up halign preamble: +% +\let\endsetuptable\relax +\def\xendsetuptable{\endsetuptable} +\let\columnfractions\relax +\def\xcolumnfractions{\columnfractions} +\newif\ifsetpercent + +% #1 is the @columnfraction, usually a decimal number like .5, but might +% be just 1. We just use it, whatever it is. +% +\def\pickupwholefraction#1 {% + \global\advance\colcount by 1 + \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% + \setuptable +} + +\newcount\colcount +\def\setuptable#1{% + \def\firstarg{#1}% + \ifx\firstarg\xendsetuptable + \let\go = \relax + \else + \ifx\firstarg\xcolumnfractions + \global\setpercenttrue + \else + \ifsetpercent + \let\go\pickupwholefraction + \else + \global\advance\colcount by 1 + \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a + % separator; typically that is always in the input, anyway. + \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% + \fi + \fi + \ifx\go\pickupwholefraction + % Put the argument back for the \pickupwholefraction call, so + % we'll always have a period there to be parsed. + \def\go{\pickupwholefraction#1}% + \else + \let\go = \setuptable + \fi% + \fi + \go +} + +% multitable-only commands. +% +% @headitem starts a heading row, which we typeset in bold. +% Assignments have to be global since we are inside the implicit group +% of an alignment entry. \everycr resets \everytab so we don't have to +% undo it ourselves. +\def\headitemfont{\b}% for people to use in the template row; not changeable +\def\headitem{% + \checkenv\multitable + \crcr + \global\everytab={\bf}% can't use \headitemfont since the parsing differs + \the\everytab % for the first item +}% +% +% A \tab used to include \hskip1sp. But then the space in a template +% line is not enough. That is bad. So let's go back to just `&' until +% we again encounter the problem the 1sp was intended to solve. +% --karl, nathan@acm.org, 20apr99. +\def\tab{\checkenv\multitable &\the\everytab}% + +% @multitable ... @end multitable definitions: +% +\newtoks\everytab % insert after every tab. +% +\envdef\multitable{% + \vskip\parskip + \startsavinginserts + % + % @item within a multitable starts a normal row. + % We use \def instead of \let so that if one of the multitable entries + % contains an @itemize, we don't choke on the \item (seen as \crcr aka + % \endtemplate) expanding \doitemize. + \def\item{\crcr}% + % + \tolerance=9500 + \hbadness=9500 + \setmultitablespacing + \parskip=\multitableparskip + \parindent=\multitableparindent + \overfullrule=0pt + \global\colcount=0 + % + \everycr = {% + \noalign{% + \global\everytab={}% + \global\colcount=0 % Reset the column counter. + % Check for saved footnotes, etc. + \checkinserts + % Keeps underfull box messages off when table breaks over pages. + %\filbreak + % Maybe so, but it also creates really weird page breaks when the + % table breaks over pages. Wouldn't \vfil be better? Wait until the + % problem manifests itself, so it can be fixed for real --karl. + }% + }% + % + \parsearg\domultitable +} +\def\domultitable#1{% + % To parse everything between @multitable and @item: + \setuptable#1 \endsetuptable + % + % This preamble sets up a generic column definition, which will + % be used as many times as user calls for columns. + % \vtop will set a single line and will also let text wrap and + % continue for many paragraphs if desired. + \halign\bgroup &% + \global\advance\colcount by 1 + \multistrut + \vtop{% + % Use the current \colcount to find the correct column width: + \hsize=\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip + \else + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace + \fi + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighting sequences respectively + % marking characters. + \noindent\ignorespaces##\unskip\multistrut + }\cr +} +\def\Emultitable{% + \crcr + \egroup % end the \halign + \global\setpercentfalse +} + +\def\setmultitablespacing{% + \def\multistrut{\strut}% just use the standard line spacing + % + % Compute \multitablelinespace (if not defined by user) for use in + % \multitableparskip calculation. We used define \multistrut based on + % this, but (ironically) that caused the spacing to be off. + % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. +\ifdim\multitablelinespace=0pt +\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip +\global\advance\multitablelinespace by-\ht0 +\fi +% Test to see if parskip is larger than space between lines of +% table. If not, do nothing. +% If so, set to same dimension as multitablelinespace. +\ifdim\multitableparskip>\multitablelinespace +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller + % than skip between lines in the table. +\fi% +\ifdim\multitableparskip=0pt +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller + % than skip between lines in the table. +\fi} + + +\message{conditionals,} + +% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, +% @ifnotxml always succeed. They currently do nothing; we don't +% attempt to check whether the conditionals are properly nested. But we +% have to remember that they are conditionals, so that @end doesn't +% attempt to close an environment group. +% +\def\makecond#1{% + \expandafter\let\csname #1\endcsname = \relax + \expandafter\let\csname iscond.#1\endcsname = 1 +} +\makecond{iftex} +\makecond{ifnotdocbook} +\makecond{ifnothtml} +\makecond{ifnotinfo} +\makecond{ifnotplaintext} +\makecond{ifnotxml} + +% Ignore @ignore, @ifhtml, @ifinfo, and the like. +% +\def\direntry{\doignore{direntry}} +\def\documentdescription{\doignore{documentdescription}} +\def\docbook{\doignore{docbook}} +\def\html{\doignore{html}} +\def\ifdocbook{\doignore{ifdocbook}} +\def\ifhtml{\doignore{ifhtml}} +\def\ifinfo{\doignore{ifinfo}} +\def\ifnottex{\doignore{ifnottex}} +\def\ifplaintext{\doignore{ifplaintext}} +\def\ifxml{\doignore{ifxml}} +\def\ignore{\doignore{ignore}} +\def\menu{\doignore{menu}} +\def\xml{\doignore{xml}} + +% Ignore text until a line `@end #1', keeping track of nested conditionals. +% +% A count to remember the depth of nesting. +\newcount\doignorecount + +\def\doignore#1{\begingroup + % Scan in ``verbatim'' mode: + \obeylines + \catcode`\@ = \other + \catcode`\{ = \other + \catcode`\} = \other + % + % Make sure that spaces turn into tokens that match what \doignoretext wants. + \spaceisspace + % + % Count number of #1's that we've seen. + \doignorecount = 0 + % + % Swallow text until we reach the matching `@end #1'. + \dodoignore{#1}% +} + +{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. + \obeylines % + % + \gdef\dodoignore#1{% + % #1 contains the command name as a string, e.g., `ifinfo'. + % + % Define a command to find the next `@end #1'. + \long\def\doignoretext##1^^M@end #1{% + \doignoretextyyy##1^^M@#1\_STOP_}% + % + % And this command to find another #1 command, at the beginning of a + % line. (Otherwise, we would consider a line `@c @ifset', for + % example, to count as an @ifset for nesting.) + \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% + % + % And now expand that command. + \doignoretext ^^M% + }% +} + +\def\doignoreyyy#1{% + \def\temp{#1}% + \ifx\temp\empty % Nothing found. + \let\next\doignoretextzzz + \else % Found a nested condition, ... + \advance\doignorecount by 1 + \let\next\doignoretextyyy % ..., look for another. + % If we're here, #1 ends with ^^M\ifinfo (for example). + \fi + \next #1% the token \_STOP_ is present just after this macro. +} + +% We have to swallow the remaining "\_STOP_". +% +\def\doignoretextzzz#1{% + \ifnum\doignorecount = 0 % We have just found the outermost @end. + \let\next\enddoignore + \else % Still inside a nested condition. + \advance\doignorecount by -1 + \let\next\doignoretext % Look for the next @end. + \fi + \next +} + +% Finish off ignored text. +{ \obeylines% + % Ignore anything after the last `@end #1'; this matters in verbatim + % environments, where otherwise the newline after an ignored conditional + % would result in a blank line in the output. + \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% +} + + +% @set VAR sets the variable VAR to an empty value. +% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. +% +% Since we want to separate VAR from REST-OF-LINE (which might be +% empty), we can't just use \parsearg; we have to insert a space of our +% own to delimit the rest of the line, and then take it out again if we +% didn't need it. +% We rely on the fact that \parsearg sets \catcode`\ =10. +% +\parseargdef\set{\setyyy#1 \endsetyyy} +\def\setyyy#1 #2\endsetyyy{% + {% + \makevalueexpandable + \def\temp{#2}% + \edef\next{\gdef\makecsname{SET#1}}% + \ifx\temp\empty + \next{}% + \else + \setzzz#2\endsetzzz + \fi + }% +} +% Remove the trailing space \setxxx inserted. +\def\setzzz#1 \endsetzzz{\next{#1}} + +% @clear VAR clears (i.e., unsets) the variable VAR. +% +\parseargdef\clear{% + {% + \makevalueexpandable + \global\expandafter\let\csname SET#1\endcsname=\relax + }% +} + +% @value{foo} gets the text saved in variable foo. +\def\value{\begingroup\makevalueexpandable\valuexxx} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} +{ + \catcode`\- = \active \catcode`\_ = \active + % + \gdef\makevalueexpandable{% + \let\value = \expandablevalue + % We don't want these characters active, ... + \catcode`\-=\other \catcode`\_=\other + % ..., but we might end up with active ones in the argument if + % we're called from @code, as @code{@value{foo-bar_}}, though. + % So \let them to their normal equivalents. + \let-\normaldash \let_\normalunderscore + } +} + +% We have this subroutine so that we can handle at least some @value's +% properly in indexes (we call \makevalueexpandable in \indexdummies). +% The command has to be fully expandable (if the variable is set), since +% the result winds up in the index file. This means that if the +% variable's value contains other Texinfo commands, it's almost certain +% it will fail (although perhaps we could fix that with sufficient work +% to do a one-level expansion on the result, instead of complete). +% +\def\expandablevalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + {[No value for ``#1'']}% + \message{Variable `#1', used in @value, is not set.}% + \else + \csname SET#1\endcsname + \fi +} + +% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined +% with @set. +% +% To get special treatment of `@end ifset,' call \makeond and the redefine. +% +\makecond{ifset} +\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} +\def\doifset#1#2{% + {% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname SET#2\endcsname\relax + #1% If not set, redefine \next. + \fi + \expandafter + }\next +} +\def\ifsetfail{\doignore{ifset}} + +% @ifclear VAR ... @end executes the `...' iff VAR has never been +% defined with @set, or has been undefined with @clear. +% +% The `\else' inside the `\doifset' parameter is a trick to reuse the +% above code: if the variable is not set, do nothing, if it is set, +% then redefine \next to \ifclearfail. +% +\makecond{ifclear} +\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} +\def\ifclearfail{\doignore{ifclear}} + +% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written +% without the @) is in fact defined. We can only feasibly check at the +% TeX level, so something like `mathcode' is going to considered +% defined even though it is not a Texinfo command. +% +\makecond{ifcommanddefined} +\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} +% +\def\doifcmddefined#1#2{{% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname #2\endcsname\relax + #1% If not defined, \let\next as above. + \fi + \expandafter + }\next +} +\def\ifcmddefinedfail{\doignore{ifcommanddefined}} + +% @ifcommandnotdefined CMD ... handled similar to @ifclear above. +\makecond{ifcommandnotdefined} +\def\ifcommandnotdefined{% + \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} +\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} + +% Set the `txicommandconditionals' variable, so documents have a way to +% test if the @ifcommand...defined conditionals are available. +\set txicommandconditionals + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory=\comment + +% @defininfoenclose. +\let\definfoenclose=\comment + + +\message{indexing,} +% Index generation facilities + +% Define \newwrite to be identical to plain tex's \newwrite +% except not \outer, so it can be used within macros and \if's. +\edef\newwrite{\makecsname{ptexnewwrite}} + +% \newindex {foo} defines an index named foo. +% It automatically defines \fooindex such that +% \fooindex ...rest of line... puts an entry in the index foo. +% It also defines \fooindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is foo. +% The name of an index should be no more than 2 characters long +% for the sake of vms. +% +\def\newindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 % Open the file + \fi + \expandafter\xdef\csname#1index\endcsname{% % Define @#1index + \noexpand\doindex{#1}} +} + +% @defindex foo == \newindex{foo} +% +\def\defindex{\parsearg\newindex} + +% Define @defcodeindex, like @defindex except put all entries in @code. +% +\def\defcodeindex{\parsearg\newcodeindex} +% +\def\newcodeindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 + \fi + \expandafter\xdef\csname#1index\endcsname{% + \noexpand\docodeindex{#1}}% +} + + +% @synindex foo bar makes index foo feed into index bar. +% Do this instead of @defindex foo if you don't want it as a separate index. +% +% @syncodeindex foo bar similar, but put all entries made for index foo +% inside @code. +% +\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} +\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} + +% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), +% #3 the target index (bar). +\def\dosynindex#1#2#3{% + % Only do \closeout if we haven't already done it, else we'll end up + % closing the target index. + \expandafter \ifx\csname donesynindex#2\endcsname \relax + % The \closeout helps reduce unnecessary open files; the limit on the + % Acorn RISC OS is a mere 16 files. + \expandafter\closeout\csname#2indfile\endcsname + \expandafter\let\csname donesynindex#2\endcsname = 1 + \fi + % redefine \fooindfile: + \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname + \expandafter\let\csname#2indfile\endcsname=\temp + % redefine \fooindex: + \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% +} + +% Define \doindex, the driver for all \fooindex macros. +% Argument #1 is generated by the calling \fooindex macro, +% and it is "foo", the name of the index. + +% \doindex just uses \parsearg; it calls \doind for the actual work. +% This is because \doind is more useful to call from other macros. + +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. + +\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} +\def\singleindexer #1{\doind{\indexname}{#1}} + +% like the previous two, but they put @code around the argument. +\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} +\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} + +% Take care of Texinfo commands that can appear in an index entry. +% Since there are some commands we want to expand, and others we don't, +% we have to laboriously prevent expansion for those that we don't. +% +\def\indexdummies{% + \escapechar = `\\ % use backslash in output files. + \def\@{@}% change to @@ when we switch to @ as escape char in index files. + \def\ {\realbackslash\space }% + % + % Need these unexpandable (because we define \tt as a dummy) + % definitions when @{ or @} appear in index entry text. Also, more + % complicated, when \tex is in effect and \{ is a \delimiter again. + % We can't use \lbracecmd and \rbracecmd because texindex assumes + % braces and backslashes are used only as delimiters. Perhaps we + % should define @lbrace and @rbrace commands a la @comma. + \def\{{{\tt\char123}}% + \def\}{{\tt\char125}}% + % + % I don't entirely understand this, but when an index entry is + % generated from a macro call, the \endinput which \scanmacro inserts + % causes processing to be prematurely terminated. This is, + % apparently, because \indexsorttmp is fully expanded, and \endinput + % is an expandable command. The redefinition below makes \endinput + % disappear altogether for that purpose -- although logging shows that + % processing continues to some further point. On the other hand, it + % seems \endinput does not hurt in the printed index arg, since that + % is still getting written without apparent harm. + % + % Sample source (mac-idx3.tex, reported by Graham Percival to + % help-texinfo, 22may06): + % @macro funindex {WORD} + % @findex xyz + % @end macro + % ... + % @funindex commtest + % + % The above is not enough to reproduce the bug, but it gives the flavor. + % + % Sample whatsit resulting: + % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} + % + % So: + \let\endinput = \empty + % + % Do the redefinitions. + \commondummies +} + +% For the aux and toc files, @ is the escape character. So we want to +% redefine everything using @ as the escape character (instead of +% \realbackslash, still used for index files). When everything uses @, +% this will be simpler. +% +\def\atdummies{% + \def\@{@@}% + \def\ {@ }% + \let\{ = \lbraceatcmd + \let\} = \rbraceatcmd + % + % Do the redefinitions. + \commondummies + \otherbackslash +} + +% Called from \indexdummies and \atdummies. +% +\def\commondummies{% + % + % \definedummyword defines \#1 as \string\#1\space, thus effectively + % preventing its expansion. This is used only for control words, + % not control letters, because the \space would be incorrect for + % control characters, but is needed to separate the control word + % from whatever follows. + % + % For control letters, we have \definedummyletter, which omits the + % space. + % + % These can be used both for control words that take an argument and + % those that do not. If it is followed by {arg} in the input, then + % that will dutifully get written to the index (or wherever). + % + \def\definedummyword ##1{\def##1{\string##1\space}}% + \def\definedummyletter##1{\def##1{\string##1}}% + \let\definedummyaccent\definedummyletter + % + \commondummiesnofonts + % + \definedummyletter\_% + \definedummyletter\-% + % + % Non-English letters. + \definedummyword\AA + \definedummyword\AE + \definedummyword\DH + \definedummyword\L + \definedummyword\O + \definedummyword\OE + \definedummyword\TH + \definedummyword\aa + \definedummyword\ae + \definedummyword\dh + \definedummyword\exclamdown + \definedummyword\l + \definedummyword\o + \definedummyword\oe + \definedummyword\ordf + \definedummyword\ordm + \definedummyword\questiondown + \definedummyword\ss + \definedummyword\th + % + % Although these internal commands shouldn't show up, sometimes they do. + \definedummyword\bf + \definedummyword\gtr + \definedummyword\hat + \definedummyword\less + \definedummyword\sf + \definedummyword\sl + \definedummyword\tclose + \definedummyword\tt + % + \definedummyword\LaTeX + \definedummyword\TeX + % + % Assorted special characters. + \definedummyword\arrow + \definedummyword\bullet + \definedummyword\comma + \definedummyword\copyright + \definedummyword\registeredsymbol + \definedummyword\dots + \definedummyword\enddots + \definedummyword\entrybreak + \definedummyword\equiv + \definedummyword\error + \definedummyword\euro + \definedummyword\expansion + \definedummyword\geq + \definedummyword\guillemetleft + \definedummyword\guillemetright + \definedummyword\guilsinglleft + \definedummyword\guilsinglright + \definedummyword\lbracechar + \definedummyword\leq + \definedummyword\minus + \definedummyword\ogonek + \definedummyword\pounds + \definedummyword\point + \definedummyword\print + \definedummyword\quotedblbase + \definedummyword\quotedblleft + \definedummyword\quotedblright + \definedummyword\quoteleft + \definedummyword\quoteright + \definedummyword\quotesinglbase + \definedummyword\rbracechar + \definedummyword\result + \definedummyword\textdegree + % + % We want to disable all macros so that they are not expanded by \write. + \macrolist + % + \normalturnoffactive + % + % Handle some cases of @value -- where it does not contain any + % (non-fully-expandable) commands. + \makevalueexpandable +} + +% \commondummiesnofonts: common to \commondummies and \indexnofonts. +% +\def\commondummiesnofonts{% + % Control letters and accents. + \definedummyletter\!% + \definedummyaccent\"% + \definedummyaccent\'% + \definedummyletter\*% + \definedummyaccent\,% + \definedummyletter\.% + \definedummyletter\/% + \definedummyletter\:% + \definedummyaccent\=% + \definedummyletter\?% + \definedummyaccent\^% + \definedummyaccent\`% + \definedummyaccent\~% + \definedummyword\u + \definedummyword\v + \definedummyword\H + \definedummyword\dotaccent + \definedummyword\ogonek + \definedummyword\ringaccent + \definedummyword\tieaccent + \definedummyword\ubaraccent + \definedummyword\udotaccent + \definedummyword\dotless + % + % Texinfo font commands. + \definedummyword\b + \definedummyword\i + \definedummyword\r + \definedummyword\sansserif + \definedummyword\sc + \definedummyword\slanted + \definedummyword\t + % + % Commands that take arguments. + \definedummyword\abbr + \definedummyword\acronym + \definedummyword\anchor + \definedummyword\cite + \definedummyword\code + \definedummyword\command + \definedummyword\dfn + \definedummyword\dmn + \definedummyword\email + \definedummyword\emph + \definedummyword\env + \definedummyword\file + \definedummyword\image + \definedummyword\indicateurl + \definedummyword\inforef + \definedummyword\kbd + \definedummyword\key + \definedummyword\math + \definedummyword\option + \definedummyword\pxref + \definedummyword\ref + \definedummyword\samp + \definedummyword\strong + \definedummyword\tie + \definedummyword\uref + \definedummyword\url + \definedummyword\var + \definedummyword\verb + \definedummyword\w + \definedummyword\xref +} + +% \indexnofonts is used when outputting the strings to sort the index +% by, and when constructing control sequence names. It eliminates all +% control sequences and just writes whatever the best ASCII sort string +% would be for a given command (usually its argument). +% +\def\indexnofonts{% + % Accent commands should become @asis. + \def\definedummyaccent##1{\let##1\asis}% + % We can just ignore other control letters. + \def\definedummyletter##1{\let##1\empty}% + % All control words become @asis by default; overrides below. + \let\definedummyword\definedummyaccent + % + \commondummiesnofonts + % + % Don't no-op \tt, since it isn't a user-level command + % and is used in the definitions of the active chars like <, >, |, etc. + % Likewise with the other plain tex font commands. + %\let\tt=\asis + % + \def\ { }% + \def\@{@}% + \def\_{\normalunderscore}% + \def\-{}% @- shouldn't affect sorting + % + % Unfortunately, texindex is not prepared to handle braces in the + % content at all. So for index sorting, we map @{ and @} to strings + % starting with |, since that ASCII character is between ASCII { and }. + \def\{{|a}% + \def\lbracechar{|a}% + % + \def\}{|b}% + \def\rbracechar{|b}% + % + % Non-English letters. + \def\AA{AA}% + \def\AE{AE}% + \def\DH{DZZ}% + \def\L{L}% + \def\OE{OE}% + \def\O{O}% + \def\TH{ZZZ}% + \def\aa{aa}% + \def\ae{ae}% + \def\dh{dzz}% + \def\exclamdown{!}% + \def\l{l}% + \def\oe{oe}% + \def\ordf{a}% + \def\ordm{o}% + \def\o{o}% + \def\questiondown{?}% + \def\ss{ss}% + \def\th{zzz}% + % + \def\LaTeX{LaTeX}% + \def\TeX{TeX}% + % + % Assorted special characters. + % (The following {} will end up in the sort string, but that's ok.) + \def\arrow{->}% + \def\bullet{bullet}% + \def\comma{,}% + \def\copyright{copyright}% + \def\dots{...}% + \def\enddots{...}% + \def\equiv{==}% + \def\error{error}% + \def\euro{euro}% + \def\expansion{==>}% + \def\geq{>=}% + \def\guillemetleft{<<}% + \def\guillemetright{>>}% + \def\guilsinglleft{<}% + \def\guilsinglright{>}% + \def\leq{<=}% + \def\minus{-}% + \def\point{.}% + \def\pounds{pounds}% + \def\print{-|}% + \def\quotedblbase{"}% + \def\quotedblleft{"}% + \def\quotedblright{"}% + \def\quoteleft{`}% + \def\quoteright{'}% + \def\quotesinglbase{,}% + \def\registeredsymbol{R}% + \def\result{=>}% + \def\textdegree{o}% + % + \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax + \else \indexlquoteignore \fi + % + % We need to get rid of all macros, leaving only the arguments (if present). + % Of course this is not nearly correct, but it is the best we can do for now. + % makeinfo does not expand macros in the argument to @deffn, which ends up + % writing an index entry, and texindex isn't prepared for an index sort entry + % that starts with \. + % + % Since macro invocations are followed by braces, we can just redefine them + % to take a single TeX argument. The case of a macro invocation that + % goes to end-of-line is not handled. + % + \macrolist +} + +% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us +% ignore left quotes in the sort term. +{\catcode`\`=\active + \gdef\indexlquoteignore{\let`=\empty}} + +\let\indexbackslash=0 %overridden during \printindex. +\let\SETmarginindex=\relax % put index entries in margin (undocumented)? + +% Most index entries go through here, but \dosubind is the general case. +% #1 is the index name, #2 is the entry text. +\def\doind#1#2{\dosubind{#1}{#2}{}} + +% Workhorse for all \fooindexes. +% #1 is name of index, #2 is stuff to put there, #3 is subentry -- +% empty if called from \doind, as we usually are (the main exception +% is with most defuns, which call us directly). +% +\def\dosubind#1#2#3{% + \iflinks + {% + % Store the main index entry text (including the third arg). + \toks0 = {#2}% + % If third arg is present, precede it with a space. + \def\thirdarg{#3}% + \ifx\thirdarg\empty \else + \toks0 = \expandafter{\the\toks0 \space #3}% + \fi + % + \edef\writeto{\csname#1indfile\endcsname}% + % + \safewhatsit\dosubindwrite + }% + \fi +} + +% Write the entry in \toks0 to the index file: +% +\def\dosubindwrite{% + % Put the index entry in the margin if desired. + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% + \fi + % + % Remember, we are within a group. + \indexdummies % Must do this here, since \bf, etc expand at this stage + \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + % Process the index entry with all font commands turned off, to + % get the string to sort by. + {\indexnofonts + \edef\temp{\the\toks0}% need full expansion + \xdef\indexsorttmp{\temp}% + }% + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. + \edef\temp{% + \write\writeto{% + \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% + }% + \temp +} + +% Take care of unwanted page breaks/skips around a whatsit: +% +% If a skip is the last thing on the list now, preserve it +% by backing up by \lastskip, doing the \write, then inserting +% the skip again. Otherwise, the whatsit generated by the +% \write or \pdfdest will make \lastskip zero. The result is that +% sequences like this: +% @end defun +% @tindex whatever +% @defun ... +% will have extra space inserted, because the \medbreak in the +% start of the @defun won't see the skip inserted by the @end of +% the previous defun. +% +% But don't do any of this if we're not in vertical mode. We +% don't want to do a \vskip and prematurely end a paragraph. +% +% Avoid page breaks due to these extra skips, too. +% +% But wait, there is a catch there: +% We'll have to check whether \lastskip is zero skip. \ifdim is not +% sufficient for this purpose, as it ignores stretch and shrink parts +% of the skip. The only way seems to be to check the textual +% representation of the skip. +% +% The following is almost like \def\zeroskipmacro{0.0pt} except that +% the ``p'' and ``t'' characters have catcode \other, not 11 (letter). +% +\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} +% +\newskip\whatsitskip +\newcount\whatsitpenalty +% +% ..., ready, GO: +% +\def\safewhatsit#1{\ifhmode + #1% + \else + % \lastskip and \lastpenalty cannot both be nonzero simultaneously. + \whatsitskip = \lastskip + \edef\lastskipmacro{\the\lastskip}% + \whatsitpenalty = \lastpenalty + % + % If \lastskip is nonzero, that means the last item was a + % skip. And since a skip is discardable, that means this + % -\whatsitskip glue we're inserting is preceded by a + % non-discardable item, therefore it is not a potential + % breakpoint, therefore no \nobreak needed. + \ifx\lastskipmacro\zeroskipmacro + \else + \vskip-\whatsitskip + \fi + % + #1% + % + \ifx\lastskipmacro\zeroskipmacro + % If \lastskip was zero, perhaps the last item was a penalty, and + % perhaps it was >=10000, e.g., a \nobreak. In that case, we want + % to re-insert the same penalty (values >10000 are used for various + % signals); since we just inserted a non-discardable item, any + % following glue (such as a \parskip) would be a breakpoint. For example: + % @deffn deffn-whatever + % @vindex index-whatever + % Description. + % would allow a break between the index-whatever whatsit + % and the "Description." paragraph. + \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi + \else + % On the other hand, if we had a nonzero \lastskip, + % this make-up glue would be preceded by a non-discardable item + % (the whatsit from the \write), so we must insert a \nobreak. + \nobreak\vskip\whatsitskip + \fi +\fi} + +% The index entry written in the file actually looks like +% \entry {sortstring}{page}{topic} +% or +% \entry {sortstring}{page}{topic}{subtopic} +% The texindex program reads in these files and writes files +% containing these kinds of lines: +% \initial {c} +% before the first topic whose initial is c +% \entry {topic}{pagelist} +% for a topic that is used without subtopics +% \primary {topic} +% for the beginning of a topic that is used with subtopics +% \secondary {subtopic}{pagelist} +% for each subtopic. + +% Define the user-accessible indexing commands +% @findex, @vindex, @kindex, @cindex. + +\def\findex {\fnindex} +\def\kindex {\kyindex} +\def\cindex {\cpindex} +\def\vindex {\vrindex} +\def\tindex {\tpindex} +\def\pindex {\pgindex} + +\def\cindexsub {\begingroup\obeylines\cindexsub} +{\obeylines % +\gdef\cindexsub "#1" #2^^M{\endgroup % +\dosubind{cp}{#2}{#1}}} + +% Define the macros used in formatting output of the sorted index material. + +% @printindex causes a particular index (the ??s file) to get printed. +% It does not print any chapter heading (usually an @unnumbered). +% +\parseargdef\printindex{\begingroup + \dobreak \chapheadingskip{10000}% + % + \smallfonts \rm + \tolerance = 9500 + \plainfrenchspacing + \everypar = {}% don't want the \kern\-parindent from indentation suppression. + % + % See if the index file exists and is nonempty. + % Change catcode of @ here so that if the index file contains + % \initial {@} + % as its first line, TeX doesn't complain about mismatched braces + % (because it thinks @} is a control sequence). + \catcode`\@ = 11 + \openin 1 \jobname.#1s + \ifeof 1 + % \enddoublecolumns gets confused if there is no text in the index, + % and it loses the chapter title and the aux file entries for the + % index. The easiest way to prevent this problem is to make sure + % there is some text. + \putwordIndexNonexistent + \else + % + % If the index file exists but is empty, then \openin leaves \ifeof + % false. We have to make TeX try to read something from the file, so + % it can discover if there is anything in it. + \read 1 to \temp + \ifeof 1 + \putwordIndexIsEmpty + \else + % Index files are almost Texinfo source, but we use \ as the escape + % character. It would be better to use @, but that's too big a change + % to make right now. + \def\indexbackslash{\backslashcurfont}% + \catcode`\\ = 0 + \escapechar = `\\ + \begindoublecolumns + \input \jobname.#1s + \enddoublecolumns + \fi + \fi + \closein 1 +\endgroup} + +% These macros are used by the sorted index file itself. +% Change them to control the appearance of the index. + +\def\initial#1{{% + % Some minor font changes for the special characters. + \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt + % + % Remove any glue we may have, we'll be inserting our own. + \removelastskip + % + % We like breaks before the index initials, so insert a bonus. + \nobreak + \vskip 0pt plus 3\baselineskip + \penalty 0 + \vskip 0pt plus -3\baselineskip + % + % Typeset the initial. Making this add up to a whole number of + % baselineskips increases the chance of the dots lining up from column + % to column. It still won't often be perfect, because of the stretch + % we need before each entry, but it's better. + % + % No shrink because it confuses \balancecolumns. + \vskip 1.67\baselineskip plus .5\baselineskip + \leftline{\secbf #1}% + % Do our best not to break after the initial. + \nobreak + \vskip .33\baselineskip plus .1\baselineskip +}} + +% \entry typesets a paragraph consisting of the text (#1), dot leaders, and +% then page number (#2) flushed to the right margin. It is used for index +% and table of contents entries. The paragraph is indented by \leftskip. +% +% A straightforward implementation would start like this: +% \def\entry#1#2{... +% But this freezes the catcodes in the argument, and can cause problems to +% @code, which sets - active. This problem was fixed by a kludge--- +% ``-'' was active throughout whole index, but this isn't really right. +% The right solution is to prevent \entry from swallowing the whole text. +% --kasal, 21nov03 +\def\entry{% + \begingroup + % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par + % + % Do not fill out the last line with white space. + \parfillskip = 0in + % + % No extra space above this paragraph. + \parskip = 0in + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent = 2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip = 0pt plus1fil + % + % A bit of stretch before each entry for the benefit of balancing + % columns. + \vskip 0pt plus1pt + % + % When reading the text of entry, convert explicit line breaks + % from @* into spaces. The user might give these in long section + % titles, for instance. + \def\*{\unskip\space\ignorespaces}% + \def\entrybreak{\hfil\break}% + % + % Swallow the left brace of the text (first parameter): + \afterassignment\doentry + \let\temp = +} +\def\entrybreak{\unskip\space\ignorespaces}% +\def\doentry{% + \bgroup % Instead of the swallowed brace. + \noindent + \aftergroup\finishentry + % And now comes the text of the entry. +} +\def\finishentry#1{% + % #1 is the page number. + % + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \setbox\boxA = \hbox{#1}% + \ifdim\wd\boxA = 0pt + \ % + \else + % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ifpdf + \pdfgettoks#1.% + \ \the\toksA + \else + \ #1% + \fi + \fi + \par + \endgroup +} + +% Like plain.tex's \dotfill, except uses up at least 1 em. +\def\indexdotfill{\cleaders + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} + +\def\primary #1{\line{#1\hfil}} + +\newskip\secondaryindent \secondaryindent=0.5cm +\def\secondary#1#2{{% + \parfillskip=0in + \parskip=0in + \hangindent=1in + \hangafter=1 + \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill + \ifpdf + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \else + #2 + \fi + \par +}} + +% Define two-column mode, which we use to typeset indexes. +% Adapted from the TeXbook, page 416, which is to say, +% the manmac.tex format used to print the TeXbook itself. +\catcode`\@=11 + +\newbox\partialpage +\newdimen\doublecolumnhsize + +\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % Grab any single-column material above us. + \output = {% + % + % Here is a possibility not foreseen in manmac: if we accumulate a + % whole lot of material, we might end up calling this \output + % routine twice in a row (see the doublecol-lose test, which is + % essentially a couple of indexes with @setchapternewpage off). In + % that case we just ship out what is in \partialpage with the normal + % output routine. Generally, \partialpage will be empty when this + % runs and this will be a no-op. See the indexspread.tex test case. + \ifvoid\partialpage \else + \onepageout{\pagecontents\partialpage}% + \fi + % + \global\setbox\partialpage = \vbox{% + % Unvbox the main output page. + \unvbox\PAGE + \kern-\topskip \kern\baselineskip + }% + }% + \eject % run that output routine to set \partialpage + % + % Use the double-column output routine for subsequent pages. + \output = {\doublecolumnout}% + % + % Change the page size parameters. We could do this once outside this + % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 + % format, but then we repeat the same computation. Repeating a couple + % of assignments once per index is clearly meaningless for the + % execution time, so we may as well do it in one place. + % + % First we halve the line length, less a little for the gutter between + % the columns. We compute the gutter based on the line length, so it + % changes automatically with the paper format. The magic constant + % below is chosen so that the gutter has the same value (well, +-<1pt) + % as it did when we hard-coded it. + % + % We put the result in a separate register, \doublecolumhsize, so we + % can restore it in \pagesofar, after \hsize itself has (potentially) + % been clobbered. + % + \doublecolumnhsize = \hsize + \advance\doublecolumnhsize by -.04154\hsize + \divide\doublecolumnhsize by 2 + \hsize = \doublecolumnhsize + % + % Double the \vsize as well. (We don't need a separate register here, + % since nobody clobbers \vsize.) + \vsize = 2\vsize +} + +% The double-column output routine for all double-column pages except +% the last. +% +\def\doublecolumnout{% + \splittopskip=\topskip \splitmaxdepth=\maxdepth + % Get the available space for the double columns -- the normal + % (undoubled) page height minus any material left over from the + % previous page. + \dimen@ = \vsize + \divide\dimen@ by 2 + \advance\dimen@ by -\ht\partialpage + % + % box0 will be the left-hand column, box2 the right. + \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ + \onepageout\pagesofar + \unvbox255 + \penalty\outputpenalty +} +% +% Re-output the contents of the output page -- any previous material, +% followed by the two boxes we just split, in box0 and box2. +\def\pagesofar{% + \unvbox\partialpage + % + \hsize = \doublecolumnhsize + \wd0=\hsize \wd2=\hsize + \hbox to\pagewidth{\box0\hfil\box2}% +} +% +% All done with double columns. +\def\enddoublecolumns{% + % The following penalty ensures that the page builder is exercised + % _before_ we change the output routine. This is necessary in the + % following situation: + % + % The last section of the index consists only of a single entry. + % Before this section, \pagetotal is less than \pagegoal, so no + % break occurs before the last section starts. However, the last + % section, consisting of \initial and the single \entry, does not + % fit on the page and has to be broken off. Without the following + % penalty the page builder will not be exercised until \eject + % below, and by that time we'll already have changed the output + % routine to the \balancecolumns version, so the next-to-last + % double-column page will be processed with \balancecolumns, which + % is wrong: The two columns will go to the main vertical list, with + % the broken-off section in the recent contributions. As soon as + % the output routine finishes, TeX starts reconsidering the page + % break. The two columns and the broken-off section both fit on the + % page, because the two columns now take up only half of the page + % goal. When TeX sees \eject from below which follows the final + % section, it invokes the new output routine that we've set after + % \balancecolumns below; \onepageout will try to fit the two columns + % and the final section into the vbox of \pageheight (see + % \pagebody), causing an overfull box. + % + % Note that glue won't work here, because glue does not exercise the + % page builder, unlike penalties (see The TeXbook, pp. 280-281). + \penalty0 + % + \output = {% + % Split the last of the double-column material. Leave it on the + % current page, no automatic page break. + \balancecolumns + % + % If we end up splitting too much material for the current page, + % though, there will be another page break right after this \output + % invocation ends. Having called \balancecolumns once, we do not + % want to call it again. Therefore, reset \output to its normal + % definition right away. (We hope \balancecolumns will never be + % called on to balance too much material, but if it is, this makes + % the output somewhat more palatable.) + \global\output = {\onepageout{\pagecontents\PAGE}}% + }% + \eject + \endgroup % started in \begindoublecolumns + % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize (after the + % \endgroup where \vsize got restored). + \pagegoal = \vsize +} +% +% Called at the end of the double column material. +\def\balancecolumns{% + \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. + \dimen@ = \ht0 + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip + \divide\dimen@ by 2 % target to split to + %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% + \splittopskip = \topskip + % Loop until we get a decent breakpoint. + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht3>\dimen@ + \global\advance\dimen@ by 1pt + \repeat + }% + %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% + \setbox0=\vbox to\dimen@{\unvbox1}% + \setbox2=\vbox to\dimen@{\unvbox3}% + % + \pagesofar +} +\catcode`\@ = \other + + +\message{sectioning,} +% Chapters, sections, etc. + +% Let's start with @part. +\outer\parseargdef\part{\partzzz{#1}} +\def\partzzz#1{% + \chapoddpage + \null + \vskip.3\vsize % move it down on the page a bit + \begingroup + \noindent \titlefonts\rmisbold #1\par % the text + \let\lastnode=\empty % no node to associate with + \writetocentry{part}{#1}{}% but put it in the toc + \headingsoff % no headline or footline on the part page + \chapoddpage + \endgroup +} + +% \unnumberedno is an oxymoron. But we count the unnumbered +% sections so that we can refer to them unambiguously in the pdf +% outlines by their "section number". We avoid collisions with chapter +% numbers by starting them at 10000. (If a document ever has 10000 +% chapters, we're in trouble anyway, I'm sure.) +\newcount\unnumberedno \unnumberedno = 10000 +\newcount\chapno +\newcount\secno \secno=0 +\newcount\subsecno \subsecno=0 +\newcount\subsubsecno \subsubsecno=0 + +% This counter is funny since it counts through charcodes of letters A, B, ... +\newcount\appendixno \appendixno = `\@ +% +% \def\appendixletter{\char\the\appendixno} +% We do the following ugly conditional instead of the above simple +% construct for the sake of pdftex, which needs the actual +% letter in the expansion, not just typeset. +% +\def\appendixletter{% + \ifnum\appendixno=`A A% + \else\ifnum\appendixno=`B B% + \else\ifnum\appendixno=`C C% + \else\ifnum\appendixno=`D D% + \else\ifnum\appendixno=`E E% + \else\ifnum\appendixno=`F F% + \else\ifnum\appendixno=`G G% + \else\ifnum\appendixno=`H H% + \else\ifnum\appendixno=`I I% + \else\ifnum\appendixno=`J J% + \else\ifnum\appendixno=`K K% + \else\ifnum\appendixno=`L L% + \else\ifnum\appendixno=`M M% + \else\ifnum\appendixno=`N N% + \else\ifnum\appendixno=`O O% + \else\ifnum\appendixno=`P P% + \else\ifnum\appendixno=`Q Q% + \else\ifnum\appendixno=`R R% + \else\ifnum\appendixno=`S S% + \else\ifnum\appendixno=`T T% + \else\ifnum\appendixno=`U U% + \else\ifnum\appendixno=`V V% + \else\ifnum\appendixno=`W W% + \else\ifnum\appendixno=`X X% + \else\ifnum\appendixno=`Y Y% + \else\ifnum\appendixno=`Z Z% + % The \the is necessary, despite appearances, because \appendixletter is + % expanded while writing the .toc file. \char\appendixno is not + % expandable, thus it is written literally, thus all appendixes come out + % with the same letter (or @) in the toc without it. + \else\char\the\appendixno + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} + +% Each @chapter defines these (using marks) as the number+name, number +% and name of the chapter. Page headings and footings can use +% these. @section does likewise. +\def\thischapter{} +\def\thischapternum{} +\def\thischaptername{} +\def\thissection{} +\def\thissectionnum{} +\def\thissectionname{} + +\newcount\absseclevel % used to calculate proper heading level +\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count + +% @raisesections: treat @section as chapter, @subsection as section, etc. +\def\raisesections{\global\advance\secbase by -1} +\let\up=\raisesections % original BFox name + +% @lowersections: treat @chapter as section, @section as subsection, etc. +\def\lowersections{\global\advance\secbase by 1} +\let\down=\lowersections % original BFox name + +% we only have subsub. +\chardef\maxseclevel = 3 +% +% A numbered section within an unnumbered changes to unnumbered too. +% To achieve this, remember the "biggest" unnum. sec. we are currently in: +\chardef\unnlevel = \maxseclevel +% +% Trace whether the current chapter is an appendix or not: +% \chapheadtype is "N" or "A", unnumbered chapters are ignored. +\def\chapheadtype{N} + +% Choose a heading macro +% #1 is heading type +% #2 is heading level +% #3 is text for heading +\def\genhead#1#2#3{% + % Compute the abs. sec. level: + \absseclevel=#2 + \advance\absseclevel by \secbase + % Make sure \absseclevel doesn't fall outside the range: + \ifnum \absseclevel < 0 + \absseclevel = 0 + \else + \ifnum \absseclevel > 3 + \absseclevel = 3 + \fi + \fi + % The heading type: + \def\headtype{#1}% + \if \headtype U% + \ifnum \absseclevel < \unnlevel + \chardef\unnlevel = \absseclevel + \fi + \else + % Check for appendix sections: + \ifnum \absseclevel = 0 + \edef\chapheadtype{\headtype}% + \else + \if \headtype A\if \chapheadtype N% + \errmessage{@appendix... within a non-appendix chapter}% + \fi\fi + \fi + % Check for numbered within unnumbered: + \ifnum \absseclevel > \unnlevel + \def\headtype{U}% + \else + \chardef\unnlevel = 3 + \fi + \fi + % Now print the heading: + \if \headtype U% + \ifcase\absseclevel + \unnumberedzzz{#3}% + \or \unnumberedseczzz{#3}% + \or \unnumberedsubseczzz{#3}% + \or \unnumberedsubsubseczzz{#3}% + \fi + \else + \if \headtype A% + \ifcase\absseclevel + \appendixzzz{#3}% + \or \appendixsectionzzz{#3}% + \or \appendixsubseczzz{#3}% + \or \appendixsubsubseczzz{#3}% + \fi + \else + \ifcase\absseclevel + \chapterzzz{#3}% + \or \seczzz{#3}% + \or \numberedsubseczzz{#3}% + \or \numberedsubsubseczzz{#3}% + \fi + \fi + \fi + \suppressfirstparagraphindent +} + +% an interface: +\def\numhead{\genhead N} +\def\apphead{\genhead A} +\def\unnmhead{\genhead U} + +% @chapter, @appendix, @unnumbered. Increment top-level counter, reset +% all lower-level sectioning counters to zero. +% +% Also set \chaplevelprefix, which we prepend to @float sequence numbers +% (e.g., figures), q.v. By default (before any chapter), that is empty. +\let\chaplevelprefix = \empty +% +\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz#1{% + % section resetting is \global in case the chapter is in a group, such + % as an @include file. + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\chapno by 1 + % + % Used for \float. + \gdef\chaplevelprefix{\the\chapno.}% + \resetallfloatnos + % + % \putwordChapter can contain complex things in translations. + \toks0=\expandafter{\putwordChapter}% + \message{\the\toks0 \space \the\chapno}% + % + % Write the actual heading. + \chapmacro{#1}{Ynumbered}{\the\chapno}% + % + % So @section and the like are numbered underneath this chapter. + \global\let\section = \numberedsec + \global\let\subsection = \numberedsubsec + \global\let\subsubsection = \numberedsubsubsec +} + +\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz +% +\def\appendixzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\appendixno by 1 + \gdef\chaplevelprefix{\appendixletter.}% + \resetallfloatnos + % + % \putwordAppendix can contain complex things in translations. + \toks0=\expandafter{\putwordAppendix}% + \message{\the\toks0 \space \appendixletter}% + % + \chapmacro{#1}{Yappendix}{\appendixletter}% + % + \global\let\section = \appendixsec + \global\let\subsection = \appendixsubsec + \global\let\subsubsection = \appendixsubsubsec +} + +% normally unnmhead0 calls unnumberedzzz: +\outer\parseargdef\unnumbered{\unnmhead0{#1}} +\def\unnumberedzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\unnumberedno by 1 + % + % Since an unnumbered has no number, no prefix for figures. + \global\let\chaplevelprefix = \empty + \resetallfloatnos + % + % This used to be simply \message{#1}, but TeX fully expands the + % argument to \message. Therefore, if #1 contained @-commands, TeX + % expanded them. For example, in `@unnumbered The @cite{Book}', TeX + % expanded @cite (which turns out to cause errors because \cite is meant + % to be executed, not expanded). + % + % Anyway, we don't want the fully-expanded definition of @cite to appear + % as a result of the \message, we just want `@cite' itself. We use + % \the to achieve this: TeX expands \the only once, + % simply yielding the contents of . (We also do this for + % the toc entries.) + \toks0 = {#1}% + \message{(\the\toks0)}% + % + \chapmacro{#1}{Ynothing}{\the\unnumberedno}% + % + \global\let\section = \unnumberedsec + \global\let\subsection = \unnumberedsubsec + \global\let\subsubsection = \unnumberedsubsubsec +} + +% @centerchap is like @unnumbered, but the heading is centered. +\outer\parseargdef\centerchap{% + % Well, we could do the following in a group, but that would break + % an assumption that \chapmacro is called at the outermost level. + % Thus we are safer this way: --kasal, 24feb04 + \let\centerparametersmaybe = \centerparameters + \unnmhead0{#1}% + \let\centerparametersmaybe = \relax +} + +% @top is like @unnumbered. +\let\top\unnumbered + +% Sections. +% +\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz +\def\seczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% +} + +% normally calls appendixsectionzzz: +\outer\parseargdef\appendixsection{\apphead1{#1}} +\def\appendixsectionzzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% +} +\let\appendixsec\appendixsection + +% normally calls unnumberedseczzz: +\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} +\def\unnumberedseczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% +} + +% Subsections. +% +% normally calls numberedsubseczzz: +\outer\parseargdef\numberedsubsec{\numhead2{#1}} +\def\numberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% +} + +% normally calls appendixsubseczzz: +\outer\parseargdef\appendixsubsec{\apphead2{#1}} +\def\appendixsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno}% +} + +% normally calls unnumberedsubseczzz: +\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} +\def\unnumberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno}% +} + +% Subsubsections. +% +% normally numberedsubsubseczzz: +\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} +\def\numberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynumbered}% + {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% normally appendixsubsubseczzz: +\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} +\def\appendixsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% normally unnumberedsubsubseczzz: +\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} +\def\unnumberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% These macros control what the section commands do, according +% to what kind of chapter we are in (ordinary, appendix, or unnumbered). +% Define them by default for a numbered chapter. +\let\section = \numberedsec +\let\subsection = \numberedsubsec +\let\subsubsection = \numberedsubsubsec + +% Define @majorheading, @heading and @subheading + +\def\majorheading{% + {\advance\chapheadingskip by 10pt \chapbreak }% + \parsearg\chapheadingzzz +} + +\def\chapheading{\chapbreak \parsearg\chapheadingzzz} +\def\chapheadingzzz#1{% + \vbox{\chapfonts \raggedtitlesettings #1\par}% + \nobreak\bigskip \nobreak + \suppressfirstparagraphindent +} + +% @heading, @subheading, @subsubheading. +\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} + +% These macros generate a chapter, section, etc. heading only +% (including whitespace, linebreaking, etc. around it), +% given all the information in convenient, parsed form. + +% Args are the skip and penalty (usually negative) +\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} + +% Parameter controlling skip before chapter headings (if needed) +\newskip\chapheadingskip + +% Define plain chapter starts, and page on/off switching for it. +\def\chapbreak{\dobreak \chapheadingskip {-4000}} +\def\chappager{\par\vfill\supereject} +% Because \domark is called before \chapoddpage, the filler page will +% get the headings for the next chapter, which is wrong. But we don't +% care -- we just disable all headings on the filler page. +\def\chapoddpage{% + \chappager + \ifodd\pageno \else + \begingroup + \headingsoff + \null + \chappager + \endgroup + \fi +} + +\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} + +\def\CHAPPAGoff{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chapbreak +\global\let\pagealignmacro=\chappager} + +\def\CHAPPAGon{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chappager +\global\let\pagealignmacro=\chappager +\global\def\HEADINGSon{\HEADINGSsingle}} + +\def\CHAPPAGodd{% +\global\let\contentsalignmacro = \chapoddpage +\global\let\pchapsepmacro=\chapoddpage +\global\let\pagealignmacro=\chapoddpage +\global\def\HEADINGSon{\HEADINGSdouble}} + +\CHAPPAGon + +% Chapter opening. +% +% #1 is the text, #2 is the section type (Ynumbered, Ynothing, +% Yappendix, Yomitfromtoc), #3 the chapter number. +% +% To test against our argument. +\def\Ynothingkeyword{Ynothing} +\def\Yomitfromtockeyword{Yomitfromtoc} +\def\Yappendixkeyword{Yappendix} +% +\def\chapmacro#1#2#3{% + % Insert the first mark before the heading break (see notes for \domark). + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% + \gdef\thissection{}}% + % + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{\thischaptername}}% + \else\ifx\temptype\Yomitfromtockeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{}}% + \else\ifx\temptype\Yappendixkeyword + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\appendixletter}% + % \noexpand\putwordAppendix avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} + \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \else + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\the\chapno}% + % \noexpand\putwordChapter avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thischapter{\noexpand\putwordChapter{} + \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \fi\fi\fi + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert the chapter heading break. + \pchapsepmacro + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \domark + % + {% + \chapfonts \rmisbold + % + % Have to define \lastsection before calling \donoderef, because the + % xref code eventually uses it. On the other hand, it has to be called + % after \pchapsepmacro, or the headline will change too soon. + \gdef\lastsection{#1}% + % + % Only insert the separating space if we have a chapter/appendix + % number, and don't print the unnumbered ``number''. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unnchap}% + \else\ifx\temptype\Yomitfromtockeyword + \setbox0 = \hbox{}% contents like unnumbered, but no toc entry + \def\toctype{omit}% + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% + \def\toctype{app}% + \else + \setbox0 = \hbox{#3\enspace}% + \def\toctype{numchap}% + \fi\fi\fi + % + % Write the toc entry for this chapter. Must come before the + % \donoderef, because we include the current node name in the toc + % entry, and \donoderef resets it to empty. + \writetocentry{\toctype}{#1}{#3}% + % + % For pdftex, we have to write out the node definition (aka, make + % the pdfdest) after any page break, but before the actual text has + % been typeset. If the destination for the pdf outline is after the + % text, then jumping from the outline may wind up with the text not + % being visible, for instance under high magnification. + \donoderef{#2}% + % + % Typeset the actual heading. + \nobreak % Avoid page breaks at the interline glue. + \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe + \unhbox0 #1\par}% + }% + \nobreak\bigskip % no page break after a chapter title + \nobreak +} + +% @centerchap -- centered and unnumbered. +\let\centerparametersmaybe = \relax +\def\centerparameters{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt +} + + +% I don't think this chapter style is supported any more, so I'm not +% updating it with the new noderef stuff. We'll see. --karl, 11aug03. +% +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} +% +\def\unnchfopen #1{% + \chapoddpage + \vbox{\chapfonts \raggedtitlesettings #1\par}% + \nobreak\bigskip\nobreak +} +\def\chfopen #1#2{\chapoddpage {\chapfonts +\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% +\par\penalty 5000 % +} +\def\centerchfopen #1{% + \chapoddpage + \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% + \nobreak\bigskip \nobreak +} +\def\CHAPFopen{% + \global\let\chapmacro=\chfopen + \global\let\centerchapmacro=\centerchfopen} + + +% Section titles. These macros combine the section number parts and +% call the generic \sectionheading to do the printing. +% +\newskip\secheadingskip +\def\secheadingbreak{\dobreak \secheadingskip{-1000}} + +% Subsection titles. +\newskip\subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} + +% Subsubsection titles. +\def\subsubsecheadingskip{\subsecheadingskip} +\def\subsubsecheadingbreak{\subsecheadingbreak} + + +% Print any size, any type, section title. +% +% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is +% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the +% section number. +% +\def\seckeyword{sec} +% +\def\sectionheading#1#2#3#4{% + {% + \checkenv{}% should not be in an environment. + % + % Switch to the right set of fonts. + \csname #2fonts\endcsname \rmisbold + % + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + % Insert first mark before the heading break (see notes for \domark). + \let\prevsectiondefs=\lastsectiondefs + \ifx\temptype\Ynothingkeyword + \ifx\sectionlevel\seckeyword + \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% + \gdef\thissection{\thissectionname}}% + \fi + \else\ifx\temptype\Yomitfromtockeyword + % Don't redefine \thissection. + \else\ifx\temptype\Yappendixkeyword + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + % \noexpand\putwordSection avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thissection{\noexpand\putwordSection{} + \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \else + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + % \noexpand\putwordSection avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thissection{\noexpand\putwordSection{} + \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \fi\fi\fi + % + % Go into vertical mode. Usually we'll already be there, but we + % don't want the following whatsit to end up in a preceding paragraph + % if the document didn't happen to have a blank line. + \par + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert space above the heading. + \csname #2headingbreak\endcsname + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \let\prevsectiondefs=\lastsectiondefs + \domark + % + % Only insert the space after the number if we have a section number. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unn}% + \gdef\lastsection{#1}% + \else\ifx\temptype\Yomitfromtockeyword + % for @headings -- no section number, don't include in toc, + % and don't redefine \lastsection. + \setbox0 = \hbox{}% + \def\toctype{omit}% + \let\sectionlevel=\empty + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{#4\enspace}% + \def\toctype{app}% + \gdef\lastsection{#1}% + \else + \setbox0 = \hbox{#4\enspace}% + \def\toctype{num}% + \gdef\lastsection{#1}% + \fi\fi\fi + % + % Write the toc entry (before \donoderef). See comments in \chapmacro. + \writetocentry{\toctype\sectionlevel}{#1}{#4}% + % + % Write the node reference (= pdf destination for pdftex). + % Again, see comments in \chapmacro. + \donoderef{#3}% + % + % Interline glue will be inserted when the vbox is completed. + % That glue will be a valid breakpoint for the page, since it'll be + % preceded by a whatsit (usually from the \donoderef, or from the + % \writetocentry if there was no node). We don't want to allow that + % break, since then the whatsits could end up on page n while the + % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. + \nobreak + % + % Output the actual section heading. + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright + \hangindent=\wd0 % zero if no section number + \unhbox0 #1}% + }% + % Add extra space after the heading -- half of whatever came above it. + % Don't allow stretch, though. + \kern .5 \csname #2headingskip\endcsname + % + % Do not let the kern be a potential breakpoint, as it would be if it + % was followed by glue. + \nobreak + % + % We'll almost certainly start a paragraph next, so don't let that + % glue accumulate. (Not a breakpoint because it's preceded by a + % discardable item.) However, when a paragraph is not started next + % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out + % or the negative glue will cause weirdly wrong output, typically + % obscuring the section heading with something else. + \vskip-\parskip + % + % This is so the last item on the main vertical list is a known + % \penalty > 10000, so \startdefun, etc., can recognize the situation + % and do the needful. + \penalty 10001 +} + + +\message{toc,} +% Table of contents. +\newwrite\tocfile + +% Write an entry to the toc file, opening it if necessary. +% Called from @chapter, etc. +% +% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} +% We append the current node name (if any) and page number as additional +% arguments for the \{chap,sec,...}entry macros which will eventually +% read this. The node name is used in the pdf outlines as the +% destination to jump to. +% +% We open the .toc file for writing here instead of at @setfilename (or +% any other fixed time) so that @contents can be anywhere in the document. +% But if #1 is `omit', then we don't do anything. This is used for the +% table of contents chapter openings themselves. +% +\newif\iftocfileopened +\def\omitkeyword{omit}% +% +\def\writetocentry#1#2#3{% + \edef\writetoctype{#1}% + \ifx\writetoctype\omitkeyword \else + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + % + \iflinks + {\atdummies + \edef\temp{% + \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% + \temp + }% + \fi + \fi + % + % Tell \shipout to create a pdf destination on each page, if we're + % writing pdf. These are used in the table of contents. We can't + % just write one on every page because the title pages are numbered + % 1 and 2 (the page numbers aren't printed), and so are the first + % two pages of the document. Thus, we'd have two destinations named + % `1', and two named `2'. + \ifpdf \global\pdfmakepagedesttrue \fi +} + + +% These characters do not print properly in the Computer Modern roman +% fonts, so we must take special care. This is more or less redundant +% with the Texinfo input format setup at the end of this file. +% +\def\activecatcodes{% + \catcode`\"=\active + \catcode`\$=\active + \catcode`\<=\active + \catcode`\>=\active + \catcode`\\=\active + \catcode`\^=\active + \catcode`\_=\active + \catcode`\|=\active + \catcode`\~=\active +} + + +% Read the toc file, which is essentially Texinfo input. +\def\readtocfile{% + \setupdatafile + \activecatcodes + \input \tocreadfilename +} + +\newskip\contentsrightmargin \contentsrightmargin=1in +\newcount\savepageno +\newcount\lastnegativepageno \lastnegativepageno = -1 + +% Prepare to read what we've written to \tocfile. +% +\def\startcontents#1{% + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund + \contentsalignmacro + \immediate\closeout\tocfile + % + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \chapmacro{#1}{Yomitfromtoc}{}% + % + \savepageno = \pageno + \begingroup % Set up to handle contents files properly. + \raggedbottom % Worry more about breakpoints than the bottom. + \advance\hsize by -\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi +} + +% redefined for the two-volume lispref. We always output on +% \jobname.toc even if this is redefined. +% +\def\tocreadfilename{\jobname.toc} + +% Normal (long) toc. +% +\def\contents{% + \startcontents{\putwordTOC}% + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \ifeof 1 \else + \pdfmakeoutlines + \fi + \closein 1 + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} + +% And just the chapters. +\def\summarycontents{% + \startcontents{\putwordShortTOC}% + % + \let\partentry = \shortpartentry + \let\numchapentry = \shortchapentry + \let\appentry = \shortchapentry + \let\unnchapentry = \shortunnchapentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf + \let\sl=\shortcontsl \let\tt=\shortconttt + \rm + \hyphenpenalty = 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\numsecentry##1##2##3##4{} + \let\appsecentry = \numsecentry + \let\unnsecentry = \numsecentry + \let\numsubsecentry = \numsecentry + \let\appsubsecentry = \numsecentry + \let\unnsubsecentry = \numsecentry + \let\numsubsubsecentry = \numsecentry + \let\appsubsubsecentry = \numsecentry + \let\unnsubsubsecentry = \numsecentry + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \closein 1 + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} +\let\shortcontents = \summarycontents + +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g., `A' for an appendix, or `3' for a chapter. +% +\def\shortchaplabel#1{% + % This space should be enough, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % But use \hss just in case. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in by \shortchapentry above.) + % + % We'd like to right-justify chapter numbers, but that looks strange + % with appendix letters. And right-justifying numbers and + % left-justifying letters looks strange when there is less than 10 + % chapters. Have to read the whole toc once to know how many chapters + % there are before deciding ... + \hbox to 1em{#1\hss}% +} + +% These macros generate individual entries in the table of contents. +% The first argument is the chapter or section name. +% The last argument is the page number. +% The arguments in between are the chapter number, section number, ... + +% Parts, in the main contents. Replace the part number, which doesn't +% exist, with an empty box. Let's hope all the numbers have the same width. +% Also ignore the page number, which is conventionally not printed. +\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} +\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} +% +% Parts, in the short toc. +\def\shortpartentry#1#2#3#4{% + \penalty-300 + \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip + \shortchapentry{{\bf #1}}{\numeralbox}{}{}% +} + +% Chapters, in the main contents. +\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} +% +% Chapters, in the short toc. +% See comments in \dochapentry re vbox and related settings. +\def\shortchapentry#1#2#3#4{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% +} + +% Appendices, in the main contents. +% Need the word Appendix, and a fixed-size box. +% +\def\appendixbox#1{% + % We use M since it's probably the widest letter. + \setbox0 = \hbox{\putwordAppendix{} M}% + \hbox to \wd0{\putwordAppendix{} #1\hss}} +% +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} + +% Unnumbered chapters. +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} + +% Sections. +\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} +\let\appsecentry=\numsecentry +\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} + +% Subsections. +\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} +\let\appsubsecentry=\numsubsecentry +\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} + +% And subsubsections. +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} +\let\appsubsubsecentry=\numsubsubsecentry +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} + +% This parameter controls the indentation of the various levels. +% Same as \defaultparindent. +\newdimen\tocindent \tocindent = 15pt + +% Now for the actual typesetting. In all these, #1 is the text and #2 is the +% page number. +% +% If the toc has to be broken over pages, we want it to be at chapters +% if at all possible; hence the \penalty. +\def\dochapentry#1#2{% + \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip + \begingroup + \chapentryfonts + \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \endgroup + \nobreak\vskip .25\baselineskip plus.1\baselineskip +} + +\def\dosecentry#1#2{\begingroup + \secentryfonts \leftskip=\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsecentry#1#2{\begingroup + \subsecentryfonts \leftskip=2\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsubsecentry#1#2{\begingroup + \subsubsecentryfonts \leftskip=3\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +% We use the same \entry macro as for the index entries. +\let\tocentry = \entry + +% Space between chapter (or whatever) number and the title. +\def\labelspace{\hskip1em \relax} + +\def\dopageno#1{{\rm #1}} +\def\doshortpageno#1{{\rm #1}} + +\def\chapentryfonts{\secfonts \rm} +\def\secentryfonts{\textfonts} +\def\subsecentryfonts{\textfonts} +\def\subsubsecentryfonts{\textfonts} + + +\message{environments,} +% @foo ... @end foo. + +% @tex ... @end tex escapes into raw TeX temporarily. +% One exception: @ is still an escape character, so that @end tex works. +% But \@ or @@ will get a plain @ character. + +\envdef\tex{% + \setupmarkupstyle{tex}% + \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 + \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 + \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie + \catcode `\%=14 + \catcode `\+=\other + \catcode `\"=\other + \catcode `\|=\other + \catcode `\<=\other + \catcode `\>=\other + \catcode`\`=\other + \catcode`\'=\other + \escapechar=`\\ + % + % ' is active in math mode (mathcode"8000). So reset it, and all our + % other math active characters (just in case), to plain's definitions. + \mathactive + % + \let\b=\ptexb + \let\bullet=\ptexbullet + \let\c=\ptexc + \let\,=\ptexcomma + \let\.=\ptexdot + \let\dots=\ptexdots + \let\equiv=\ptexequiv + \let\!=\ptexexclam + \let\i=\ptexi + \let\indent=\ptexindent + \let\noindent=\ptexnoindent + \let\{=\ptexlbrace + \let\+=\tabalign + \let\}=\ptexrbrace + \let\/=\ptexslash + \let\*=\ptexstar + \let\t=\ptext + \expandafter \let\csname top\endcsname=\ptextop % outer + \let\frenchspacing=\plainfrenchspacing + % + \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% + \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% + \def\@{@}% +} +% There is no need to define \Etex. + +% Define @lisp ... @end lisp. +% @lisp environment forms a group so it can rebind things, +% including the definition of @end lisp (which normally is erroneous). + +% Amount to narrow the margins by for @lisp. +\newskip\lispnarrowing \lispnarrowing=0.4in + +% This is the definition that ^^M gets inside @lisp, @example, and other +% such environments. \null is better than a space, since it doesn't +% have any width. +\def\lisppar{\null\endgraf} + +% This space is always present above and below environments. +\newskip\envskipamount \envskipamount = 0pt + +% Make spacing and below environment symmetrical. We use \parskip here +% to help in doing that, since in @example-like environments \parskip +% is reset to zero; thus the \afterenvbreak inserts no space -- but the +% start of the next paragraph will insert \parskip. +% +\def\aboveenvbreak{{% + % =10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. + \ifnum \lastpenalty=10000 \else + \advance\envskipamount by \parskip + \endgraf + \ifdim\lastskip<\envskipamount + \removelastskip + % it's not a good place to break if the last penalty was \nobreak + % or better ... + \ifnum\lastpenalty<10000 \penalty-50 \fi + \vskip\envskipamount + \fi + \fi +}} + +\let\afterenvbreak = \aboveenvbreak + +% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will +% also clear it, so that its embedded environments do the narrowing again. +\let\nonarrowing=\relax + +% @cartouche ... @end cartouche: draw rectangle w/rounded corners around +% environment contents. +\font\circle=lcircle10 +\newdimen\circthick +\newdimen\cartouter\newdimen\cartinner +\newskip\normbskip\newskip\normpskip\newskip\normlskip +\circthick=\fontdimen8\circle +% +\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth +\def\ctr{{\hskip 6pt\circle\char'010}} +\def\cbl{{\circle\char'012\hskip -6pt}} +\def\cbr{{\hskip 6pt\circle\char'011}} +\def\carttop{\hbox to \cartouter{\hskip\lskip + \ctl\leaders\hrule height\circthick\hfil\ctr + \hskip\rskip}} +\def\cartbot{\hbox to \cartouter{\hskip\lskip + \cbl\leaders\hrule height\circthick\hfil\cbr + \hskip\rskip}} +% +\newskip\lskip\newskip\rskip + +\envdef\cartouche{% + \ifhmode\par\fi % can't be in the midst of a paragraph. + \startsavinginserts + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt % we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18.4pt % allow for 3pt kerns on either + % side, and for 6pt waste from + % each corner char, and rule thickness + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing = t% + % + % If this cartouche directly follows a sectioning command, we need the + % \parskip glue (backspaced over by default) or the cartouche can + % collide with the section heading. + \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi + % + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \kern3pt + \hsize=\cartinner + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip + \comment % For explanation, see the end of def\group. +} +\def\Ecartouche{% + \ifhmode\par\fi + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup + \checkinserts +} + + +% This macro is called at the beginning of all the @example variants, +% inside a group. +\newdimen\nonfillparindent +\def\nonfillstart{% + \aboveenvbreak + \hfuzz = 12pt % Don't be fussy + \sepspaces % Make spaces be word-separators rather than space tokens. + \let\par = \lisppar % don't ignore blank lines + \obeylines % each line of input is a line of output + \parskip = 0pt + % Turn off paragraph indentation but redefine \indent to emulate + % the normal \indent. + \nonfillparindent=\parindent + \parindent = 0pt + \let\indent\nonfillindent + % + \emergencystretch = 0pt % don't try to avoid overfull boxes + \ifx\nonarrowing\relax + \advance \leftskip by \lispnarrowing + \exdentamount=\lispnarrowing + \else + \let\nonarrowing = \relax + \fi + \let\exdent=\nofillexdent +} + +\begingroup +\obeyspaces +% We want to swallow spaces (but not other tokens) after the fake +% @indent in our nonfill-environments, where spaces are normally +% active and set to @tie, resulting in them not being ignored after +% @indent. +\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% +\gdef\nonfillindentcheck{% +\ifx\temp % +\expandafter\nonfillindentgobble% +\else% +\leavevmode\nonfillindentbox% +\fi% +}% +\endgroup +\def\nonfillindentgobble#1{\nonfillindent} +\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} + +% If you want all examples etc. small: @set dispenvsize small. +% If you want even small examples the full size: @set dispenvsize nosmall. +% This affects the following displayed environments: +% @example, @display, @format, @lisp +% +\def\smallword{small} +\def\nosmallword{nosmall} +\let\SETdispenvsize\relax +\def\setnormaldispenv{% + \ifx\SETdispenvsize\smallword + % end paragraph for sake of leading, in case document has no blank + % line. This is redundant with what happens in \aboveenvbreak, but + % we need to do it before changing the fonts, and it's inconvenient + % to change the fonts afterward. + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} +\def\setsmalldispenv{% + \ifx\SETdispenvsize\nosmallword + \else + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} + +% We often define two environments, @foo and @smallfoo. +% Let's do it in one command. #1 is the env name, #2 the definition. +\def\makedispenvdef#1#2{% + \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% + \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% + \expandafter\let\csname E#1\endcsname \afterenvbreak + \expandafter\let\csname Esmall#1\endcsname \afterenvbreak +} + +% Define two environment synonyms (#1 and #2) for an environment. +\def\maketwodispenvdef#1#2#3{% + \makedispenvdef{#1}{#3}% + \makedispenvdef{#2}{#3}% +} +% +% @lisp: indented, narrowed, typewriter font; +% @example: same as @lisp. +% +% @smallexample and @smalllisp: use smaller fonts. +% Originally contributed by Pavel@xerox. +% +\maketwodispenvdef{lisp}{example}{% + \nonfillstart + \tt\setupmarkupstyle{example}% + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return +} +% @display/@smalldisplay: same as @lisp except keep current font. +% +\makedispenvdef{display}{% + \nonfillstart + \gobble +} + +% @format/@smallformat: same as @display except don't narrow margins. +% +\makedispenvdef{format}{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} + +% @flushleft: same as @format, but doesn't obey \SETdispenvsize. +\envdef\flushleft{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} +\let\Eflushleft = \afterenvbreak + +% @flushright. +% +\envdef\flushright{% + \let\nonarrowing = t% + \nonfillstart + \advance\leftskip by 0pt plus 1fill\relax + \gobble +} +\let\Eflushright = \afterenvbreak + + +% @raggedright does more-or-less normal line breaking but no right +% justification. From plain.tex. +\envdef\raggedright{% + \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax +} +\let\Eraggedright\par + +\envdef\raggedleft{% + \parindent=0pt \leftskip0pt plus2em + \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt + \hbadness=10000 % Last line will usually be underfull, so turn off + % badness reporting. +} +\let\Eraggedleft\par + +\envdef\raggedcenter{% + \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em + \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt + \hbadness=10000 % Last line will usually be underfull, so turn off + % badness reporting. +} +\let\Eraggedcenter\par + + +% @quotation does normal linebreaking (hence we can't use \nonfillstart) +% and narrows the margins. We keep \parskip nonzero in general, since +% we're doing normal filling. So, when using \aboveenvbreak and +% \afterenvbreak, temporarily make \parskip 0. +% +\makedispenvdef{quotation}{\quotationstart} +% +\def\quotationstart{% + \indentedblockstart % same as \indentedblock, but increase right margin too. + \ifx\nonarrowing\relax + \advance\rightskip by \lispnarrowing + \fi + \parsearg\quotationlabel +} + +% We have retained a nonzero parskip for the environment, since we're +% doing normal filling. +% +\def\Equotation{% + \par + \ifx\quotationauthor\thisisundefined\else + % indent a bit. + \leftline{\kern 2\leftskip \sl ---\quotationauthor}% + \fi + {\parskip=0pt \afterenvbreak}% +} +\def\Esmallquotation{\Equotation} + +% If we're given an argument, typeset it in bold with a colon after. +\def\quotationlabel#1{% + \def\temp{#1}% + \ifx\temp\empty \else + {\bf #1: }% + \fi +} + +% @indentedblock is like @quotation, but indents only on the left and +% has no optional argument. +% +\makedispenvdef{indentedblock}{\indentedblockstart} +% +\def\indentedblockstart{% + {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip + \parindent=0pt + % + % @cartouche defines \nonarrowing to inhibit narrowing at next level down. + \ifx\nonarrowing\relax + \advance\leftskip by \lispnarrowing + \exdentamount = \lispnarrowing + \else + \let\nonarrowing = \relax + \fi +} + +% Keep a nonzero parskip for the environment, since we're doing normal filling. +% +\def\Eindentedblock{% + \par + {\parskip=0pt \afterenvbreak}% +} +\def\Esmallindentedblock{\Eindentedblock} + + +% LaTeX-like @verbatim...@end verbatim and @verb{...} +% If we want to allow any as delimiter, +% we need the curly braces so that makeinfo sees the @verb command, eg: +% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org +% +% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. +% +% [Knuth] p.344; only we need to do the other characters Texinfo sets +% active too. Otherwise, they get lost as the first character on a +% verbatim line. +\def\dospecials{% + \do\ \do\\\do\{\do\}\do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% + \do\<\do\>\do\|\do\@\do+\do\"% + % Don't do the quotes -- if we do, @set txicodequoteundirected and + % @set txicodequotebacktick will not have effect on @verb and + % @verbatim, and ?` and !` ligatures won't get disabled. + %\do\`\do\'% +} +% +% [Knuth] p. 380 +\def\uncatcodespecials{% + \def\do##1{\catcode`##1=\other}\dospecials} +% +% Setup for the @verb command. +% +% Eight spaces for a tab +\begingroup + \catcode`\^^I=\active + \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} +\endgroup +% +\def\setupverb{% + \tt % easiest (and conventionally used) font for verbatim + \def\par{\leavevmode\endgraf}% + \setupmarkupstyle{verb}% + \tabeightspaces + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces +} + +% Setup for the @verbatim environment +% +% Real tab expansion. +\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount +% +% We typeset each line of the verbatim in an \hbox, so we can handle +% tabs. The \global is in case the verbatim line starts with an accent, +% or some other command that starts with a begin-group. Otherwise, the +% entire \verbbox would disappear at the corresponding end-group, before +% it is typeset. Meanwhile, we can't have nested verbatim commands +% (can we?), so the \global won't be overwriting itself. +\newbox\verbbox +\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} +% +\begingroup + \catcode`\^^I=\active + \gdef\tabexpand{% + \catcode`\^^I=\active + \def^^I{\leavevmode\egroup + \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab + \divide\dimen\verbbox by\tabw + \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw + \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw + \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox + }% + } +\endgroup + +% start the verbatim environment. +\def\setupverbatim{% + \let\nonarrowing = t% + \nonfillstart + \tt % easiest (and conventionally used) font for verbatim + % The \leavevmode here is for blank lines. Otherwise, we would + % never \starttabox and the \egroup would end verbatim mode. + \def\par{\leavevmode\egroup\box\verbbox\endgraf}% + \tabexpand + \setupmarkupstyle{verbatim}% + % Respect line breaks, + % print special symbols as themselves, and + % make each space count. + % Must do in this order: + \obeylines \uncatcodespecials \sepspaces + \everypar{\starttabbox}% +} + +% Do the @verb magic: verbatim text is quoted by unique +% delimiter characters. Before first delimiter expect a +% right brace, after last delimiter expect closing brace: +% +% \def\doverb'{'#1'}'{#1} +% +% [Knuth] p. 382; only eat outer {} +\begingroup + \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other + \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] +\endgroup +% +\def\verb{\begingroup\setupverb\doverb} +% +% +% Do the @verbatim magic: define the macro \doverbatim so that +% the (first) argument ends when '@end verbatim' is reached, ie: +% +% \def\doverbatim#1@end verbatim{#1} +% +% For Texinfo it's a lot easier than for LaTeX, +% because texinfo's \verbatim doesn't stop at '\end{verbatim}': +% we need not redefine '\', '{' and '}'. +% +% Inspired by LaTeX's verbatim command set [latex.ltx] +% +\begingroup + \catcode`\ =\active + \obeylines % + % ignore everything up to the first ^^M, that's the newline at the end + % of the @verbatim input line itself. Otherwise we get an extra blank + % line in the output. + \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + % We really want {...\end verbatim} in the body of the macro, but + % without the active space; thus we have to use \xdef and \gobble. +\endgroup +% +\envdef\verbatim{% + \setupverbatim\doverbatim +} +\let\Everbatim = \afterenvbreak + + +% @verbatiminclude FILE - insert text of file in verbatim environment. +% +\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} +% +\def\doverbatiminclude#1{% + {% + \makevalueexpandable + \setupverbatim + \indexnofonts % Allow `@@' and other weird things in file names. + \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% + \input #1 + \afterenvbreak + }% +} + +% @copying ... @end copying. +% Save the text away for @insertcopying later. +% +% We save the uninterpreted tokens, rather than creating a box. +% Saving the text in a box would be much easier, but then all the +% typesetting commands (@smallbook, font changes, etc.) have to be done +% beforehand -- and a) we want @copying to be done first in the source +% file; b) letting users define the frontmatter in as flexible order as +% possible is very desirable. +% +\def\copying{\checkenv{}\begingroup\scanargctxt\docopying} +\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} +% +\def\insertcopying{% + \begingroup + \parindent = 0pt % paragraph indentation looks wrong on title page + \scanexp\copyingtext + \endgroup +} + + +\message{defuns,} +% @defun etc. + +\newskip\defbodyindent \defbodyindent=.4in +\newskip\defargsindent \defargsindent=50pt +\newskip\deflastargmargin \deflastargmargin=18pt +\newcount\defunpenalty + +% Start the processing of @deffn: +\def\startdefun{% + \ifnum\lastpenalty<10000 + \medbreak + \defunpenalty=10003 % Will keep this @deffn together with the + % following @def command, see below. + \else + % If there are two @def commands in a row, we'll have a \nobreak, + % which is there to keep the function description together with its + % header. But if there's nothing but headers, we need to allow a + % break somewhere. Check specifically for penalty 10002, inserted + % by \printdefunline, instead of 10000, since the sectioning + % commands also insert a nobreak penalty, and we don't want to allow + % a break between a section heading and a defun. + % + % As a further refinement, we avoid "club" headers by signalling + % with penalty of 10003 after the very first @deffn in the + % sequence (see above), and penalty of 10002 after any following + % @def command. + \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi + % + % Similarly, after a section heading, do not allow a break. + % But do insert the glue. + \medskip % preceded by discardable penalty, so not a breakpoint + \fi + % + \parindent=0in + \advance\leftskip by \defbodyindent + \exdentamount=\defbodyindent +} + +\def\dodefunx#1{% + % First, check whether we are in the right environment: + \checkenv#1% + % + % As above, allow line break if we have multiple x headers in a row. + % It's not a great place, though. + \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi + % + % And now, it's time to reuse the body of the original defun: + \expandafter\gobbledefun#1% +} +\def\gobbledefun#1\startdefun{} + +% \printdefunline \deffnheader{text} +% +\def\printdefunline#1#2{% + \begingroup + % call \deffnheader: + #1#2 \endheader + % common ending: + \interlinepenalty = 10000 + \advance\rightskip by 0pt plus 1fil\relax + \endgraf + \nobreak\vskip -\parskip + \penalty\defunpenalty % signal to \startdefun and \dodefunx + % Some of the @defun-type tags do not enable magic parentheses, + % rendering the following check redundant. But we don't optimize. + \checkparencounts + \endgroup +} + +\def\Edefun{\endgraf\medbreak} + +% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; +% the only thing remaining is to define \deffnheader. +% +\def\makedefun#1{% + \expandafter\let\csname E#1\endcsname = \Edefun + \edef\temp{\noexpand\domakedefun + \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% + \temp +} + +% \domakedefun \deffn \deffnx \deffnheader +% +% Define \deffn and \deffnx, without parameters. +% \deffnheader has to be defined explicitly. +% +\def\domakedefun#1#2#3{% + \envdef#1{% + \startdefun + \doingtypefnfalse % distinguish typed functions from all else + \parseargusing\activeparens{\printdefunline#3}% + }% + \def#2{\dodefunx#1}% + \def#3% +} + +\newif\ifdoingtypefn % doing typed function? +\newif\ifrettypeownline % typeset return type on its own line? + +% @deftypefnnewline on|off says whether the return type of typed functions +% are printed on their own line. This affects @deftypefn, @deftypefun, +% @deftypeop, and @deftypemethod. +% +\parseargdef\deftypefnnewline{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxideftypefnnl\endcsname + = \empty + \else\ifx\temp\offword + \expandafter\let\csname SETtxideftypefnnl\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @txideftypefnnl value `\temp', + must be on|off}% + \fi\fi +} + +% Untyped functions: + +% @deffn category name args +\makedefun{deffn}{\deffngeneral{}} + +% @deffn category class name args +\makedefun{defop}#1 {\defopon{#1\ \putwordon}} + +% \defopon {category on}class name args +\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deffngeneral {subind}category name args +% +\def\deffngeneral#1#2 #3 #4\endheader{% + % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. + \dosubind{fn}{\code{#3}}{#1}% + \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% +} + +% Typed functions: + +% @deftypefn category type name args +\makedefun{deftypefn}{\deftypefngeneral{}} + +% @deftypeop category class type name args +\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} + +% \deftypeopon {category on}class type name args +\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deftypefngeneral {subind}category type name args +% +\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% + \dosubind{fn}{\code{#4}}{#1}% + \doingtypefntrue + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +% Typed variables: + +% @deftypevr category type var args +\makedefun{deftypevr}{\deftypecvgeneral{}} + +% @deftypecv category class type var args +\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} + +% \deftypecvof {category of}class type var args +\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } + +% \deftypecvgeneral {subind}category type var args +% +\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% + \dosubind{vr}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +% Untyped variables: + +% @defvr category var args +\makedefun{defvr}#1 {\deftypevrheader{#1} {} } + +% @defcv category class var args +\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} + +% \defcvof {category of}class var args +\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } + +% Types: + +% @deftp category name args +\makedefun{deftp}#1 #2 #3\endheader{% + \doind{tp}{\code{#2}}% + \defname{#1}{}{#2}\defunargs{#3\unskip}% +} + +% Remaining @defun-like shortcuts: +\makedefun{defun}{\deffnheader{\putwordDeffunc} } +\makedefun{defmac}{\deffnheader{\putwordDefmac} } +\makedefun{defspec}{\deffnheader{\putwordDefspec} } +\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } +\makedefun{defvar}{\defvrheader{\putwordDefvar} } +\makedefun{defopt}{\defvrheader{\putwordDefopt} } +\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } +\makedefun{defmethod}{\defopon\putwordMethodon} +\makedefun{deftypemethod}{\deftypeopon\putwordMethodon} +\makedefun{defivar}{\defcvof\putwordInstanceVariableof} +\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} + +% \defname, which formats the name of the @def (not the args). +% #1 is the category, such as "Function". +% #2 is the return type, if any. +% #3 is the function name. +% +% We are followed by (but not passed) the arguments, if any. +% +\def\defname#1#2#3{% + \par + % Get the values of \leftskip and \rightskip as they were outside the @def... + \advance\leftskip by -\defbodyindent + % + % Determine if we are typesetting the return type of a typed function + % on a line by itself. + \rettypeownlinefalse + \ifdoingtypefn % doing a typed function specifically? + % then check user option for putting return type on its own line: + \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else + \rettypeownlinetrue + \fi + \fi + % + % How we'll format the category name. Putting it in brackets helps + % distinguish it from the body text that may end up on the next line + % just below it. + \def\temp{#1}% + \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} + % + % Figure out line sizes for the paragraph shape. We'll always have at + % least two. + \tempnum = 2 + % + % The first line needs space for \box0; but if \rightskip is nonzero, + % we need only space for the part of \box0 which exceeds it: + \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip + % + % If doing a return type on its own line, we'll have another line. + \ifrettypeownline + \advance\tempnum by 1 + \def\maybeshapeline{0in \hsize}% + \else + \def\maybeshapeline{}% + \fi + % + % The continuations: + \dimen2=\hsize \advance\dimen2 by -\defargsindent + % + % The final paragraph shape: + \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 + % + % Put the category name at the right margin. + \noindent + \hbox to 0pt{% + \hfil\box0 \kern-\hsize + % \hsize has to be shortened this way: + \kern\leftskip + % Intentionally do not respect \rightskip, since we need the space. + }% + % + % Allow all lines to be underfull without complaint: + \tolerance=10000 \hbadness=10000 + \exdentamount=\defbodyindent + {% + % defun fonts. We use typewriter by default (used to be bold) because: + % . we're printing identifiers, they should be in tt in principle. + % . in languages with many accents, such as Czech or French, it's + % common to leave accents off identifiers. The result looks ok in + % tt, but exceedingly strange in rm. + % . we don't want -- and --- to be treated as ligatures. + % . this still does not fix the ?` and !` ligatures, but so far no + % one has made identifiers using them :). + \df \tt + \def\temp{#2}% text of the return type + \ifx\temp\empty\else + \tclose{\temp}% typeset the return type + \ifrettypeownline + % put return type on its own line; prohibit line break following: + \hfil\vadjust{\nobreak}\break + \else + \space % type on same line, so just followed by a space + \fi + \fi % no return type + #3% output function name + }% + {\rm\enskip}% hskip 0.5 em of \tenrm + % + \boldbrax + % arguments will be output next, if any. +} + +% Print arguments in slanted roman (not ttsl), inconsistently with using +% tt for the name. This is because literal text is sometimes needed in +% the argument list (groff manual), and ttsl and tt are not very +% distinguishable. Prevent hyphenation at `-' chars. +% +\def\defunargs#1{% + % use sl by default (not ttsl), + % tt for the names. + \df \sl \hyphenchar\font=0 + % + % On the other hand, if an argument has two dashes (for instance), we + % want a way to get ttsl. We used to recommend @var for that, so + % leave the code in, but it's strange for @var to lead to typewriter. + % Nowadays we recommend @code, since the difference between a ttsl hyphen + % and a tt hyphen is pretty tiny. @code also disables ?` !`. + \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% + #1% + \sl\hyphenchar\font=45 +} + +% We want ()&[] to print specially on the defun line. +% +\def\activeparens{% + \catcode`\(=\active \catcode`\)=\active + \catcode`\[=\active \catcode`\]=\active + \catcode`\&=\active +} + +% Make control sequences which act like normal parenthesis chars. +\let\lparen = ( \let\rparen = ) + +% Be sure that we always have a definition for `(', etc. For example, +% if the fn name has parens in it, \boldbrax will not be in effect yet, +% so TeX would otherwise complain about undefined control sequence. +{ + \activeparens + \global\let(=\lparen \global\let)=\rparen + \global\let[=\lbrack \global\let]=\rbrack + \global\let& = \& + + \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} + \gdef\magicamp{\let&=\amprm} +} + +\newcount\parencount + +% If we encounter &foo, then turn on ()-hacking afterwards +\newif\ifampseen +\def\amprm#1 {\ampseentrue{\bf\ }} + +\def\parenfont{% + \ifampseen + % At the first level, print parens in roman, + % otherwise use the default font. + \ifnum \parencount=1 \rm \fi + \else + % The \sf parens (in \boldbrax) actually are a little bolder than + % the contained text. This is especially needed for [ and ] . + \sf + \fi +} +\def\infirstlevel#1{% + \ifampseen + \ifnum\parencount=1 + #1% + \fi + \fi +} +\def\bfafterword#1 {#1 \bf} + +\def\opnr{% + \global\advance\parencount by 1 + {\parenfont(}% + \infirstlevel \bfafterword +} +\def\clnr{% + {\parenfont)}% + \infirstlevel \sl + \global\advance\parencount by -1 +} + +\newcount\brackcount +\def\lbrb{% + \global\advance\brackcount by 1 + {\bf[}% +} +\def\rbrb{% + {\bf]}% + \global\advance\brackcount by -1 +} + +\def\checkparencounts{% + \ifnum\parencount=0 \else \badparencount \fi + \ifnum\brackcount=0 \else \badbrackcount \fi +} +% these should not use \errmessage; the glibc manual, at least, actually +% has such constructs (when documenting function pointers). +\def\badparencount{% + \message{Warning: unbalanced parentheses in @def...}% + \global\parencount=0 +} +\def\badbrackcount{% + \message{Warning: unbalanced square brackets in @def...}% + \global\brackcount=0 +} + + +\message{macros,} +% @macro. + +% To do this right we need a feature of e-TeX, \scantokens, +% which we arrange to emulate with a temporary file in ordinary TeX. +\ifx\eTeXversion\thisisundefined + \newwrite\macscribble + \def\scantokens#1{% + \toks0={#1}% + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \input \jobname.tmp + } +\fi + +\def\scanmacro#1{\begingroup + \newlinechar`\^^M + \let\xeatspaces\eatspaces + % + % Undo catcode changes of \startcontents and \doprintindex + % When called from @insertcopying or (short)caption, we need active + % backslash to get it printed correctly. Previously, we had + % \catcode`\\=\other instead. We'll see whether a problem appears + % with macro expansion. --kasal, 19aug04 + \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ + % + % ... and for \example: + \spaceisspace + % + % The \empty here causes a following catcode 5 newline to be eaten as + % part of reading whitespace after a control sequence. It does not + % eat a catcode 13 newline. There's no good way to handle the two + % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX + % would then have different behavior). See the Macro Details node in + % the manual for the workaround we recommend for macros and + % line-oriented commands. + % + \scantokens{#1\empty}% +\endgroup} + +\def\scanexp#1{% + \edef\temp{\noexpand\scanmacro{#1}}% + \temp +} + +\newcount\paramno % Count of parameters +\newtoks\macname % Macro name +\newif\ifrecursive % Is it recursive? + +% List of all defined macros in the form +% \definedummyword\macro1\definedummyword\macro2... +% Currently is also contains all @aliases; the list can be split +% if there is a need. +\def\macrolist{} + +% Add the macro to \macrolist +\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} +\def\addtomacrolistxxx#1{% + \toks0 = \expandafter{\macrolist\definedummyword#1}% + \xdef\macrolist{\the\toks0}% +} + +% Utility routines. +% This does \let #1 = #2, with \csnames; that is, +% \let \csname#1\endcsname = \csname#2\endcsname +% (except of course we have to play expansion games). +% +\def\cslet#1#2{% + \expandafter\let + \csname#1\expandafter\endcsname + \csname#2\endcsname +} + +% Trim leading and trailing spaces off a string. +% Concepts from aro-bend problem 15 (see CTAN). +{\catcode`\@=11 +\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} +\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} +\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} +\def\unbrace#1{#1} +\unbrace{\gdef\trim@@@ #1 } #2@{#1} +} + +% Trim a single trailing ^^M off a string. +{\catcode`\^^M=\other \catcode`\Q=3% +\gdef\eatcr #1{\eatcra #1Q^^MQ}% +\gdef\eatcra#1^^MQ{\eatcrb#1Q}% +\gdef\eatcrb#1Q#2Q{#1}% +} + +% Macro bodies are absorbed as an argument in a context where +% all characters are catcode 10, 11 or 12, except \ which is active +% (as in normal texinfo). It is necessary to change the definition of \ +% to recognize macro arguments; this is the job of \mbodybackslash. +% +% Non-ASCII encodings make 8-bit characters active, so un-activate +% them to avoid their expansion. Must do this non-globally, to +% confine the change to the current group. +% +% It's necessary to have hard CRs when the macro is executed. This is +% done by making ^^M (\endlinechar) catcode 12 when reading the macro +% body, and then making it the \newlinechar in \scanmacro. +% +\def\scanctxt{% used as subroutine + \catcode`\"=\other + \catcode`\+=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\@=\other + \catcode`\^=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\~=\other + \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi +} + +\def\scanargctxt{% used for copying and captions, not macros. + \scanctxt + \catcode`\\=\other + \catcode`\^^M=\other +} + +\def\macrobodyctxt{% used for @macro definitions + \scanctxt + \catcode`\{=\other + \catcode`\}=\other + \catcode`\^^M=\other + \usembodybackslash +} + +\def\macroargctxt{% used when scanning invocations + \scanctxt + \catcode`\\=0 +} +% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" +% for the single characters \ { }. Thus, we end up with the "commands" +% that would be written @\ @{ @} in a Texinfo document. +% +% We already have @{ and @}. For @\, we define it here, and only for +% this purpose, to produce a typewriter backslash (so, the @\ that we +% define for @math can't be used with @macro calls): +% +\def\\{\normalbackslash}% +% +% We would like to do this for \, too, since that is what makeinfo does. +% But it is not possible, because Texinfo already has a command @, for a +% cedilla accent. Documents must use @comma{} instead. +% +% \anythingelse will almost certainly be an error of some kind. + + +% \mbodybackslash is the definition of \ in @macro bodies. +% It maps \foo\ => \csname macarg.foo\endcsname => #N +% where N is the macro parameter number. +% We define \csname macarg.\endcsname to be \realbackslash, so +% \\ in macro replacement text gets you a backslash. +% +{\catcode`@=0 @catcode`@\=@active + @gdef@usembodybackslash{@let\=@mbodybackslash} + @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} +} +\expandafter\def\csname macarg.\endcsname{\realbackslash} + +\def\margbackslash#1{\char`\#1 } + +\def\macro{\recursivefalse\parsearg\macroxxx} +\def\rmacro{\recursivetrue\parsearg\macroxxx} + +\def\macroxxx#1{% + \getargs{#1}% now \macname is the macname and \argl the arglist + \ifx\argl\empty % no arguments + \paramno=0\relax + \else + \expandafter\parsemargdef \argl;% + \if\paramno>256\relax + \ifx\eTeXversion\thisisundefined + \errhelp = \EMsimple + \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} + \fi + \fi + \fi + \if1\csname ismacro.\the\macname\endcsname + \message{Warning: redefining \the\macname}% + \else + \expandafter\ifx\csname \the\macname\endcsname \relax + \else \errmessage{Macro name \the\macname\space already defined}\fi + \global\cslet{macsave.\the\macname}{\the\macname}% + \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% + \addtomacrolist{\the\macname}% + \fi + \begingroup \macrobodyctxt + \ifrecursive \expandafter\parsermacbody + \else \expandafter\parsemacbody + \fi} + +\parseargdef\unmacro{% + \if1\csname ismacro.#1\endcsname + \global\cslet{#1}{macsave.#1}% + \global\expandafter\let \csname ismacro.#1\endcsname=0% + % Remove the macro name from \macrolist: + \begingroup + \expandafter\let\csname#1\endcsname \relax + \let\definedummyword\unmacrodo + \xdef\macrolist{\macrolist}% + \endgroup + \else + \errmessage{Macro #1 not defined}% + \fi +} + +% Called by \do from \dounmacro on each macro. The idea is to omit any +% macro definitions that have been changed to \relax. +% +\def\unmacrodo#1{% + \ifx #1\relax + % remove this + \else + \noexpand\definedummyword \noexpand#1% + \fi +} + +% This makes use of the obscure feature that if the last token of a +% is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. +\def\getargs#1{\getargsxxx#1{}} +\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} +\def\getmacname#1 #2\relax{\macname={#1}} +\def\getmacargs#1{\def\argl{#1}} + +% For macro processing make @ a letter so that we can make Texinfo private macro names. +\edef\texiatcatcode{\the\catcode`\@} +\catcode `@=11\relax + +% Parse the optional {params} list. Set up \paramno and \paramlist +% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH +% in the params list to some hook where the argument si to be expanded. If +% there are less than 10 arguments that hook is to be replaced by ##N where N +% is the position in that list, that is to say the macro arguments are to be +% defined `a la TeX in the macro body. +% +% That gets used by \mbodybackslash (above). +% +% We need to get `macro parameter char #' into several definitions. +% The technique used is stolen from LaTeX: let \hash be something +% unexpandable, insert that wherever you need a #, and then redefine +% it to # just before using the token list produced. +% +% The same technique is used to protect \eatspaces till just before +% the macro is used. +% +% If there are 10 or more arguments, a different technique is used, where the +% hook remains in the body, and when macro is to be expanded the body is +% processed again to replace the arguments. +% +% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the +% argument N value and then \edef the body (nothing else will expand because of +% the catcode regime underwhich the body was input). +% +% If you compile with TeX (not eTeX), and you have macros with 10 or more +% arguments, you need that no macro has more than 256 arguments, otherwise an +% error is produced. +\def\parsemargdef#1;{% + \paramno=0\def\paramlist{}% + \let\hash\relax + \let\xeatspaces\relax + \parsemargdefxxx#1,;,% + % In case that there are 10 or more arguments we parse again the arguments + % list to set new definitions for the \macarg.BLAH macros corresponding to + % each BLAH argument. It was anyhow needed to parse already once this list + % in order to count the arguments, and as macros with at most 9 arguments + % are by far more frequent than macro with 10 or more arguments, defining + % twice the \macarg.BLAH macros does not cost too much processing power. + \ifnum\paramno<10\relax\else + \paramno0\relax + \parsemmanyargdef@@#1,;,% 10 or more arguments + \fi +} +\def\parsemargdefxxx#1,{% + \if#1;\let\next=\relax + \else \let\next=\parsemargdefxxx + \advance\paramno by 1 + \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname + {\xeatspaces{\hash\the\paramno}}% + \edef\paramlist{\paramlist\hash\the\paramno,}% + \fi\next} + +\def\parsemmanyargdef@@#1,{% + \if#1;\let\next=\relax + \else + \let\next=\parsemmanyargdef@@ + \edef\tempb{\eatspaces{#1}}% + \expandafter\def\expandafter\tempa + \expandafter{\csname macarg.\tempb\endcsname}% + % Note that we need some extra \noexpand\noexpand, this is because we + % don't want \the to be expanded in the \parsermacbody as it uses an + % \xdef . + \expandafter\edef\tempa + {\noexpand\noexpand\noexpand\the\toks\the\paramno}% + \advance\paramno by 1\relax + \fi\next} + +% These two commands read recursive and nonrecursive macro bodies. +% (They're different since rec and nonrec macros end differently.) +% + +\catcode `\@\texiatcatcode +\long\def\parsemacbody#1@end macro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\long\def\parsermacbody#1@end rmacro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\catcode `\@=11\relax + +\let\endargs@\relax +\let\nil@\relax +\def\nilm@{\nil@}% +\long\def\nillm@{\nil@}% + +% This macro is expanded during the Texinfo macro expansion, not during its +% definition. It gets all the arguments values and assigns them to macros +% macarg.ARGNAME +% +% #1 is the macro name +% #2 is the list of argument names +% #3 is the list of argument values +\def\getargvals@#1#2#3{% + \def\macargdeflist@{}% + \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. + \def\paramlist{#2,\nil@}% + \def\macroname{#1}% + \begingroup + \macroargctxt + \def\argvaluelist{#3,\nil@}% + \def\@tempa{#3}% + \ifx\@tempa\empty + \setemptyargvalues@ + \else + \getargvals@@ + \fi +} + +% +\def\getargvals@@{% + \ifx\paramlist\nilm@ + % Some sanity check needed here that \argvaluelist is also empty. + \ifx\argvaluelist\nillm@ + \else + \errhelp = \EMsimple + \errmessage{Too many arguments in macro `\macroname'!}% + \fi + \let\next\macargexpandinbody@ + \else + \ifx\argvaluelist\nillm@ + % No more arguments values passed to macro. Set remaining named-arg + % macros to empty. + \let\next\setemptyargvalues@ + \else + % pop current arg name into \@tempb + \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% + \expandafter\@tempa\expandafter{\paramlist}% + % pop current argument value into \@tempc + \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% + \expandafter\@tempa\expandafter{\argvaluelist}% + % Here \@tempb is the current arg name and \@tempc is the current arg value. + % First place the new argument macro definition into \@tempd + \expandafter\macname\expandafter{\@tempc}% + \expandafter\let\csname macarg.\@tempb\endcsname\relax + \expandafter\def\expandafter\@tempe\expandafter{% + \csname macarg.\@tempb\endcsname}% + \edef\@tempd{\long\def\@tempe{\the\macname}}% + \push@\@tempd\macargdeflist@ + \let\next\getargvals@@ + \fi + \fi + \next +} + +\def\push@#1#2{% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter#2% + \expandafter\expandafter\expandafter{% + \expandafter#1#2}% +} + +% Replace arguments by their values in the macro body, and place the result +% in macro \@tempa +\def\macvalstoargs@{% + % To do this we use the property that token registers that are \the'ed + % within an \edef expand only once. So we are going to place all argument + % values into respective token registers. + % + % First we save the token context, and initialize argument numbering. + \begingroup + \paramno0\relax + % Then, for each argument number #N, we place the corresponding argument + % value into a new token list register \toks#N + \expandafter\putargsintokens@\saveparamlist@,;,% + % Then, we expand the body so that argument are replaced by their + % values. The trick for values not to be expanded themselves is that they + % are within tokens and that tokens expand only once in an \edef . + \edef\@tempc{\csname mac.\macroname .body\endcsname}% + % Now we restore the token stack pointer to free the token list registers + % which we have used, but we make sure that expanded body is saved after + % group. + \expandafter + \endgroup + \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% + } + +\def\macargexpandinbody@{% + %% Define the named-macro outside of this group and then close this group. + \expandafter + \endgroup + \macargdeflist@ + % First the replace in body the macro arguments by their values, the result + % is in \@tempa . + \macvalstoargs@ + % Then we point at the \norecurse or \gobble (for recursive) macro value + % with \@tempb . + \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname + % Depending on whether it is recursive or not, we need some tailing + % \egroup . + \ifx\@tempb\gobble + \let\@tempc\relax + \else + \let\@tempc\egroup + \fi + % And now we do the real job: + \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% + \@tempd +} + +\def\putargsintokens@#1,{% + \if#1;\let\next\relax + \else + \let\next\putargsintokens@ + % First we allocate the new token list register, and give it a temporary + % alias \@tempb . + \toksdef\@tempb\the\paramno + % Then we place the argument value into that token list register. + \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname + \expandafter\@tempb\expandafter{\@tempa}% + \advance\paramno by 1\relax + \fi + \next +} + +% Save the token stack pointer into macro #1 +\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} +% Restore the token stack pointer from number in macro #1 +\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} +% newtoks that can be used non \outer . +\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} + +% Tailing missing arguments are set to empty +\def\setemptyargvalues@{% + \ifx\paramlist\nilm@ + \let\next\macargexpandinbody@ + \else + \expandafter\setemptyargvaluesparser@\paramlist\endargs@ + \let\next\setemptyargvalues@ + \fi + \next +} + +\def\setemptyargvaluesparser@#1,#2\endargs@{% + \expandafter\def\expandafter\@tempa\expandafter{% + \expandafter\def\csname macarg.#1\endcsname{}}% + \push@\@tempa\macargdeflist@ + \def\paramlist{#2}% +} + +% #1 is the element target macro +% #2 is the list macro +% #3,#4\endargs@ is the list value +\def\pop@#1#2#3,#4\endargs@{% + \def#1{#3}% + \def#2{#4}% +} +\long\def\longpop@#1#2#3,#4\endargs@{% + \long\def#1{#3}% + \long\def#2{#4}% +} + +% This defines a Texinfo @macro. There are eight cases: recursive and +% nonrecursive macros of zero, one, up to nine, and many arguments. +% Much magic with \expandafter here. +% \xdef is used so that macro definitions will survive the file +% they're defined in; @include reads the file inside a group. +% +\def\defmacro{% + \let\hash=##% convert placeholders to macro parameter chars + \ifrecursive + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\scanmacro{\temp}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup\noexpand\scanmacro{\temp}}% + \else + \ifnum\paramno<10\relax % at most 9 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{\egroup\noexpand\scanmacro{\temp}}% + \else % 10 or more + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble + \fi + \fi + \else + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % at most 9 + \ifnum\paramno<10\relax + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \expandafter\noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % 10 or more: + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse + \fi + \fi + \fi} + +\catcode `\@\texiatcatcode\relax + +\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + +% \braceorline decides whether the next nonwhitespace character is a +% {. If so it reads up to the closing }, if not, it reads the whole +% line. Whatever was read is then fed to the next control sequence +% as an argument (by \parsebrace or \parsearg). +% +\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} +\def\braceorlinexxx{% + \ifx\nchar\bgroup\else + \expandafter\parsearg + \fi \macnamexxx} + + +% @alias. +% We need some trickery to remove the optional spaces around the equal +% sign. Make them active and then expand them all to nothing. +% +\def\alias{\parseargusing\obeyspaces\aliasxxx} +\def\aliasxxx #1{\aliasyyy#1\relax} +\def\aliasyyy #1=#2\relax{% + {% + \expandafter\let\obeyedspace=\empty + \addtomacrolist{#1}% + \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% + }% + \next +} + + +\message{cross references,} + +\newwrite\auxfile +\newif\ifhavexrefs % True if xref values are known. +\newif\ifwarnedxrefs % True if we warned once that they aren't known. + +% @inforef is relatively simple. +\def\inforef #1{\inforefzzz #1,,,,**} +\def\inforefzzz #1,#2,#3,#4**{% + \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, + node \samp{\ignorespaces#1{}}} + +% @node's only job in TeX is to define \lastnode, which is used in +% cross-references. The @node line might or might not have commas, and +% might or might not have spaces before the first comma, like: +% @node foo , bar , ... +% We don't want such trailing spaces in the node name. +% +\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} +% +% also remove a trailing comma, in case of something like this: +% @node Help-Cross, , , Cross-refs +\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} + +\let\nwnode=\node +\let\lastnode=\empty + +% Write a cross-reference definition for the current node. #1 is the +% type (Ynumbered, Yappendix, Ynothing). +% +\def\donoderef#1{% + \ifx\lastnode\empty\else + \setref{\lastnode}{#1}% + \global\let\lastnode=\empty + \fi +} + +% @anchor{NAME} -- define xref target at arbitrary point. +% +\newcount\savesfregister +% +\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} +\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} +\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} + +% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an +% anchor), which consists of three parts: +% 1) NAME-title - the current sectioning name taken from \lastsection, +% or the anchor name. +% 2) NAME-snt - section number and type, passed as the SNT arg, or +% empty for anchors. +% 3) NAME-pg - the page number. +% +% This is called from \donoderef, \anchor, and \dofloat. In the case of +% floats, there is an additional part, which is not written here: +% 4) NAME-lof - the text as it should appear in a @listoffloats. +% +\def\setref#1#2{% + \pdfmkdest{#1}% + \iflinks + {% + \atdummies % preserve commands, but don't expand them + \edef\writexrdef##1##2{% + \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef + ##1}{##2}}% these are parameters of \writexrdef + }% + \toks0 = \expandafter{\lastsection}% + \immediate \writexrdef{title}{\the\toks0 }% + \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. + \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout + }% + \fi +} + +% @xrefautosectiontitle on|off says whether @section(ing) names are used +% automatically in xrefs, if the third arg is not explicitly specified. +% This was provided as a "secret" @set xref-automatic-section-title +% variable, now it's official. +% +\parseargdef\xrefautomaticsectiontitle{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETxref-automatic-section-title\endcsname + = \empty + \else\ifx\temp\offword + \expandafter\let\csname SETxref-automatic-section-title\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', + must be on|off}% + \fi\fi +} + +% +% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is +% the node name, #2 the name of the Info cross-reference, #3 the printed +% node name, #4 the name of the Info file, #5 the name of the printed +% manual. All but the node name can be omitted. +% +\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} +\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} +\def\ref#1{\xrefX[#1,,,,,,,]} +% +\newbox\toprefbox +\newbox\printedrefnamebox +\newbox\infofilenamebox +\newbox\printedmanualbox +% +\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup + \unsepspaces + % + % Get args without leading/trailing spaces. + \def\printedrefname{\ignorespaces #3}% + \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% + % + \def\infofilename{\ignorespaces #4}% + \setbox\infofilenamebox = \hbox{\infofilename\unskip}% + % + \def\printedmanual{\ignorespaces #5}% + \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% + % + % If the printed reference name (arg #3) was not explicitly given in + % the @xref, figure out what we want to use. + \ifdim \wd\printedrefnamebox = 0pt + % No printed node name was explicitly given. + \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax + % Not auto section-title: use node name inside the square brackets. + \def\printedrefname{\ignorespaces #1}% + \else + % Auto section-title: use chapter/section title inside + % the square brackets if we have it. + \ifdim \wd\printedmanualbox > 0pt + % It is in another manual, so we don't have it; use node name. + \def\printedrefname{\ignorespaces #1}% + \else + \ifhavexrefs + % We (should) know the real title if we have the xref values. + \def\printedrefname{\refx{#1-title}{}}% + \else + % Otherwise just copy the Info node name. + \def\printedrefname{\ignorespaces #1}% + \fi% + \fi + \fi + \fi + % + % Make link in pdf output. + \ifpdf + {\indexnofonts + \turnoffactive + \makevalueexpandable + % This expands tokens, so do it after making catcode changes, so _ + % etc. don't get their TeX definitions. This ignores all spaces in + % #4, including (wrongly) those in the middle of the filename. + \getfilename{#4}% + % + % This (wrongly) does not take account of leading or trailing + % spaces in #1, which should be ignored. + \edef\pdfxrefdest{#1}% + \ifx\pdfxrefdest\empty + \def\pdfxrefdest{Top}% no empty targets + \else + \txiescapepdf\pdfxrefdest % escape PDF special chars + \fi + % + \leavevmode + \startlink attr{/Border [0 0 0]}% + \ifnum\filenamelength>0 + goto file{\the\filename.pdf} name{\pdfxrefdest}% + \else + goto name{\pdfmkpgn{\pdfxrefdest}}% + \fi + }% + \setcolor{\linkcolor}% + \fi + % + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". We distinguish them by the + % LABEL-title being set to a magic string. + {% + % Have to otherify everything special to allow the \csname to + % include an _ in the xref name, etc. + \indexnofonts + \turnoffactive + \expandafter\global\expandafter\let\expandafter\Xthisreftitle + \csname XR#1-title\endcsname + }% + \iffloat\Xthisreftitle + % If the user specified the print name (third arg) to the ref, + % print it instead of our usual "Figure 1.2". + \ifdim\wd\printedrefnamebox = 0pt + \refx{#1-snt}{}% + \else + \printedrefname + \fi + % + % If the user also gave the printed manual name (fifth arg), append + % "in MANUALNAME". + \ifdim \wd\printedmanualbox > 0pt + \space \putwordin{} \cite{\printedmanual}% + \fi + \else + % node/anchor (non-float) references. + % + % If we use \unhbox to print the node names, TeX does not insert + % empty discretionaries after hyphens, which means that it will not + % find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, + % this is a loss. Therefore, we give the text of the node name + % again, so it is as if TeX is seeing it for the first time. + % + \ifdim \wd\printedmanualbox > 0pt + % Cross-manual reference with a printed manual name. + % + \crossmanualxref{\cite{\printedmanual\unskip}}% + % + \else\ifdim \wd\infofilenamebox > 0pt + % Cross-manual reference with only an info filename (arg 4), no + % printed manual name (arg 5). This is essentially the same as + % the case above; we output the filename, since we have nothing else. + % + \crossmanualxref{\code{\infofilename\unskip}}% + % + \else + % Reference within this manual. + % + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % output the `[mynode]' via the macro below so it can be overridden. + \xrefprintnodename\printedrefname + % + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. + \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + \fi\fi + \fi + \endlink +\endgroup} + +% Output a cross-manual xref to #1. Used just above (twice). +% +% Only include the text "Section ``foo'' in" if the foo is neither +% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply +% "see The Foo Manual", the idea being to refer to the whole manual. +% +% But, this being TeX, we can't easily compare our node name against the +% string "Top" while ignoring the possible spaces before and after in +% the input. By adding the arbitrary 7sp below, we make it much less +% likely that a real node name would have the same width as "Top" (e.g., +% in a monospaced font). Hopefully it will never happen in practice. +% +% For the same basic reason, we retypeset the "Top" at every +% reference, since the current font is indeterminate. +% +\def\crossmanualxref#1{% + \setbox\toprefbox = \hbox{Top\kern7sp}% + \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% + \ifdim \wd2 > 7sp % nonempty? + \ifdim \wd2 = \wd\toprefbox \else % same as Top? + \putwordSection{} ``\printedrefname'' \putwordin{}\space + \fi + \fi + #1% +} + +% This macro is called from \xrefX for the `[nodename]' part of xref +% output. It's a separate macro only so it can be changed more easily, +% since square brackets don't work well in some documents. Particularly +% one that Bob is working on :). +% +\def\xrefprintnodename#1{[#1]} + +% Things referred to by \setref. +% +\def\Ynothing{} +\def\Yomitfromtoc{} +\def\Ynumbered{% + \ifnum\secno=0 + \putwordChapter@tie \the\chapno + \else \ifnum\subsecno=0 + \putwordSection@tie \the\chapno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno + \else + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} +\def\Yappendix{% + \ifnum\secno=0 + \putwordAppendix@tie @char\the\appendixno{}% + \else \ifnum\subsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno + \else + \putwordSection@tie + @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} + +% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. +% If its value is nonempty, SUFFIX is output afterward. +% +\def\refx#1#2{% + {% + \indexnofonts + \otherbackslash + \expandafter\global\expandafter\let\expandafter\thisrefX + \csname XR#1\endcsname + }% + \ifx\thisrefX\relax + % If not defined, say something at least. + \angleleft un\-de\-fined\angleright + \iflinks + \ifhavexrefs + {\toks0 = {#1}% avoid expansion of possibly-complex value + \message{\linenumber Undefined cross reference `\the\toks0'.}}% + \else + \ifwarnedxrefs\else + \global\warnedxrefstrue + \message{Cross reference values unknown; you must run TeX again.}% + \fi + \fi + \fi + \else + % It's defined, so just use it. + \thisrefX + \fi + #2% Output the suffix in any case. +} + +% This is the macro invoked by entries in the aux file. Usually it's +% just a \def (we prepend XR to the control sequence name to avoid +% collisions). But if this is a float type, we have more work to do. +% +\def\xrdef#1#2{% + {% The node name might contain 8-bit characters, which in our current + % implementation are changed to commands like @'e. Don't let these + % mess up the control sequence name. + \indexnofonts + \turnoffactive + \xdef\safexrefname{#1}% + }% + % + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref + % + % Was that xref control sequence that we just defined for a float? + \expandafter\iffloat\csname XR\safexrefname\endcsname + % it was a float, and we have the (safe) float type in \iffloattype. + \expandafter\let\expandafter\floatlist + \csname floatlist\iffloattype\endcsname + % + % Is this the first time we've seen this float type? + \expandafter\ifx\floatlist\relax + \toks0 = {\do}% yes, so just \do + \else + % had it before, so preserve previous elements in list. + \toks0 = \expandafter{\floatlist\do}% + \fi + % + % Remember this xref in the control sequence \floatlistFLOATTYPE, + % for later use in \listoffloats. + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 + {\safexrefname}}% + \fi +} + +% Read the last existing aux file, if any. No error if none exists. +% +\def\tryauxfile{% + \openin 1 \jobname.aux + \ifeof 1 \else + \readdatafile{aux}% + \global\havexrefstrue + \fi + \closein 1 +} + +\def\setupdatafile{% + \catcode`\^^@=\other + \catcode`\^^A=\other + \catcode`\^^B=\other + \catcode`\^^C=\other + \catcode`\^^D=\other + \catcode`\^^E=\other + \catcode`\^^F=\other + \catcode`\^^G=\other + \catcode`\^^H=\other + \catcode`\^^K=\other + \catcode`\^^L=\other + \catcode`\^^N=\other + \catcode`\^^P=\other + \catcode`\^^Q=\other + \catcode`\^^R=\other + \catcode`\^^S=\other + \catcode`\^^T=\other + \catcode`\^^U=\other + \catcode`\^^V=\other + \catcode`\^^W=\other + \catcode`\^^X=\other + \catcode`\^^Z=\other + \catcode`\^^[=\other + \catcode`\^^\=\other + \catcode`\^^]=\other + \catcode`\^^^=\other + \catcode`\^^_=\other + % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. + % in xref tags, i.e., node names. But since ^^e4 notation isn't + % supported in the main text, it doesn't seem desirable. Furthermore, + % that is not enough: for node names that actually contain a ^ + % character, we would end up writing a line like this: 'xrdef {'hat + % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first + % argument, and \hat is not an expandable control sequence. It could + % all be worked out, but why? Either we support ^^ or we don't. + % + % The other change necessary for this was to define \auxhat: + % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter + % and then to call \auxhat in \setq. + % + \catcode`\^=\other + % + % Special characters. Should be turned off anyway, but... + \catcode`\~=\other + \catcode`\[=\other + \catcode`\]=\other + \catcode`\"=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\$=\other + \catcode`\#=\other + \catcode`\&=\other + \catcode`\%=\other + \catcode`+=\other % avoid \+ for paranoia even though we've turned it off + % + % This is to support \ in node names and titles, since the \ + % characters end up in a \csname. It's easier than + % leaving it active and making its active definition an actual \ + % character. What I don't understand is why it works in the *value* + % of the xrdef. Seems like it should be a catcode12 \, and that + % should not typeset properly. But it works, so I'm moving on for + % now. --karl, 15jan04. + \catcode`\\=\other + % + % Make the characters 128-255 be printing characters. + {% + \count1=128 + \def\loop{% + \catcode\count1=\other + \advance\count1 by 1 + \ifnum \count1<256 \loop \fi + }% + }% + % + % @ is our escape character in .aux files, and we need braces. + \catcode`\{=1 + \catcode`\}=2 + \catcode`\@=0 +} + +\def\readdatafile#1{% +\begingroup + \setupdatafile + \input\jobname.#1 +\endgroup} + + +\message{insertions,} +% including footnotes. + +\newcount \footnoteno + +% The trailing space in the following definition for supereject is +% vital for proper filling; pages come out unaligned when you do a +% pagealignmacro call if that space before the closing brace is +% removed. (Generally, numeric constants should always be followed by a +% space to prevent strange expansion errors.) +\def\supereject{\par\penalty -20000\footnoteno =0 } + +% @footnotestyle is meaningful for Info output only. +\let\footnotestyle=\comment + +{\catcode `\@=11 +% +% Auto-number footnotes. Otherwise like plain. +\gdef\footnote{% + \let\indent=\ptexindent + \let\noindent=\ptexnoindent + \global\advance\footnoteno by \@ne + \edef\thisfootno{$^{\the\footnoteno}$}% + % + % In case the footnote comes at the end of a sentence, preserve the + % extra spacing after we do the footnote number. + \let\@sf\empty + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi + % + % Remove inadvertent blank space before typesetting the footnote number. + \unskip + \thisfootno\@sf + \dofootnote +}% + +% Don't bother with the trickery in plain.tex to not require the +% footnote text as a parameter. Our footnotes don't need to be so general. +% +% Oh yes, they do; otherwise, @ifset (and anything else that uses +% \parseargline) fails inside footnotes because the tokens are fixed when +% the footnote is read. --karl, 16nov96. +% +\gdef\dofootnote{% + \insert\footins\bgroup + % We want to typeset this text as a normal paragraph, even if the + % footnote reference occurs in (for example) a display environment. + % So reset some parameters. + \hsize=\pagewidth + \interlinepenalty\interfootnotelinepenalty + \splittopskip\ht\strutbox % top baseline for broken footnotes + \splitmaxdepth\dp\strutbox + \floatingpenalty\@MM + \leftskip\z@skip + \rightskip\z@skip + \spaceskip\z@skip + \xspaceskip\z@skip + \parindent\defaultparindent + % + \smallfonts \rm + % + % Because we use hanging indentation in footnotes, a @noindent appears + % to exdent this text, so make it be a no-op. makeinfo does not use + % hanging indentation so @noindent can still be needed within footnote + % text after an @example or the like (not that this is good style). + \let\noindent = \relax + % + % Hang the footnote text off the number. Use \everypar in case the + % footnote extends for more than one paragraph. + \everypar = {\hang}% + \textindent{\thisfootno}% + % + % Don't crash into the line above the footnote text. Since this + % expands into a box, it must come within the paragraph, lest it + % provide a place where TeX can split the footnote. + \footstrut + % + % Invoke rest of plain TeX footnote routine. + \futurelet\next\fo@t +} +}%end \catcode `\@=11 + +% In case a @footnote appears in a vbox, save the footnote text and create +% the real \insert just after the vbox finished. Otherwise, the insertion +% would be lost. +% Similarly, if a @footnote appears inside an alignment, save the footnote +% text to a box and make the \insert when a row of the table is finished. +% And the same can be done for other insert classes. --kasal, 16nov03. + +% Replace the \insert primitive by a cheating macro. +% Deeper inside, just make sure that the saved insertions are not spilled +% out prematurely. +% +\def\startsavinginserts{% + \ifx \insert\ptexinsert + \let\insert\saveinsert + \else + \let\checkinserts\relax + \fi +} + +% This \insert replacement works for both \insert\footins{foo} and +% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. +% +\def\saveinsert#1{% + \edef\next{\noexpand\savetobox \makeSAVEname#1}% + \afterassignment\next + % swallow the left brace + \let\temp = +} +\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} +\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} + +\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} + +\def\placesaveins#1{% + \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname + {\box#1}% +} + +% eat @SAVE -- beware, all of them have catcode \other: +{ + \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) + \gdef\gobblesave @SAVE{} +} + +% initialization: +\def\newsaveins #1{% + \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% + \next +} +\def\newsaveinsX #1{% + \csname newbox\endcsname #1% + \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts + \checksaveins #1}% +} + +% initialize: +\let\checkinserts\empty +\newsaveins\footins +\newsaveins\margin + + +% @image. We use the macros from epsf.tex to support this. +% If epsf.tex is not installed and @image is used, we complain. +% +% Check for and read epsf.tex up front. If we read it only at @image +% time, we might be inside a group, and then its definitions would get +% undone and the next image would fail. +\openin 1 = epsf.tex +\ifeof 1 \else + % Do not bother showing banner with epsf.tex v2.7k (available in + % doc/epsf.tex and on ctan). + \def\epsfannounce{\toks0 = }% + \input epsf.tex +\fi +\closein 1 +% +% We will only complain once about lack of epsf.tex. +\newif\ifwarnednoepsf +\newhelp\noepsfhelp{epsf.tex must be installed for images to + work. It is also included in the Texinfo distribution, or you can get + it from ftp://tug.org/tex/epsf.tex.} +% +\def\image#1{% + \ifx\epsfbox\thisisundefined + \ifwarnednoepsf \else + \errhelp = \noepsfhelp + \errmessage{epsf.tex not found, images will be ignored}% + \global\warnednoepsftrue + \fi + \else + \imagexxx #1,,,,,\finish + \fi +} +% +% Arguments to @image: +% #1 is (mandatory) image filename; we tack on .eps extension. +% #2 is (optional) width, #3 is (optional) height. +% #4 is (ignored optional) html alt text. +% #5 is (ignored optional) extension. +% #6 is just the usual extra ignored arg for parsing stuff. +\newif\ifimagevmode +\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup + \catcode`\^^M = 5 % in case we're inside an example + \normalturnoffactive % allow _ et al. in names + % If the image is by itself, center it. + \ifvmode + \imagevmodetrue + \else \ifx\centersub\centerV + % for @center @image, we need a vbox so we can have our vertical space + \imagevmodetrue + \vbox\bgroup % vbox has better behavior than vtop herev + \fi\fi + % + \ifimagevmode + \nobreak\medskip + % Usually we'll have text after the image which will insert + % \parskip glue, so insert it here too to equalize the space + % above and below. + \nobreak\vskip\parskip + \nobreak + \fi + % + % Leave vertical mode so that indentation from an enclosing + % environment such as @quotation is respected. + % However, if we're at the top level, we don't want the + % normal paragraph indentation. + % On the other hand, if we are in the case of @center @image, we don't + % want to start a paragraph, which will create a hsize-width box and + % eradicate the centering. + \ifx\centersub\centerV\else \noindent \fi + % + % Output the image. + \ifpdf + \dopdfimage{#1}{#2}{#3}% + \else + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + \epsfbox{#1.eps}% + \fi + % + \ifimagevmode + \medskip % space after a standalone image + \fi + \ifx\centersub\centerV \egroup \fi +\endgroup} + + +% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, +% etc. We don't actually implement floating yet, we always include the +% float "here". But it seemed the best name for the future. +% +\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} + +% There may be a space before second and/or third parameter; delete it. +\def\eatcommaspace#1, {#1,} + +% #1 is the optional FLOATTYPE, the text label for this float, typically +% "Figure", "Table", "Example", etc. Can't contain commas. If omitted, +% this float will not be numbered and cannot be referred to. +% +% #2 is the optional xref label. Also must be present for the float to +% be referable. +% +% #3 is the optional positioning argument; for now, it is ignored. It +% will somehow specify the positions allowed to float to (here, top, bottom). +% +% We keep a separate counter for each FLOATTYPE, which we reset at each +% chapter-level command. +\let\resetallfloatnos=\empty +% +\def\dofloat#1,#2,#3,#4\finish{% + \let\thiscaption=\empty + \let\thisshortcaption=\empty + % + % don't lose footnotes inside @float. + % + % BEWARE: when the floats start float, we have to issue warning whenever an + % insert appears inside a float which could possibly float. --kasal, 26may04 + % + \startsavinginserts + % + % We can't be used inside a paragraph. + \par + % + \vtop\bgroup + \def\floattype{#1}% + \def\floatlabel{#2}% + \def\floatloc{#3}% we do nothing with this yet. + % + \ifx\floattype\empty + \let\safefloattype=\empty + \else + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + \fi + % + % If label is given but no type, we handle that as the empty type. + \ifx\floatlabel\empty \else + % We want each FLOATTYPE to be numbered separately (Figure 1, + % Table 1, Figure 2, ...). (And if no label, no number.) + % + \expandafter\getfloatno\csname\safefloattype floatno\endcsname + \global\advance\floatno by 1 + % + {% + % This magic value for \lastsection is output by \setref as the + % XREFLABEL-title value. \xrefX uses it to distinguish float + % labels (which have a completely different output format) from + % node and anchor labels. And \xrdef uses it to construct the + % lists of floats. + % + \edef\lastsection{\floatmagic=\safefloattype}% + \setref{\floatlabel}{Yfloat}% + }% + \fi + % + % start with \parskip glue, I guess. + \vskip\parskip + % + % Don't suppress indentation if a float happens to start a section. + \restorefirstparagraphindent +} + +% we have these possibilities: +% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap +% @float Foo,lbl & no caption: Foo 1.1 +% @float Foo & @caption{Cap}: Foo: Cap +% @float Foo & no caption: Foo +% @float ,lbl & Caption{Cap}: 1.1: Cap +% @float ,lbl & no caption: 1.1 +% @float & @caption{Cap}: Cap +% @float & no caption: +% +\def\Efloat{% + \let\floatident = \empty + % + % In all cases, if we have a float type, it comes first. + \ifx\floattype\empty \else \def\floatident{\floattype}\fi + % + % If we have an xref label, the number comes next. + \ifx\floatlabel\empty \else + \ifx\floattype\empty \else % if also had float type, need tie first. + \appendtomacro\floatident{\tie}% + \fi + % the number. + \appendtomacro\floatident{\chaplevelprefix\the\floatno}% + \fi + % + % Start the printed caption with what we've constructed in + % \floatident, but keep it separate; we need \floatident again. + \let\captionline = \floatident + % + \ifx\thiscaption\empty \else + \ifx\floatident\empty \else + \appendtomacro\captionline{: }% had ident, so need a colon between + \fi + % + % caption text. + \appendtomacro\captionline{\scanexp\thiscaption}% + \fi + % + % If we have anything to print, print it, with space before. + % Eventually this needs to become an \insert. + \ifx\captionline\empty \else + \vskip.5\parskip + \captionline + % + % Space below caption. + \vskip\parskip + \fi + % + % If have an xref label, write the list of floats info. Do this + % after the caption, to avoid chance of it being a breakpoint. + \ifx\floatlabel\empty \else + % Write the text that goes in the lof to the aux file as + % \floatlabel-lof. Besides \floatident, we include the short + % caption if specified, else the full caption if specified, else nothing. + {% + \atdummies + % + % since we read the caption text in the macro world, where ^^M + % is turned into a normal character, we have to scan it back, so + % we don't write the literal three characters "^^M" into the aux file. + \scanexp{% + \xdef\noexpand\gtemp{% + \ifx\thisshortcaption\empty + \thiscaption + \else + \thisshortcaption + \fi + }% + }% + \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident + \ifx\gtemp\empty \else : \gtemp \fi}}% + }% + \fi + \egroup % end of \vtop + % + % place the captured inserts + % + % BEWARE: when the floats start floating, we have to issue warning + % whenever an insert appears inside a float which could possibly + % float. --kasal, 26may04 + % + \checkinserts +} + +% Append the tokens #2 to the definition of macro #1, not expanding either. +% +\def\appendtomacro#1#2{% + \expandafter\def\expandafter#1\expandafter{#1#2}% +} + +% @caption, @shortcaption +% +\def\caption{\docaption\thiscaption} +\def\shortcaption{\docaption\thisshortcaption} +\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} +\def\defcaption#1#2{\egroup \def#1{#2}} + +% The parameter is the control sequence identifying the counter we are +% going to use. Create it if it doesn't exist and assign it to \floatno. +\def\getfloatno#1{% + \ifx#1\relax + % Haven't seen this figure type before. + \csname newcount\endcsname #1% + % + % Remember to reset this floatno at the next chap. + \expandafter\gdef\expandafter\resetallfloatnos + \expandafter{\resetallfloatnos #1=0 }% + \fi + \let\floatno#1% +} + +% \setref calls this to get the XREFLABEL-snt value. We want an @xref +% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we +% first read the @float command. +% +\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% + +% Magic string used for the XREFLABEL-title value, so \xrefX can +% distinguish floats from other xref types. +\def\floatmagic{!!float!!} + +% #1 is the control sequence we are passed; we expand into a conditional +% which is true if #1 represents a float ref. That is, the magic +% \lastsection value which we \setref above. +% +\def\iffloat#1{\expandafter\doiffloat#1==\finish} +% +% #1 is (maybe) the \floatmagic string. If so, #2 will be the +% (safe) float type for this float. We set \iffloattype to #2. +% +\def\doiffloat#1=#2=#3\finish{% + \def\temp{#1}% + \def\iffloattype{#2}% + \ifx\temp\floatmagic +} + +% @listoffloats FLOATTYPE - print a list of floats like a table of contents. +% +\parseargdef\listoffloats{% + \def\floattype{#1}% floattype + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + % + % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. + \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax + \ifhavexrefs + % if the user said @listoffloats foo but never @float foo. + \message{\linenumber No `\safefloattype' floats to list.}% + \fi + \else + \begingroup + \leftskip=\tocindent % indent these entries like a toc + \let\do=\listoffloatsdo + \csname floatlist\safefloattype\endcsname + \endgroup + \fi +} + +% This is called on each entry in a list of floats. We're passed the +% xref label, in the form LABEL-title, which is how we save it in the +% aux file. We strip off the -title and look up \XRLABEL-lof, which +% has the text we're supposed to typeset here. +% +% Figures without xref labels will not be included in the list (since +% they won't appear in the aux file). +% +\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} +\def\listoffloatsdoentry#1-title\finish{{% + % Can't fully expand XR#1-lof because it can contain anything. Just + % pass the control sequence. On the other hand, XR#1-pg is just the + % page number, and we want to fully expand that so we can get a link + % in pdf output. + \toksA = \expandafter{\csname XR#1-lof\endcsname}% + % + % use the same \entry macro we use to generate the TOC and index. + \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% + \writeentry +}} + + +\message{localization,} + +% For single-language documents, @documentlanguage is usually given very +% early, just after @documentencoding. Single argument is the language +% (de) or locale (de_DE) abbreviation. +% +{ + \catcode`\_ = \active + \globaldefs=1 +\parseargdef\documentlanguage{\begingroup + \let_=\normalunderscore % normal _ character for filenames + \tex % read txi-??.tex file in plain TeX. + % Read the file by the name they passed if it exists. + \openin 1 txi-#1.tex + \ifeof 1 + \documentlanguagetrywithoutunderscore{#1_\finish}% + \else + \globaldefs = 1 % everything in the txi-LL files needs to persist + \input txi-#1.tex + \fi + \closein 1 + \endgroup % end raw TeX +\endgroup} +% +% If they passed de_DE, and txi-de_DE.tex doesn't exist, +% try txi-de.tex. +% +\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% + \openin 1 txi-#1.tex + \ifeof 1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \else + \globaldefs = 1 % everything in the txi-LL files needs to persist + \input txi-#1.tex + \fi + \closein 1 +} +}% end of special _ catcode +% +\newhelp\nolanghelp{The given language definition file cannot be found or +is empty. Maybe you need to install it? Putting it in the current +directory should work if nowhere else does.} + +% This macro is called from txi-??.tex files; the first argument is the +% \language name to set (without the "\lang@" prefix), the second and +% third args are \{left,right}hyphenmin. +% +% The language names to pass are determined when the format is built. +% See the etex.log file created at that time, e.g., +% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. +% +% With TeX Live 2008, etex now includes hyphenation patterns for all +% available languages. This means we can support hyphenation in +% Texinfo, at least to some extent. (This still doesn't solve the +% accented characters problem.) +% +\catcode`@=11 +\def\txisetlanguage#1#2#3{% + % do not set the language if the name is undefined in the current TeX. + \expandafter\ifx\csname lang@#1\endcsname \relax + \message{no patterns for #1}% + \else + \global\language = \csname lang@#1\endcsname + \fi + % but there is no harm in adjusting the hyphenmin values regardless. + \global\lefthyphenmin = #2\relax + \global\righthyphenmin = #3\relax +} + +% Helpers for encodings. +% Set the catcode of characters 128 through 255 to the specified number. +% +\def\setnonasciicharscatcode#1{% + \count255=128 + \loop\ifnum\count255<256 + \global\catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} + +\def\setnonasciicharscatcodenonglobal#1{% + \count255=128 + \loop\ifnum\count255<256 + \catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} + +% @documentencoding sets the definition of non-ASCII characters +% according to the specified encoding. +% +\parseargdef\documentencoding{% + % Encoding being declared for the document. + \def\declaredencoding{\csname #1.enc\endcsname}% + % + % Supported encodings: names converted to tokens in order to be able + % to compare them with \ifx. + \def\ascii{\csname US-ASCII.enc\endcsname}% + \def\latnine{\csname ISO-8859-15.enc\endcsname}% + \def\latone{\csname ISO-8859-1.enc\endcsname}% + \def\lattwo{\csname ISO-8859-2.enc\endcsname}% + \def\utfeight{\csname UTF-8.enc\endcsname}% + % + \ifx \declaredencoding \ascii + \asciichardefs + % + \else \ifx \declaredencoding \lattwo + \setnonasciicharscatcode\active + \lattwochardefs + % + \else \ifx \declaredencoding \latone + \setnonasciicharscatcode\active + \latonechardefs + % + \else \ifx \declaredencoding \latnine + \setnonasciicharscatcode\active + \latninechardefs + % + \else \ifx \declaredencoding \utfeight + \setnonasciicharscatcode\active + \utfeightchardefs + % + \else + \message{Unknown document encoding #1, ignoring.}% + % + \fi % utfeight + \fi % latnine + \fi % latone + \fi % lattwo + \fi % ascii +} + +% A message to be logged when using a character that isn't available +% the default font encoding (OT1). +% +\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} + +% Take account of \c (plain) vs. \, (Texinfo) difference. +\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} + +% First, make active non-ASCII characters in order for them to be +% correctly categorized when TeX reads the replacement text of +% macros containing the character definitions. +\setnonasciicharscatcode\active +% +% Latin1 (ISO-8859-1) character definitions. +\def\latonechardefs{% + \gdef^^a0{\tie} + \gdef^^a1{\exclamdown} + \gdef^^a2{\missingcharmsg{CENT SIGN}} + \gdef^^a3{{\pounds}} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\missingcharmsg{YEN SIGN}} + \gdef^^a6{\missingcharmsg{BROKEN BAR}} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\copyright} + \gdef^^aa{\ordf} + \gdef^^ab{\guillemetleft} + \gdef^^ac{$\lnot$} + \gdef^^ad{\-} + \gdef^^ae{\registeredsymbol} + \gdef^^af{\={}} + % + \gdef^^b0{\textdegree} + \gdef^^b1{$\pm$} + \gdef^^b2{$^2$} + \gdef^^b3{$^3$} + \gdef^^b4{\'{}} + \gdef^^b5{$\mu$} + \gdef^^b6{\P} + % + \gdef^^b7{$^.$} + \gdef^^b8{\cedilla\ } + \gdef^^b9{$^1$} + \gdef^^ba{\ordm} + % + \gdef^^bb{\guillemetright} + \gdef^^bc{$1\over4$} + \gdef^^bd{$1\over2$} + \gdef^^be{$3\over4$} + \gdef^^bf{\questiondown} + % + \gdef^^c0{\`A} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\~A} + \gdef^^c4{\"A} + \gdef^^c5{\ringaccent A} + \gdef^^c6{\AE} + \gdef^^c7{\cedilla C} + \gdef^^c8{\`E} + \gdef^^c9{\'E} + \gdef^^ca{\^E} + \gdef^^cb{\"E} + \gdef^^cc{\`I} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\"I} + % + \gdef^^d0{\DH} + \gdef^^d1{\~N} + \gdef^^d2{\`O} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\~O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\O} + \gdef^^d9{\`U} + \gdef^^da{\'U} + \gdef^^db{\^U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\TH} + \gdef^^df{\ss} + % + \gdef^^e0{\`a} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\~a} + \gdef^^e4{\"a} + \gdef^^e5{\ringaccent a} + \gdef^^e6{\ae} + \gdef^^e7{\cedilla c} + \gdef^^e8{\`e} + \gdef^^e9{\'e} + \gdef^^ea{\^e} + \gdef^^eb{\"e} + \gdef^^ec{\`{\dotless i}} + \gdef^^ed{\'{\dotless i}} + \gdef^^ee{\^{\dotless i}} + \gdef^^ef{\"{\dotless i}} + % + \gdef^^f0{\dh} + \gdef^^f1{\~n} + \gdef^^f2{\`o} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\~o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\o} + \gdef^^f9{\`u} + \gdef^^fa{\'u} + \gdef^^fb{\^u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\th} + \gdef^^ff{\"y} +} + +% Latin9 (ISO-8859-15) encoding character definitions. +\def\latninechardefs{% + % Encoding is almost identical to Latin1. + \latonechardefs + % + \gdef^^a4{\euro} + \gdef^^a6{\v S} + \gdef^^a8{\v s} + \gdef^^b4{\v Z} + \gdef^^b8{\v z} + \gdef^^bc{\OE} + \gdef^^bd{\oe} + \gdef^^be{\"Y} +} + +% Latin2 (ISO-8859-2) character definitions. +\def\lattwochardefs{% + \gdef^^a0{\tie} + \gdef^^a1{\ogonek{A}} + \gdef^^a2{\u{}} + \gdef^^a3{\L} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\v L} + \gdef^^a6{\'S} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\v S} + \gdef^^aa{\cedilla S} + \gdef^^ab{\v T} + \gdef^^ac{\'Z} + \gdef^^ad{\-} + \gdef^^ae{\v Z} + \gdef^^af{\dotaccent Z} + % + \gdef^^b0{\textdegree} + \gdef^^b1{\ogonek{a}} + \gdef^^b2{\ogonek{ }} + \gdef^^b3{\l} + \gdef^^b4{\'{}} + \gdef^^b5{\v l} + \gdef^^b6{\'s} + \gdef^^b7{\v{}} + \gdef^^b8{\cedilla\ } + \gdef^^b9{\v s} + \gdef^^ba{\cedilla s} + \gdef^^bb{\v t} + \gdef^^bc{\'z} + \gdef^^bd{\H{}} + \gdef^^be{\v z} + \gdef^^bf{\dotaccent z} + % + \gdef^^c0{\'R} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\u A} + \gdef^^c4{\"A} + \gdef^^c5{\'L} + \gdef^^c6{\'C} + \gdef^^c7{\cedilla C} + \gdef^^c8{\v C} + \gdef^^c9{\'E} + \gdef^^ca{\ogonek{E}} + \gdef^^cb{\"E} + \gdef^^cc{\v E} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\v D} + % + \gdef^^d0{\DH} + \gdef^^d1{\'N} + \gdef^^d2{\v N} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\H O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\v R} + \gdef^^d9{\ringaccent U} + \gdef^^da{\'U} + \gdef^^db{\H U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\cedilla T} + \gdef^^df{\ss} + % + \gdef^^e0{\'r} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\u a} + \gdef^^e4{\"a} + \gdef^^e5{\'l} + \gdef^^e6{\'c} + \gdef^^e7{\cedilla c} + \gdef^^e8{\v c} + \gdef^^e9{\'e} + \gdef^^ea{\ogonek{e}} + \gdef^^eb{\"e} + \gdef^^ec{\v e} + \gdef^^ed{\'{\dotless{i}}} + \gdef^^ee{\^{\dotless{i}}} + \gdef^^ef{\v d} + % + \gdef^^f0{\dh} + \gdef^^f1{\'n} + \gdef^^f2{\v n} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\H o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\v r} + \gdef^^f9{\ringaccent u} + \gdef^^fa{\'u} + \gdef^^fb{\H u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\cedilla t} + \gdef^^ff{\dotaccent{}} +} + +% UTF-8 character definitions. +% +% This code to support UTF-8 is based on LaTeX's utf8.def, with some +% changes for Texinfo conventions. It is included here under the GPL by +% permission from Frank Mittelbach and the LaTeX team. +% +\newcount\countUTFx +\newcount\countUTFy +\newcount\countUTFz + +\gdef\UTFviiiTwoOctets#1#2{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\endcsname} +% +\gdef\UTFviiiThreeOctets#1#2#3{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} +% +\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} + +\gdef\UTFviiiDefined#1{% + \ifx #1\relax + \message{\linenumber Unicode char \string #1 not defined for Texinfo}% + \else + \expandafter #1% + \fi +} + +\begingroup + \catcode`\~13 + \catcode`\"12 + + \def\UTFviiiLoop{% + \global\catcode\countUTFx\active + \uccode`\~\countUTFx + \uppercase\expandafter{\UTFviiiTmp}% + \advance\countUTFx by 1 + \ifnum\countUTFx < \countUTFy + \expandafter\UTFviiiLoop + \fi} + + \countUTFx = "C2 + \countUTFy = "E0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiTwoOctets\string~}} + \UTFviiiLoop + + \countUTFx = "E0 + \countUTFy = "F0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiThreeOctets\string~}} + \UTFviiiLoop + + \countUTFx = "F0 + \countUTFy = "F4 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiFourOctets\string~}} + \UTFviiiLoop +\endgroup + +\begingroup + \catcode`\"=12 + \catcode`\<=12 + \catcode`\.=12 + \catcode`\,=12 + \catcode`\;=12 + \catcode`\!=12 + \catcode`\~=13 + + \gdef\DeclareUnicodeCharacter#1#2{% + \countUTFz = "#1\relax + %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% + \begingroup + \parseXMLCharref + \def\UTFviiiTwoOctets##1##2{% + \csname u8:##1\string ##2\endcsname}% + \def\UTFviiiThreeOctets##1##2##3{% + \csname u8:##1\string ##2\string ##3\endcsname}% + \def\UTFviiiFourOctets##1##2##3##4{% + \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \gdef\UTFviiiTmp{#2}% + \endgroup} + + \gdef\parseXMLCharref{% + \ifnum\countUTFz < "A0\relax + \errhelp = \EMsimple + \errmessage{Cannot define Unicode char value < 00A0}% + \else\ifnum\countUTFz < "800\relax + \parseUTFviiiA,% + \parseUTFviiiB C\UTFviiiTwoOctets.,% + \else\ifnum\countUTFz < "10000\relax + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% + \else + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiA!% + \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% + \fi\fi\fi + } + + \gdef\parseUTFviiiA#1{% + \countUTFx = \countUTFz + \divide\countUTFz by 64 + \countUTFy = \countUTFz + \multiply\countUTFz by 64 + \advance\countUTFx by -\countUTFz + \advance\countUTFx by 128 + \uccode `#1\countUTFx + \countUTFz = \countUTFy} + + \gdef\parseUTFviiiB#1#2#3#4{% + \advance\countUTFz by "#10\relax + \uccode `#3\countUTFz + \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} +\endgroup + +\def\utfeightchardefs{% + \DeclareUnicodeCharacter{00A0}{\tie} + \DeclareUnicodeCharacter{00A1}{\exclamdown} + \DeclareUnicodeCharacter{00A3}{\pounds} + \DeclareUnicodeCharacter{00A8}{\"{ }} + \DeclareUnicodeCharacter{00A9}{\copyright} + \DeclareUnicodeCharacter{00AA}{\ordf} + \DeclareUnicodeCharacter{00AB}{\guillemetleft} + \DeclareUnicodeCharacter{00AD}{\-} + \DeclareUnicodeCharacter{00AE}{\registeredsymbol} + \DeclareUnicodeCharacter{00AF}{\={ }} + + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} + \DeclareUnicodeCharacter{00B4}{\'{ }} + \DeclareUnicodeCharacter{00B8}{\cedilla{ }} + \DeclareUnicodeCharacter{00BA}{\ordm} + \DeclareUnicodeCharacter{00BB}{\guillemetright} + \DeclareUnicodeCharacter{00BF}{\questiondown} + + \DeclareUnicodeCharacter{00C0}{\`A} + \DeclareUnicodeCharacter{00C1}{\'A} + \DeclareUnicodeCharacter{00C2}{\^A} + \DeclareUnicodeCharacter{00C3}{\~A} + \DeclareUnicodeCharacter{00C4}{\"A} + \DeclareUnicodeCharacter{00C5}{\AA} + \DeclareUnicodeCharacter{00C6}{\AE} + \DeclareUnicodeCharacter{00C7}{\cedilla{C}} + \DeclareUnicodeCharacter{00C8}{\`E} + \DeclareUnicodeCharacter{00C9}{\'E} + \DeclareUnicodeCharacter{00CA}{\^E} + \DeclareUnicodeCharacter{00CB}{\"E} + \DeclareUnicodeCharacter{00CC}{\`I} + \DeclareUnicodeCharacter{00CD}{\'I} + \DeclareUnicodeCharacter{00CE}{\^I} + \DeclareUnicodeCharacter{00CF}{\"I} + + \DeclareUnicodeCharacter{00D0}{\DH} + \DeclareUnicodeCharacter{00D1}{\~N} + \DeclareUnicodeCharacter{00D2}{\`O} + \DeclareUnicodeCharacter{00D3}{\'O} + \DeclareUnicodeCharacter{00D4}{\^O} + \DeclareUnicodeCharacter{00D5}{\~O} + \DeclareUnicodeCharacter{00D6}{\"O} + \DeclareUnicodeCharacter{00D8}{\O} + \DeclareUnicodeCharacter{00D9}{\`U} + \DeclareUnicodeCharacter{00DA}{\'U} + \DeclareUnicodeCharacter{00DB}{\^U} + \DeclareUnicodeCharacter{00DC}{\"U} + \DeclareUnicodeCharacter{00DD}{\'Y} + \DeclareUnicodeCharacter{00DE}{\TH} + \DeclareUnicodeCharacter{00DF}{\ss} + + \DeclareUnicodeCharacter{00E0}{\`a} + \DeclareUnicodeCharacter{00E1}{\'a} + \DeclareUnicodeCharacter{00E2}{\^a} + \DeclareUnicodeCharacter{00E3}{\~a} + \DeclareUnicodeCharacter{00E4}{\"a} + \DeclareUnicodeCharacter{00E5}{\aa} + \DeclareUnicodeCharacter{00E6}{\ae} + \DeclareUnicodeCharacter{00E7}{\cedilla{c}} + \DeclareUnicodeCharacter{00E8}{\`e} + \DeclareUnicodeCharacter{00E9}{\'e} + \DeclareUnicodeCharacter{00EA}{\^e} + \DeclareUnicodeCharacter{00EB}{\"e} + \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} + \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} + \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} + \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} + + \DeclareUnicodeCharacter{00F0}{\dh} + \DeclareUnicodeCharacter{00F1}{\~n} + \DeclareUnicodeCharacter{00F2}{\`o} + \DeclareUnicodeCharacter{00F3}{\'o} + \DeclareUnicodeCharacter{00F4}{\^o} + \DeclareUnicodeCharacter{00F5}{\~o} + \DeclareUnicodeCharacter{00F6}{\"o} + \DeclareUnicodeCharacter{00F8}{\o} + \DeclareUnicodeCharacter{00F9}{\`u} + \DeclareUnicodeCharacter{00FA}{\'u} + \DeclareUnicodeCharacter{00FB}{\^u} + \DeclareUnicodeCharacter{00FC}{\"u} + \DeclareUnicodeCharacter{00FD}{\'y} + \DeclareUnicodeCharacter{00FE}{\th} + \DeclareUnicodeCharacter{00FF}{\"y} + + \DeclareUnicodeCharacter{0100}{\=A} + \DeclareUnicodeCharacter{0101}{\=a} + \DeclareUnicodeCharacter{0102}{\u{A}} + \DeclareUnicodeCharacter{0103}{\u{a}} + \DeclareUnicodeCharacter{0104}{\ogonek{A}} + \DeclareUnicodeCharacter{0105}{\ogonek{a}} + \DeclareUnicodeCharacter{0106}{\'C} + \DeclareUnicodeCharacter{0107}{\'c} + \DeclareUnicodeCharacter{0108}{\^C} + \DeclareUnicodeCharacter{0109}{\^c} + \DeclareUnicodeCharacter{0118}{\ogonek{E}} + \DeclareUnicodeCharacter{0119}{\ogonek{e}} + \DeclareUnicodeCharacter{010A}{\dotaccent{C}} + \DeclareUnicodeCharacter{010B}{\dotaccent{c}} + \DeclareUnicodeCharacter{010C}{\v{C}} + \DeclareUnicodeCharacter{010D}{\v{c}} + \DeclareUnicodeCharacter{010E}{\v{D}} + + \DeclareUnicodeCharacter{0112}{\=E} + \DeclareUnicodeCharacter{0113}{\=e} + \DeclareUnicodeCharacter{0114}{\u{E}} + \DeclareUnicodeCharacter{0115}{\u{e}} + \DeclareUnicodeCharacter{0116}{\dotaccent{E}} + \DeclareUnicodeCharacter{0117}{\dotaccent{e}} + \DeclareUnicodeCharacter{011A}{\v{E}} + \DeclareUnicodeCharacter{011B}{\v{e}} + \DeclareUnicodeCharacter{011C}{\^G} + \DeclareUnicodeCharacter{011D}{\^g} + \DeclareUnicodeCharacter{011E}{\u{G}} + \DeclareUnicodeCharacter{011F}{\u{g}} + + \DeclareUnicodeCharacter{0120}{\dotaccent{G}} + \DeclareUnicodeCharacter{0121}{\dotaccent{g}} + \DeclareUnicodeCharacter{0124}{\^H} + \DeclareUnicodeCharacter{0125}{\^h} + \DeclareUnicodeCharacter{0128}{\~I} + \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} + \DeclareUnicodeCharacter{012A}{\=I} + \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} + \DeclareUnicodeCharacter{012C}{\u{I}} + \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} + + \DeclareUnicodeCharacter{0130}{\dotaccent{I}} + \DeclareUnicodeCharacter{0131}{\dotless{i}} + \DeclareUnicodeCharacter{0132}{IJ} + \DeclareUnicodeCharacter{0133}{ij} + \DeclareUnicodeCharacter{0134}{\^J} + \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} + \DeclareUnicodeCharacter{0139}{\'L} + \DeclareUnicodeCharacter{013A}{\'l} + + \DeclareUnicodeCharacter{0141}{\L} + \DeclareUnicodeCharacter{0142}{\l} + \DeclareUnicodeCharacter{0143}{\'N} + \DeclareUnicodeCharacter{0144}{\'n} + \DeclareUnicodeCharacter{0147}{\v{N}} + \DeclareUnicodeCharacter{0148}{\v{n}} + \DeclareUnicodeCharacter{014C}{\=O} + \DeclareUnicodeCharacter{014D}{\=o} + \DeclareUnicodeCharacter{014E}{\u{O}} + \DeclareUnicodeCharacter{014F}{\u{o}} + + \DeclareUnicodeCharacter{0150}{\H{O}} + \DeclareUnicodeCharacter{0151}{\H{o}} + \DeclareUnicodeCharacter{0152}{\OE} + \DeclareUnicodeCharacter{0153}{\oe} + \DeclareUnicodeCharacter{0154}{\'R} + \DeclareUnicodeCharacter{0155}{\'r} + \DeclareUnicodeCharacter{0158}{\v{R}} + \DeclareUnicodeCharacter{0159}{\v{r}} + \DeclareUnicodeCharacter{015A}{\'S} + \DeclareUnicodeCharacter{015B}{\'s} + \DeclareUnicodeCharacter{015C}{\^S} + \DeclareUnicodeCharacter{015D}{\^s} + \DeclareUnicodeCharacter{015E}{\cedilla{S}} + \DeclareUnicodeCharacter{015F}{\cedilla{s}} + + \DeclareUnicodeCharacter{0160}{\v{S}} + \DeclareUnicodeCharacter{0161}{\v{s}} + \DeclareUnicodeCharacter{0162}{\cedilla{t}} + \DeclareUnicodeCharacter{0163}{\cedilla{T}} + \DeclareUnicodeCharacter{0164}{\v{T}} + + \DeclareUnicodeCharacter{0168}{\~U} + \DeclareUnicodeCharacter{0169}{\~u} + \DeclareUnicodeCharacter{016A}{\=U} + \DeclareUnicodeCharacter{016B}{\=u} + \DeclareUnicodeCharacter{016C}{\u{U}} + \DeclareUnicodeCharacter{016D}{\u{u}} + \DeclareUnicodeCharacter{016E}{\ringaccent{U}} + \DeclareUnicodeCharacter{016F}{\ringaccent{u}} + + \DeclareUnicodeCharacter{0170}{\H{U}} + \DeclareUnicodeCharacter{0171}{\H{u}} + \DeclareUnicodeCharacter{0174}{\^W} + \DeclareUnicodeCharacter{0175}{\^w} + \DeclareUnicodeCharacter{0176}{\^Y} + \DeclareUnicodeCharacter{0177}{\^y} + \DeclareUnicodeCharacter{0178}{\"Y} + \DeclareUnicodeCharacter{0179}{\'Z} + \DeclareUnicodeCharacter{017A}{\'z} + \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} + \DeclareUnicodeCharacter{017C}{\dotaccent{z}} + \DeclareUnicodeCharacter{017D}{\v{Z}} + \DeclareUnicodeCharacter{017E}{\v{z}} + + \DeclareUnicodeCharacter{01C4}{D\v{Z}} + \DeclareUnicodeCharacter{01C5}{D\v{z}} + \DeclareUnicodeCharacter{01C6}{d\v{z}} + \DeclareUnicodeCharacter{01C7}{LJ} + \DeclareUnicodeCharacter{01C8}{Lj} + \DeclareUnicodeCharacter{01C9}{lj} + \DeclareUnicodeCharacter{01CA}{NJ} + \DeclareUnicodeCharacter{01CB}{Nj} + \DeclareUnicodeCharacter{01CC}{nj} + \DeclareUnicodeCharacter{01CD}{\v{A}} + \DeclareUnicodeCharacter{01CE}{\v{a}} + \DeclareUnicodeCharacter{01CF}{\v{I}} + + \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} + \DeclareUnicodeCharacter{01D1}{\v{O}} + \DeclareUnicodeCharacter{01D2}{\v{o}} + \DeclareUnicodeCharacter{01D3}{\v{U}} + \DeclareUnicodeCharacter{01D4}{\v{u}} + + \DeclareUnicodeCharacter{01E2}{\={\AE}} + \DeclareUnicodeCharacter{01E3}{\={\ae}} + \DeclareUnicodeCharacter{01E6}{\v{G}} + \DeclareUnicodeCharacter{01E7}{\v{g}} + \DeclareUnicodeCharacter{01E8}{\v{K}} + \DeclareUnicodeCharacter{01E9}{\v{k}} + + \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} + \DeclareUnicodeCharacter{01F1}{DZ} + \DeclareUnicodeCharacter{01F2}{Dz} + \DeclareUnicodeCharacter{01F3}{dz} + \DeclareUnicodeCharacter{01F4}{\'G} + \DeclareUnicodeCharacter{01F5}{\'g} + \DeclareUnicodeCharacter{01F8}{\`N} + \DeclareUnicodeCharacter{01F9}{\`n} + \DeclareUnicodeCharacter{01FC}{\'{\AE}} + \DeclareUnicodeCharacter{01FD}{\'{\ae}} + \DeclareUnicodeCharacter{01FE}{\'{\O}} + \DeclareUnicodeCharacter{01FF}{\'{\o}} + + \DeclareUnicodeCharacter{021E}{\v{H}} + \DeclareUnicodeCharacter{021F}{\v{h}} + + \DeclareUnicodeCharacter{0226}{\dotaccent{A}} + \DeclareUnicodeCharacter{0227}{\dotaccent{a}} + \DeclareUnicodeCharacter{0228}{\cedilla{E}} + \DeclareUnicodeCharacter{0229}{\cedilla{e}} + \DeclareUnicodeCharacter{022E}{\dotaccent{O}} + \DeclareUnicodeCharacter{022F}{\dotaccent{o}} + + \DeclareUnicodeCharacter{0232}{\=Y} + \DeclareUnicodeCharacter{0233}{\=y} + \DeclareUnicodeCharacter{0237}{\dotless{j}} + + \DeclareUnicodeCharacter{02DB}{\ogonek{ }} + + \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} + \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} + \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} + \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} + \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} + \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} + \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} + \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} + \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} + \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} + \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} + \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} + + \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} + \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} + + \DeclareUnicodeCharacter{1E20}{\=G} + \DeclareUnicodeCharacter{1E21}{\=g} + \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} + \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} + \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} + \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} + \DeclareUnicodeCharacter{1E26}{\"H} + \DeclareUnicodeCharacter{1E27}{\"h} + + \DeclareUnicodeCharacter{1E30}{\'K} + \DeclareUnicodeCharacter{1E31}{\'k} + \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} + \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} + \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} + \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} + \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} + \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} + \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} + \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} + \DeclareUnicodeCharacter{1E3E}{\'M} + \DeclareUnicodeCharacter{1E3F}{\'m} + + \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} + \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} + \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} + \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} + \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} + \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} + \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} + \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} + \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} + \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} + + \DeclareUnicodeCharacter{1E54}{\'P} + \DeclareUnicodeCharacter{1E55}{\'p} + \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} + \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} + \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} + \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} + \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} + \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} + \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} + \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} + + \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} + \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} + \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} + \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} + \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} + \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} + \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} + \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} + \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} + \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} + + \DeclareUnicodeCharacter{1E7C}{\~V} + \DeclareUnicodeCharacter{1E7D}{\~v} + \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} + \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} + + \DeclareUnicodeCharacter{1E80}{\`W} + \DeclareUnicodeCharacter{1E81}{\`w} + \DeclareUnicodeCharacter{1E82}{\'W} + \DeclareUnicodeCharacter{1E83}{\'w} + \DeclareUnicodeCharacter{1E84}{\"W} + \DeclareUnicodeCharacter{1E85}{\"w} + \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} + \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} + \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} + \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} + \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} + \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} + \DeclareUnicodeCharacter{1E8C}{\"X} + \DeclareUnicodeCharacter{1E8D}{\"x} + \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} + \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} + + \DeclareUnicodeCharacter{1E90}{\^Z} + \DeclareUnicodeCharacter{1E91}{\^z} + \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} + \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} + \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} + \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} + \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} + \DeclareUnicodeCharacter{1E97}{\"t} + \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} + \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} + + \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} + \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} + + \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} + \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} + \DeclareUnicodeCharacter{1EBC}{\~E} + \DeclareUnicodeCharacter{1EBD}{\~e} + + \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} + \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} + \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} + \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} + + \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} + \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} + + \DeclareUnicodeCharacter{1EF2}{\`Y} + \DeclareUnicodeCharacter{1EF3}{\`y} + \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} + + \DeclareUnicodeCharacter{1EF8}{\~Y} + \DeclareUnicodeCharacter{1EF9}{\~y} + + \DeclareUnicodeCharacter{2013}{--} + \DeclareUnicodeCharacter{2014}{---} + \DeclareUnicodeCharacter{2018}{\quoteleft} + \DeclareUnicodeCharacter{2019}{\quoteright} + \DeclareUnicodeCharacter{201A}{\quotesinglbase} + \DeclareUnicodeCharacter{201C}{\quotedblleft} + \DeclareUnicodeCharacter{201D}{\quotedblright} + \DeclareUnicodeCharacter{201E}{\quotedblbase} + \DeclareUnicodeCharacter{2022}{\bullet} + \DeclareUnicodeCharacter{2026}{\dots} + \DeclareUnicodeCharacter{2039}{\guilsinglleft} + \DeclareUnicodeCharacter{203A}{\guilsinglright} + \DeclareUnicodeCharacter{20AC}{\euro} + + \DeclareUnicodeCharacter{2192}{\expansion} + \DeclareUnicodeCharacter{21D2}{\result} + + \DeclareUnicodeCharacter{2212}{\minus} + \DeclareUnicodeCharacter{2217}{\point} + \DeclareUnicodeCharacter{2261}{\equiv} +}% end of \utfeightchardefs + + +% US-ASCII character definitions. +\def\asciichardefs{% nothing need be done + \relax +} + +% Make non-ASCII characters printable again for compatibility with +% existing Texinfo documents that may use them, even without declaring a +% document encoding. +% +\setnonasciicharscatcode \other + + +\message{formatting,} + +\newdimen\defaultparindent \defaultparindent = 15pt + +\chapheadingskip = 15pt plus 4pt minus 2pt +\secheadingskip = 12pt plus 3pt minus 2pt +\subsecheadingskip = 9pt plus 2pt minus 2pt + +% Prevent underfull vbox error messages. +\vbadness = 10000 + +% Don't be very finicky about underfull hboxes, either. +\hbadness = 6666 + +% Following George Bush, get rid of widows and orphans. +\widowpenalty=10000 +\clubpenalty=10000 + +% Use TeX 3.0's \emergencystretch to help line breaking, but if we're +% using an old version of TeX, don't do anything. We want the amount of +% stretch added to depend on the line length, hence the dependence on +% \hsize. We call this whenever the paper size is set. +% +\def\setemergencystretch{% + \ifx\emergencystretch\thisisundefined + % Allow us to assign to \emergencystretch anyway. + \def\emergencystretch{\dimen0}% + \else + \emergencystretch = .15\hsize + \fi +} + +% Parameters in order: 1) textheight; 2) textwidth; +% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; +% 7) physical page height; 8) physical page width. +% +% We also call \setleading{\textleading}, so the caller should define +% \textleading. The caller should also set \parskip. +% +\def\internalpagesizes#1#2#3#4#5#6#7#8{% + \voffset = #3\relax + \topskip = #6\relax + \splittopskip = \topskip + % + \vsize = #1\relax + \advance\vsize by \topskip + \outervsize = \vsize + \advance\outervsize by 2\topandbottommargin + \pageheight = \vsize + % + \hsize = #2\relax + \outerhsize = \hsize + \advance\outerhsize by 0.5in + \pagewidth = \hsize + % + \normaloffset = #4\relax + \bindingoffset = #5\relax + % + \ifpdf + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + % if we don't reset these, they will remain at "1 true in" of + % whatever layout pdftex was dumped with. + \pdfhorigin = 1 true in + \pdfvorigin = 1 true in + \fi + % + \setleading{\textleading} + % + \parindent = \defaultparindent + \setemergencystretch +} + +% @letterpaper (the default). +\def\letterpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % If page is nothing but text, make it come out even. + \internalpagesizes{607.2pt}{6in}% that's 46 lines + {\voffset}{.25in}% + {\bindingoffset}{36pt}% + {11in}{8.5in}% +}} + +% Use @smallbook to reset parameters for 7x9.25 trim size. +\def\smallbook{{\globaldefs = 1 + \parskip = 2pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.5in}{5in}% + {-.2in}{0in}% + {\bindingoffset}{16pt}% + {9.25in}{7in}% + % + \lispnarrowing = 0.3in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = .5cm +}} + +% Use @smallerbook to reset parameters for 6x9 trim size. +% (Just testing, parameters still in flux.) +\def\smallerbook{{\globaldefs = 1 + \parskip = 1.5pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.4in}{4.8in}% + {-.2in}{-.4in}% + {0pt}{14pt}% + {9in}{6in}% + % + \lispnarrowing = 0.25in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = .4cm +}} + +% Use @afourpaper to print on European A4 paper. +\def\afourpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % Double-side printing via postscript on Laserjet 4050 + % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. + % To change the settings for a different printer or situation, adjust + % \normaloffset until the front-side and back-side texts align. Then + % do the same for \bindingoffset. You can set these for testing in + % your texinfo source file like this: + % @tex + % \global\normaloffset = -6mm + % \global\bindingoffset = 10mm + % @end tex + \internalpagesizes{673.2pt}{160mm}% that's 51 lines + {\voffset}{\hoffset}% + {\bindingoffset}{44pt}% + {297mm}{210mm}% + % + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = 5mm +}} + +% Use @afivepaper to print on European A5 paper. +% From romildo@urano.iceb.ufop.br, 2 July 2000. +% He also recommends making @example and @lisp be small. +\def\afivepaper{{\globaldefs = 1 + \parskip = 2pt plus 1pt minus 0.1pt + \textleading = 12.5pt + % + \internalpagesizes{160mm}{120mm}% + {\voffset}{\hoffset}% + {\bindingoffset}{8pt}% + {210mm}{148mm}% + % + \lispnarrowing = 0.2in + \tolerance = 800 + \hfuzz = 1.2pt + \contentsrightmargin = 0pt + \defbodyindent = 2mm + \tableindent = 12mm +}} + +% A specific text layout, 24x15cm overall, intended for A4 paper. +\def\afourlatex{{\globaldefs = 1 + \afourpaper + \internalpagesizes{237mm}{150mm}% + {\voffset}{4.6mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + % + % Must explicitly reset to 0 because we call \afourpaper. + \globaldefs = 0 +}} + +% Use @afourwide to print on A4 paper in landscape format. +\def\afourwide{{\globaldefs = 1 + \afourpaper + \internalpagesizes{241mm}{165mm}% + {\voffset}{-2.95mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + \globaldefs = 0 +}} + +% @pagesizes TEXTHEIGHT[,TEXTWIDTH] +% Perhaps we should allow setting the margins, \topskip, \parskip, +% and/or leading, also. Or perhaps we should compute them somehow. +% +\parseargdef\pagesizes{\pagesizesyyy #1,,\finish} +\def\pagesizesyyy#1,#2,#3\finish{{% + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi + \globaldefs = 1 + % + \parskip = 3pt plus 2pt minus 1pt + \setleading{\textleading}% + % + \dimen0 = #1\relax + \advance\dimen0 by \voffset + % + \dimen2 = \hsize + \advance\dimen2 by \normaloffset + % + \internalpagesizes{#1}{\hsize}% + {\voffset}{\normaloffset}% + {\bindingoffset}{44pt}% + {\dimen0}{\dimen2}% +}} + +% Set default to letter. +% +\letterpaper + + +\message{and turning on texinfo input format.} + +\def^^L{\par} % remove \outer, so ^L can appear in an @comment + +% DEL is a comment character, in case @c does not suffice. +\catcode`\^^? = 14 + +% Define macros to output various characters with catcode for normal text. +\catcode`\"=\other \def\normaldoublequote{"} +\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix +\catcode`\+=\other \def\normalplus{+} +\catcode`\<=\other \def\normalless{<} +\catcode`\>=\other \def\normalgreater{>} +\catcode`\^=\other \def\normalcaret{^} +\catcode`\_=\other \def\normalunderscore{_} +\catcode`\|=\other \def\normalverticalbar{|} +\catcode`\~=\other \def\normaltilde{~} + +% This macro is used to make a character print one way in \tt +% (where it can probably be output as-is), and another way in other fonts, +% where something hairier probably needs to be done. +% +% #1 is what to print if we are indeed using \tt; #2 is what to print +% otherwise. Since all the Computer Modern typewriter fonts have zero +% interword stretch (and shrink), and it is reasonable to expect all +% typewriter fonts to have this, we can check that font parameter. +% +\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} + +% Same as above, but check for italic font. Actually this also catches +% non-italic slanted fonts since it is impossible to distinguish them from +% italic fonts. But since this is only used by $ and it uses \sl anyway +% this is not a problem. +\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} + +% Turn off all special characters except @ +% (and those which the user can use as if they were ordinary). +% Most of these we simply print from the \tt font, but for some, we can +% use math or other variants that look better in normal text. + +\catcode`\"=\active +\def\activedoublequote{{\tt\char34}} +\let"=\activedoublequote +\catcode`\~=\active +\def~{{\tt\char126}} +\chardef\hat=`\^ +\catcode`\^=\active +\def^{{\tt \hat}} + +\catcode`\_=\active +\def_{\ifusingtt\normalunderscore\_} +\let\realunder=_ +% Subroutine for the previous macro. +\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } + +\catcode`\|=\active +\def|{{\tt\char124}} +\chardef \less=`\< +\catcode`\<=\active +\def<{{\tt \less}} +\chardef \gtr=`\> +\catcode`\>=\active +\def>{{\tt \gtr}} +\catcode`\+=\active +\def+{{\tt \char 43}} +\catcode`\$=\active +\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix + +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have \everyjob (or @setfilename) turn them on. +% \otherifyactive is called near the end of this file. +\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} + +% Used sometimes to turn off (effectively) the active characters even after +% parsing them. +\def\turnoffactive{% + \normalturnoffactive + \otherbackslash +} + +\catcode`\@=0 + +% \backslashcurfont outputs one backslash character in current font, +% as in \char`\\. +\global\chardef\backslashcurfont=`\\ +\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work + +% \realbackslash is an actual character `\' with catcode other, and +% \doublebackslash is two of them (for the pdf outlines). +{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} + +% In texinfo, backslash is an active character; it prints the backslash +% in fixed width font. +\catcode`\\=\active % @ for escape char from now on. + +% The story here is that in math mode, the \char of \backslashcurfont +% ends up printing the roman \ from the math symbol font (because \char +% in math mode uses the \mathcode, and plain.tex sets +% \mathcode`\\="026E). It seems better for @backslashchar{} to always +% print a typewriter backslash, hence we use an explicit \mathchar, +% which is the decimal equivalent of "715c (class 7, e.g., use \fam; +% ignored family value; char position "5C). We can't use " for the +% usual hex value because it has already been made active. +@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} +@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. + +% On startup, @fixbackslash assigns: +% @let \ = @normalbackslash +% \rawbackslash defines an active \ to do \backslashcurfont. +% \otherbackslash defines an active \ to be a literal `\' character with +% catcode other. We switch back and forth between these. +@gdef@rawbackslash{@let\=@backslashcurfont} +@gdef@otherbackslash{@let\=@realbackslash} + +% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +% the literal character `\'. Also revert - to its normal character, in +% case the active - from code has slipped in. +% +{@catcode`- = @active + @gdef@normalturnoffactive{% + @let-=@normaldash + @let"=@normaldoublequote + @let$=@normaldollar %$ font-lock fix + @let+=@normalplus + @let<=@normalless + @let>=@normalgreater + @let\=@normalbackslash + @let^=@normalcaret + @let_=@normalunderscore + @let|=@normalverticalbar + @let~=@normaltilde + @markupsetuplqdefault + @markupsetuprqdefault + @unsepspaces + } +} + +% Make _ and + \other characters, temporarily. +% This is canceled by @fixbackslash. +@otherifyactive + +% If a .fmt file is being used, we don't want the `\input texinfo' to show up. +% That is what \eatinput is for; after that, the `\' should revert to printing +% a backslash. +% +@gdef@eatinput input texinfo{@fixbackslash} +@global@let\ = @eatinput + +% On the other hand, perhaps the file did not have a `\input texinfo'. Then +% the first `\' in the file would cause an error. This macro tries to fix +% that, assuming it is called before the first `\' could plausibly occur. +% Also turn back on active characters that might appear in the input +% file name, in case not using a pre-dumped format. +% +@gdef@fixbackslash{% + @ifx\@eatinput @let\ = @normalbackslash @fi + @catcode`+=@active + @catcode`@_=@active +} + +% Say @foo, not \foo, in error messages. +@escapechar = `@@ + +% These (along with & and #) are made active for url-breaking, so need +% active definitions as the normal characters. +@def@normaldot{.} +@def@normalquest{?} +@def@normalslash{/} + +% These look ok in all fonts, so just make them not special. +% @hashchar{} gets its own user-level command, because of #line. +@catcode`@& = @other @def@normalamp{&} +@catcode`@# = @other @def@normalhash{#} +@catcode`@% = @other @def@normalpercent{%} + +@let @hashchar = @normalhash + +@c Finally, make ` and ' active, so that txicodequoteundirected and +@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we +@c don't make ` and ' active, @code will not get them as active chars. +@c Do this last of all since we use ` in the previous @catcode assignments. +@catcode`@'=@active +@catcode`@`=@active +@markupsetuplqdefault +@markupsetuprqdefault + +@c Local variables: +@c eval: (add-hook 'write-file-hooks 'time-stamp) +@c page-delimiter: "^\\\\message" +@c time-stamp-start: "def\\\\texinfoversion{" +@c time-stamp-format: "%:y-%02m-%02d.%02H" +@c time-stamp-end: "}" +@c End: + +@c vim:sw=2: + +@ignore + arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 +@end ignore diff --git a/doc/version.texi b/doc/version.texi new file mode 100644 index 0000000..3820806 --- /dev/null +++ b/doc/version.texi @@ -0,0 +1,4 @@ +@set UPDATED 27 November 2016 +@set UPDATED-MONTH November 2016 +@set EDITION 2.38.0 +@set VERSION 2.38.0 diff --git a/doc/white-paper.texi b/doc/white-paper.texi new file mode 100644 index 0000000..8c53c26 --- /dev/null +++ b/doc/white-paper.texi @@ -0,0 +1,90 @@ +@node White Paper, Reference Manual, About, Top +@chapter LibGTop White Paper + +@menu +* Introduction:: Introduction +* Overview:: Overview +@end menu + +@node Introduction, Overview, White Paper, White Paper +@section Introduction + +Many modern UNIX systems like Solaris, BSD or Digitial Unix only allow +priviledged processes to read information like CPU and Memory Usage or +information about running processes. + +@itemize @bullet +@item +BSD, for instance, doesn't have any other way to get those data than reading +directly from @file{/dev/kmem} and you need to be in the @code{kmem} group to +be able to read this. + +@item +Other systems, like Digital Unix, allow all users to get things like CPU and +Memory statistics, but only root may read information about any process other +than the current one (you may not even get information about your own processes +if you're not root). + +@item +Linux has a very nice @file{/proc} filesystem, but reading and parsing +@file{/proc} is very slow and inefficient. + +@item +Solaris is a bit better, but you still need to be in the @code{sys} group or +even root to get some data. +@end itemize + +Because of this system utilities like @code{ps}, @code{uptime} or @code{top} +often are setgid kmem or setuid root. Usually, they're also very specific to +the system they're written for and not easily portable to other systems without +a lot of work. + +This, of cause, becomes a problem for graphical tools like @code{gtop} - making +a GTK+ program setgid or even setuid would be a security hole as big as you can +drive the entire X11 source code through. For the GNOME project, we also needed +some kind of library which provides all the required information in a portable +since there's more than just one single program that wants to use them - for +instance @code{gtop} and the @code{multiload}, @code{cpumemusage} and +@code{netload} panel applets. + +@node Overview, , Introduction, White Paper +@section Overview + +This section should give you a short overview on how LibGTop was developed, which +things needed to be considered and how it works. + +@menu +* Interface Design:: Things that need to be considered +* Server Implementation:: The LibGTop "server" +@end menu + +@node Interface Design, Server Implementation, Overview, Overview +@subsection Interface Design + +At the very beginning, it was necessary to collect all the data the library part +should provide and put them into some C structures. This was not that easiy as it +might sound since LibGTop should be portable to any modern UNIX system with a common +library part on all those systems, but the data that should be returned vary from +system to system. For instance some systems support shared memory, but some others +may not. + +The header files where we define these C structures (which are system-independent) are +shared between client and server. This way we can call the system dependent code +directly where we do not need any special privileges to do so. + +All of those structures contain a @code{flags} member which is interpreted as a bit +mask and tells the caller of the library functions which of the fields in the returned +structure are valid and which are not. + +@node Server Implementation, , Interface Design, Overview +@subsection Server Implementation + +The LibGTop @dfn{server} is a setgid/setuid binary which contains all the system +dependent code which needs special privileges. It is only build if it's required +on the current system (for instance, the Linux kernel provides all the required +data via its @file{/proc} filesystem so we do not need the server at all) and it +only contains the @dfn{features} which need privileges. + +Whenever we do not need any privileges to get all the data for some of the requested +structures (here called @dfn{features}) the library calls the sysdeps code directly +rather than using the server. diff --git a/examples/ChangeLog b/examples/ChangeLog new file mode 100644 index 0000000..ce70977 --- /dev/null +++ b/examples/ChangeLog @@ -0,0 +1,243 @@ +2007-05-19 Benoît Dejean + + * Makefile.am: + * mem.c: (main): + * wd.c: (main): + + Fixed wd and new simple mem example. + +2006-02-27 Benoît Dejean + + * pprint.c: (pprint_get_proc_mem), (main): + + Added proc_mem example. + +2005-12-15 Benoît Dejean + + * proclist.c: (print_pids), (main): + + Improved example. + +2005-12-12 Benoît Dejean + + * .cvsignore: + * Makefile.am: + * proclist.c: (main): + * procmap.c: (main): + + Added quick example for glibtop_get_proclist() + and updated procmap example to display smap. + +2005-08-02 Benoît Dejean + + * pprint.c: (pprint_get_cpu), (pprint_get_loadavg), + (pprint_get_mem), (pprint_get_msg_limits), (pprint_get_netlist), + (pprint_get_swap), (pprint_get_uptime), (pprint_get_proc_kernel), + (main): + + Added pprint_get_proc_kernel(pid). + Fixed prototypes. + +2005-01-22 Benoît Dejean + + * openfiles.c: (show_open_files): Updated. + +2004-12-23 Benoît Dejean + + * netload.c: (main): + * procmap.c: (main): s/glibtop_error/g_error/g + +2004-11-15 Benoît Dejean + + * netload.c: (hwaddress_format_for_display), (main): Updated. + +2004-11-13 Benoît Dejean + + * pprint.c: (pprint_get_fsusage), (pprint_get_mountlist), + (pprint_get_netload), (pprint_get_netlist), (main): Updated. + +2004-09-25 Benoît Dejean + + * pprint.c: (main): Re-added pprint_get_msg_limits() + +i2004-09-25 Benoît Dejean + + * df.c: (main): + * pprint.c: (main): + * procargs.c: (main): Added missing call to glibgtop_init() / glibtop_close() + +2004-09-24 Benoît Dejean + + * .cvsignore: + * Makefile.am: + * ../configure.in + * df.c: (print_fsusage), (main): Added new example, just like 'df'. + +2004-09-22 Benoît Dejean + + * pprint.c: (main): Disable pprint_get_msg_limits() because it can fail. + +2004-09-21 Benoît Dejean + + * pprint.c: (pprint_get_swap), (main): Updated. + +2004-09-21 Benoît Dejean + + * procargs.c: (show_args), (main): Updated. + +2004-09-21 Benoît Dejean + + * pprint.c: (pprint_get_mountlist), (pprint_get_netload), + (pprint_get_uptime), (main): Updated. + +2004-09-21 Benoît Dejean + + * pprint.c: (pprint_get_mountlist): Updated. + +2004-09-21 Benoît Dejean + + * procargs.c: (show_args), (main): Updated. + +2004-09-20 Benoît Dejean + + * .cvsignore: + * Makefile.am: + * pprint.c: (pprint_get_cpu), (pprint_get_fsusage), + (pprint_get_loadavg), (pprint_get_mem), (pprint_get_mountlist), + (pprint_get_msg_limits), (main): Added new example : pretty prints + the result of glibtop_*. Work in progress. + + Now builds procargs. + + * ../configure.in: Added to static list. + +2004-07-07 Benoît Dejean + + * procargs.c: Added glibtop_get_proc_argv demo. + +2003-12-27 Ole Laursen + + * mountlist.c: Updated to display block size too. + +2004-03-04 Bastien Nocera + + * smp.c: use libgtop-i18n.h + +2003-10-21 Bastien Nocera + + * Makefile.am: + * smp.c: + * sysdeps.c: (main): install only one library, libgtop-2.0 + Fix build-time warnings due to the redefinition of guint64 + Fix building smp.c and sysdeps.c + +2003-10-20 Bastien Nocera + + * first.c: + * mountlist.c: + * netload.c: + * procmap.c: + * second.c: + * smp.c: + * sysdeps.c: + * third.c: + * timings.c: fixed compilation + +2003-10-20 Bastien Nocera + + * Makefile.am: removed traces of guile, intllibs and libgnomesupport + +2001-01-14 Abel Cheung + + * \*.c: bindtextdomain and textdomain uses GETTEXT_PACKAGE. + + * Makefile.am, first.c, second.c, sysdeps.c: Make them at least + compile for now, by disabling chunks which should belong to + HEAD branch. + +1999-05-28 Martin Baulig + + * first.c, second.c, sysdeps.c: Use LibGTop version conditionals + so we can more easily merge the code into LIBGTOP_STABLE_1_0. + +1999-05-07 Martin Baulig + + * timings.c (timersub): Renamed this to `libgtop_timersub' and define + it on all systems. + +Fri Apr 9 00:14:52 1999 Timur Bakeyev + + * timings.c: Added timersub defenition, to make code compilable on + BSDI. + +1999-03-24 Martin Baulig + + * timings.c: New example. + +1999-03-17 Martin Baulig + + * first.c, second.c: Fixed a bug that caused a core dump when + the sysdeps code does not return all data. + +1998-11-22 Martin Baulig + + * netload.c: Call inet_ntoa () to get address and subnet + in quatted dot notation (like 136.199.14.201) and not just + as a number (like 0xc90ec788). + +1998-11-02 Martin Baulig + + * sysdeps.c: New example. + +1998-10-26 Martin Baulig + + * netload.c: New file. Gets network load for the interface + given as command line argument. + +1998-10-26 Martin Baulig + + * first.c (glibtop_get_proc_args): Get command line arguments. + * second.c: Likewise. + +1998-10-25 Martin Baulig + + * first.c (glibtop_get_ppp): Get PPP/ISDN statistics. + +1998-09-28 Martin Baulig + + * Makefile.am: Install everything in $(libexecdir)/libgtop. + +1998-09-09 Martin Baulig + + * smp.c: New file. Nice tool to show CPU statistics on SMP systems. + +1998-08-25 Martin Baulig + + * first.c, second.c, procmap.c: Fixed some compiler warnings. + +1998-08-18 Martin Baulig + + * procmap.c: We now display filenames when compiled + `--with-libgtop-inodedb'. + +1998-08-12 Martin Baulig + + * second.c: Works a little bit more like `ps' - you can + give an optional command line argument to get information + about a single process. + +1998-07-22 Martin Baulig + + * mountlist.c: New file. + +1998-06-12 Martin Baulig + + * test.scm: New file. + +1998-06-07 Martin Baulig + + * Makefile.am (CFLAGS): Disable optimize. + + * first.c (PROFILE_COUNT): Number of times each function + should be called. Defaults to 1; to profile the code, you + can increase this when compiling. diff --git a/examples/Makefile.am b/examples/Makefile.am new file mode 100644 index 0000000..25585e0 --- /dev/null +++ b/examples/Makefile.am @@ -0,0 +1,69 @@ +## Process this file with automake to produce Makefile.in + +AM_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/sysdeps/$(sysdeps_dir) \ + -DGTOPLOCALEDIR=\"$(localedir)\" \ + $(GLIB_CFLAGS) + +AM_LDFLAGS = $(LIBGTOP_EXTRA_LIBS) + +noinst_PROGRAMS = first second pprint procargs df netlist \ + mountlist procmap netload sysdeps timings \ + openfiles smp proclist free wd affinity diskio + +first_SOURCES = first.c +first_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +second_SOURCES = second.c +second_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm + +procmap_SOURCES = procmap.c +procmap_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +netload_SOURCES = netload.c +netload_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +sysdeps_SOURCES = sysdeps.c +sysdeps_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +mountlist_SOURCES = mountlist.c +mountlist_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +smp_SOURCES = smp.c +smp_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm + +timings_SOURCES = timings.c +timings_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +pprint_SOURCES = pprint.c +pprint_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +procargs_SOURCES = procargs.c +procargs_LDADD = $(top_builddir)/lib/libgtop-2.0.la + + +df_SOURCES = df.c +df_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +netlist_SOURCES = netlist.c +netlist_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +openfiles_SOURCES = openfiles.c +openfiles_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +proclist_SOURCES = proclist.c +proclist_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +wd_SOURCES = wd.c +wd_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +free_SOURCE = mem.c +free_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +affinity_SOURCES = affinity.c +affinity_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +diskio_SOURCES = diskio.c +diskio_LDADD = $(top_builddir)/lib/libgtop-2.0.la diff --git a/examples/Makefile.in b/examples/Makefile.in new file mode 100644 index 0000000..17b28e1 --- /dev/null +++ b/examples/Makefile.in @@ -0,0 +1,853 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = first$(EXEEXT) second$(EXEEXT) pprint$(EXEEXT) \ + procargs$(EXEEXT) df$(EXEEXT) netlist$(EXEEXT) \ + mountlist$(EXEEXT) procmap$(EXEEXT) netload$(EXEEXT) \ + sysdeps$(EXEEXT) timings$(EXEEXT) openfiles$(EXEEXT) \ + smp$(EXEEXT) proclist$(EXEEXT) free$(EXEEXT) wd$(EXEEXT) \ + affinity$(EXEEXT) diskio$(EXEEXT) +subdir = examples +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_affinity_OBJECTS = affinity.$(OBJEXT) +affinity_OBJECTS = $(am_affinity_OBJECTS) +affinity_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am_df_OBJECTS = df.$(OBJEXT) +df_OBJECTS = $(am_df_OBJECTS) +df_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_diskio_OBJECTS = diskio.$(OBJEXT) +diskio_OBJECTS = $(am_diskio_OBJECTS) +diskio_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_first_OBJECTS = first.$(OBJEXT) +first_OBJECTS = $(am_first_OBJECTS) +first_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +free_SOURCES = free.c +free_OBJECTS = free.$(OBJEXT) +free_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_mountlist_OBJECTS = mountlist.$(OBJEXT) +mountlist_OBJECTS = $(am_mountlist_OBJECTS) +mountlist_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_netlist_OBJECTS = netlist.$(OBJEXT) +netlist_OBJECTS = $(am_netlist_OBJECTS) +netlist_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_netload_OBJECTS = netload.$(OBJEXT) +netload_OBJECTS = $(am_netload_OBJECTS) +netload_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_openfiles_OBJECTS = openfiles.$(OBJEXT) +openfiles_OBJECTS = $(am_openfiles_OBJECTS) +openfiles_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_pprint_OBJECTS = pprint.$(OBJEXT) +pprint_OBJECTS = $(am_pprint_OBJECTS) +pprint_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_procargs_OBJECTS = procargs.$(OBJEXT) +procargs_OBJECTS = $(am_procargs_OBJECTS) +procargs_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_proclist_OBJECTS = proclist.$(OBJEXT) +proclist_OBJECTS = $(am_proclist_OBJECTS) +proclist_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_procmap_OBJECTS = procmap.$(OBJEXT) +procmap_OBJECTS = $(am_procmap_OBJECTS) +procmap_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_second_OBJECTS = second.$(OBJEXT) +second_OBJECTS = $(am_second_OBJECTS) +second_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_smp_OBJECTS = smp.$(OBJEXT) +smp_OBJECTS = $(am_smp_OBJECTS) +smp_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_sysdeps_OBJECTS = sysdeps.$(OBJEXT) +sysdeps_OBJECTS = $(am_sysdeps_OBJECTS) +sysdeps_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_timings_OBJECTS = timings.$(OBJEXT) +timings_OBJECTS = $(am_timings_OBJECTS) +timings_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +am_wd_OBJECTS = wd.$(OBJEXT) +wd_OBJECTS = $(am_wd_OBJECTS) +wd_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(affinity_SOURCES) $(df_SOURCES) $(diskio_SOURCES) \ + $(first_SOURCES) free.c $(mountlist_SOURCES) \ + $(netlist_SOURCES) $(netload_SOURCES) $(openfiles_SOURCES) \ + $(pprint_SOURCES) $(procargs_SOURCES) $(proclist_SOURCES) \ + $(procmap_SOURCES) $(second_SOURCES) $(smp_SOURCES) \ + $(sysdeps_SOURCES) $(timings_SOURCES) $(wd_SOURCES) +DIST_SOURCES = $(affinity_SOURCES) $(df_SOURCES) $(diskio_SOURCES) \ + $(first_SOURCES) free.c $(mountlist_SOURCES) \ + $(netlist_SOURCES) $(netload_SOURCES) $(openfiles_SOURCES) \ + $(pprint_SOURCES) $(procargs_SOURCES) $(proclist_SOURCES) \ + $(procmap_SOURCES) $(second_SOURCES) $(smp_SOURCES) \ + $(sysdeps_SOURCES) $(timings_SOURCES) $(wd_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + ChangeLog +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/sysdeps/$(sysdeps_dir) \ + -DGTOPLOCALEDIR=\"$(localedir)\" \ + $(GLIB_CFLAGS) + +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_LDFLAGS = $(LIBGTOP_EXTRA_LIBS) +first_SOURCES = first.c +first_LDADD = $(top_builddir)/lib/libgtop-2.0.la +second_SOURCES = second.c +second_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm +procmap_SOURCES = procmap.c +procmap_LDADD = $(top_builddir)/lib/libgtop-2.0.la +netload_SOURCES = netload.c +netload_LDADD = $(top_builddir)/lib/libgtop-2.0.la +sysdeps_SOURCES = sysdeps.c +sysdeps_LDADD = $(top_builddir)/lib/libgtop-2.0.la +mountlist_SOURCES = mountlist.c +mountlist_LDADD = $(top_builddir)/lib/libgtop-2.0.la +smp_SOURCES = smp.c +smp_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm +timings_SOURCES = timings.c +timings_LDADD = $(top_builddir)/lib/libgtop-2.0.la +pprint_SOURCES = pprint.c +pprint_LDADD = $(top_builddir)/lib/libgtop-2.0.la +procargs_SOURCES = procargs.c +procargs_LDADD = $(top_builddir)/lib/libgtop-2.0.la +df_SOURCES = df.c +df_LDADD = $(top_builddir)/lib/libgtop-2.0.la +netlist_SOURCES = netlist.c +netlist_LDADD = $(top_builddir)/lib/libgtop-2.0.la +openfiles_SOURCES = openfiles.c +openfiles_LDADD = $(top_builddir)/lib/libgtop-2.0.la +proclist_SOURCES = proclist.c +proclist_LDADD = $(top_builddir)/lib/libgtop-2.0.la +wd_SOURCES = wd.c +wd_LDADD = $(top_builddir)/lib/libgtop-2.0.la +free_SOURCE = mem.c +free_LDADD = $(top_builddir)/lib/libgtop-2.0.la +affinity_SOURCES = affinity.c +affinity_LDADD = $(top_builddir)/lib/libgtop-2.0.la +diskio_SOURCES = diskio.c +diskio_LDADD = $(top_builddir)/lib/libgtop-2.0.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu examples/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +affinity$(EXEEXT): $(affinity_OBJECTS) $(affinity_DEPENDENCIES) $(EXTRA_affinity_DEPENDENCIES) + @rm -f affinity$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(affinity_OBJECTS) $(affinity_LDADD) $(LIBS) + +df$(EXEEXT): $(df_OBJECTS) $(df_DEPENDENCIES) $(EXTRA_df_DEPENDENCIES) + @rm -f df$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(df_OBJECTS) $(df_LDADD) $(LIBS) + +diskio$(EXEEXT): $(diskio_OBJECTS) $(diskio_DEPENDENCIES) $(EXTRA_diskio_DEPENDENCIES) + @rm -f diskio$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(diskio_OBJECTS) $(diskio_LDADD) $(LIBS) + +first$(EXEEXT): $(first_OBJECTS) $(first_DEPENDENCIES) $(EXTRA_first_DEPENDENCIES) + @rm -f first$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(first_OBJECTS) $(first_LDADD) $(LIBS) + +free$(EXEEXT): $(free_OBJECTS) $(free_DEPENDENCIES) $(EXTRA_free_DEPENDENCIES) + @rm -f free$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(free_OBJECTS) $(free_LDADD) $(LIBS) + +mountlist$(EXEEXT): $(mountlist_OBJECTS) $(mountlist_DEPENDENCIES) $(EXTRA_mountlist_DEPENDENCIES) + @rm -f mountlist$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mountlist_OBJECTS) $(mountlist_LDADD) $(LIBS) + +netlist$(EXEEXT): $(netlist_OBJECTS) $(netlist_DEPENDENCIES) $(EXTRA_netlist_DEPENDENCIES) + @rm -f netlist$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlist_OBJECTS) $(netlist_LDADD) $(LIBS) + +netload$(EXEEXT): $(netload_OBJECTS) $(netload_DEPENDENCIES) $(EXTRA_netload_DEPENDENCIES) + @rm -f netload$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netload_OBJECTS) $(netload_LDADD) $(LIBS) + +openfiles$(EXEEXT): $(openfiles_OBJECTS) $(openfiles_DEPENDENCIES) $(EXTRA_openfiles_DEPENDENCIES) + @rm -f openfiles$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(openfiles_OBJECTS) $(openfiles_LDADD) $(LIBS) + +pprint$(EXEEXT): $(pprint_OBJECTS) $(pprint_DEPENDENCIES) $(EXTRA_pprint_DEPENDENCIES) + @rm -f pprint$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pprint_OBJECTS) $(pprint_LDADD) $(LIBS) + +procargs$(EXEEXT): $(procargs_OBJECTS) $(procargs_DEPENDENCIES) $(EXTRA_procargs_DEPENDENCIES) + @rm -f procargs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(procargs_OBJECTS) $(procargs_LDADD) $(LIBS) + +proclist$(EXEEXT): $(proclist_OBJECTS) $(proclist_DEPENDENCIES) $(EXTRA_proclist_DEPENDENCIES) + @rm -f proclist$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(proclist_OBJECTS) $(proclist_LDADD) $(LIBS) + +procmap$(EXEEXT): $(procmap_OBJECTS) $(procmap_DEPENDENCIES) $(EXTRA_procmap_DEPENDENCIES) + @rm -f procmap$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(procmap_OBJECTS) $(procmap_LDADD) $(LIBS) + +second$(EXEEXT): $(second_OBJECTS) $(second_DEPENDENCIES) $(EXTRA_second_DEPENDENCIES) + @rm -f second$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(second_OBJECTS) $(second_LDADD) $(LIBS) + +smp$(EXEEXT): $(smp_OBJECTS) $(smp_DEPENDENCIES) $(EXTRA_smp_DEPENDENCIES) + @rm -f smp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(smp_OBJECTS) $(smp_LDADD) $(LIBS) + +sysdeps$(EXEEXT): $(sysdeps_OBJECTS) $(sysdeps_DEPENDENCIES) $(EXTRA_sysdeps_DEPENDENCIES) + @rm -f sysdeps$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sysdeps_OBJECTS) $(sysdeps_LDADD) $(LIBS) + +timings$(EXEEXT): $(timings_OBJECTS) $(timings_DEPENDENCIES) $(EXTRA_timings_DEPENDENCIES) + @rm -f timings$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(timings_OBJECTS) $(timings_LDADD) $(LIBS) + +wd$(EXEEXT): $(wd_OBJECTS) $(wd_DEPENDENCIES) $(EXTRA_wd_DEPENDENCIES) + @rm -f wd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(wd_OBJECTS) $(wd_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/affinity.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/df.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/first.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/free.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mountlist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netload.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openfiles.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pprint.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/second.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysdeps.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timings.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wd.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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: diff --git a/examples/affinity.c b/examples/affinity.c new file mode 100644 index 0000000..cd670da --- /dev/null +++ b/examples/affinity.c @@ -0,0 +1,34 @@ +#include +#include + +#include +#include + +int main(int argc, char **argv) +{ + pid_t pid; + glibtop_proc_affinity buf; + guint16 *cpus; + size_t i; + + if (argc < 2 || !(pid = strtoul(argv[1], NULL, 0))) + pid = getpid(); + + glibtop_init(); + + cpus = glibtop_get_proc_affinity(&buf, pid); + + g_print("Process %u:\n" + " - all: %d\n", + (unsigned)pid, buf.all); + + for (i = 0; i != buf.number; ++i) + g_print(" - CPU#%u is set\n", cpus[i]); + + g_free(cpus); + + glibtop_close(); + + return 0; +} + diff --git a/examples/df.c b/examples/df.c new file mode 100644 index 0000000..afab4e6 --- /dev/null +++ b/examples/df.c @@ -0,0 +1,76 @@ +#ifdef HAVE_CONFIG_H +# include +#endif +#include + +#include +#include + +#include + + +static void print_fsusage(const char *mountpoint) +{ + glibtop_fsusage buf; + + enum { SIZE, USED, FREE, AVAIL, READ, WRITE, MAX }; + char **a = g_new0(char*, MAX); + + glibtop_get_fsusage(&buf, mountpoint); + + +#define I(X) a[(X)] + I(SIZE) = g_format_size_full(buf.blocks * buf.block_size, G_FORMAT_SIZE_IEC_UNITS); + I(USED) = g_format_size_full((buf.blocks - buf.bavail) * buf.block_size, G_FORMAT_SIZE_IEC_UNITS); + I(FREE) = g_format_size_full(buf.bfree * buf.block_size, G_FORMAT_SIZE_IEC_UNITS); + I(AVAIL) = g_format_size_full(buf.bavail * buf.block_size, G_FORMAT_SIZE_IEC_UNITS); + I(READ) = g_format_size_full(buf.read, G_FORMAT_SIZE_IEC_UNITS); + I(WRITE) = g_format_size_full(buf.write, G_FORMAT_SIZE_IEC_UNITS); + + printf("%#7x %10s %10s %10s %10s %5.1f%% %10s %10s %8lu %8lu %s\n", + (unsigned)buf.flags, + I(SIZE), + I(USED), + I(FREE), + I(AVAIL), + (buf.blocks - buf.bavail) * 100.0 / (buf.blocks ? buf.blocks : 1.0), + I(READ), + I(WRITE), + (unsigned long)buf.files, + (unsigned long)buf.ffree, + mountpoint + ); + + g_strfreev(a); +} + +int main(int argc, char **argv) +{ + glibtop_mountlist buf; + + glibtop_init(); + + printf("%-6s %10s %10s %10s %10s %5s %10s %10s %10s %10s %s\n", + "(flags)", "Size", "Used", "Free", "Avail", "Use%", "Read", "Write", "Files", "Files Free", "Mountpoint"); + + if (argc > 1) { + while (*++argv) + print_fsusage(*argv); + } else { + glibtop_mountentry *entries; + size_t i; + + entries = glibtop_get_mountlist(&buf, TRUE); + + for(i = 0; i < buf.number; ++i) + { + print_fsusage(entries[i].mountdir); + } + + g_free(entries); + } + + glibtop_close(); + + return 0; +} diff --git a/examples/diskio.c b/examples/diskio.c new file mode 100644 index 0000000..de6d775 --- /dev/null +++ b/examples/diskio.c @@ -0,0 +1,39 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#include + +#include + +static void show_diskio(pid_t pid) +{ + glibtop_proc_io io; + + glibtop_get_proc_io (&io, pid); + + printf("<%ld>\t", (long)pid); + + printf("flags: %08lx disk_rchar : %lu, disk_wchar : %lu, disk_read_bytes : %lu, disk_write_bytes : %lu\n", (unsigned long)io.flags, io.disk_rchar, io.disk_wchar, io.disk_rbytes, io.disk_wbytes); + +} + + +int main(int argc, char **argv) +{ + glibtop_init(); + + while(*++argv) + { + pid_t pid = strtol(*argv, NULL, 10); + show_diskio(pid); + } + + glibtop_close(); + + return 0; +} + diff --git a/examples/first.c b/examples/first.c new file mode 100644 index 0000000..be76aaf --- /dev/null +++ b/examples/first.c @@ -0,0 +1,578 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include + +#ifndef PROFILE_COUNT +#define PROFILE_COUNT 1 +#endif + +int +main (int argc, char *argv []) +{ + glibtop_union data; + glibtop_sysdeps sysdeps; + unsigned c, method, count, port, i; + char buffer [BUFSIZ]; + pid_t pid, ppid, *ptr; + char *args; + + count = PROFILE_COUNT; + + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, GTOPLOCALEDIR); + textdomain (GETTEXT_PACKAGE); + + glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_OPEN); + + glibtop_get_parameter (GLIBTOP_PARAM_METHOD, &method, sizeof (method)); + + printf ("Method = %d\n", method); + + count = glibtop_get_parameter (GLIBTOP_PARAM_COMMAND, buffer, BUFSIZ); + buffer [count] = 0; + + printf ("Command = '%s'\n", buffer); + + count = glibtop_get_parameter (GLIBTOP_PARAM_HOST, buffer, BUFSIZ); + buffer [count] = 0; + + glibtop_get_parameter (GLIBTOP_PARAM_PORT, &port, sizeof (port)); + + printf ("Host = '%s' - %u\n\n", buffer, port); + + glibtop_init_r (&glibtop_global_server, 0, 0); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_cpu (&data.cpu); + + printf ("CPU (0x%08lx): %lu, %lu, %lu, %lu, %lu, %lu\n", + (unsigned long) data.cpu.flags, + (unsigned long) data.cpu.total, + (unsigned long) data.cpu.user, + (unsigned long) data.cpu.nice, + (unsigned long) data.cpu.sys, + (unsigned long) data.cpu.idle, + (unsigned long) data.cpu.frequency); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_mem (&data.mem); + + printf ("Memory (0x%08lx): " + "%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n", + (unsigned long) data.mem.flags, + (unsigned long) data.mem.total, + (unsigned long) data.mem.used, + (unsigned long) data.mem.free, + (unsigned long) data.mem.shared, + (unsigned long) data.mem.buffer, + (unsigned long) data.mem.cached, + (unsigned long) data.mem.user, + (unsigned long) data.mem.locked); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_swap (&data.swap); + + printf ("Swap (0x%08lx): %lu, %lu, %lu, %lu, %lu\n", + (unsigned long) data.swap.flags, + (unsigned long) data.swap.total, + (unsigned long) data.swap.used, + (unsigned long) data.swap.free, + (unsigned long) data.swap.pagein, + (unsigned long) data.swap.pageout); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_uptime (&data.uptime); + + printf ("Uptime (0x%08lx): %f, %f\n", + (unsigned long) data.uptime.flags, + data.uptime.uptime, data.uptime.idletime); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_loadavg (&data.loadavg); + + printf ("Loadavg (0x%08lx): %f, %f, %f - %lu, %lu, %lu\n", + (unsigned long) data.loadavg.flags, + (double) data.loadavg.loadavg [0], + (double) data.loadavg.loadavg [1], + (double) data.loadavg.loadavg [2], + (unsigned long) data.loadavg.nr_running, + (unsigned long) data.loadavg.nr_tasks, + (unsigned long) data.loadavg.last_pid); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_shm_limits (&data.shm_limits); + + printf ("Shm Limits (0x%08lx): %lu, %lu, %lu, %lu, %lu\n", + (unsigned long) data.shm_limits.flags, + (unsigned long) data.shm_limits.shmmax, + (unsigned long) data.shm_limits.shmmin, + (unsigned long) data.shm_limits.shmmni, + (unsigned long) data.shm_limits.shmseg, + (unsigned long) data.shm_limits.shmall); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_msg_limits (&data.msg_limits); + + printf ("Msg Limits (0x%08lx): %lu, %lu, %lu, %lu, %lu, %lu, %lu\n", + (unsigned long) data.msg_limits.flags, + (unsigned long) data.msg_limits.msgpool, + (unsigned long) data.msg_limits.msgmap, + (unsigned long) data.msg_limits.msgmax, + (unsigned long) data.msg_limits.msgmnb, + (unsigned long) data.msg_limits.msgmni, + (unsigned long) data.msg_limits.msgssz, + (unsigned long) data.msg_limits.msgtql); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_sem_limits (&data.sem_limits); + + printf ("Sem Limits (0x%08lx): " + "%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n", + (unsigned long) data.sem_limits.flags, + (unsigned long) data.sem_limits.semmap, + (unsigned long) data.sem_limits.semmni, + (unsigned long) data.sem_limits.semmns, + (unsigned long) data.sem_limits.semmnu, + (unsigned long) data.sem_limits.semmsl, + (unsigned long) data.sem_limits.semopm, + (unsigned long) data.sem_limits.semume, + (unsigned long) data.sem_limits.semusz, + (unsigned long) data.sem_limits.semvmx, + (unsigned long) data.sem_limits.semaem); + + printf ("\n"); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_ppp (&data.ppp, 0); + + printf ("PPP (0x%08lx): %lu, %lu, %lu\n", + (unsigned long) data.ppp.flags, + (unsigned long) data.ppp.state, + (unsigned long) data.ppp.bytes_in, + (unsigned long) data.ppp.bytes_out); + + printf ("\n"); + + glibtop_get_sysdeps (&sysdeps); + + printf ("Sysdeps (0x%08lx): %lu, %lu, %lu, %lu, %lu, " + "%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, " + "%lu, %lu, %lu, %lu, %lu, %lu\n", + (unsigned long) sysdeps.flags, + (unsigned long) sysdeps.cpu, + (unsigned long) sysdeps.mem, + (unsigned long) sysdeps.swap, + (unsigned long) sysdeps.uptime, + (unsigned long) sysdeps.loadavg, + (unsigned long) sysdeps.shm_limits, + (unsigned long) sysdeps.msg_limits, + (unsigned long) sysdeps.sem_limits, + (unsigned long) sysdeps.proclist, + (unsigned long) sysdeps.proc_state, + (unsigned long) sysdeps.proc_uid, + (unsigned long) sysdeps.proc_mem, + (unsigned long) sysdeps.proc_time, + (unsigned long) sysdeps.proc_signal, + (unsigned long) sysdeps.proc_kernel, + (unsigned long) sysdeps.proc_segment, + (unsigned long) sysdeps.proc_args, + (unsigned long) sysdeps.proc_map, + (unsigned long) sysdeps.mountlist, + (unsigned long) sysdeps.fsusage, + (unsigned long) sysdeps.netload, + (unsigned long) sysdeps.ppp); + + printf ("\n"); + + ptr = glibtop_get_proclist (&data.proclist, 0, 0); + + printf ("Proclist (0x%08lx): %lu, %lu, %lu\n", + (unsigned long) data.proclist.flags, + (unsigned long) data.proclist.number, + (unsigned long) data.proclist.size, + (unsigned long) data.proclist.total); + + if (ptr) { + printf ("\nProcess: "); + for (i = 0; i < data.proclist.number; i++) + printf ("%s%u", i ? ", " : "", ptr [i]); + printf ("\n"); + } + + g_free (ptr); + + pid = getpid (); + ppid = getppid (); + + printf ("\n"); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_state (&data.proc_state, pid); + + printf ("Proc_State PID %5d (0x%08lx): '%s', %c, %lu, %lu\n", + (int) pid, (unsigned long) data.proc_state.flags, + data.proc_state.cmd, data.proc_state.state, + (unsigned long) data.proc_state.uid, + (unsigned long) data.proc_state.gid); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_uid (&data.proc_uid, pid); + + printf ("Proc_Uid PID %5d (0x%08lx): " + "%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid, + (unsigned long) data.proc_uid.flags, + data.proc_uid.uid, data.proc_uid.euid, + data.proc_uid.gid, data.proc_uid.egid, + data.proc_uid.pid, data.proc_uid.ppid, + data.proc_uid.pgrp, data.proc_uid.session, + data.proc_uid.tty, data.proc_uid.tpgid, + data.proc_uid.priority, data.proc_uid.nice); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_mem (&data.proc_mem, pid); + + printf ("Proc_Mem PID %5d (0x%08lx): " + "%lu %lu %lu %lu %lu %lu\n", (int) pid, + (unsigned long) data.proc_mem.flags, + (unsigned long) data.proc_mem.size, + (unsigned long) data.proc_mem.vsize, + (unsigned long) data.proc_mem.resident, + (unsigned long) data.proc_mem.share, + (unsigned long) data.proc_mem.rss, + (unsigned long) data.proc_mem.rss_rlim); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_segment (&data.proc_segment, pid); + + printf ("Proc_Segment PID %5d (0x%08lx): " + "%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid, + (unsigned long) data.proc_segment.flags, + (unsigned long) data.proc_segment.text_rss, + (unsigned long) data.proc_segment.shlib_rss, + (unsigned long) data.proc_segment.data_rss, + (unsigned long) data.proc_segment.stack_rss, + (unsigned long) data.proc_segment.dirty_size, + (unsigned long) data.proc_segment.start_code, + (unsigned long) data.proc_segment.end_code, + (unsigned long) data.proc_segment.start_stack); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_time (&data.proc_time, pid); + + printf ("Proc_Time PID %5d (0x%08lx): " + "%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid, + (unsigned long) data.proc_time.flags, + (unsigned long) data.proc_time.start_time, + (unsigned long) data.proc_time.rtime, + (unsigned long) data.proc_time.utime, + (unsigned long) data.proc_time.stime, + (unsigned long) data.proc_time.cutime, + (unsigned long) data.proc_time.cstime, + (unsigned long) data.proc_time.timeout, + (unsigned long) data.proc_time.it_real_value, + (unsigned long) data.proc_time.frequency); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_signal (&data.proc_signal, pid); + + printf ("Proc_Signal PID %5d (0x%08lx): " + "%lu %lu %lu %lu\n", (int) pid, + (unsigned long) data.proc_signal.flags, + (unsigned long) data.proc_signal.signal, + (unsigned long) data.proc_signal.blocked, + (unsigned long) data.proc_signal.sigignore, + (unsigned long) data.proc_signal.sigcatch); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_kernel (&data.proc_kernel, pid); + + printf ("Proc_Kernel PID %5d (0x%08lx): " + "%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", (int) pid, + (unsigned long) data.proc_kernel.flags, + (unsigned long) data.proc_kernel.k_flags, + (unsigned long) data.proc_kernel.min_flt, + (unsigned long) data.proc_kernel.maj_flt, + (unsigned long) data.proc_kernel.cmin_flt, + (unsigned long) data.proc_kernel.cmaj_flt, + (unsigned long) data.proc_kernel.kstk_esp, + (unsigned long) data.proc_kernel.kstk_eip, + (unsigned long) data.proc_kernel.nwchan, + data.proc_kernel.wchan); + + printf ("\n"); + + args = glibtop_get_proc_args (&data.proc_args, pid, 0); + + for (i = 0; i < data.proc_args.size; i++) { + if (args [i]) continue; + args [i] = '|'; + } + + printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid, + (unsigned long) data.proc_args.flags, + (unsigned long) data.proc_args.size, + args ? args : ""); + + g_free (args); + + printf ("\n"); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_state (&data.proc_state, ppid); + + printf ("Proc_State PPID %5d (0x%08lx): '%s', %c, %lu, %lu\n", + (int) ppid, (unsigned long) data.proc_state.flags, + data.proc_state.cmd, data.proc_state.state, + (unsigned long) data.proc_state.uid, + (unsigned long) data.proc_state.gid); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_uid (&data.proc_uid, ppid); + + printf ("Proc_Uid PPID %5d (0x%08lx): " + "%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) ppid, + (unsigned long) data.proc_uid.flags, + data.proc_uid.uid, data.proc_uid.euid, + data.proc_uid.gid, data.proc_uid.egid, + data.proc_uid.pid, data.proc_uid.ppid, + data.proc_uid.pgrp, data.proc_uid.session, + data.proc_uid.tty, data.proc_uid.tpgid, + data.proc_uid.priority, data.proc_uid.nice); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_mem (&data.proc_mem, ppid); + + printf ("Proc_Mem PPID %5d (0x%08lx): " + "%lu %lu %lu %lu %lu %lu\n", (int) ppid, + (unsigned long) data.proc_mem.flags, + (unsigned long) data.proc_mem.size, + (unsigned long) data.proc_mem.vsize, + (unsigned long) data.proc_mem.resident, + (unsigned long) data.proc_mem.share, + (unsigned long) data.proc_mem.rss, + (unsigned long) data.proc_mem.rss_rlim); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_segment (&data.proc_segment, ppid); + + printf ("Proc_Segment PPID %5d (0x%08lx): " + "%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) ppid, + (unsigned long) data.proc_segment.flags, + (unsigned long) data.proc_segment.text_rss, + (unsigned long) data.proc_segment.shlib_rss, + (unsigned long) data.proc_segment.data_rss, + (unsigned long) data.proc_segment.stack_rss, + (unsigned long) data.proc_segment.dirty_size, + (unsigned long) data.proc_segment.start_code, + (unsigned long) data.proc_segment.end_code, + (unsigned long) data.proc_segment.start_stack); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_time (&data.proc_time, ppid); + + printf ("Proc_Time PPID %5d (0x%08lx): " + "%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) ppid, + (unsigned long) data.proc_time.flags, + (unsigned long) data.proc_time.start_time, + (unsigned long) data.proc_time.rtime, + (unsigned long) data.proc_time.utime, + (unsigned long) data.proc_time.stime, + (unsigned long) data.proc_time.cutime, + (unsigned long) data.proc_time.cstime, + (unsigned long) data.proc_time.timeout, + (unsigned long) data.proc_time.it_real_value, + (unsigned long) data.proc_time.frequency); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_signal (&data.proc_signal, ppid); + + printf ("Proc_Signal PPID %5d (0x%08lx): %lu %lu %lu %lu\n", + (int) ppid, (unsigned long) data.proc_signal.flags, + (unsigned long) data.proc_signal.signal, + (unsigned long) data.proc_signal.blocked, + (unsigned long) data.proc_signal.sigignore, + (unsigned long) data.proc_signal.sigcatch); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_kernel (&data.proc_kernel, ppid); + + printf ("Proc_Kernel PPID %5d (0x%08lx): " + "%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", (int) ppid, + (unsigned long) data.proc_kernel.flags, + (unsigned long) data.proc_kernel.k_flags, + (unsigned long) data.proc_kernel.min_flt, + (unsigned long) data.proc_kernel.maj_flt, + (unsigned long) data.proc_kernel.cmin_flt, + (unsigned long) data.proc_kernel.cmaj_flt, + (unsigned long) data.proc_kernel.kstk_esp, + (unsigned long) data.proc_kernel.kstk_eip, + (unsigned long) data.proc_kernel.nwchan, + data.proc_kernel.wchan); + + printf ("\n"); + + args = glibtop_get_proc_args (&data.proc_args, ppid, 0); + + for (i = 0; i < data.proc_args.size; i++) { + if (args [i]) continue; + args [i] = '|'; + } + + printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) ppid, + (unsigned long) data.proc_args.flags, + (unsigned long) data.proc_args.size, + args ? args : ""); + + g_free (args); + + printf ("\n"); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_state (&data.proc_state, 1); + + printf ("Proc_State INIT %5d (0x%08lx): '%s', %c, %lu, %lu\n", 1, + (unsigned long) data.proc_state.flags, + data.proc_state.cmd, data.proc_state.state, + (unsigned long) data.proc_state.uid, + (unsigned long) data.proc_state.gid); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_uid (&data.proc_uid, 1); + + printf ("Proc_Uid INIT %5d (0x%08lx): " + "%d %d %d %d %d %d %d %d %d %d %d %d\n", 1, + (unsigned long) data.proc_uid.flags, + data.proc_uid.uid, data.proc_uid.euid, + data.proc_uid.gid, data.proc_uid.egid, + data.proc_uid.pid, data.proc_uid.ppid, + data.proc_uid.pgrp, data.proc_uid.session, + data.proc_uid.tty, data.proc_uid.tpgid, + data.proc_uid.priority, data.proc_uid.nice); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_mem (&data.proc_mem, 1); + + printf ("Proc_Mem INIT %5d (0x%08lx): " + "%lu %lu %lu %lu %lu %lu\n", 1, + (unsigned long) data.proc_mem.flags, + (unsigned long) data.proc_mem.size, + (unsigned long) data.proc_mem.vsize, + (unsigned long) data.proc_mem.resident, + (unsigned long) data.proc_mem.share, + (unsigned long) data.proc_mem.rss, + (unsigned long) data.proc_mem.rss_rlim); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_segment (&data.proc_segment, 1); + + printf ("Proc_Segment INIT %5d (0x%08lx): " + "%lu %lu %lu %lu %lu %lu %lu %lu\n", 1, + (unsigned long) data.proc_segment.flags, + (unsigned long) data.proc_segment.text_rss, + (unsigned long) data.proc_segment.shlib_rss, + (unsigned long) data.proc_segment.data_rss, + (unsigned long) data.proc_segment.stack_rss, + (unsigned long) data.proc_segment.dirty_size, + (unsigned long) data.proc_segment.start_code, + (unsigned long) data.proc_segment.end_code, + (unsigned long) data.proc_segment.start_stack); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_time (&data.proc_time, 1); + + printf ("Proc_Time INIT %5d (0x%08lx): " + "%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", 1, + (unsigned long) data.proc_time.flags, + (unsigned long) data.proc_time.start_time, + (unsigned long) data.proc_time.rtime, + (unsigned long) data.proc_time.utime, + (unsigned long) data.proc_time.stime, + (unsigned long) data.proc_time.cutime, + (unsigned long) data.proc_time.cstime, + (unsigned long) data.proc_time.timeout, + (unsigned long) data.proc_time.it_real_value, + (unsigned long) data.proc_time.frequency); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_signal (&data.proc_signal, 1); + + printf ("Proc_Signal INIT %5d (0x%08lx): " + "%lu %lu %lu %lu\n", 1, + (unsigned long) data.proc_signal.flags, + (unsigned long) data.proc_signal.signal, + (unsigned long) data.proc_signal.blocked, + (unsigned long) data.proc_signal.sigignore, + (unsigned long) data.proc_signal.sigcatch); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_kernel (&data.proc_kernel, 1); + + printf ("Proc_Kernel INIT %5d (0x%08lx): " + "%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", 1, + (unsigned long) data.proc_kernel.flags, + (unsigned long) data.proc_kernel.k_flags, + (unsigned long) data.proc_kernel.min_flt, + (unsigned long) data.proc_kernel.maj_flt, + (unsigned long) data.proc_kernel.cmin_flt, + (unsigned long) data.proc_kernel.cmaj_flt, + (unsigned long) data.proc_kernel.kstk_esp, + (unsigned long) data.proc_kernel.kstk_eip, + (unsigned long) data.proc_kernel.nwchan, + data.proc_kernel.wchan); + + printf ("\n"); + + args = glibtop_get_proc_args (&data.proc_args, 1, 0); + + for (i = 0; i < data.proc_args.size; i++) { + if (args [i]) continue; + args [i] = '|'; + } + + printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", 1, + (unsigned long) data.proc_args.flags, + (unsigned long) data.proc_args.size, + args ? args : ""); + + g_free (args); + + glibtop_close (); + + exit (0); +} diff --git a/examples/free.c b/examples/free.c new file mode 100644 index 0000000..db0645e --- /dev/null +++ b/examples/free.c @@ -0,0 +1,44 @@ +#include +#include +#include + +#include +#include + +static unsigned mb(guint64 n) +{ + return n >> 20; +} + +int main(int argc, char **argv) +{ + glibtop_mem mem; + glibtop_swap swap; + + glibtop_init(); + + glibtop_get_mem(&mem); + glibtop_get_swap(&swap); + + printf(" total used free shared buff/cache available\n"); + + printf("%-7s %11u %11u %11u %11u %11u %11u\n", + "Mem:", + mb(mem.total), + mb(mem.used - mem.buffer - mem.cached), + mb(mem.free), + mb(mem.shared), + mb(mem.buffer + mem.cached), + mb(mem.total - mem.user)); + + printf("%-7s %11u %11u %11u\n", + "Swap:", + mb(swap.total), + mb(swap.used), + mb(swap.free)); + + glibtop_close(); + + return 0; +} + diff --git a/examples/mountlist.c b/examples/mountlist.c new file mode 100644 index 0000000..13570f8 --- /dev/null +++ b/examples/mountlist.c @@ -0,0 +1,116 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#ifndef PROFILE_COUNT +#define PROFILE_COUNT 1000 +#endif + +int +main (int argc, char *argv []) +{ + glibtop_fsusage fsusage; + glibtop_mountlist mount_list; + glibtop_mountentry *mount_entries; + unsigned c, index, method, count, port; + char buffer [BUFSIZ]; + + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, GTOPLOCALEDIR); + textdomain (GETTEXT_PACKAGE); + + glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_OPEN); + + glibtop_get_parameter (GLIBTOP_PARAM_METHOD, &method, sizeof (method)); + + printf ("Method = %d\n", method); + + count = glibtop_get_parameter (GLIBTOP_PARAM_COMMAND, buffer, BUFSIZ); + buffer [count] = 0; + + printf ("Command = '%s'\n", buffer); + + count = glibtop_get_parameter (GLIBTOP_PARAM_HOST, buffer, BUFSIZ); + buffer [count] = 0; + + glibtop_get_parameter (GLIBTOP_PARAM_PORT, &port, sizeof (port)); + + printf ("Host = '%s' - %u\n\n", buffer, port); + + printf ("sbrk (0) = %p\n\n", sbrk (0)); + + for (c = 0; c < PROFILE_COUNT; c++) { + mount_entries = glibtop_get_mountlist (&mount_list, 1); + + g_free (mount_entries); + } + + printf ("sbrk (0) = %p\n\n", sbrk (0)); + + mount_entries = glibtop_get_mountlist (&mount_list, 1); + + if (mount_entries == NULL) + _exit (1); + + for (index = 0; index < mount_list.number; index++) + printf ("Mount_Entry: %-30s %-10s %-20s\n", + mount_entries [index].mountdir, + mount_entries [index].type, + mount_entries [index].devname); + + printf ("\n\n%-16s %9s %9s %9s %9s %9s %9s\n", + "Mount", "Blocks", "Free", "Avail", "Files", "Free", "BlockSz"); + + for (index = 0; index < mount_list.number; index++) { + glibtop_get_fsusage (&fsusage, + mount_entries [index].mountdir); + + printf ("%-16s %9Lu %9Lu %9Lu %9Lu %9Lu %9d\n", + mount_entries [index].mountdir, + fsusage.blocks, fsusage.bfree, + fsusage.bavail, fsusage.files, + fsusage.ffree, fsusage.block_size); + } + + g_free (mount_entries); + + printf ("\nsbrk (0) = %p\n\n", sbrk (0)); + + glibtop_close (); + + exit (0); +} diff --git a/examples/netlist.c b/examples/netlist.c new file mode 100644 index 0000000..0adcd14 --- /dev/null +++ b/examples/netlist.c @@ -0,0 +1,50 @@ +/* Copyright (C) 2004 Benoît Dejean + This file is part of LibGTop 2.0. + + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#include +#include + + +int main(int argc, char *argv []) +{ + glibtop_netlist buf; + char **devices; + guint32 i; + + glibtop_init(); + + devices = glibtop_get_netlist(&buf); + + for(i = 0; i < buf.number; ++i) + { + printf("net device '%s'\n", devices[i]); + } + + g_strfreev(devices); + + glibtop_close(); + return 0; +} diff --git a/examples/netload.c b/examples/netload.c new file mode 100644 index 0000000..6bd9786 --- /dev/null +++ b/examples/netload.c @@ -0,0 +1,162 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#include +#include +#include + +#include + +#include + +#include +#include + +#ifndef PROFILE_COUNT +#define PROFILE_COUNT 1 +#endif + + +static char* hwaddress_format_for_display(glibtop_netload *buf) +{ + unsigned i; + GString *repr = g_string_new(""); + char *str; + + for(i = 0; i < sizeof buf->hwaddress; ++i) + g_string_append_printf(repr, "%02X:", + ((unsigned char*)buf->hwaddress)[i]); + + repr->str [ repr->len - 1] = ' '; + str = g_string_free(repr, FALSE); + g_strstrip(str); + return str; +} + + +int +main (int argc, char *argv []) +{ + glibtop_netload netload; + unsigned method, count, port; + struct in_addr addr, subnet; + char *address_string, *subnet_string; + char address6_string[INET6_ADDRSTRLEN], prefix6_string[INET6_ADDRSTRLEN]; + char *hwaddress_string; + char buffer [BUFSIZ]; + + count = PROFILE_COUNT; + + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, GTOPLOCALEDIR); + textdomain (GETTEXT_PACKAGE); + + glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_OPEN); + + glibtop_get_parameter (GLIBTOP_PARAM_METHOD, &method, sizeof (method)); + + printf ("Method = %d\n", method); + + count = glibtop_get_parameter (GLIBTOP_PARAM_COMMAND, buffer, BUFSIZ); + buffer [count] = 0; + + printf ("Command = '%s'\n", buffer); + + count = glibtop_get_parameter (GLIBTOP_PARAM_HOST, buffer, BUFSIZ); + buffer [count] = 0; + + glibtop_get_parameter (GLIBTOP_PARAM_PORT, &port, sizeof (port)); + + printf ("Host = '%s' - %u\n\n", buffer, port); + + glibtop_init_r (&glibtop_global_server, 0, 0); + + if (argc != 2) + g_error ("Usage: %s interface", argv [0]); + + glibtop_get_netload (&netload, argv [1]); + + addr.s_addr = netload.address; + subnet.s_addr = netload.subnet; + + address_string = g_strdup (inet_ntoa (addr)); + subnet_string = g_strdup (inet_ntoa (subnet)); + + inet_ntop (AF_INET6, netload.address6, address6_string, INET6_ADDRSTRLEN); + inet_ntop (AF_INET6, netload.prefix6, prefix6_string, INET6_ADDRSTRLEN); + + hwaddress_string = hwaddress_format_for_display(&netload); + + printf ("Network Load (0x%016llx):\n\n" + "\tInterface Flags:\t0x%016llx\n" + "\tAddress:\t\t0x%08x - %s\n" + "\tSubnet:\t\t\t0x%08x - %s\n\n" + "\tMTU:\t\t\t%d\n" + "\tCollisions:\t\t%llu\n\n" + "\tPackets In:\t\t%llu\n" + "\tPackets Out:\t\t%llu\n" + "\tPackets Total:\t\t%llu\n\n" + "\tBytes In:\t\t%llu\n" + "\tBytes Out:\t\t%llu\n" + "\tBytes Total:\t\t%llu\n\n" + "\tErrors In:\t\t%llu\n" + "\tErrors Out:\t\t%llu\n" + "\tErrors Total:\t\t%llu\n\n" + "\tAddress6:\t\t%s\n" + "\tPrefix6:\t\t%s\n" + "\tScope6:\t\t\t%#03x\n\n" + "\tHarware Address:\t%s\n\n", + netload.flags, + netload.if_flags, + (guint32) netload.address, address_string, + (guint32) netload.subnet, subnet_string, + netload.mtu, + netload.collisions, + netload.packets_in, + netload.packets_out, + netload.packets_total, + netload.bytes_in, + netload.bytes_out, + netload.bytes_total, + netload.errors_in, + netload.errors_out, + netload.errors_total, + address6_string, + prefix6_string, + (int) netload.scope6, + hwaddress_string); + + + g_free (address_string); + g_free (subnet_string); + + glibtop_close (); + + exit (0); +} diff --git a/examples/openfiles.c b/examples/openfiles.c new file mode 100644 index 0000000..aa6e1be --- /dev/null +++ b/examples/openfiles.c @@ -0,0 +1,75 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#include + +#include + +static void show_open_files(pid_t pid) +{ + glibtop_proc_open_files buf; + glibtop_open_files_entry *files; + unsigned i; + + files = glibtop_get_proc_open_files(&buf, pid); + + printf("<%ld>\n", (long)pid); + + for(i = 0; i < buf.number; ++i) + { + printf("\tfd = %d\t", files[i].fd); + + switch(files[i].type) + { + case GLIBTOP_FILE_TYPE_FILE: + printf("file \"%s\"\n", files[i].info.file.name); + break; + + case GLIBTOP_FILE_TYPE_PIPE: + printf("pipe\n"); + break; + + case GLIBTOP_FILE_TYPE_INETSOCKET: + printf("socket %s:%d\n", files[i].info.sock.dest_host, files[i].info.sock.dest_port); + break; + + case GLIBTOP_FILE_TYPE_INET6SOCKET: + printf("socket [%s]:%d\n", files[i].info.sock.dest_host, files[i].info.sock.dest_port); + break; + + case GLIBTOP_FILE_TYPE_LOCALSOCKET: + printf("localsocket %s\n", files[i].info.localsock.name); + break; + + default: + printf("unknown type\n"); + } + } + + putchar('\n'); + + g_free(files); +} + + +int main(int argc, char **argv) +{ + glibtop_init(); + + show_open_files(getpid()); + + while(*++argv) + { + pid_t pid = strtol(*argv, NULL, 10); + show_open_files(pid); + } + + glibtop_close(); + + return 0; +} + diff --git a/examples/pprint.c b/examples/pprint.c new file mode 100644 index 0000000..683afde --- /dev/null +++ b/examples/pprint.c @@ -0,0 +1,391 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#include + +#include + +#include +#include + + +#define buf_offsetof(MEMBER) ((ptrdiff_t)&(buf.MEMBER) - (ptrdiff_t)&buf) + +#define HEADER_PPRINT(FUNC) printf("### " #FUNC " ###\nsizeof *buf = %lu B\n", \ +(unsigned long) sizeof buf) + +#define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ +(unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) + +#define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ + size_t i; \ + printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ + (unsigned long) sizeof buf.ARRAY, \ + (unsigned long) buf_offsetof(ARRAY), \ + (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ + for (i = 0; i < (SIZE); ++i) { \ + if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ + do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ + printf("..., "); \ + } else { \ + printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ + } \ + } \ + printf("}\n"); \ + } while(0) + +#define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ +size_t i; \ +printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ +(unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ +(unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ +for(i = 0; i < SIZE; ++i) { \ + if (buf->ARRAY[i].values) { \ + printf ("\t[ "); \ + PPRINT_HASHTABLE(buf->ARRAY[i].values); \ + printf ("]\n"); \ + } \ +} \ +printf("} "); \ +} while(0) + +#define PPRINT_HASHTABLE(HASHTABLE) do { \ +g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ +} while(0) + +#define FOOTER_PPRINT() putchar('\n'); + +static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) +{ + printf ("'%s': '%s', ", key, value); +} +static void pprint_get_sysinfo(void) +{ + const glibtop_sysinfo *buf; + + buf = glibtop_get_sysinfo(); + + HEADER_PPRINT(glibtop_get_sysinfo); + //PPRINT(flags, "%#llx"); + // PPRINT(ncpu, "%llu"); + PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); + FOOTER_PPRINT(); +} + +static void pprint_get_cpu(void) +{ + glibtop_cpu buf; + + glibtop_get_cpu(&buf); + + HEADER_PPRINT(glibtop_get_cpu); + PPRINT(flags, "%#llx"); + PPRINT(total, "%llu"); + PPRINT(user, "%llu"); + PPRINT(nice, "%llu"); + PPRINT(sys, "%llu"); + PPRINT(idle, "%llu"); + PPRINT(iowait, "%llu"); + PPRINT(irq, "%llu"); + PPRINT(softirq, "%llu"); + PPRINT(frequency, "%llu"); + PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); + PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); + PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); + PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); + PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); + PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); + PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); + PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); + PPRINT(xcpu_flags, "%llx"); + FOOTER_PPRINT(); +} + + + +static void pprint_get_fsusage(const char *mountpoint) +{ + glibtop_fsusage buf; + + glibtop_get_fsusage(&buf, mountpoint); + + HEADER_PPRINT(glibtop_get_fsusage); + printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); + PPRINT(flags, "%#llx"); + PPRINT(blocks, "%llu"); + PPRINT(bfree, "%llu"); + PPRINT(bavail, "%llu"); + PPRINT(files, "%llu"); + PPRINT(ffree, "%llu"); + PPRINT(block_size, "%u"); + PPRINT(read, "%llu"); + PPRINT(write, "%llu"); + FOOTER_PPRINT(); +} + + + +static void pprint_get_loadavg(void) +{ + glibtop_loadavg buf; + + glibtop_get_loadavg(&buf); + + HEADER_PPRINT(glibtop_get_loadavg); + PPRINT(flags, "%#llx"); + PPRINT_ARRAY(loadavg, 3, "%f"); + PPRINT(nr_running, "%llu"); + PPRINT(nr_tasks, "%llu"); + PPRINT(last_pid, "%llu"); + FOOTER_PPRINT(); +} + + + +static void pprint_get_mem(void) +{ + glibtop_mem buf; + + glibtop_get_mem(&buf); + + HEADER_PPRINT(glibtop_get_mem); + PPRINT(flags, "%#llx"); + PPRINT(total, "%llu"); + PPRINT(used, "%llu"); + PPRINT(free, "%llu"); + PPRINT(shared, "%llu"); + PPRINT(buffer, "%llu"); + PPRINT(cached, "%llu"); + PPRINT(user, "%llu"); + PPRINT(locked, "%llu"); + FOOTER_PPRINT(); +} + + + +static void pprint_get_mountlist(gboolean allfs) +{ + glibtop_mountlist buf; + glibtop_mountentry *entries; + size_t i; + + entries = glibtop_get_mountlist(&buf, allfs); + + HEADER_PPRINT(glibtop_get_mountlist); + printf("glibtop_get_mountlist (allfs = %d)\n", allfs); + PPRINT(flags, "%#llx"); + PPRINT(number, "%llu"); + PPRINT(total, "%llu"); + PPRINT(size, "%llu"); + + printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); + + for(i = 0; i < buf.number; ++i) + { + printf("\t\t .%lu = { .dev = %#llx," + " .devname = \"%s\"," + " .mountir = \"%s\"," + " .type = \"%s\" }\n", + (unsigned long) i, entries[i].dev, + entries[i].devname, + entries[i].mountdir, + entries[i].type); + } + + printf("\t\t}\n"); + FOOTER_PPRINT(); + + g_free(entries); +} + + + +static void pprint_get_msg_limits(void) +{ + glibtop_msg_limits buf; + + glibtop_get_msg_limits(&buf); + + HEADER_PPRINT(glibtop_get_msg_limits); + PPRINT(flags, "%#llx"); + PPRINT(msgpool, "%llu"); + PPRINT(msgmap, "%llu"); + PPRINT(msgmax, "%llu"); + PPRINT(msgmnb, "%llu"); + PPRINT(msgmni, "%llu"); + PPRINT(msgssz, "%llu"); + PPRINT(msgtql, "%llu"); + FOOTER_PPRINT(); +} + + + +static void pprint_get_netload(const char *iface) +{ + glibtop_netload buf; + + glibtop_get_netload(&buf, iface); + + HEADER_PPRINT(glibtop_get_netload); + printf("glibtop_get_netload (iface = \"%s\")\n", iface); + PPRINT(flags, "%#llx"); + FOOTER_PPRINT(); +} + + +static void pprint_get_netlist(void) +{ + glibtop_netlist buf; + char **devices; + guint32 i; + + devices = glibtop_get_netlist(&buf); + + HEADER_PPRINT(glibtop_get_netlist); + + for(i = 0; i < buf.number; ++i) + { + printf("\t%s\n", devices[i]); + } + + FOOTER_PPRINT(); + + g_strfreev(devices); +} + + + +static void pprint_get_swap(void) +{ + glibtop_swap buf; + + glibtop_get_swap(&buf); + + HEADER_PPRINT(glibtop_get_swap); + PPRINT(flags, "%#llx"); + PPRINT(total, "%llu"); + PPRINT(used, "%llu"); + PPRINT(free, "%llu"); + PPRINT(pagein, "%llu"); + PPRINT(pageout, "%llu"); + FOOTER_PPRINT(); +} + + + +static void pprint_get_uptime(void) +{ + glibtop_uptime buf; + + glibtop_get_uptime(&buf); + + HEADER_PPRINT(glibtop_get_uptime); + PPRINT(flags, "%#llx"); + PPRINT(uptime, "%f"); + PPRINT(idletime, "%f"); + PPRINT(boot_time, "%llu"); + FOOTER_PPRINT(); +} + + + + +static void pprint_get_proc_kernel(pid_t pid) +{ + glibtop_proc_kernel buf; + + glibtop_get_proc_kernel(&buf, pid); + + HEADER_PPRINT(glibtop_get_proc_kernel); + PPRINT(flags, "%#llx"); + PPRINT(k_flags, "%llu"); + PPRINT(min_flt, "%llu"); + PPRINT(maj_flt, "%llu"); + PPRINT(cmin_flt, "%llu"); + PPRINT(cmaj_flt, "%llu"); + FOOTER_PPRINT(); +} + + +static void pprint_get_proc_mem(pid_t pid) +{ + glibtop_proc_mem buf; + + glibtop_get_proc_mem(&buf, pid); + + HEADER_PPRINT(glibtop_get_proc_mem); + PPRINT(flags, "%#llx"); + PPRINT(size, "%llu"); + PPRINT(vsize, "%llu"); + PPRINT(resident, "%llu"); + PPRINT(share, "%llu"); + PPRINT(rss, "%llu"); + PPRINT(rss_rlim, "%llu"); + FOOTER_PPRINT(); +} + + +static void pprint_get_proc_affinity(pid_t pid) +{ + glibtop_proc_affinity buf; + guint32 i; + guint16* cpus; + + cpus = glibtop_get_proc_affinity(&buf, pid); + + HEADER_PPRINT(glibtop_get_proc_affinity); + PPRINT(flags, "%#llx"); + PPRINT(number, "%u"); + PPRINT(all, "%d"); + + printf("\taffinity="); + for (i = 0; i < buf.number; i++) { + printf("%d, ", cpus[i]); + } + putchar('\n'); + + FOOTER_PPRINT(); +} + + +int main() +{ + glibtop_init(); + + pprint_get_sysinfo(); + pprint_get_cpu(); + + pprint_get_fsusage("/"); + + pprint_get_loadavg(); + + pprint_get_mem(); + + pprint_get_mountlist(TRUE); + pprint_get_mountlist(FALSE); + + pprint_get_msg_limits(); + + pprint_get_swap(); + + pprint_get_netlist(); + + pprint_get_netload("eth0"); + pprint_get_netload("ppp0"); + pprint_get_netload(""); +/* pprint_get_sysinfo(); */ + + pprint_get_uptime(); + + pprint_get_proc_kernel(getpid()); + pprint_get_proc_mem(getpid()); + pprint_get_proc_affinity(getpid()); + + glibtop_close(); + + return 0; +} diff --git a/examples/procargs.c b/examples/procargs.c new file mode 100644 index 0000000..d5bd1fd --- /dev/null +++ b/examples/procargs.c @@ -0,0 +1,51 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#include + +#include + +static void show_args(pid_t pid, unsigned max_len) +{ + glibtop_proc_args buf; + char ** const pargv = glibtop_get_proc_argv(&buf, pid, max_len); + + char **parg = pargv; + + printf("<%ld>\t", (long)pid); + + while(*parg) + { + printf("\"%s\" ", *parg); + parg++; + } + + putchar('\n'); + + g_strfreev(pargv); +} + + +int main(int argc, char **argv) +{ + glibtop_init(); + + show_args(getpid(), 0); + show_args(getpid(), 15); + + while(*++argv) + { + pid_t pid = strtol(*argv, NULL, 10); + show_args(pid, 0); + show_args(pid, 15); + } + + glibtop_close(); + + return 0; +} + diff --git a/examples/proclist.c b/examples/proclist.c new file mode 100644 index 0000000..8ab0742 --- /dev/null +++ b/examples/proclist.c @@ -0,0 +1,59 @@ +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + + +static void print_pids(guint64 which, guint64 arg) +{ + pid_t *pids; + unsigned i; + glibtop_proclist buf; + + pids = glibtop_get_proclist(&buf, which, arg); + + for (i = 0; i < buf.number; ++i) { + glibtop_proc_time ptime; + glibtop_proc_uid puid; + glibtop_proc_state pstate; + + pid_t p = pids[i]; + + glibtop_get_proc_time(&ptime, p); + glibtop_get_proc_uid(&puid, p); + glibtop_get_proc_state(&pstate, p); + + /* almost equivalent to ps -x -o user,pid,time,usertime,systime,start,command */ + printf("%u pid=%u real=%.2f user=%.2f sys=%.2f start=%lu %s (%lx)\n", + puid.uid, + p, + (double)ptime.rtime / ptime.frequency, + (double)ptime.utime / ptime.frequency, + (double)ptime.stime / ptime.frequency, + (unsigned long)ptime.start_time, + pstate.cmd, + (long)ptime.flags); + } + + g_free(pids); +} + + +int main() +{ + glibtop_init(); + + print_pids(GLIBTOP_KERN_PROC_UID, getuid()); + + glibtop_close(); + + return 0; +} diff --git a/examples/procmap.c b/examples/procmap.c new file mode 100644 index 0000000..b32555b --- /dev/null +++ b/examples/procmap.c @@ -0,0 +1,185 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#include +#include +#include + +#include + +#include + + +#include +#include + +#include + +#ifndef PROFILE_COUNT +#define PROFILE_COUNT 1 +#endif + +static void +try_mmap(const char *path) +{ + struct stat buf; + int fd; + + if ((fd = open(path, O_RDONLY)) < 0) + goto out; + + if (fstat(fd, &buf) < 0) + goto out; + + if (mmap(NULL, buf.st_size, PROT_READ, MAP_PRIVATE, fd, 0) == MAP_FAILED) + goto out; + + close(fd); + + return; + +out: + fprintf(stderr, "Failed to test mmap with '%s'\n", path); +} + + +int +main (int argc, char *argv []) +{ + glibtop_proc_map procmap; + glibtop_map_entry *maps; + unsigned method, count, port, i; + char buffer [BUFSIZ]; + pid_t pid; + + count = PROFILE_COUNT; + + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, GTOPLOCALEDIR); + textdomain (GETTEXT_PACKAGE); + + glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_OPEN); + + glibtop_get_parameter (GLIBTOP_PARAM_METHOD, &method, sizeof (method)); + + printf ("Method = %d\n", method); + + count = glibtop_get_parameter (GLIBTOP_PARAM_COMMAND, buffer, BUFSIZ); + buffer [count] = 0; + + printf ("Command = '%s'\n", buffer); + + count = glibtop_get_parameter (GLIBTOP_PARAM_HOST, buffer, BUFSIZ); + buffer [count] = 0; + + glibtop_get_parameter (GLIBTOP_PARAM_PORT, &port, sizeof (port)); + + printf ("Host = '%s' - %u\n\n", buffer, port); + + glibtop_init_r (&glibtop_global_server, 0, 0); + + if (argc == 1) { + pid = getpid(); + } + else if ((argc != 2) || (sscanf (argv [1], "%d", (int *) &pid) != 1)) + g_error ("Usage: %s [pid]", argv [0]); + + if (pid == getpid()) { + /* let's map something for a try */ + try_mmap("/etc/passwd"); + try_mmap("/etc/resolv.conf"); + try_mmap(argv[0]); + } + + fprintf (stderr, "Getting memory maps for pid %d.\n\n", (int) pid); + + maps = glibtop_get_proc_map (&procmap, pid); + + for (i = 0; i < procmap.number; i++) { + const char *filename = NULL; + char * format; + unsigned device, device_major, device_minor; + char perm [5]; + + if (maps [i].flags & (1L << GLIBTOP_MAP_ENTRY_FILENAME)) + filename = maps [i].filename; + + perm [0] = (maps [i].perm & GLIBTOP_MAP_PERM_READ) ? 'r' : '-'; + perm [1] = (maps [i].perm & GLIBTOP_MAP_PERM_WRITE) ? 'w' : '-'; + perm [2] = (maps [i].perm & GLIBTOP_MAP_PERM_EXECUTE) ? 'x' : '-'; + perm [3] = (maps [i].perm & GLIBTOP_MAP_PERM_SHARED) ? 's' : '-'; + perm [4] = (maps [i].perm & GLIBTOP_MAP_PERM_PRIVATE) ? 'p' : '-'; + + device = (unsigned long) maps [i].device; + device_minor = (device & 255); + device_major = ((device >> 8) & 255); + + if (sizeof (void*) == 8) + format = "%016lx-%016lx +%016lx (%8lu bytes mapped) - " + "%02x:%02x % 8lu - %.*s"; + else + format = "%08lx-%08lx +%08lx (%8lu bytes mapped) - " + "%02x:%02x % 8lu - %.*s"; + + fprintf (stderr, format, + (unsigned long) maps [i].start, + (unsigned long) maps [i].end, + (unsigned long) maps [i].offset, + (unsigned long) (maps [i].end - (maps [i].start + maps [i].offset)), + device_major, device_minor, + (unsigned long) maps [i].inode, + sizeof perm, perm); + + if (filename) { + fprintf(stderr, " - %s", filename); + } + + fputc('\n', stderr); + + g_print("smaps flags:%#llx size:%lluKiB rss:%lluKiB " + "shared_clean:%lluKib shared_dirty:%lluKiB " + "private_clean:%lluKiB private_dirty: %lluKiB\n", + maps[i].flags, + maps[i].size >> 10, + maps[i].rss >> 10, + maps[i].shared_clean >> 10, + maps[i].shared_dirty >> 10, + maps[i].private_clean >> 10, + maps[i].private_dirty >> 10); + + if (filename && (filename != maps [i].filename)) + g_free ((void*)filename); + } + + g_free (maps); + + glibtop_close (); + + exit (0); +} diff --git a/examples/second.c b/examples/second.c new file mode 100644 index 0000000..5cb2d1a --- /dev/null +++ b/examples/second.c @@ -0,0 +1,300 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +static void +output (pid_t pid) +{ + glibtop_union data; + char *args; + unsigned i; + + unsigned long total; + double p_total, p_utime, p_stime; + double b_total, b_utime, b_stime; + double s_total, s_utime, s_stime; + double my_utime, my_stime; + unsigned int ncpu; + + printf ("\n"); + + glibtop_get_proc_state (&data.proc_state, pid); + + printf ("Proc_State PID %5d (0x%08lx): " + "'%s', %c, %lu, %lu\n", (int) pid, + (unsigned long) data.proc_state.flags, + data.proc_state.cmd, data.proc_state.state, + (unsigned long) data.proc_state.uid, + (unsigned long) data.proc_state.gid); + + glibtop_get_proc_uid (&data.proc_uid, pid); + + printf ("Proc_Uid PID %5d (0x%08lx): " + "%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid, + (unsigned long) data.proc_uid.flags, + data.proc_uid.uid, data.proc_uid.euid, + data.proc_uid.gid, data.proc_uid.egid, + data.proc_uid.pid, data.proc_uid.ppid, + data.proc_uid.pgrp, data.proc_uid.session, + data.proc_uid.tty, data.proc_uid.tpgid, + data.proc_uid.priority, data.proc_uid.nice); + + glibtop_get_proc_mem (&data.proc_mem, pid); + + printf ("Proc_Mem PID %5d (0x%08lx): " + "%lu %lu %lu %lu %lu %lu\n", (int) pid, + (unsigned long) data.proc_mem.flags, + (unsigned long) data.proc_mem.size, + (unsigned long) data.proc_mem.vsize, + (unsigned long) data.proc_mem.resident, + (unsigned long) data.proc_mem.share, + (unsigned long) data.proc_mem.rss, + (unsigned long) data.proc_mem.rss_rlim); + + glibtop_get_proc_segment (&data.proc_segment, pid); + + printf ("Proc_Segment PID %5d (0x%08lx): " + "%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid, + (unsigned long) data.proc_segment.flags, + (unsigned long) data.proc_segment.text_rss, + (unsigned long) data.proc_segment.shlib_rss, + (unsigned long) data.proc_segment.data_rss, + (unsigned long) data.proc_segment.stack_rss, + (unsigned long) data.proc_segment.dirty_size, + (unsigned long) data.proc_segment.start_code, + (unsigned long) data.proc_segment.end_code, + (unsigned long) data.proc_segment.start_stack); + + glibtop_get_proc_time (&data.proc_time, pid); + + printf ("Proc_Time PID %5d (0x%08lx): " + "%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid, + (unsigned long) data.proc_time.flags, + (unsigned long) data.proc_time.start_time, + (unsigned long) data.proc_time.rtime, + (unsigned long) data.proc_time.utime, + (unsigned long) data.proc_time.stime, + (unsigned long) data.proc_time.cutime, + (unsigned long) data.proc_time.cstime, + (unsigned long) data.proc_time.timeout, + (unsigned long) data.proc_time.it_real_value, + (unsigned long) data.proc_time.frequency); + + glibtop_get_proc_signal (&data.proc_signal, pid); + + printf ("Proc_Signal PID %5d (0x%08lx): " + "%lu %lu %lu %lu\n", (int) pid, + (unsigned long) data.proc_signal.flags, + (unsigned long) data.proc_signal.signal, + (unsigned long) data.proc_signal.blocked, + (unsigned long) data.proc_signal.sigignore, + (unsigned long) data.proc_signal.sigcatch); + + glibtop_get_proc_kernel (&data.proc_kernel, pid); + + printf ("Proc_Kernel PID %5d (0x%08lx): " + "%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", (int) pid, + (unsigned long) data.proc_kernel.flags, + (unsigned long) data.proc_kernel.k_flags, + (unsigned long) data.proc_kernel.min_flt, + (unsigned long) data.proc_kernel.maj_flt, + (unsigned long) data.proc_kernel.cmin_flt, + (unsigned long) data.proc_kernel.cmaj_flt, + (unsigned long) data.proc_kernel.kstk_esp, + (unsigned long) data.proc_kernel.kstk_eip, + (unsigned long) data.proc_kernel.nwchan, + data.proc_kernel.wchan); + + printf ("\n"); + + args = glibtop_get_proc_args (&data.proc_args, pid, 0); + + for (i = 0; i < data.proc_args.size; i++) { + if (args [i]) continue; + args [i] = '|'; + } + + printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid, + (unsigned long) data.proc_args.flags, + (unsigned long) data.proc_args.size, + args ? args : ""); + + g_free (args); + + printf ("\n"); + + ncpu = glibtop_global_server->ncpu; + + glibtop_get_proc_time (&data.proc_time, pid); + + total = (unsigned long) data.proc_time.utime + + (unsigned long) data.proc_time.stime; + + p_total = total ? (double) total : 1.0; + + p_utime = (double) data.proc_time.utime * 100.0 / p_total; + p_stime = (double) data.proc_time.stime * 100.0 / p_total; + + b_total = p_total / ncpu; + b_utime = (double) data.proc_time.utime / ncpu; + b_stime = (double) data.proc_time.stime / ncpu; + + s_total = 0.0; s_utime = 0.0; s_stime = 0.0; + + printf ("Proc_Time PID %5d (0x%08lx): %12lu %12lu %12lu\n", (int) pid, + (unsigned long) data.proc_time.flags, total, + (unsigned long) data.proc_time.utime, + (unsigned long) data.proc_time.stime); + + for (i = 0; i < ncpu; i++) { + unsigned long this_total; + + this_total = (unsigned long) data.proc_time.xcpu_utime [i] + + (unsigned long) data.proc_time.xcpu_stime [i]; + + printf ("CPU %3d PID %5d (0x%08lx): %12lu %12lu %12lu\n", i, + (int) pid, (unsigned long) data.proc_time.flags, this_total, + (unsigned long) data.proc_time.xcpu_utime [i], + (unsigned long) data.proc_time.xcpu_stime [i]); + + s_total += fabs (((double) this_total) - b_total); + s_utime += fabs (((double) data.proc_time.xcpu_utime [i]) - b_utime); + s_stime += fabs (((double) data.proc_time.xcpu_stime [i]) - b_stime); + } + + printf ("\n"); + + printf ("Proc_Time PID %5d (0x%08lx): %12.3f %12.3f %12.3f\n", (int) pid, + (unsigned long) data.proc_time.flags, 100.0, p_utime, p_stime); + + for (i = 0; i < ncpu; i++) { + double this_p_total, this_p_utime, this_p_stime; + unsigned long this_total; + + this_total = (unsigned long) data.proc_time.xcpu_utime [i] + + (unsigned long) data.proc_time.xcpu_stime [i]; + + this_p_total = (double) this_total * 100.0 / p_total; + + this_p_utime = (double) data.proc_time.xcpu_utime [i] * 100.0 / p_total; + this_p_stime = (double) data.proc_time.xcpu_stime [i] * 100.0 / p_total; + + printf ("CPU %3d PID %5d (0x%08lx): %12.3f %12.3f %12.3f\n", i, + (int) pid, (unsigned long) data.proc_time.flags, + this_p_total, this_p_utime, this_p_stime); + } + + printf ("\n"); + + my_utime = (unsigned long) data.proc_time.utime ? + (double) data.proc_time.utime : 1.0; + my_stime = (unsigned long) data.proc_time.stime ? + (double) data.proc_time.stime : 1.0; + + printf ("SPIN: %31s %12.3f %12.3f %12.3f\n", "", s_total * 100.0 / p_total, + s_utime * 100.0 / my_utime, s_stime * 100.0 / my_stime); + + printf ("\n"); +} + +int +main (int argc, char *argv []) +{ + glibtop_proclist proclist; + glibtop_sysdeps sysdeps; + unsigned i; + pid_t *ptr, pid; + + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, GTOPLOCALEDIR); + textdomain (GETTEXT_PACKAGE); + + glibtop_init (); + + glibtop_get_sysdeps (&sysdeps); + + printf ("Sysdeps (0x%08lx): %lu, %lu, %lu, %lu, %lu, " + "%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n", + (unsigned long) sysdeps.flags, + (unsigned long) sysdeps.cpu, + (unsigned long) sysdeps.mem, + (unsigned long) sysdeps.swap, + (unsigned long) sysdeps.uptime, + (unsigned long) sysdeps.loadavg, + (unsigned long) sysdeps.shm_limits, + (unsigned long) sysdeps.msg_limits, + (unsigned long) sysdeps.sem_limits, + (unsigned long) sysdeps.proclist, + (unsigned long) sysdeps.proc_state, + (unsigned long) sysdeps.proc_uid, + (unsigned long) sysdeps.proc_mem, + (unsigned long) sysdeps.proc_time, + (unsigned long) sysdeps.proc_signal, + (unsigned long) sysdeps.proc_kernel, + (unsigned long) sysdeps.proc_segment); + + if ((argc == 2) && (sscanf (argv [1], "%d", &pid) == 1)) { + output (pid); + + exit (0); + } + + printf ("\n"); + + ptr = glibtop_get_proclist (&proclist, 0, 0); + + printf ("Proclist (0x%08lx): %lu, %lu, %lu\n", + (unsigned long) proclist.flags, + (unsigned long) proclist.number, + (unsigned long) proclist.size, + (unsigned long) proclist.total); + + if (!ptr) exit (1); + + for (i = 0; i < proclist.number; i++) { + + pid = ptr [i]; + + output (pid); + } + + g_free (ptr); + + exit (0); +} + + + diff --git a/examples/smp.c b/examples/smp.c new file mode 100644 index 0000000..ffa3472 --- /dev/null +++ b/examples/smp.c @@ -0,0 +1,124 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , September 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include +#include +#include +#include + +#include +#include + +int +main (int argc, char *argv []) +{ + glibtop_cpu cpu; + unsigned long frequency; + double total, user, nice, sys, idle; + double b_total, b_user, b_nice, b_sys, b_idle; + double s_total, s_user, s_nice, s_sys, s_idle; + char separator [BUFSIZ], buffer [BUFSIZ]; + int ncpu, i; + + glibtop_init(); + + glibtop_get_cpu (&cpu); + + ncpu = glibtop_global_server->ncpu ? glibtop_global_server->ncpu : 1; + + frequency = (unsigned long) cpu.frequency; + + total = ((unsigned long) cpu.total) ? ((double) cpu.total) : 1.0; + user = ((unsigned long) cpu.user) ? ((double) cpu.user) : 1.0; + nice = ((unsigned long) cpu.nice) ? ((double) cpu.nice) : 1.0; + sys = ((unsigned long) cpu.sys) ? ((double) cpu.sys) : 1.0; + idle = ((unsigned long) cpu.idle) ? ((double) cpu.idle) : 1.0; + + s_total = s_user = s_nice = s_sys = s_idle = 0.0; + + b_total = total / ncpu; + b_user = user / ncpu; + b_nice = nice / ncpu; + b_sys = sys / ncpu; + b_idle = idle / ncpu; + + memset (separator, '-', 91); + separator [92] = '\0'; + + sprintf (buffer, "Ticks (%ld per second):", frequency); + + printf ("\n\n%-26s %12s %12s %12s %12s %12s\n%s\n", buffer, + "Total", "User", "Nice", "Sys", "Idle", separator); + + printf ("CPU (0x%08lx): %12.0f %12.0f %12.0f %12.0f %12.0f\n\n", + (unsigned long) cpu.flags, total, user, nice, sys, idle); + + for (i = 0; i < glibtop_global_server->ncpu; i++) { + printf ("CPU %3d (0x%08lx): %12lu %12lu %12lu %12lu %12lu\n", i, + (unsigned long) cpu.flags, + (unsigned long) cpu.xcpu_total [i], + (unsigned long) cpu.xcpu_user [i], + (unsigned long) cpu.xcpu_nice [i], + (unsigned long) cpu.xcpu_sys [i], + (unsigned long) cpu.xcpu_idle [i]); + + s_total += fabs (((double) cpu.xcpu_total [i]) - b_total); + s_user += fabs (((double) cpu.xcpu_user [i]) - b_user); + s_nice += fabs (((double) cpu.xcpu_nice [i]) - b_nice); + s_sys += fabs (((double) cpu.xcpu_sys [i]) - b_sys); + s_idle += fabs (((double) cpu.xcpu_idle [i]) - b_idle); + } + + printf ("%s\n\n\n", separator); + + printf ("%-26s %12s %12s %12s %12s %12s\n%s\n", "Percent:", + "Total (%)", "User (%)", "Nice (%)", "Sys (%)", + "Idle (%)", separator); + + printf ("CPU (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n\n", + (unsigned long) cpu.flags, (double) total * 100.0 / total, + (double) user * 100.0 / total, + (double) nice * 100.0 / total, + (double) sys * 100.0 / total, + (double) idle * 100.0 / total); + + for (i = 0; i < glibtop_global_server->ncpu; i++) { + double p_total, p_user, p_nice, p_sys, p_idle; + + p_total = ((double) cpu.xcpu_total [i]) * 100.0 / total; + p_user = ((double) cpu.xcpu_user [i]) * 100.0 / user; + p_nice = ((double) cpu.xcpu_nice [i]) * 100.0 / nice; + p_sys = ((double) cpu.xcpu_sys [i]) * 100.0 / sys; + p_idle = ((double) cpu.xcpu_idle [i]) * 100.0 / idle; + + printf ("CPU %3d (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n", + i, (unsigned long) cpu.flags, p_total, p_user, p_nice, + p_sys, p_idle); + } + + printf ("%s\n%-26s %12.3f %12.3f %12.3f %12.3f %12.3f\n\n", separator, + "Spin:", s_total * 100.0 / total, s_user * 100.0 / user, + s_nice * 100.0 / nice, s_sys * 100.0 / sys, s_idle * 100.0 / idle); + + exit (0); +} diff --git a/examples/sysdeps.c b/examples/sysdeps.c new file mode 100644 index 0000000..559f93e --- /dev/null +++ b/examples/sysdeps.c @@ -0,0 +1,155 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#include +#include +#include +#include + +#include + +#ifndef PROFILE_COUNT +#define PROFILE_COUNT 1 +#endif + +int +main (int argc, char *argv []) +{ + glibtop_sysdeps sysdeps; + unsigned method, count, port; + char buffer [BUFSIZ]; + + count = PROFILE_COUNT; + + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, GTOPLOCALEDIR); + textdomain (GETTEXT_PACKAGE); + + glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_OPEN); + + glibtop_get_parameter (GLIBTOP_PARAM_METHOD, &method, sizeof (method)); + + printf ("Method = %d\n", method); + + count = glibtop_get_parameter (GLIBTOP_PARAM_COMMAND, buffer, BUFSIZ); + buffer [count] = 0; + + printf ("Command = '%s'\n", buffer); + + count = glibtop_get_parameter (GLIBTOP_PARAM_HOST, buffer, BUFSIZ); + buffer [count] = 0; + + glibtop_get_parameter (GLIBTOP_PARAM_PORT, &port, sizeof (port)); + + printf ("Host = '%s' - %u\n\n", buffer, port); + + glibtop_init_r (&glibtop_global_server, 0, 0); + + glibtop_get_sysdeps (&sysdeps); + +#define FEATURE_CHECK(f) ((sysdeps.features & (1L << GLIBTOP_SYSDEPS_##f)) ? 1 : 0) + + printf ("Sysdeps (0x%08lx):\n\n" + "\tfeatures:\t\t0x%08lx\n\n" + "\tcpu:\t\t%d\t0x%08lx\n" + "\tmem:\t\t%d\t0x%08lx\n" + "\tswap:\t\t%d\t0x%08lx\n\n" + "\tuptime:\t\t%d\t0x%08lx\n" + "\tloadavg:\t%d\t0x%08lx\n\n" + "\tshm_limits:\t%d\t0x%08lx\n" + "\tmsg_limits:\t%d\t0x%08lx\n" + "\tsem_limits:\t%d\t0x%08lx\n\n" + "\tproclist:\t%d\t0x%08lx\n\n" + "\tproc_state:\t%d\t0x%08lx\n" + "\tproc_uid:\t%d\t0x%08lx\n" + "\tproc_mem:\t%d\t0x%08lx\n" + "\tproc_time:\t%d\t0x%08lx\n" + "\tproc_signal:\t%d\t0x%08lx\n" + "\tproc_kernel:\t%d\t0x%08lx\n" + "\tproc_segment:\t%d\t0x%08lx\n" + "\tproc_args:\t%d\t0x%08lx\n" + "\tproc_map:\t%d\t0x%08lx\n" + "\tproc_io:\t%d\t0x%08lx\n\n" + "\tmountlist:\t%d\t0x%08lx\n" + "\tfsusage:\t%d\t0x%08lx\n\n" + "\tnetload:\t%d\t0x%08lx\n" + "\tppp:\t\t%d\t0x%08lx\n\n", + (unsigned long) sysdeps.flags, + (unsigned long) sysdeps.features, + FEATURE_CHECK(CPU), + (unsigned long) sysdeps.cpu, + FEATURE_CHECK(MEM), + (unsigned long) sysdeps.mem, + FEATURE_CHECK(SWAP), + (unsigned long) sysdeps.swap, + FEATURE_CHECK(UPTIME), + (unsigned long) sysdeps.uptime, + FEATURE_CHECK(LOADAVG), + (unsigned long) sysdeps.loadavg, + FEATURE_CHECK(SHM_LIMITS), + (unsigned long) sysdeps.shm_limits, + FEATURE_CHECK(MSG_LIMITS), + (unsigned long) sysdeps.msg_limits, + FEATURE_CHECK(SEM_LIMITS), + (unsigned long) sysdeps.sem_limits, + FEATURE_CHECK(PROCLIST), + (unsigned long) sysdeps.proclist, + FEATURE_CHECK(PROC_STATE), + (unsigned long) sysdeps.proc_state, + FEATURE_CHECK(PROC_UID), + (unsigned long) sysdeps.proc_uid, + FEATURE_CHECK(PROC_MEM), + (unsigned long) sysdeps.proc_mem, + FEATURE_CHECK(PROC_TIME), + (unsigned long) sysdeps.proc_time, + FEATURE_CHECK(PROC_SIGNAL), + (unsigned long) sysdeps.proc_signal, + FEATURE_CHECK(PROC_KERNEL), + (unsigned long) sysdeps.proc_kernel, + FEATURE_CHECK(PROC_SEGMENT), + (unsigned long) sysdeps.proc_segment, + FEATURE_CHECK(PROC_ARGS), + (unsigned long) sysdeps.proc_args, + FEATURE_CHECK(PROC_MAP), + (unsigned long) sysdeps.proc_map, + FEATURE_CHECK(PROC_IO), + (unsigned long) sysdeps.proc_io, + FEATURE_CHECK(MOUNTLIST), + (unsigned long) sysdeps.mountlist, + FEATURE_CHECK(FSUSAGE), + (unsigned long) sysdeps.fsusage, + FEATURE_CHECK(NETLOAD), + (unsigned long) sysdeps.netload, + FEATURE_CHECK(PPP), + (unsigned long) sysdeps.ppp); + + glibtop_close (); + + exit (0); +} diff --git a/examples/timings.c b/examples/timings.c new file mode 100644 index 0000000..15bc197 --- /dev/null +++ b/examples/timings.c @@ -0,0 +1,457 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#ifndef PROFILE_COUNT +#define PROFILE_COUNT 100000L +#endif + +#ifndef PROFILE_COUNT_EXPENSIVE +#define PROFILE_COUNT_EXPENSIVE (PROFILE_COUNT / 10) +#endif + +#define ELAPSED_UTIME ((unsigned long) elapsed_utime.tv_sec * 1000000 + (unsigned long) elapsed_utime.tv_usec) +#define ELAPSED_STIME ((unsigned long) elapsed_stime.tv_sec * 1000000 + (unsigned long) elapsed_stime.tv_usec) + +#define libgtop_timeradd(tvp, uvp, vvp) \ + do { \ + (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ + (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ + if ((vvp)->tv_usec >= 1000000) { \ + (vvp)->tv_sec++; \ + (vvp)->tv_usec -= 1000000; \ + } \ + } while (0) +#define libgtop_timersub(tvp, uvp, vvp) \ + do { \ + (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ + (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ + if ((vvp)->tv_usec < 0) { \ + (vvp)->tv_sec--; \ + (vvp)->tv_usec += 1000000; \ + } \ + } while (0) + + +static void display_self_times(void) +{ + printf("-- Overview using `ps` --------------------" + "---------------\n"); + printf("-- this client is %8u ----------------" + "---------------\n", (unsigned)getpid()); + printf("-- this server is %8u ----------------" + "---------------\n", (unsigned)glibtop_global_server->pid); + system("ps xjf | egrep 'timings|libgtop_server'"); + printf("-------------------------------------------" + "---------------\n"); +} + + +int +main (int argc, char *argv []) +{ + glibtop_union data; + unsigned c; + struct rusage total_start, total_end; + struct rusage rusage_start, rusage_end; + struct timeval elapsed_utime, elapsed_stime; + pid_t pid; + + pid = getpid (); + + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, GTOPLOCALEDIR); + textdomain (GETTEXT_PACKAGE); + + + glibtop_init_r (&glibtop_global_server, 0, 0); + + display_self_times(); + + printf ("%-12s (%-10s): %7s - %9s - %9s\n", + "Feature", "Flags", "Count", "utime", "stime"); + printf ("-------------------------------------------" + "---------------\n"); + + getrusage (RUSAGE_SELF, &total_start); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_cpu (&data.cpu); + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("CPU (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.cpu.flags, PROFILE_COUNT, + (long double) ELAPSED_UTIME / PROFILE_COUNT, + (long double) ELAPSED_STIME / PROFILE_COUNT); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT_EXPENSIVE; c++) + glibtop_get_mem (&data.mem); + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Memory (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.mem.flags, PROFILE_COUNT_EXPENSIVE, + (long double) ELAPSED_UTIME / PROFILE_COUNT_EXPENSIVE, + (long double) ELAPSED_STIME / PROFILE_COUNT_EXPENSIVE); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT_EXPENSIVE; c++) + glibtop_get_swap (&data.swap); + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Swap (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.swap.flags, PROFILE_COUNT_EXPENSIVE, + (long double) ELAPSED_UTIME / PROFILE_COUNT_EXPENSIVE, + (long double) ELAPSED_STIME / PROFILE_COUNT_EXPENSIVE); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_uptime (&data.uptime); + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Uptime (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.uptime.flags, PROFILE_COUNT, + (long double) ELAPSED_UTIME / PROFILE_COUNT, + (long double) ELAPSED_STIME / PROFILE_COUNT); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_loadavg (&data.loadavg); + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Loadavg (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.loadavg.flags, PROFILE_COUNT, + (long double) ELAPSED_UTIME / PROFILE_COUNT, + (long double) ELAPSED_STIME / PROFILE_COUNT); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT_EXPENSIVE; c++) { + pid_t* ptr = glibtop_get_proclist (&data.proclist, 0, 0); + g_free (ptr); + } + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Proclist (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.proclist.flags, + PROFILE_COUNT_EXPENSIVE, + (long double) ELAPSED_UTIME / PROFILE_COUNT_EXPENSIVE, + (long double) ELAPSED_STIME / PROFILE_COUNT_EXPENSIVE); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT_EXPENSIVE; c++) { + char** ptr = glibtop_get_netlist (&data.netlist); + g_strfreev (ptr); + } + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Netlist (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.proclist.flags, + PROFILE_COUNT_EXPENSIVE, + (long double) ELAPSED_UTIME / PROFILE_COUNT_EXPENSIVE, + (long double) ELAPSED_STIME / PROFILE_COUNT_EXPENSIVE); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_state (&data.proc_state, pid); + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Proc_State (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.proc_state.flags, PROFILE_COUNT, + (long double) ELAPSED_UTIME / PROFILE_COUNT, + (long double) ELAPSED_STIME / PROFILE_COUNT); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_uid (&data.proc_uid, pid); + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Proc_Uid (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.proc_uid.flags, PROFILE_COUNT, + (long double) ELAPSED_UTIME / PROFILE_COUNT, + (long double) ELAPSED_STIME / PROFILE_COUNT); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_mem (&data.proc_mem, pid); + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Proc_Mem (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.proc_mem.flags, PROFILE_COUNT, + (long double) ELAPSED_UTIME / PROFILE_COUNT, + (long double) ELAPSED_STIME / PROFILE_COUNT); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT_EXPENSIVE; c++) { + glibtop_map_entry* entries; + entries = glibtop_get_proc_map (&data.proc_map, pid); + g_free (entries); + } + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Proc_Map (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.proc_map.flags, PROFILE_COUNT_EXPENSIVE, + (long double) ELAPSED_UTIME / PROFILE_COUNT_EXPENSIVE, + (long double) ELAPSED_STIME / PROFILE_COUNT_EXPENSIVE); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_segment (&data.proc_segment, pid); + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Proc_Segment (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.proc_segment.flags, PROFILE_COUNT, + (long double) ELAPSED_UTIME / PROFILE_COUNT, + (long double) ELAPSED_STIME / PROFILE_COUNT); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT; c++) { + char** argv; + argv = glibtop_get_proc_argv (&data.proc_args, pid, 0); + g_strfreev(argv); + } + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Proc_Args (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.proc_args.flags, PROFILE_COUNT, + (long double) ELAPSED_UTIME / PROFILE_COUNT, + (long double) ELAPSED_STIME / PROFILE_COUNT); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_time (&data.proc_time, pid); + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Proc_Time (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.proc_time.flags, PROFILE_COUNT, + (long double) ELAPSED_UTIME / PROFILE_COUNT, + (long double) ELAPSED_STIME / PROFILE_COUNT); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_signal (&data.proc_signal, pid); + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Proc_Signal (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.proc_signal.flags, PROFILE_COUNT, + (long double) ELAPSED_UTIME / PROFILE_COUNT, + (long double) ELAPSED_STIME / PROFILE_COUNT); + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_kernel (&data.proc_kernel, pid); + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Proc_Kernel (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.proc_kernel.flags, PROFILE_COUNT, + (long double) ELAPSED_UTIME / PROFILE_COUNT, + (long double) ELAPSED_STIME / PROFILE_COUNT); + + + getrusage (RUSAGE_SELF, &rusage_start); + + for (c = 0; c < PROFILE_COUNT; c++) + glibtop_get_proc_io (&data.proc_io, pid); + + getrusage (RUSAGE_SELF, &rusage_end); + + libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, + &elapsed_stime); + + printf ("Proc_Io (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", + (unsigned long) data.proc_io.flags, PROFILE_COUNT, + (long double) ELAPSED_UTIME / PROFILE_COUNT, + (long double) ELAPSED_STIME / PROFILE_COUNT); + + + getrusage (RUSAGE_SELF, &total_end); + + libgtop_timersub (&total_end.ru_utime, &total_start.ru_utime, + &elapsed_utime); + + libgtop_timersub (&total_end.ru_stime, &total_start.ru_stime, + &elapsed_stime); + + printf ("-------------------------------------------" + "---------------\n"); + + printf ("%-36s %9lu - %9lu\n\n", "TOTAL", + ELAPSED_UTIME, ELAPSED_STIME); + + printf ("All timings are in clock ticks " + "(1000000 ticks per second).\n\n"); + + display_self_times(); + + glibtop_close (); + + exit (0); +} diff --git a/examples/wd.c b/examples/wd.c new file mode 100644 index 0000000..353a466 --- /dev/null +++ b/examples/wd.c @@ -0,0 +1,35 @@ +#include +#include + +#include +#include + +int main(int argc, char **argv) +{ + pid_t pid; + glibtop_proc_wd buf; + char **dirs, **dir; + + if (argc < 2 || !(pid = strtoul(argv[1], NULL, 0))) + pid = getpid(); + + glibtop_init(); + + dirs = glibtop_get_proc_wd(&buf, pid); + + g_print("Process %u:\n" + " - root: '%s'\n" + " - exe: '%s'\n" + " - working directories:\n", + (unsigned)pid, buf.root, buf.exe); + + for (dir = dirs; *dir; ++dir) + g_print(" - '%s'\n", *dir); + + g_strfreev(dirs); + + glibtop_close(); + + return 0; +} + diff --git a/features.def b/features.def new file mode 100644 index 0000000..faab87b --- /dev/null +++ b/features.def @@ -0,0 +1,28 @@ +void|cpu +void|mem +void|swap +void|uptime +void|loadavg +void|shm_limits +void|msg_limits +void|sem_limits +pid_t*|proclist|long(which,arg) +void|proc_state|pid_t(pid) +void|proc_uid|pid_t(pid) +void|proc_mem|pid_t(pid) +void|proc_time|pid_t(pid) +void|proc_signal|pid_t(pid) +void|proc_kernel|pid_t(pid) +void|proc_segment|pid_t(pid) +char *|proc_args|pid_t(pid):unsigned(max_len) +glibtop_map_entry *|proc_map|pid_t(pid) +glibtop_open_files_entry *|proc_open_files|pid_t(pid) +glibtop_mountentry *|@mountlist|int(all_fs) +void|@fsusage|string|mount_dir +void|netload|string|interface +void|ppp|ushort(device) +char **|netlist +char **|proc_wd|pid_t(pid) +guint16*|proc_affinity|pid_t(pid) +void|proc_io|pid_t(pid) + diff --git a/glibtop.h b/glibtop.h new file mode 100644 index 0000000..2c963d0 --- /dev/null +++ b/glibtop.h @@ -0,0 +1,147 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_H__ +#define __GLIBTOP_H__ + +/* for pid_t, uid_t, gid_t */ +#include + + +#include +#include + +G_BEGIN_DECLS + +typedef struct _glibtop glibtop; +typedef struct _glibtop_machine glibtop_machine; + +/** + * LIBGTOP_CHECK_VERSION + * @major: Major version number + * @minor: Minor version number + * @micro: Micro version number + * + * Checks if the version given is compatable with this version of the + * library. For example, LIBGTOP_CHECK_VERSION(1.2.3) would return TRUE + * if the version is 1.2.5, and FALSE if 1.1.0. This can be used in + * build tests. + * + **/ + +#include + +#define LIBGTOP_CHECK_VERSION(major, minor, micro) \ +(LIBGTOP_MAJOR_VERSION > (major) || \ +(LIBGTOP_MAJOR_VERSION == (major) && LIBGTOP_MINOR_VERSION > (minor)) || \ +(LIBGTOP_MAJOR_VERSION == (major) && LIBGTOP_MINOR_VERSION == (minor) && \ +LIBGTOP_MICRO_VERSION >= (micro))) + + +#include + +#include + +#ifndef GLIBTOP_MOUNTENTRY_LEN +#define GLIBTOP_MOUNTENTRY_LEN 79 +#endif + + +#include + +#include + + +struct _glibtop +{ + unsigned flags; + unsigned method; /* Server Method */ + unsigned error_method; /* Error Method */ + int input [2]; /* Pipe client <- server */ + int output [2]; /* Pipe client -> server */ + int socket; /* Accepted connection of a socket */ + int ncpu; /* Number of CPUs, zero if single-processor */ + int real_ncpu; /* Real number of CPUs. Only ncpu are monitored */ + unsigned long os_version_code; /* Version code of the operating system */ + const char *name; /* Program name for error messages */ + const char *server_command; /* Command used to invoke server */ + const char *server_host; /* Host the server should run on */ + const char *server_user; /* Name of the user on the target host */ + const char *server_rsh; /* Command used to connect to the target host */ + unsigned long features; /* Server is required for this features */ + unsigned long server_port; /* Port on which daemon is listening */ + glibtop_sysdeps sysdeps; /* Detailed feature list */ + glibtop_sysdeps required; /* Required feature list */ + pid_t pid; /* PID of the server */ + + uid_t uid; + uid_t euid; + gid_t gid; + gid_t egid; + + glibtop_machine *machine; /* Machine dependent data */ +}; + +extern glibtop *glibtop_global_server; + +extern const unsigned long glibtop_server_features; + +/** + * glibtop_init: + * + * Returns: (transfer none): + */ +glibtop * +glibtop_init (void); + + +/** + * glibtop_init_r: + * @server_ptr: (out): + * @features: + * @flags: + * + * Returns: (transfer none): + */ +glibtop * +glibtop_init_r (glibtop **server_ptr, + unsigned long features, + unsigned flags); + + +/** + * glibtop_init_s: + * @server_ptr: (out): + * @features: + * @flags: + * + * Returns: (transfer none): + */ +glibtop * +glibtop_init_s (glibtop **server_ptr, + unsigned long features, + unsigned flags); + +GType glibtop_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif diff --git a/gtk-doc.make b/gtk-doc.make new file mode 100644 index 0000000..e4a12a5 --- /dev/null +++ b/gtk-doc.make @@ -0,0 +1,304 @@ +# -*- mode: makefile -*- + +#################################### +# Everything below here is generic # +#################################### + +if GTK_DOC_USE_LIBTOOL +GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = $(LIBTOOL) --mode=execute +else +GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = +endif + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) + +SETUP_FILES = \ + $(content_files) \ + $(expand_content_files) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + +EXTRA_DIST = \ + $(HTML_IMAGES) \ + $(SETUP_FILES) + +DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \ + html-build.stamp pdf-build.stamp \ + sgml.stamp html.stamp pdf.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +gtkdoc-check.test: Makefile + $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ + echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ + chmod +x $@ + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test + +if GTK_DOC_BUILD_HTML +HTML_BUILD_STAMP=html-build.stamp +else +HTML_BUILD_STAMP= +endif +if GTK_DOC_BUILD_PDF +PDF_BUILD_STAMP=pdf-build.stamp +else +PDF_BUILD_STAMP= +endif + +all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) +.PHONY: all-gtk-doc + +if ENABLE_GTK_DOC +all-local: all-gtk-doc +endif + +docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) + +$(REPORT_FILES): sgml-build.stamp + +#### setup #### + +GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_$(V)) +GTK_DOC_V_SETUP_=$(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_SETUP_0=@echo " DOC Preparing build"; + +setup-build.stamp: + -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ + if test "x$$files" != "x" ; then \ + for file in $$files ; do \ + destdir=`dirname $(abs_builddir)/$$file`; \ + test -d "$$destdir" || mkdir -p "$$destdir"; \ + test -f $(abs_srcdir)/$$file && \ + cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ + done; \ + fi; \ + fi + $(AM_V_at)touch setup-build.stamp + + +#### scan #### + +GTK_DOC_V_SCAN=$(GTK_DOC_V_SCAN_$(V)) +GTK_DOC_V_SCAN_=$(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_SCAN_0=@echo " DOC Scanning header files"; + +GTK_DOC_V_INTROSPECT=$(GTK_DOC_V_INTROSPECT_$(V)) +GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; + +scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) + $(GTK_DOC_V_SCAN)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) + $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ + scanobj_options=""; \ + gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ + fi; \ + fi; \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ + else \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + $(AM_V_at)touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +#### xml #### + +GTK_DOC_V_XML=$(GTK_DOC_V_XML_$(V)) +GTK_DOC_V_XML_=$(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_XML_0=@echo " DOC Building XML"; + +sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent + $(GTK_DOC_V_XML)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) + $(AM_V_at)touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +xml/gtkdocentities.ent: Makefile + $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + ) > $@ + +#### html #### + +GTK_DOC_V_HTML=$(GTK_DOC_V_HTML_$(V)) +GTK_DOC_V_HTML_=$(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_HTML_0=@echo " DOC Building HTML"; + +GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_$(V)) +GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_XREF_0=@echo " DOC Fixing cross-references"; + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ + mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$$?" = "0"; then \ + mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + -@test "x$(HTML_IMAGES)" = "x" || \ + for file in $(HTML_IMAGES) ; do \ + if test -f $(abs_srcdir)/$$file ; then \ + cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ + fi; \ + if test -f $(abs_builddir)/$$file ; then \ + cp $(abs_builddir)/$$file $(abs_builddir)/html; \ + fi; \ + done; + $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + $(AM_V_at)touch html-build.stamp + +#### pdf #### + +GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_$(V)) +GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_PDF_0=@echo " DOC Building PDF"; + +pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ + mkpdf_options=""; \ + gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkpdf_options="$$mkpdf_options --verbose"; \ + fi; \ + fi; \ + if test "x$(HTML_IMAGES)" != "x"; then \ + for img in $(HTML_IMAGES); do \ + part=`dirname $$img`; \ + echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ + if test $$? != 0; then \ + mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ + fi; \ + done; \ + fi; \ + gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) + $(AM_V_at)touch pdf-build.stamp + +############## + +clean-local: + @rm -f *~ *.bak + @rm -rf .libs + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ + rm -f $(DOC_MODULE).types; \ + fi + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ + rm -f $(DOC_MODULE)-sections.txt; \ + fi + +distclean-local: + @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ + fi + +maintainer-clean-local: + @rm -rf xml html + +install-data-local: + @installfiles=`echo $(builddir)/html/*`; \ + if test "$$installfiles" = '$(builddir)/html/*'; \ + then echo 1>&2 'Nothing to install' ; \ + else \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + $(mkinstalldirs) $${installdir} ; \ + for i in $$installfiles; do \ + echo ' $(INSTALL_DATA) '$$i ; \ + $(INSTALL_DATA) $$i $${installdir}; \ + done; \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ + fi + +uninstall-local: + @if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + rm -rf $${installdir} + +# +# Require gtk-doc when making dist +# +if HAVE_GTK_DOC +dist-check-gtkdoc: docs +else +dist-check-gtkdoc: + @echo "*** gtk-doc is needed to run 'make dist'. ***" + @echo "*** gtk-doc was not found when 'configure' ran. ***" + @echo "*** please install gtk-doc and rerun 'configure'. ***" + @false +endif + +dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local + @mkdir $(distdir)/html + @cp ./html/* $(distdir)/html + @-cp ./$(DOC_MODULE).pdf $(distdir)/ + @-cp ./$(DOC_MODULE).types $(distdir)/ + @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ + @cd $(distdir) && rm -f $(DISTCLEANFILES) + @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..4832afc --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = glibtop + diff --git a/include/Makefile.in b/include/Makefile.in new file mode 100644 index 0000000..bf5f367 --- /dev/null +++ b/include/Makefile.in @@ -0,0 +1,693 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = include +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = glibtop +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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: diff --git a/include/glibtop/Makefile.am b/include/glibtop/Makefile.am new file mode 100644 index 0000000..6d0e055 --- /dev/null +++ b/include/glibtop/Makefile.am @@ -0,0 +1,17 @@ +glibtopdir = $(includedir)/libgtop-2.0/glibtop + +glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \ + sem_limits.h uptime.h command.h mem.h proclist.h \ + proctime.h shm_limits.h cpu.h msg_limits.h \ + procmem.h procuid.h swap.h \ + procsegment.h sysdeps.h global.h \ + procsignal.h union.h gnuserv.h \ + parameter.h mountlist.h fsusage.h procmap.h signal.h \ + sysinfo.h ppp.h procargs.h netload.h \ + procwd.h procaffinity.h \ + procio.h \ + netlist.h procopenfiles.h open.h + +noinst_HEADERS = error.h write.h read_data.h read.h init_hooks.h machine.h \ + version.h + diff --git a/include/glibtop/Makefile.in b/include/glibtop/Makefile.in new file mode 100644 index 0000000..5495338 --- /dev/null +++ b/include/glibtop/Makefile.in @@ -0,0 +1,649 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = include/glibtop +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(glibtop_HEADERS) \ + $(noinst_HEADERS) $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(glibtopdir)" +HEADERS = $(glibtop_HEADERS) $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +glibtopdir = $(includedir)/libgtop-2.0/glibtop +glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \ + sem_limits.h uptime.h command.h mem.h proclist.h \ + proctime.h shm_limits.h cpu.h msg_limits.h \ + procmem.h procuid.h swap.h \ + procsegment.h sysdeps.h global.h \ + procsignal.h union.h gnuserv.h \ + parameter.h mountlist.h fsusage.h procmap.h signal.h \ + sysinfo.h ppp.h procargs.h netload.h \ + procwd.h procaffinity.h \ + procio.h \ + netlist.h procopenfiles.h open.h + +noinst_HEADERS = error.h write.h read_data.h read.h init_hooks.h machine.h \ + version.h + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/glibtop/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/glibtop/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-glibtopHEADERS: $(glibtop_HEADERS) + @$(NORMAL_INSTALL) + @list='$(glibtop_HEADERS)'; test -n "$(glibtopdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(glibtopdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(glibtopdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(glibtopdir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(glibtopdir)" || exit $$?; \ + done + +uninstall-glibtopHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(glibtop_HEADERS)'; test -n "$(glibtopdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(glibtopdir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(glibtopdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-glibtopHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-glibtopHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool cscopelist-am ctags ctags-am distclean \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-glibtopHEADERS \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-glibtopHEADERS + +.PRECIOUS: Makefile + + +# 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: diff --git a/include/glibtop/close.h b/include/glibtop/close.h new file mode 100644 index 0000000..88c4547 --- /dev/null +++ b/include/glibtop/close.h @@ -0,0 +1,38 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_CLOSE_H__ +#define __GLIBTOP_CLOSE_H__ + +#include + +G_BEGIN_DECLS + +void glibtop_close (void); + +void glibtop_close_r (glibtop *server); + +void glibtop_close_s (glibtop *server); +void glibtop_close_p (glibtop *server); + +G_END_DECLS + +#endif diff --git a/include/glibtop/command.h b/include/glibtop/command.h new file mode 100644 index 0000000..9a0e47b --- /dev/null +++ b/include/glibtop/command.h @@ -0,0 +1,105 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_COMMAND_H__ +#define __GLIBTOP_COMMAND_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_CMND_QUIT 0 +#define GLIBTOP_CMND_SYSDEPS 1 + +#define GLIBTOP_CMND_CPU 2 +#define GLIBTOP_CMND_MEM 3 +#define GLIBTOP_CMND_SWAP 4 +#define GLIBTOP_CMND_UPTIME 5 +#define GLIBTOP_CMND_LOADAVG 6 +#define GLIBTOP_CMND_SHM_LIMITS 7 +#define GLIBTOP_CMND_MSG_LIMITS 8 +#define GLIBTOP_CMND_SEM_LIMITS 9 +#define GLIBTOP_CMND_PROCLIST 10 + +#define GLIBTOP_CMND_PROC_STATE 11 +#define GLIBTOP_CMND_PROC_UID 12 +#define GLIBTOP_CMND_PROC_MEM 13 +#define GLIBTOP_CMND_PROC_TIME 14 +#define GLIBTOP_CMND_PROC_SIGNAL 15 +#define GLIBTOP_CMND_PROC_KERNEL 16 +#define GLIBTOP_CMND_PROC_SEGMENT 17 +#define GLIBTOP_CMND_PROC_ARGS 18 +#define GLIBTOP_CMND_PROC_MAP 19 + +#define GLIBTOP_CMND_MOUNTLIST 20 +#define GLIBTOP_CMND_FSUSAGE 21 +#define GLIBTOP_CMND_NETLOAD 22 +#define GLIBTOP_CMND_PPP 23 +#define GLIBTOP_CMND_NETLIST 24 +#define GLIBTOP_CMND_PROC_OPEN_FILES 25 +#define GLIBTOP_CMND_PROC_WD 26 +#define GLIBTOP_CMND_PROC_AFFINITY 27 +#define GLIBTOP_CMND_PROC_IO 28 + +#define GLIBTOP_MAX_CMND 29 + +#define _GLIBTOP_PARAM_SIZE 16 + +typedef struct _glibtop_command glibtop_command; + +typedef struct _glibtop_response glibtop_response; +typedef union _glibtop_response_union glibtop_response_union; + +struct _glibtop_command +{ + guint64 command; + guint64 size, data_size; + char parameter [_GLIBTOP_PARAM_SIZE]; +}; + +union _glibtop_response_union +{ + glibtop_union data; + glibtop_sysdeps sysdeps; +}; + +struct _glibtop_response +{ + gint64 offset; + guint64 size, data_size; + glibtop_response_union u; +}; + +#define glibtop_call(p1, p2, p3, p4) glibtop_call_r(glibtop_global_server, p1, p2, p3, p4) + +void * +glibtop_call_l (glibtop *server, unsigned command, size_t send_size, + const void *send_buf, size_t recv_size, void *recv_buf); + +void * +glibtop_call_s (glibtop *server, unsigned command, size_t send_size, + const void *send_buf, size_t recv_size, void *recv_buf); + +G_END_DECLS + +#endif diff --git a/include/glibtop/cpu.h b/include/glibtop/cpu.h new file mode 100644 index 0000000..4e30d27 --- /dev/null +++ b/include/glibtop/cpu.h @@ -0,0 +1,105 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_CPU_H__ +#define __GLIBTOP_CPU_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_CPU_TOTAL 0 +#define GLIBTOP_CPU_USER 1 +#define GLIBTOP_CPU_NICE 2 +#define GLIBTOP_CPU_SYS 3 +#define GLIBTOP_CPU_IDLE 4 +#define GLIBTOP_CPU_FREQUENCY 5 + +#define GLIBTOP_XCPU_TOTAL 6 +#define GLIBTOP_XCPU_USER 7 +#define GLIBTOP_XCPU_NICE 8 +#define GLIBTOP_XCPU_SYS 9 +#define GLIBTOP_XCPU_IDLE 10 +#define GLIBTOP_XCPU_FLAGS 11 + +#define GLIBTOP_CPU_IOWAIT 12 +#define GLIBTOP_CPU_IRQ 13 +#define GLIBTOP_CPU_SOFTIRQ 14 +#define GLIBTOP_XCPU_IOWAIT 15 +#define GLIBTOP_XCPU_IRQ 16 +#define GLIBTOP_XCPU_SOFTIRQ 17 + +#define GLIBTOP_MAX_CPU 18 + +/* Nobody should really be using more than 4 processors. + Yes we are :) + Nobody should really be using more than 32 processors. +*/ +#define GLIBTOP_NCPU 1024 + +typedef struct _glibtop_cpu glibtop_cpu; + +struct _glibtop_cpu +{ + guint64 flags; + guint64 total; /* GLIBTOP_CPU_TOTAL */ + guint64 user; /* GLIBTOP_CPU_USER */ + guint64 nice; /* GLIBTOP_CPU_NICE */ + guint64 sys; /* GLIBTOP_CPU_SYS */ + guint64 idle; /* GLIBTOP_CPU_IDLE */ + guint64 iowait; /* GLIBTOP_CPU_IOWAIT */ + guint64 irq; /* GLIBTOP_CPU_IRQ */ + guint64 softirq; /* GLIBTOP_CPU_SOFTIRQ */ + guint64 frequency; /* GLIBTOP_CPU_FREQUENCY */ + guint64 xcpu_total [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_TOTAL */ + guint64 xcpu_user [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_USER */ + guint64 xcpu_nice [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_NICE */ + guint64 xcpu_sys [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_SYS */ + guint64 xcpu_idle [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_IDLE */ + guint64 xcpu_iowait [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_IOWAIT */ + guint64 xcpu_irq [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_IRQ */ + guint64 xcpu_softirq [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_SOFTIRQ */ + guint64 xcpu_flags; /* GLIBTOP_XCPU_IDLE */ +}; + +void glibtop_get_cpu(glibtop_cpu *buf); + +#if GLIBTOP_SUID_CPU +#define glibtop_get_cpu_r glibtop_get_cpu_p +#else +#define glibtop_get_cpu_r glibtop_get_cpu_s +#endif + +void glibtop_get_cpu_l (glibtop *server, glibtop_cpu *buf); + +#if GLIBTOP_SUID_CPU +void _glibtop_init_cpu_p (glibtop *server); +void glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf); +#else +void _glibtop_init_cpu_s (glibtop *server); +void glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/error.h b/include/glibtop/error.h new file mode 100644 index 0000000..d5cc481 --- /dev/null +++ b/include/glibtop/error.h @@ -0,0 +1,63 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +/* + * This is private API + */ + +#ifndef __GLIBTOP_ERROR_H__ +#define __GLIBTOP_ERROR_H__ + +#include + +G_BEGIN_DECLS + +void glibtop_error_vr (glibtop *server, const char *format, va_list args) G_GNUC_NORETURN; +void glibtop_warn_vr (glibtop *server, const char *format, va_list args); +void glibtop_error_io_vr (glibtop *server, const char *format, int, va_list args) G_GNUC_NORETURN; +void glibtop_warn_io_vr (glibtop *server, const char *format, int, va_list args); + +void glibtop_error_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3) G_GNUC_NORETURN; +void glibtop_warn_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3); +void glibtop_error_io_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3) G_GNUC_NORETURN; +void glibtop_warn_io_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3); + +void glibtop_error (const char *format, ...) G_GNUC_PRINTF(1, 2) G_GNUC_NORETURN; +void glibtop_warn (const char *format, ...) G_GNUC_PRINTF(1, 2); +void glibtop_error_io (const char *format, ...) G_GNUC_PRINTF(1, 2) G_GNUC_NORETURN; +void glibtop_warn_io (const char *format, ...) G_GNUC_PRINTF(1, 2); + +/* FIXME: C99 */ +#define glibtop_debug_r(server, fmt, ...) \ + G_STMT_START { \ + if (LIBGTOP_ENABLE_DEBUG) \ + glibtop_debug_r_real(server, "%s:%d %s(): " fmt, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \ + } G_STMT_END + +#define glibtop_debug(...) glibtop_debug_r(glibtop_global_server, __VA_ARGS__) + +void glibtop_debug_vr (glibtop *server, const char *format, va_list args); +void glibtop_debug_r_real (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3); + +G_END_DECLS + +#endif diff --git a/include/glibtop/fsusage.h b/include/glibtop/fsusage.h new file mode 100644 index 0000000..112ad95 --- /dev/null +++ b/include/glibtop/fsusage.h @@ -0,0 +1,64 @@ +/* Copyright (C) 1998-99 Martin Baulig + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_FSUSAGE_H__ +#define __GLIBTOP_FSUSAGE_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_FSUSAGE_BLOCKS 0 +#define GLIBTOP_FSUSAGE_BFREE 1 +#define GLIBTOP_FSUSAGE_BAVAIL 2 +#define GLIBTOP_FSUSAGE_FILES 3 +#define GLIBTOP_FSUSAGE_FFREE 4 +#define GLIBTOP_FSUSAGE_BLOCK_SIZE 5 +#define GLIBTOP_FSUSAGE_READ 6 +#define GLIBTOP_FSUSAGE_WRITE 7 +#define GLIBTOP_MAX_FSUSAGE 8 + + +typedef struct _glibtop_fsusage glibtop_fsusage; + +struct _glibtop_fsusage +{ + guint64 flags; + guint64 blocks; /* Total number of blocks. */ + guint64 bfree; /* Free blocks available to superuser. */ + guint64 bavail; /* Free blocks available to non-superuser. */ + guint64 files; /* Total file nodes. */ + guint64 ffree; /* Free file nodes. */ + guint32 block_size; /* Size of a block in bytes. */ + guint64 read, write; /* Total blocks read and written */ +}; + +void glibtop_get_fsusage(glibtop_fsusage *buf, const char *mount_dir); + +#define glibtop_get_fsusage_r glibtop_get_fsusage_s + +void glibtop_get_fsusage_l (glibtop *server, glibtop_fsusage *buf, const char *mount_dir); +void glibtop_get_fsusage_s (glibtop *server, glibtop_fsusage *buf, const char *mount_dir); + + +G_END_DECLS + +#endif diff --git a/include/glibtop/global.h b/include/glibtop/global.h new file mode 100644 index 0000000..bd29802 --- /dev/null +++ b/include/glibtop/global.h @@ -0,0 +1,81 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_GLOBAL_H__ +#define __GLIBTOP_GLOBAL_H__ + +#include + +#ifdef _IN_LIBGTOP + +#endif /* _IN_LIBGTOP */ + +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#include +#include + +#include + +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef HAVE_MEMORY_H +#include +#endif + +#include + +#ifdef _IN_LIBGTOP + +#include +#include +#include +#include + +#endif /* _IN_LIBGTOP */ + +#include +#include + +#ifdef _IN_LIBGTOP + +G_BEGIN_DECLS + +#ifndef HAVE_STRERROR +char *strerror (int errno); +#endif + +G_END_DECLS + +#endif /* _IN_LIBGTOP */ + +#endif diff --git a/include/glibtop/gnuserv.h b/include/glibtop/gnuserv.h new file mode 100644 index 0000000..aa24e1b --- /dev/null +++ b/include/glibtop/gnuserv.h @@ -0,0 +1,160 @@ +/* -*-C-*- + + Header file for the GNU Emacs server and client C code. + + This file is part of GNU Emacs. + + Copying is permitted under those conditions described by the GNU + General Public License. + + Copyright (C) 1989 Free Software Foundation, Inc. + + Author: Andy Norman (ange@hplb.hpl.hp.com), based on + 'etc/server.c' and 'etc/emacsclient.c' from the 18.52 GNU + Emacs distribution. + + Please mail bugs and suggestions to the author at the above address. +*/ + +/* HISTORY + * 11-Nov-1990 bristor@simba + * Added EOT stuff. + */ + +/* + * This file incorporates new features added by Bob Weiner , + * Darrell Kindred and Arup Mukherjee . + * Please see the note at the end of the README file for details. + * + * (If gnuserv came bundled with your emacs, the README file is probably + * ../etc/gnuserv.README relative to the directory containing this file) + */ + +#if 0 +static char header_rcsid [] = "!Header: gnuserv.h,v 2.4 95/02/16 11:58:11 arup alpha !"; +#endif + +#define NO_SHORTNAMES + +#define PATCHLEVEL 2 + +#define NO_SHORTNAMES +/* gnuserv should not be compiled using SOCKS */ +#define DO_NOT_SOCKSIFY +#include +#undef read +#undef write +#undef open +#undef close +#undef signal + +/* Define the communication method between server and clients: + * You can have either or both kinds of sockets, but you can't mix + * sockets with sysv ipc + */ + +#define INTERNET_DOMAIN_SOCKETS +#define UNIX_DOMAIN_SOCKETS + +/* + * Define additional authentication protocols to be used. These methods will + * be tried before falling back to the default gnuserv protocol (based on + * the GNU_SECURE environment variable). Currently, only MIT-MAGIC-COOKIE-1 + * is also supported. + * + * Comment out the next line(s) if you don't want to enable the + * appropriate authentication protocol. + */ + +#if defined (HAVE_XAUTH) +#define AUTH_MAGIC_COOKIE +#endif /* HAVE_XAUTH */ + +/* + * stuff related to supporting MIT-MAGIC-COOKIE-1 + */ + +#if 0 +#define MCOOKIE_SCREEN "42980" /* screen # to use as the gnuserv cookie */ +#endif +#define MCOOKIE_NAME "MAGIC-1" /* authentication protocol name */ +#define MCOOKIE_X_NAME "MIT-MAGIC-COOKIE-1" /* as needed by X */ + + +#define DEFAUTH_NAME "GNU-SECURE" /* name of default auth protocol */ +#define AUTH_TIMEOUT 15 /* # seconds to wait for auth data */ +#define AUTH_NAMESZ 15 /* max allows auth protocol name size */ + + +/* + * Pick a default communication scheme, if none was specified. + */ + +#if !defined(UNIX_DOMAIN_SOCKETS) && !defined(INTERNET_DOMAIN_SOCKETS) + +/* BSD systems use Unix Domain sockets by default */ + +#ifdef BSD +#define UNIX_DOMAIN_SOCKETS +#endif + +#endif /* No communication method pre-defined */ + +/* + * If you are using SYSV_IPC, you might want to make the buffer size bigger + * since it limits the size of requests and responses. Don't make it bigger + * than your system's max message size though (usually a couple of k) or else + * msgsend will start failing. For sockets, using the system BUFSIZ is usually + * what you want. + */ + +#if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS) +#include +#endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */ + +#ifdef INTERNET_DOMAIN_SOCKETS +#include +#include +#include +#define TABLE_SIZE 101 /* The number of entries in the hash table */ +#define HASH(host) host /* Rather simplistic hash function */ +#define DEFAULT_PORT 21490 /* default port number to use is + * DEFAULT_PORT + uid */ +#endif /* INTERNET_DOMAIN_SOCKETS */ + +#ifdef UNIX_DOMAIN_SOCKETS +#include +#define HIDE_UNIX_SOCKET /* put the unix socket in a protected dir */ +#endif /* UNIX_DOMAIN_SOCKETS */ + +#define HOSTNAMSZ 255 /* max size of a hostname */ +#define REPLYSIZ 300 /* max size of reply from server to client */ +#undef FALSE +#define FALSE 0 +#undef TRUE +#define TRUE 1 + +/* The casts shut Sun's compiler up and are safe in the context these + are actually used. */ +#define max2(x,y) (((int) (x) > (int) (y)) ? (x) : (y)) +#define min2(x,y) (((int) (x) < (int) (y)) ? (x) : (y)) + +#ifndef _NFILE /* rough guess at maximum number of open files */ +#define _NFILE 20 +#endif + +#define EOT_STR "\004" +#define EOT_CHR '\004' + +/* connection types */ +#define CONN_UNIX 0 +#define CONN_INTERNET 1 +#define CONN_IPC 2 + +/* function declarations */ +int glibtop_make_connection (const char *hostarg, int portarg, int *s); + +#ifdef INTERNET_DOMAIN_SOCKETS +long glibtop_internet_addr (const char *host); +#endif + diff --git a/include/glibtop/init_hooks.h b/include/glibtop/init_hooks.h new file mode 100644 index 0000000..35f4d23 --- /dev/null +++ b/include/glibtop/init_hooks.h @@ -0,0 +1,15 @@ +#ifndef H_LIBGTOP_INIT_HOOKS_1122955666 +#define H_LIBGTOP_INIT_HOOKS_1122955666 + +#include + +G_BEGIN_DECLS + +typedef void (*_glibtop_init_func_t)(glibtop *); + +extern const _glibtop_init_func_t _glibtop_init_hook_s[]; +extern const _glibtop_init_func_t _glibtop_init_hook_p[]; + +G_END_DECLS + +#endif /* H_LIBGTOP_INIT_HOOKS_1122955666 */ diff --git a/include/glibtop/loadavg.h b/include/glibtop/loadavg.h new file mode 100644 index 0000000..5ac1369 --- /dev/null +++ b/include/glibtop/loadavg.h @@ -0,0 +1,69 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_LOADAVG_H__ +#define __GLIBTOP_LOADAVG_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_LOADAVG_LOADAVG 0 +#define GLIBTOP_LOADAVG_NR_RUNNING 1 +#define GLIBTOP_LOADAVG_NR_TASKS 2 +#define GLIBTOP_LOADAVG_LAST_PID 3 + +#define GLIBTOP_MAX_LOADAVG 4 + +typedef struct _glibtop_loadavg glibtop_loadavg; + +struct _glibtop_loadavg +{ + guint64 flags; + double loadavg [3]; /* GLIBTOP_LOADAVG_LOADAVG */ + guint64 nr_running; /* GLIBTOP_LOADAVG_NR_RUNNING */ + guint64 nr_tasks; /* GLIBTOP_LOADAVG_NR_TASKS */ + guint64 last_pid; /* GLIBTOP_LOADAVG_LAST_PID */ +}; + +void glibtop_get_loadavg(glibtop_loadavg *buf); + +#if GLIBTOP_SUID_LOADAVG +#define glibtop_get_loadavg_r glibtop_get_loadavg_p +#else +#define glibtop_get_loadavg_r glibtop_get_loadavg_s +#endif + +void glibtop_get_loadavg_l (glibtop *server, glibtop_loadavg *buf); + +#if GLIBTOP_SUID_LOADAVG +void _glibtop_init_loadavg_p (glibtop *server); +void glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf); +#else +void _glibtop_init_loadavg_s (glibtop *server); +void glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/machine.h b/include/glibtop/machine.h new file mode 100644 index 0000000..1321702 --- /dev/null +++ b/include/glibtop/machine.h @@ -0,0 +1,22 @@ +#ifndef GLIBTOP_SYSDEPS_COMMON_MACHINE_H_1437506041 +#define GLIBTOP_SYSDEPS_COMMON_MACHINE_H_1437506041 + +#include +#include + +/* private */ +static inline void +glibtop_machine_new(glibtop *server) +{ + server->machine = g_new0(glibtop_machine, 1); +} + +/* private */ +static inline void +glibtop_machine_delete(glibtop *server) +{ + g_free(server->machine); + server->machine = NULL; +} + +#endif /* GLIBTOP_SYSDEPS_COMMON_MACHINE_H_1437506041 */ diff --git a/include/glibtop/mem.h b/include/glibtop/mem.h new file mode 100644 index 0000000..ffd311f --- /dev/null +++ b/include/glibtop/mem.h @@ -0,0 +1,77 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_MEM_H__ +#define __GLIBTOP_MEM_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_MEM_TOTAL 0 +#define GLIBTOP_MEM_USED 1 +#define GLIBTOP_MEM_FREE 2 +#define GLIBTOP_MEM_SHARED 3 +#define GLIBTOP_MEM_BUFFER 4 +#define GLIBTOP_MEM_CACHED 5 +#define GLIBTOP_MEM_USER 6 +#define GLIBTOP_MEM_LOCKED 7 + +#define GLIBTOP_MAX_MEM 8 + +typedef struct _glibtop_mem glibtop_mem; + +struct _glibtop_mem +{ + guint64 flags; + guint64 total; /* GLIBTOP_MEM_TOTAL */ + guint64 used; /* GLIBTOP_MEM_USED */ + guint64 free; /* GLIBTOP_MEM_FREE */ + guint64 shared; /* GLIBTOP_MEM_SHARED */ + guint64 buffer; /* GLIBTOP_MEM_BUFFER */ + guint64 cached; /* GLIBTOP_MEM_CACHED */ + guint64 user; /* GLIBTOP_MEM_USER */ + guint64 locked; /* GLIBTOP_MEM_LOCKED */ +}; + +void glibtop_get_mem(glibtop_mem *buf); + +#if GLIBTOP_SUID_MEM +#define glibtop_get_mem_r glibtop_get_mem_p +#else +#define glibtop_get_mem_r glibtop_get_mem_s +#endif + +void glibtop_get_mem_l (glibtop *server, glibtop_mem *buf); + +#if GLIBTOP_SUID_MEM +void _glibtop_init_mem_p (glibtop *server); +void glibtop_get_mem_p (glibtop *server, glibtop_mem *buf); +#else +void _glibtop_init_mem_s (glibtop *server); +void glibtop_get_mem_s (glibtop *server, glibtop_mem *buf); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/mountlist.h b/include/glibtop/mountlist.h new file mode 100644 index 0000000..f4691b3 --- /dev/null +++ b/include/glibtop/mountlist.h @@ -0,0 +1,104 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_MOUNTLIST_H__ +#define __GLIBTOP_MOUNTLIST_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_MOUNTLIST_NUMBER 0 +#define GLIBTOP_MOUNTLIST_TOTAL 1 +#define GLIBTOP_MOUNTLIST_SIZE 2 + +#define GLIBTOP_MAX_MOUNTLIST 3 + +typedef struct _glibtop_mountentry glibtop_mountentry; + +typedef struct _glibtop_mountlist glibtop_mountlist; + +struct _glibtop_mountentry +{ + guint64 dev; + char devname [GLIBTOP_MOUNTENTRY_LEN+1]; + char mountdir [GLIBTOP_MOUNTENTRY_LEN+1]; + char type [GLIBTOP_MOUNTENTRY_LEN+1]; +}; + +struct _glibtop_mountlist +{ + guint64 flags; + guint64 number; /* GLIBTOP_MOUNTLIST_NUMBER */ + guint64 total; /* GLIBTOP_MOUNTLIST_TOTAL */ + guint64 size; /* GLIBTOP_MOUNTLIST_SIZE */ +}; + +/** + * glibtop_get_mountlist: + * @buf: + * @all_fs: + * + * Returns: (transfer full): + */ + +/** + * glibtop_get_mountlist_r: + * @buf: (out): + * @all_fs: + * + * Returns: (transfer none): + */ + +/** + * glibtop_get_mountlist_s: + * @buf: (out): + * @all_fs: + * + * Returns: (transfer none): + */ + +/** + * glibtop_get_mountlist_l: + * @buf: (out): + * @all_fs: + * + * Returns: (transfer none): + */ + +glibtop_mountentry * +glibtop_get_mountlist(glibtop_mountlist *buf, int all_fs); + +#define glibtop_get_mountlist_r glibtop_get_mountlist_s + +glibtop_mountentry * +glibtop_get_mountlist_l (glibtop *server, glibtop_mountlist *buf, int all_fs); + +glibtop_mountentry * +glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf, int all_fs); + +GType glibtop_mountlist_get_type (void) G_GNUC_CONST; +GType glibtop_mountentry_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif diff --git a/include/glibtop/msg_limits.h b/include/glibtop/msg_limits.h new file mode 100644 index 0000000..a4ea974 --- /dev/null +++ b/include/glibtop/msg_limits.h @@ -0,0 +1,76 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_MSG_LIMITS_H__ +#define __GLIBTOP_MSG_LIMITS_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_IPC_MSGPOOL 0 +#define GLIBTOP_IPC_MSGMAP 1 +#define GLIBTOP_IPC_MSGMAX 2 +#define GLIBTOP_IPC_MSGMNB 3 +#define GLIBTOP_IPC_MSGMNI 4 +#define GLIBTOP_IPC_MSGSSZ 5 +#define GLIBTOP_IPC_MSGTQL 6 + +#define GLIBTOP_MAX_MSG_LIMITS 7 + +typedef struct _glibtop_msg_limits glibtop_msg_limits; + +struct _glibtop_msg_limits +{ + guint64 flags; + guint64 msgpool; /* GLIBTOP_IPC_MSGPOOL */ + guint64 msgmap; /* GLIBTOP_IPC_MSGMAP */ + guint64 msgmax; /* GLIBTOP_IPC_MSGMAX */ + guint64 msgmnb; /* GLIBTOP_IPC_MSGMNB */ + guint64 msgmni; /* GLIBTOP_IPC_MSGMNI */ + guint64 msgssz; /* GLIBTOP_IPC_MSGSSZ */ + guint64 msgtql; /* GLIBTOP_IPC_MSGTQL */ +}; + +void glibtop_get_msg_limits(glibtop_msg_limits *buf); + +#if GLIBTOP_SUID_MSG_LIMITS +#define glibtop_get_msg_limits_r glibtop_get_msg_limits_p +#else +#define glibtop_get_msg_limits_r glibtop_get_msg_limits_s +#endif + +void glibtop_get_msg_limits_l (glibtop *server, glibtop_msg_limits *buf); + +#if GLIBTOP_SUID_MSG_LIMITS +void _glibtop_init_msg_limits_p (glibtop *server); +void glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf); +#else +void _glibtop_init_msg_limits_s (glibtop *server); +void glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf); +#endif + + +G_END_DECLS + +#endif + diff --git a/include/glibtop/netlist.h b/include/glibtop/netlist.h new file mode 100644 index 0000000..f5ed2ff --- /dev/null +++ b/include/glibtop/netlist.h @@ -0,0 +1,98 @@ +/* Copyright (C) 2004 Benoît Dejean + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_NETLIST_H__ +#define __GLIBTOP_NETLIST_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_NETLIST_NUMBER 0 + +#define GLIBTOP_MAX_NETLIST 1 + +typedef struct _glibtop_netlist glibtop_netlist; + +/** + * glibtop_netlist: + * @number: Number of entries in the returned list. + */ +struct _glibtop_netlist +{ + guint64 flags; + guint32 number; +}; + +/** + * glibtop_get_netlist: + * @buf: a #glibtop_netlist + * + * Returns: (array zero-terminated=1) (transfer none): an array of network + * interface names. + */ +char** glibtop_get_netlist(glibtop_netlist *buf); + +#if GLIBTOP_SUID_NETLIST +#define glibtop_get_netlist_r glibtop_get_netlist_p +#else +#define glibtop_get_netlist_r glibtop_get_netlist_s +#endif + +/** + * glibtop_get_netlist_l: + * @server: a #glibtop server + * @buf: a #glibtop_netlist + * + * Returns: (array zero-terminated=1) (transfer none): an array of network + * interface names. + */ +char** glibtop_get_netlist_l (glibtop *server, glibtop_netlist *buf); + +#if GLIBTOP_SUID_NETLIST +void _glibtop_init_netlist_p (glibtop *server); + +/** + * glibtop_get_netlist_p: + * @server: a #glibtop server + * @buf: a #glibtop_netlist + * + * Returns: (array zero-terminated=1) (transfer none): an array of network + * interface names. + */ +char** glibtop_get_netlist_p (glibtop *server, glibtop_netlist *buf); +#else +void _glibtop_init_netlist_s (glibtop *server); + +/** + * glibtop_get_netlist_s: + * @server: a #glibtop server + * @buf: a #glibtop_netlist + * + * Returns: (array zero-terminated=1) (transfer none): an array of network + * interface names. + */ +char** glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/netload.h b/include/glibtop/netload.h new file mode 100644 index 0000000..7261dd2 --- /dev/null +++ b/include/glibtop/netload.h @@ -0,0 +1,130 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_NETLOAD_H__ +#define __GLIBTOP_NETLOAD_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_NETLOAD_IF_FLAGS 0 +#define GLIBTOP_NETLOAD_MTU 1 +#define GLIBTOP_NETLOAD_SUBNET 2 +#define GLIBTOP_NETLOAD_ADDRESS 3 +#define GLIBTOP_NETLOAD_PACKETS_IN 4 +#define GLIBTOP_NETLOAD_PACKETS_OUT 5 +#define GLIBTOP_NETLOAD_PACKETS_TOTAL 6 +#define GLIBTOP_NETLOAD_BYTES_IN 7 +#define GLIBTOP_NETLOAD_BYTES_OUT 8 +#define GLIBTOP_NETLOAD_BYTES_TOTAL 9 +#define GLIBTOP_NETLOAD_ERRORS_IN 10 +#define GLIBTOP_NETLOAD_ERRORS_OUT 11 +#define GLIBTOP_NETLOAD_ERRORS_TOTAL 12 +#define GLIBTOP_NETLOAD_COLLISIONS 13 +#define GLIBTOP_NETLOAD_ADDRESS6 14 +#define GLIBTOP_NETLOAD_PREFIX6 15 +#define GLIBTOP_NETLOAD_SCOPE6 16 +#define GLIBTOP_NETLOAD_HWADDRESS 17 + +#define GLIBTOP_MAX_NETLOAD 18 + +typedef struct _glibtop_netload glibtop_netload; + +enum { + GLIBTOP_IF_FLAGS_UP = 1, + GLIBTOP_IF_FLAGS_BROADCAST, + GLIBTOP_IF_FLAGS_DEBUG, + GLIBTOP_IF_FLAGS_LOOPBACK, + GLIBTOP_IF_FLAGS_POINTOPOINT, + GLIBTOP_IF_FLAGS_RUNNING, + GLIBTOP_IF_FLAGS_NOARP, + GLIBTOP_IF_FLAGS_PROMISC, + GLIBTOP_IF_FLAGS_ALLMULTI, + GLIBTOP_IF_FLAGS_OACTIVE, + GLIBTOP_IF_FLAGS_SIMPLEX, + GLIBTOP_IF_FLAGS_LINK0, + GLIBTOP_IF_FLAGS_LINK1, + GLIBTOP_IF_FLAGS_LINK2, + GLIBTOP_IF_FLAGS_ALTPHYS, + GLIBTOP_IF_FLAGS_MULTICAST, + GLIBTOP_IF_FLAGS_WIRELESS +}; + +enum GLIBTOP_IF_IN6_SCOPE +{ + GLIBTOP_IF_IN6_SCOPE_UNKNOWN = 0, + GLIBTOP_IF_IN6_SCOPE_LINK = 1, + GLIBTOP_IF_IN6_SCOPE_SITE = 2, + GLIBTOP_IF_IN6_SCOPE_GLOBAL = 4, + GLIBTOP_IF_IN6_SCOPE_HOST = 8 +}; + +struct _glibtop_netload +{ + guint64 flags; + guint64 if_flags; /* GLIBTOP_NETLOAD_IF_FLAGS */ + + guint32 mtu; /* GLIBTOP_NETLOAD_MTU */ + guint32 subnet; /* GLIBTOP_NETLOAD_SUBNET */ + guint32 address; /* GLIBTOP_NETLOAD_ADDRESS */ + + guint64 packets_in; /* GLIBTOP_NETLOAD_PACKETS_IN */ + guint64 packets_out; /* GLIBTOP_NETLOAD_PACKETS_OUT */ + guint64 packets_total; /* GLIBTOP_NETLOAD_PACKETS_TOTAL*/ + guint64 bytes_in; /* GLIBTOP_NETLOAD_BYTES_IN */ + guint64 bytes_out; /* GLIBTOP_NETLOAD_BYTES_OUT */ + guint64 bytes_total; /* GLIBTOP_NETLOAD_BYTES_TOTAL */ + guint64 errors_in; /* GLIBTOP_NETLOAD_ERRORS_IN */ + guint64 errors_out; /* GLIBTOP_NETLOAD_ERRORS_OUT */ + guint64 errors_total; /* GLIBTOP_NETLOAD_ERRORS_TOTAL */ + guint64 collisions; /* GLIBTOP_NETLOAD_COLLISIONS */ + + guint8 address6[16]; /* GLIBTOP_NETLOAD_ADDRESS6 */ + guint8 prefix6[16]; /* GLIBTOP_NETLOAD_PREXIF6 */ + guint8 scope6; /* GLIBTOP_NETLOAD_SCOPE6 */ + + guint8 hwaddress[8]; /* GLIBTOP_NETLOAD_HWADDRESS */ +}; + +void glibtop_get_netload(glibtop_netload *buf, const char *interface); + +#if GLIBTOP_SUID_NETLOAD +#define glibtop_get_netload_r glibtop_get_netload_p +#else +#define glibtop_get_netload_r glibtop_get_netload_s +#endif + +void glibtop_get_netload_l (glibtop *server, glibtop_netload *buf, const char *interface); + +#if GLIBTOP_SUID_NETLOAD +void _glibtop_init_netload_p (glibtop *server); +void glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, const char *interface); +#else +void _glibtop_init_netload_s (glibtop *server); +void glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, const char *interface); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/open.h b/include/glibtop/open.h new file mode 100644 index 0000000..749740c --- /dev/null +++ b/include/glibtop/open.h @@ -0,0 +1,71 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_OPEN_H__ +#define __GLIBTOP_OPEN_H__ + +#include + +G_BEGIN_DECLS + +#define _GLIBTOP_INIT_STATE_INIT 0x10000 +#define _GLIBTOP_INIT_STATE_OPEN 0x20000 +#define _GLIBTOP_INIT_STATE_SERVER 0x40000 +#define _GLIBTOP_INIT_STATE_SYSDEPS 0x80000 + +#define GLIBTOP_INIT_NO_OPEN 1 +#define GLIBTOP_INIT_NO_INIT 2 + +#define GLIBTOP_FEATURES_NO_SERVER 4 +#define GLIBTOP_FEATURES_EXCEPT 8 + +#define GLIBTOP_METHOD_DIRECT 1 +#define GLIBTOP_METHOD_PIPE 2 +#define GLIBTOP_METHOD_INET 3 +#define GLIBTOP_METHOD_UNIX 4 + +#define GLIBTOP_ERROR_METHOD_IGNORE 0 +#define GLIBTOP_ERROR_METHOD_WARN_ONCE 1 +#define GLIBTOP_ERROR_METHOD_WARN 2 +#define GLIBTOP_ERROR_METHOD_ABORT 3 + +#define GLIBTOP_ERROR_METHOD_DEFAULT GLIBTOP_ERROR_METHOD_WARN_ONCE + +void +glibtop_open_l (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags); + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags); + +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags); + +void +glibtop_open_s (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags); + + +G_END_DECLS + +#endif diff --git a/include/glibtop/parameter.h b/include/glibtop/parameter.h new file mode 100644 index 0000000..798945f --- /dev/null +++ b/include/glibtop/parameter.h @@ -0,0 +1,50 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PARAMETER_H__ +#define __GLIBTOP_PARAMETER_H__ + +#include + +G_BEGIN_DECLS + +#define GLIBTOP_PARAM_METHOD 1 +#define GLIBTOP_PARAM_FEATURES 2 +#define GLIBTOP_PARAM_COMMAND 3 +#define GLIBTOP_PARAM_HOST 4 +#define GLIBTOP_PARAM_PORT 5 +#define GLIBTOP_PARAM_ERROR_METHOD 6 +#define GLIBTOP_PARAM_REQUIRED 7 + +#define glibtop_get_parameter(p1,p2,p3) glibtop_get_parameter_l(glibtop_global_server,p1,p2,p3) +#define glibtop_set_parameter(p1,p2,p3) glibtop_set_parameter_l(glibtop_global_server,p1,p2,p3) + +size_t +glibtop_get_parameter_l (glibtop *server, const unsigned parameter, + void *data_ptr, size_t data_size); + +void +glibtop_set_parameter_l (glibtop *server, const unsigned parameter, + const void *data_ptr, size_t data_size); + +G_END_DECLS + +#endif diff --git a/include/glibtop/ppp.h b/include/glibtop/ppp.h new file mode 100644 index 0000000..6263f65 --- /dev/null +++ b/include/glibtop/ppp.h @@ -0,0 +1,73 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PPP_H__ +#define __GLIBTOP_PPP_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_PPP_STATE 0 +#define GLIBTOP_PPP_BYTES_IN 1 +#define GLIBTOP_PPP_BYTES_OUT 2 + +#define GLIBTOP_MAX_PPP 3 + +typedef struct _glibtop_ppp glibtop_ppp; + +enum { + GLIBTOP_PPP_STATE_UNKNOWN = 0, + GLIBTOP_PPP_STATE_HANGUP, + GLIBTOP_PPP_STATE_ONLINE +}; + +struct _glibtop_ppp +{ + guint64 flags; + guint64 state; /* GLIBTOP_PPP_STATE */ + guint64 bytes_in; /* GLIBTOP_PPP_BYTES_IN */ + guint64 bytes_out; /* GLIBTOP_PPP_BYTES_OUT */ +}; + +void glibtop_get_ppp(glibtop_ppp *buf, unsigned short device); + +#if GLIBTOP_SUID_PPP +#define glibtop_get_ppp_r glibtop_get_ppp_p +#else +#define glibtop_get_ppp_r glibtop_get_ppp_s +#endif + +void glibtop_get_ppp_l (glibtop *server, glibtop_ppp *buf, unsigned short device); + +#if GLIBTOP_SUID_PPP +void _glibtop_init_ppp_p (glibtop *server); +void glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device); +#else +void _glibtop_init_ppp_s (glibtop *server); +void glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/procaffinity.h b/include/glibtop/procaffinity.h new file mode 100644 index 0000000..6db47ad --- /dev/null +++ b/include/glibtop/procaffinity.h @@ -0,0 +1,62 @@ +/* Copyright (C) 2007 Benoît Dejean + This file is part of LibGTop 2. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PROCAFFINITY_H__ +#define __GLIBTOP_PROCAFFINITY_H__ + +#include +#include + +G_BEGIN_DECLS + +typedef struct _glibtop_proc_affinity glibtop_proc_affinity; + +#define GLIBTOP_PROC_AFFINITY_NUMBER 0 +#define GLIBTOP_PROC_AFFINITY_ALL 1 +#define GLIBTOP_MAX_PROC_AFFINITY 2 + +struct _glibtop_proc_affinity +{ + guint64 flags; + guint32 number; + gboolean all; +}; + + +guint16 * glibtop_get_proc_affinity(glibtop_proc_affinity *buf, pid_t pid); +guint16 * glibtop_get_proc_affinity_l(glibtop *server, glibtop_proc_affinity *buf, pid_t pid); + + +#if GLIBTOP_SUID_PROC_AFFINITY + +#define glibtop_get_proc_affinity_r glibtop_get_proc_affinity_p +void _glibtop_init_proc_affinity_p(glibtop *server); +guint16 * glibtop_get_proc_affinity_p(glibtop *server, glibtop_proc_affinity *buf, pid_t pid); + +#else + +#define glibtop_get_proc_affinity_r glibtop_get_proc_affinity_s +void _glibtop_init_proc_affinity_s(glibtop *server); +guint16 * glibtop_get_proc_affinity_s(glibtop *server, glibtop_proc_affinity *buf, pid_t pid); + +#endif + +G_END_DECLS + +#endif diff --git a/include/glibtop/procargs.h b/include/glibtop/procargs.h new file mode 100644 index 0000000..89d51e4 --- /dev/null +++ b/include/glibtop/procargs.h @@ -0,0 +1,97 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PROC_ARGS_H__ +#define __GLIBTOP_PROC_ARGS_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_PROC_ARGS_SIZE 0 + +#define GLIBTOP_MAX_PROC_ARGS 1 + +typedef struct _glibtop_proc_args glibtop_proc_args; + +struct _glibtop_proc_args +{ + guint64 flags; + guint64 size; /* GLIBTOP_PROC_ARGS_SIZE */ +}; + + +char * +glibtop_get_proc_args_l (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len); + +char * +glibtop_get_proc_args (glibtop_proc_args *buf, pid_t pid, unsigned max_len); + +#if GLIBTOP_SUID_PROC_ARGS + +# define glibtop_get_proc_args_r glibtop_get_proc_args_p + + void _glibtop_init_proc_args_p (glibtop *server); + + char * + glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len); + + +#else /* !GLIBTOP_SUID_PROC_ARGS */ + +# define glibtop_get_proc_args_r glibtop_get_proc_args_s + + void _glibtop_init_proc_args_s (glibtop *server); + + char * + glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len); +#endif /* GLIBTOP_SUID_PROC_ARGS */ + + + +/* + * NEW functions + */ + +char ** +glibtop_get_proc_argv_l (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len); + +/** + * glibtop_get_proc_argv: + * @buf: + * @pid: + * @max_len: + * + * Returns: (transfer full): + */ + +char ** +glibtop_get_proc_argv (glibtop_proc_args *buf, pid_t pid, unsigned max_len); + + +G_END_DECLS + +#endif diff --git a/include/glibtop/procio.h b/include/glibtop/procio.h new file mode 100644 index 0000000..494b011 --- /dev/null +++ b/include/glibtop/procio.h @@ -0,0 +1,91 @@ +/* Copyright (C) 2017 Robert Roth + This file is part of LibGTop. + + Contributed by Robert Roth , February 2017. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PROCIO_H__ +#define __GLIBTOP_PROCIO_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_PROC_IO_DISK_RCHAR 0 +#define GLIBTOP_PROC_IO_DISK_WCHAR 1 +#define GLIBTOP_PROC_IO_DISK_RBYTES 2 +#define GLIBTOP_PROC_IO_DISK_WBYTES 3 + +#define GLIBTOP_MAX_PROC_IO 3 + +typedef struct _glibtop_proc_io glibtop_proc_io; + +/* Time section */ + +/** + * glibtop_proc_io: + * @disk_rchar: The number of bytes which this task has caused to be read from storage. This + * is simply the sum of bytes which this process passed to read() and pread(), also including tty IO, + * and it is unaffected by whether or not actual physical disk IO was required. + * @disk_wchar: The number of bytes which this task has caused, or shall cause to be written + * to disk. Similar caveats apply here as with rchar. + * @disk_rbytes: Attempt to count the number of bytes which this process really did cause to + * be fetched from the storage layer. Done at the submit_bio() level, so it is + * accurate for block-backed filesystems. + * @disk_wbytes: Attempt to count the number of bytes which this process caused to be sent to + * the storage layer. This is done at page-dirtying time. + * + * Process disk io data filled by glibtop_get_proc_io(). + * + */ +struct _glibtop_proc_io +{ + guint64 flags; + guint64 disk_rchar; + guint64 disk_wchar; + guint64 disk_rbytes; + guint64 disk_wbytes; + + /* reserved for future extensions, e.g. per-process netio */ + guint64 reserved[10]; +}; + + +void glibtop_get_proc_io (glibtop_proc_io *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_IO +#define glibtop_get_proc_io_r glibtop_get_proc_io_p +#else +#define glibtop_get_proc_io_r glibtop_get_proc_io_s +#endif + +void glibtop_get_proc_io_l (glibtop *server, glibtop_proc_io *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_IO +void _glibtop_init_proc_io_p (glibtop *server); +void glibtop_get_proc_io_p (glibtop *server, glibtop_proc_io *buf, pid_t pid); +#else +void _glibtop_init_proc_io_s (glibtop *server); +void glibtop_get_proc_io_s (glibtop *server, glibtop_proc_io *buf, pid_t pid); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/prockernel.h b/include/glibtop/prockernel.h new file mode 100644 index 0000000..5dfc69a --- /dev/null +++ b/include/glibtop/prockernel.h @@ -0,0 +1,86 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PROCKERNEL_H__ +#define __GLIBTOP_PROCKERNEL_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_PROC_KERNEL_K_FLAGS 0 +#define GLIBTOP_PROC_KERNEL_MIN_FLT 1 +#define GLIBTOP_PROC_KERNEL_MAJ_FLT 2 +#define GLIBTOP_PROC_KERNEL_CMIN_FLT 3 +#define GLIBTOP_PROC_KERNEL_CMAJ_FLT 4 +#define GLIBTOP_PROC_KERNEL_KSTK_ESP 5 +#define GLIBTOP_PROC_KERNEL_KSTK_EIP 6 +#define GLIBTOP_PROC_KERNEL_NWCHAN 7 +#define GLIBTOP_PROC_KERNEL_WCHAN 8 + +#define GLIBTOP_MAX_PROC_KERNEL 9 + +typedef struct _glibtop_proc_kernel glibtop_proc_kernel; + +/* Kernel stuff */ + +struct _glibtop_proc_kernel +{ + guint64 flags; + guint64 k_flags; /* kernel flags for the process */ + guint64 min_flt; /* number of minor page faults since + * process start */ + guint64 maj_flt; /* number of major page faults since + * process start */ + guint64 cmin_flt; /* cumulative min_flt of process and + * child processes */ + guint64 cmaj_flt; /* cumulative maj_flt of process and + * child processes */ + guint64 kstk_esp; /* kernel stack pointer */ + guint64 kstk_eip; /* kernel stack pointer */ + guint64 nwchan; /* address of kernel wait channel + * proc is sleeping in */ + char wchan [40]; +}; + +void glibtop_get_proc_kernel(glibtop_proc_kernel *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_KERNEL +#define glibtop_get_proc_kernel_r glibtop_get_proc_kernel_p +#else +#define glibtop_get_proc_kernel_r glibtop_get_proc_kernel_s +#endif + +void glibtop_get_proc_kernel_l (glibtop *server, glibtop_proc_kernel *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_KERNEL +void _glibtop_init_proc_kernel_p (glibtop *server); +void glibtop_get_proc_kernel_p (glibtop *server, glibtop_proc_kernel *buf, pid_t pid); +#else +void _glibtop_init_proc_kernel_s (glibtop *server); +void glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, pid_t pid); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/proclist.h b/include/glibtop/proclist.h new file mode 100644 index 0000000..417d618 --- /dev/null +++ b/include/glibtop/proclist.h @@ -0,0 +1,199 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PROCLIST_H__ +#define __GLIBTOP_PROCLIST_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_PROCLIST_NUMBER 0 +#define GLIBTOP_PROCLIST_TOTAL 1 +#define GLIBTOP_PROCLIST_SIZE 2 + +#define GLIBTOP_MAX_PROCLIST 3 + +/* You can use the folowing constants as the `which' member of + * glibtop_get_proclist () to specify which processes to fetch. */ + +/** + * GLIBTOP_KERN_PROC_ALL: + * + * Return information about all processes + **/ +#define GLIBTOP_KERN_PROC_ALL 0 + +/** + * GLIBTOP_KERN_PROC_PID: + * + * Return all processes with the pid which is passed in @arg. You can use this to find out whether some process still exists. + **/ +#define GLIBTOP_KERN_PROC_PID 1 + +/** + * GLIBTOP_KERN_PROC_PGRP: + * + * Return all processes in the process group passed in @arg. + **/ +#define GLIBTOP_KERN_PROC_PGRP 2 + +/** + * GLIBTOP_KERN_PROC_SESSION: + * + * Return all processes in the session passed in @arg. + **/ +#define GLIBTOP_KERN_PROC_SESSION 3 + +/** + * GLIBTOP_KERN_PROC_TTY: + * + * Return all processes which have the controlling tty passed in @arg + * (which is interpreted as the device number). + **/ +#define GLIBTOP_KERN_PROC_TTY 4 + +/** + * GLIBTOP_KERN_PROC_UID: + * + * Return all processes with the effective uid passed in @arg. + **/ +#define GLIBTOP_KERN_PROC_UID 5 + +/** + * GLIBTOP_KERN_PROC_RUID: + * + * Return all processes with the real uid passed in @arg. + **/ +#define GLIBTOP_KERN_PROC_RUID 6 + +#define GLIBTOP_KERN_PROC_MASK 15 + + +/** + * GLIBTOP_EXCLUDE_IDLE: + * + * Exclude idle processes. + **/ +#define GLIBTOP_EXCLUDE_IDLE 0x1000 + +/** + * GLIBTOP_EXCLUDE_SYSTEM: + * + * Exclude system (on most UNIXes root's) processes. + **/ +#define GLIBTOP_EXCLUDE_SYSTEM 0x2000 + +/** + * GLIBTOP_EXCLUDE_NOTTY: + * + * Exclude processes without a controlling terminal. + **/ +#define GLIBTOP_EXCLUDE_NOTTY 0x4000 + +typedef struct _glibtop_proclist glibtop_proclist; + +/** + * glibtop_proclist: + * @number: Number of entries in the returned list. + * @total: Total size of the returned list (this equals @number * @size). + * @size: Size of a single entry in the returned list + * (this equals sizeof(unsigned)). + */ +struct _glibtop_proclist +{ + guint64 flags; + guint64 number; /* GLIBTOP_PROCLIST_NUMBER */ + guint64 total; /* GLIBTOP_PROCLIST_TOTAL */ + guint64 size; /* GLIBTOP_PROCLIST_SIZE */ +}; + +/** + * glibtop_get_proclist: + * @buf: a #glibtop_proclist + * @which: a #GLIBTOP_* constant specifying process type + * @arg: an argument specific for the process type + * + * Returns: (array zero-terminated=1) (transfer none): an array of process + * ids + */ +pid_t* +glibtop_get_proclist(glibtop_proclist *buf, gint64 which, gint64 arg); + +#if GLIBTOP_SUID_PROCLIST +#define glibtop_get_proclist_r glibtop_get_proclist_p +#else +#define glibtop_get_proclist_r glibtop_get_proclist_s +#endif + +/** + * glibtop_get_proclist_l: + * @server: a #glibtop server + * @buf: a #glibtop_proclist + * @which: a #GLIBTOP_* constant specifying process type + * @arg: an argument specific for the process type + * + * Returns: (array zero-terminated=1) (transfer none): an array of process + * ids + */ +pid_t* +glibtop_get_proclist_l (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg); + +#if GLIBTOP_SUID_PROCLIST +void _glibtop_init_proclist_p (glibtop *server); + +/** + * glibtop_get_proclist_p: + * @server: a #glibtop server + * @buf: a #glibtop_proclist + * @which: a #GLIBTOP_* constant specifying process type + * @arg: an argument specific for the process type + * + * Returns: (array zero-terminated=1) (transfer none): an array of process + * ids + */ +pid_t* +glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg); +#else +void _glibtop_init_proclist_s (glibtop *server); + +/** + * glibtop_get_proclist_s: + * @server: a #glibtop server + * @buf: a #glibtop_proclist + * @which: a #GLIBTOP_* constant specifying process type + * @arg: an argument specific for the process type + * + * Returns: (array zero-terminated=1) (transfer none): an array of process + * ids + */ +pid_t* +glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/procmap.h b/include/glibtop/procmap.h new file mode 100644 index 0000000..e0516d7 --- /dev/null +++ b/include/glibtop/procmap.h @@ -0,0 +1,161 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PROC_MAP_H__ +#define __GLIBTOP_PROC_MAP_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_PROC_MAP_NUMBER 0 +#define GLIBTOP_PROC_MAP_TOTAL 1 +#define GLIBTOP_PROC_MAP_SIZE 2 + +#define GLIBTOP_MAX_PROC_MAP 3 + +#define GLIBTOP_MAP_ENTRY_START 0 +#define GLIBTOP_MAP_ENTRY_END 1 +#define GLIBTOP_MAP_ENTRY_OFFSET 2 +#define GLIBTOP_MAP_ENTRY_PERM 3 +#define GLIBTOP_MAP_ENTRY_INODE 4 +#define GLIBTOP_MAP_ENTRY_DEVICE 5 +#define GLIBTOP_MAP_ENTRY_FILENAME 6 + +/* Smap support */ +#define GLIBTOP_MAP_ENTRY_SIZE 7 +#define GLIBTOP_MAP_ENTRY_RSS 8 +#define GLIBTOP_MAP_ENTRY_SHARED_CLEAN 9 +#define GLIBTOP_MAP_ENTRY_SHARED_DIRTY 10 +#define GLIBTOP_MAP_ENTRY_PRIVATE_CLEAN 11 +#define GLIBTOP_MAP_ENTRY_PRIVATE_DIRTY 12 +#define GLIBTOP_MAP_ENTRY_PSS 13 +#define GLIBTOP_MAP_ENTRY_SWAP 14 + +#define GLIBTOP_MAX_MAP_ENTRY 15 + +#define GLIBTOP_MAP_FILENAME_LEN 215 + +#define GLIBTOP_MAP_PERM_READ 1 +#define GLIBTOP_MAP_PERM_WRITE 2 +#define GLIBTOP_MAP_PERM_EXECUTE 4 +#define GLIBTOP_MAP_PERM_SHARED 8 +#define GLIBTOP_MAP_PERM_PRIVATE 16 + +typedef struct _glibtop_map_entry glibtop_map_entry; + +typedef struct _glibtop_proc_map glibtop_proc_map; + +struct _glibtop_map_entry +{ + guint64 flags; + guint64 start; + guint64 end; + guint64 offset; + guint64 perm; + guint64 inode; + guint64 device; + guint64 size; + guint64 rss; + guint64 shared_clean; + guint64 shared_dirty; + guint64 private_clean; + guint64 private_dirty; + guint64 pss; + guint64 swap; + char filename [GLIBTOP_MAP_FILENAME_LEN+1]; +}; + +struct _glibtop_proc_map +{ + guint64 flags; + guint64 number; /* GLIBTOP_PROC_MAP_NUMBER */ + guint64 total; /* GLIBTOP_PROC_MAP_TOTAL */ + guint64 size; /* GLIBTOP_PROC_MAP_SIZE */ +}; + +/** + * glibtop_get_proc_map: + * @buf: + * @pid: + * + * Returns: (transfer none): + */ +glibtop_map_entry * +glibtop_get_proc_map(glibtop_proc_map *buf, pid_t pid); + + + +/** + * glibtop_get_proc_map_l: + * @server: + * @buf: (out): + * @pid: + * + * Returns: (transfer none): + */ + +/** + * glibtop_get_proc_map_p: + * @server: + * @buf: (out): + * @pid: + * + * Returns: (transfer none): + */ + +/** + * glibtop_get_proc_map_s: + * @server: + * @buf: (out): + * @pid: + * + * Returns: (transfer none): + */ + +#if GLIBTOP_SUID_PROC_MAP +#define glibtop_get_proc_map_r glibtop_get_proc_map_p +#else +#define glibtop_get_proc_map_r glibtop_get_proc_map_s +#endif + +glibtop_map_entry * +glibtop_get_proc_map_l (glibtop *server, glibtop_proc_map *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_MAP +void _glibtop_init_proc_map_p (glibtop *server); + +glibtop_map_entry * +glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, pid_t pid); +#else +void _glibtop_init_proc_map_s (glibtop *server); + +glibtop_map_entry * +glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid); +#endif + +GType glibtop_map_entry_get_type (void) G_GNUC_CONST; +GType glibtop_proc_map_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif diff --git a/include/glibtop/procmem.h b/include/glibtop/procmem.h new file mode 100644 index 0000000..d0e0998 --- /dev/null +++ b/include/glibtop/procmem.h @@ -0,0 +1,83 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PROCMEM_H__ +#define __GLIBTOP_PROCMEM_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_PROC_MEM_SIZE 0 +#define GLIBTOP_PROC_MEM_VSIZE 1 +#define GLIBTOP_PROC_MEM_RESIDENT 2 +#define GLIBTOP_PROC_MEM_SHARE 3 +#define GLIBTOP_PROC_MEM_RSS 4 +#define GLIBTOP_PROC_MEM_RSS_RLIM 5 + +#define GLIBTOP_MAX_PROC_MEM 6 + +typedef struct _glibtop_proc_mem glibtop_proc_mem; + +/* Memory section */ + +struct _glibtop_proc_mem +{ + guint64 flags; + guint64 size; /* total # of pages of memory */ + guint64 vsize; /* number of pages of virtual memory ... */ + guint64 resident; /* number of resident set + * (non-swapped) pages (4k) */ + guint64 share; /* number of pages of shared (mmap'd) memory */ + guint64 rss; /* resident set size */ + guint64 rss_rlim; /* current limit (in bytes) of the rss + * of the process; usually 2,147,483,647 */ +}; + +/** + * glibtop_get_proc_mem: + * @buf: + * @pid: + * + */ +void glibtop_get_proc_mem(glibtop_proc_mem *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_MEM +#define glibtop_get_proc_mem_r glibtop_get_proc_mem_p +#else +#define glibtop_get_proc_mem_r glibtop_get_proc_mem_s +#endif + +void glibtop_get_proc_mem_l (glibtop *server, glibtop_proc_mem *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_MEM +void _glibtop_init_proc_mem_p (glibtop *server); +void glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, pid_t pid); +#else +void _glibtop_init_proc_mem_s (glibtop *server); +void glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/procopenfiles.h b/include/glibtop/procopenfiles.h new file mode 100644 index 0000000..31320eb --- /dev/null +++ b/include/glibtop/procopenfiles.h @@ -0,0 +1,154 @@ +/* Copyright (C) 1998-99 Martin Baulig + Copyright (C) 2004 Nicolás Lichtmaier + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + Modified by Nicolás Lichtmaier to give open process files. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PROC_OPEN_FILES_H__ +#define __GLIBTOP_PROC_OPEN_FILES_H__ + +#include +#include + + +G_BEGIN_DECLS + +#define GLIBTOP_PROC_OPEN_FILES_NUMBER 0 +#define GLIBTOP_PROC_OPEN_FILES_TOTAL 1 +#define GLIBTOP_PROC_OPEN_FILES_SIZE 2 + +#define GLIBTOP_MAX_PROC_OPEN_FILES 3 + +#define GLIBTOP_FILE_ENTRY_FD 0 +#define GLIBTOP_FILE_ENTRY_NAME 1 +#define GLIBTOP_FILE_ENTRY_TYPE 2 +#define GLIBTOP_FILE_ENTRY_INETSOCKET_DST_HOST 3 +#define GLIBTOP_FILE_ENTRY_INETSOCKET_DST_PORT 4 + +#define GLIBTOP_MAX_OPEN_FILE_ENTRY 5 + +#define GLIBTOP_OPEN_FILENAME_LEN 215 + /* ready for IPv6 */ +#define GLIBTOP_OPEN_DEST_HOST_LEN 46 + +enum glibtop_file_type { + GLIBTOP_FILE_TYPE_FILE = 1, + GLIBTOP_FILE_TYPE_PIPE = 2, + GLIBTOP_FILE_TYPE_INETSOCKET = 4, + GLIBTOP_FILE_TYPE_LOCALSOCKET = 8, + GLIBTOP_FILE_TYPE_INET6SOCKET = 16 +}; + +typedef struct _glibtop_open_files_entry glibtop_open_files_entry; + +typedef struct _glibtop_proc_open_files glibtop_proc_open_files; + +struct _glibtop_open_files_entry +{ + int fd; + guint16 type; /* An "enum glibtop_file_type" value. */ + union { + /* When type == GLIBTOP_FILE_TYPE_INETSOCKET or + * when type == GLIBTOP_FILE_TYPE_INET6SOCKET */ + struct { + char dest_host[GLIBTOP_OPEN_DEST_HOST_LEN+1]; + int dest_port; + } sock; + + /* When type == GLIBTOP_FILE_TYPE_FILE */ + struct { + char name[GLIBTOP_OPEN_FILENAME_LEN+1]; + } file; + + /* When type == GLIBTOP_FILE_TYPE_LOCALSOCKET */ + struct { + char name[GLIBTOP_OPEN_FILENAME_LEN+1]; + } localsock; + + } info; +}; + +struct _glibtop_proc_open_files +{ + guint64 flags; + guint64 number; /* GLIBTOP_PROC_OPEN_FILES_NUMBER */ + guint64 total; /* GLIBTOP_PROC_OPEN_FILES_TOTAL */ + guint64 size; /* GLIBTOP_PROC_OPEN_FILES_SIZE */ +}; + +/** + * glibtop_get_proc_open_files: + * @buf: + * @pid: + * + * Returns: (transfer none): + */ + +glibtop_open_files_entry * +glibtop_get_proc_open_files(glibtop_proc_open_files *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_FILE +#define glibtop_get_proc_open_files_r glibtop_get_proc_open_files_p +#else +#define glibtop_get_proc_open_files_r glibtop_get_proc_open_files_s +#endif + + +/** + * glibtop_get_proc_open_files_l: + * @server: + * @buf: (out): + * @pid: + * + * Returns: (transfer none): + */ + +glibtop_open_files_entry * +glibtop_get_proc_open_files_l (glibtop *server, glibtop_proc_open_files *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_FILE +void _glibtop_init_proc_open_files_p (glibtop *server); + + +/** + * glibtop_get_proc_open_files_p: + * @server: + * @buf: (out): + * @pid: + * + * Returns: (transfer none): + */ + +glibtop_open_files_entry * +glibtop_get_proc_open_files_p (glibtop *server, glibtop_proc_open_files *buf, pid_t pid); +#else +void _glibtop_init_proc_open_files_s (glibtop *server); + +glibtop_open_files_entry * +glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pid_t pid); +#endif + +GType glibtop_open_files_entry_get_type (void) G_GNUC_CONST; +GType glibtop_proc_open_files_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif diff --git a/include/glibtop/procsegment.h b/include/glibtop/procsegment.h new file mode 100644 index 0000000..3e31e4a --- /dev/null +++ b/include/glibtop/procsegment.h @@ -0,0 +1,80 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PROCSEGMENT_H__ +#define __GLIBTOP_PROCSEGMENT_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_PROC_SEGMENT_TEXT_RSS 0 +#define GLIBTOP_PROC_SEGMENT_SHLIB_RSS 1 +#define GLIBTOP_PROC_SEGMENT_DATA_RSS 2 +#define GLIBTOP_PROC_SEGMENT_STACK_RSS 3 +#define GLIBTOP_PROC_SEGMENT_DIRTY_SIZE 4 +#define GLIBTOP_PROC_SEGMENT_START_CODE 5 +#define GLIBTOP_PROC_SEGMENT_END_CODE 6 +#define GLIBTOP_PROC_SEGMENT_START_STACK 7 + +#define GLIBTOP_MAX_PROC_SEGMENT 8 + +typedef struct _glibtop_proc_segment glibtop_proc_segment; + +/* Segment stuff */ + +struct _glibtop_proc_segment +{ + guint64 flags; + guint64 text_rss; /* text resident set size */ + guint64 shlib_rss; /* shared-lib resident set size */ + guint64 data_rss; /* data resident set size */ + guint64 stack_rss; /* stack resident set size */ + guint64 dirty_size; /* size of dirty pages */ + guint64 start_code; + /* address of beginning of code segment */ + guint64 end_code; /* address of end of code segment */ + guint64 start_stack; /* address of the bottom of stack segment */ +}; + +void glibtop_get_proc_segment(glibtop_proc_segment *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_SEGMENT +#define glibtop_get_proc_segment_r glibtop_get_proc_segment_p +#else +#define glibtop_get_proc_segment_r glibtop_get_proc_segment_s +#endif + +void glibtop_get_proc_segment_l (glibtop *server, glibtop_proc_segment *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_SEGMENT +void _glibtop_init_proc_segment_p (glibtop *server); +void glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf, pid_t pid); +#else +void _glibtop_init_proc_segment_s (glibtop *server); +void glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf, pid_t pid); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/procsignal.h b/include/glibtop/procsignal.h new file mode 100644 index 0000000..f029fba --- /dev/null +++ b/include/glibtop/procsignal.h @@ -0,0 +1,71 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PROCSIGNAL_H__ +#define __GLIBTOP_PROCSIGNAL_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_PROC_SIGNAL_SIGNAL 0 +#define GLIBTOP_PROC_SIGNAL_BLOCKED 1 +#define GLIBTOP_PROC_SIGNAL_SIGIGNORE 2 +#define GLIBTOP_PROC_SIGNAL_SIGCATCH 3 + +#define GLIBTOP_MAX_PROC_SIGNAL 4 + +typedef struct _glibtop_proc_signal glibtop_proc_signal; + +/* Signals section */ + +struct _glibtop_proc_signal +{ + guint64 flags; + guint64 signal [2]; /* mask of pending signals */ + guint64 blocked [2]; /* mask of blocked signals */ + guint64 sigignore [2]; /* mask of ignored signals */ + guint64 sigcatch [2]; /* mask of caught signals */ +}; + +void glibtop_get_proc_signal(glibtop_proc_signal *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_SIGNAL +#define glibtop_get_proc_signal_r glibtop_get_proc_signal_p +#else +#define glibtop_get_proc_signal_r glibtop_get_proc_signal_s +#endif + +void glibtop_get_proc_signal_l (glibtop *server, glibtop_proc_signal *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_SIGNAL +void _glibtop_init_proc_signal_p (glibtop *server); +void glibtop_get_proc_signal_p (glibtop *server, glibtop_proc_signal *buf, pid_t pid); +#else +void _glibtop_init_proc_signal_s (glibtop *server); +void glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, pid_t pid); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/procstate.h b/include/glibtop/procstate.h new file mode 100644 index 0000000..8ba66f7 --- /dev/null +++ b/include/glibtop/procstate.h @@ -0,0 +1,95 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PROCSTATE_H__ +#define __GLIBTOP_PROCSTATE_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_PROC_STATE_CMD 0 +#define GLIBTOP_PROC_STATE_STATE 1 +#define GLIBTOP_PROC_STATE_UID 2 +#define GLIBTOP_PROC_STATE_GID 3 +#define GLIBTOP_PROC_STATE_RUID 4 +#define GLIBTOP_PROC_STATE_RGID 5 +#define GLIBTOP_PROC_STATE_HAS_CPU 6 +#define GLIBTOP_PROC_STATE_PROCESSOR 7 +#define GLIBTOP_PROC_STATE_LAST_PROCESSOR 8 + +#define GLIBTOP_MAX_PROC_STATE 9 + +#define GLIBTOP_PROCESS_RUNNING 1 +#define GLIBTOP_PROCESS_INTERRUPTIBLE 2 +#define GLIBTOP_PROCESS_UNINTERRUPTIBLE 4 +#define GLIBTOP_PROCESS_ZOMBIE 8 +#define GLIBTOP_PROCESS_STOPPED 16 +#define GLIBTOP_PROCESS_SWAPPING 32 +#define GLIBTOP_PROCESS_DEAD 64 + +typedef struct _glibtop_proc_state glibtop_proc_state; + +/* Name and status */ + +struct _glibtop_proc_state +{ + guint64 flags; + char cmd[40]; /* basename of executable file in + * call to exec(2) */ + unsigned state; + /* NOTE: when porting the library, TRY HARD to implement the + * following two fields. */ + /* IMPORTANT NOTICE: For security reasons, it is extremely important + * only to set the flags value for those two + * fields if their values are corrent ! */ + int uid; /* UID of process */ + int gid; /* GID of process */ + int ruid; + int rgid; + int has_cpu; + int processor; + int last_processor; +}; + +void glibtop_get_proc_state(glibtop_proc_state *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_STATE +#define glibtop_get_proc_state_r glibtop_get_proc_state_p +#else +#define glibtop_get_proc_state_r glibtop_get_proc_state_s +#endif + +void glibtop_get_proc_state_l (glibtop *server, glibtop_proc_state *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_STATE +void _glibtop_init_proc_state_p (glibtop *server); +void glibtop_get_proc_state_p (glibtop *server, glibtop_proc_state *buf, pid_t pid); +#else +void _glibtop_init_proc_state_s (glibtop *server); +void glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/proctime.h b/include/glibtop/proctime.h new file mode 100644 index 0000000..df79558 --- /dev/null +++ b/include/glibtop/proctime.h @@ -0,0 +1,117 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PROCTIME_H__ +#define __GLIBTOP_PROCTIME_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_PROC_TIME_START_TIME 0 +#define GLIBTOP_PROC_TIME_RTIME 1 +#define GLIBTOP_PROC_TIME_UTIME 2 +#define GLIBTOP_PROC_TIME_STIME 3 +#define GLIBTOP_PROC_TIME_CUTIME 4 +#define GLIBTOP_PROC_TIME_CSTIME 5 +#define GLIBTOP_PROC_TIME_TIMEOUT 6 +#define GLIBTOP_PROC_TIME_IT_REAL_VALUE 7 +#define GLIBTOP_PROC_TIME_FREQUENCY 8 +#define GLIBTOP_PROC_TIME_XCPU_UTIME 9 +#define GLIBTOP_PROC_TIME_XCPU_STIME 10 + +#define GLIBTOP_MAX_PROC_TIME 11 + +typedef struct _glibtop_proc_time glibtop_proc_time; + +/* Time section */ + +/** + * glibtop_proc_time: + * @start_time: Start time of process in seconds since the epoch. + * @rtime: Real time accumulated by process (should be @utime + @stime). + * @utime: User-mode CPU time accumulated by process. + * @stime: Kernel-mode CPU time accumulated by process. + * @cutime: Cumulative utime of process and reaped children. + * @cstime: Cumulative stime of process and reaped children. + * @timeout: The time (in jiffies) of the process’s next timeout. + * @it_real_value: The time (in jiffies) before the next SIGALRM + * is sent to the process due to an interval timer. + * @frequency: Tick frequency. + * @xcpu_utime: SMP user-mode CPU time accumulated by process. + * @xcpu_stime: SMP kernel-mode CPU time accumulated by process + * + * Process time data filled by glibtop_get_proc_time(). + * + * Under Linux the @start_time value may be wrong due to the information + * available from the kernel. + * + * The Linux kernel defines INITIAL_JIFFIES which implies a time + * shift. Because INITIAL_JIFFIES is not user-space defined, + * we cannot use it to compute an accurate @start_time. On Linux 2.6, + * INITIAL_JIFFIES is 300 so @start_time is + * always 3s different from the real start time of the given process. You + * may also get shift results if your system clock is not synchronised + * with your hardware clock. See man hwclock. + */ +struct _glibtop_proc_time +{ + /*< private >*/ + guint64 flags; + /*< public >*/ + guint64 start_time; + guint64 rtime; + guint64 utime; + guint64 stime; + guint64 cutime; + guint64 cstime; + guint64 timeout; + guint64 it_real_value; + guint64 frequency; + guint64 xcpu_utime [GLIBTOP_NCPU]; + guint64 xcpu_stime [GLIBTOP_NCPU]; +}; + + +void glibtop_get_proc_time(glibtop_proc_time *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_TIME +#define glibtop_get_proc_time_r glibtop_get_proc_time_p +#else +#define glibtop_get_proc_time_r glibtop_get_proc_time_s +#endif + +void glibtop_get_proc_time_l (glibtop *server, glibtop_proc_time *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_TIME +void _glibtop_init_proc_time_p (glibtop *server); +void glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, pid_t pid); +#else +void _glibtop_init_proc_time_s (glibtop *server); +void glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/procuid.h b/include/glibtop/procuid.h new file mode 100644 index 0000000..736f779 --- /dev/null +++ b/include/glibtop/procuid.h @@ -0,0 +1,102 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PROCUID_H__ +#define __GLIBTOP_PROCUID_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_PROC_UID_UID 0 +#define GLIBTOP_PROC_UID_EUID 1 +#define GLIBTOP_PROC_UID_GID 2 +#define GLIBTOP_PROC_UID_EGID 3 +#define GLIBTOP_PROC_UID_SUID 4 +#define GLIBTOP_PROC_UID_SGID 5 +#define GLIBTOP_PROC_UID_FSUID 6 +#define GLIBTOP_PROC_UID_FSGID 7 +#define GLIBTOP_PROC_UID_PID 8 +#define GLIBTOP_PROC_UID_PPID 9 +#define GLIBTOP_PROC_UID_PGRP 10 +#define GLIBTOP_PROC_UID_SESSION 11 +#define GLIBTOP_PROC_UID_TTY 12 +#define GLIBTOP_PROC_UID_TPGID 13 +#define GLIBTOP_PROC_UID_PRIORITY 14 +#define GLIBTOP_PROC_UID_NICE 15 +#define GLIBTOP_PROC_UID_NGROUPS 16 +#define GLIBTOP_PROC_UID_GROUPS 17 + +#define GLIBTOP_MAX_PROC_UID 18 + +typedef struct _glibtop_proc_uid glibtop_proc_uid; + +#define GLIBTOP_MAX_GROUPS 64 + +/* User, Group, Terminal and session */ + +struct _glibtop_proc_uid +{ + guint64 flags; + gint32 uid; /* user id */ + gint32 euid; /* effective user id */ + gint32 gid; /* group id */ + gint32 egid; /* effective group id */ + gint32 suid; /* set user id */ + gint32 sgid; /* set group id */ + gint32 fsuid; /* ??? user id */ + gint32 fsgid; /* ??? group id */ + gint32 pid; /* process id */ + gint32 ppid; /* pid of parent process */ + gint32 pgrp; /* process group id */ + gint32 session; /* session id */ + gint32 tty; /* full device number of controlling terminal */ + gint32 tpgid; /* terminal process group id */ + gint32 priority; /* kernel scheduling priority */ + gint32 nice; /* standard unix nice level of process */ + gint32 ngroups; + gint32 groups [GLIBTOP_MAX_GROUPS]; + +}; + +void glibtop_get_proc_uid(glibtop_proc_uid *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_UID +#define glibtop_get_proc_uid_r glibtop_get_proc_uid_p +#else +#define glibtop_get_proc_uid_r glibtop_get_proc_uid_s +#endif + +void glibtop_get_proc_uid_l (glibtop *server, glibtop_proc_uid *buf, pid_t pid); + +#if GLIBTOP_SUID_PROC_UID +void _glibtop_init_proc_uid_p (glibtop *server); +void glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, pid_t pid); +#else +void _glibtop_init_proc_uid_s (glibtop *server); +void glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/procwd.h b/include/glibtop/procwd.h new file mode 100644 index 0000000..2bb96a4 --- /dev/null +++ b/include/glibtop/procwd.h @@ -0,0 +1,76 @@ +/* Copyright (C) 2007 Benoît Dejean + This file is part of LibGTop 2. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PROCWD_H__ +#define __GLIBTOP_PROCWD_H__ + +#include +#include + +G_BEGIN_DECLS + +typedef struct _glibtop_proc_wd glibtop_proc_wd; + +#define GLIBTOP_PROC_WD_NUMBER 0 +#define GLIBTOP_PROC_WD_ROOT 1 +#define GLIBTOP_PROC_WD_EXE 2 +#define GLIBTOP_MAX_PROC_WD 3 + +#define GLIBTOP_PROC_WD_ROOT_LEN 215 +#define GLIBTOP_PROC_WD_EXE_LEN 215 + +struct _glibtop_proc_wd +{ + guint64 flags; + guint32 number; + char root[GLIBTOP_PROC_WD_ROOT_LEN+1]; + char exe[GLIBTOP_PROC_WD_EXE_LEN+1]; +}; + + +/** + * glibtop_get_proc_wd: + * @buf: + * @pid: + * + * Returns: (transfer full): + */ +char ** glibtop_get_proc_wd(glibtop_proc_wd *buf, pid_t pid); +char ** glibtop_get_proc_wd_l(glibtop *server, glibtop_proc_wd *buf, pid_t pid); + + +#if GLIBTOP_SUID_PROC_WD + +#define glibtop_get_proc_wd_r glibtop_get_proc_wd_p +void _glibtop_init_proc_wd_p(glibtop *server); +char ** glibtop_get_proc_wd_p(glibtop *server, glibtop_proc_wd *buf, pid_t pid); + +#else + +#define glibtop_get_proc_wd_r glibtop_get_proc_wd_s +void _glibtop_init_proc_wd_s(glibtop *server); +char ** glibtop_get_proc_wd_s(glibtop *server, glibtop_proc_wd *buf, pid_t pid); + +#endif + + + +G_END_DECLS + +#endif diff --git a/include/glibtop/read.h b/include/glibtop/read.h new file mode 100644 index 0000000..6d04e6c --- /dev/null +++ b/include/glibtop/read.h @@ -0,0 +1,36 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_READ_H__ +#define __GLIBTOP_READ_H__ + +#include + +G_BEGIN_DECLS + +#define glibtop_read(p1, p2) glibtop_read(glibtop_global_server, p1, p2) + +void glibtop_read_l (glibtop *server, size_t size, void *buf); +void glibtop_read_s (glibtop *server, size_t size, void *buf); + +G_END_DECLS + +#endif diff --git a/include/glibtop/read_data.h b/include/glibtop/read_data.h new file mode 100644 index 0000000..cdb435c --- /dev/null +++ b/include/glibtop/read_data.h @@ -0,0 +1,36 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_READ_DATA_H__ +#define __GLIBTOP_READ_DATA_H__ + +#include + +G_BEGIN_DECLS + +#define glibtop_read_data() glibtop_read_data_r(glibtop_global_server) + +void *glibtop_read_data_l (glibtop *server); +void *glibtop_read_data_s (glibtop *server); + +G_END_DECLS + +#endif diff --git a/include/glibtop/sem_limits.h b/include/glibtop/sem_limits.h new file mode 100644 index 0000000..74a5b0b --- /dev/null +++ b/include/glibtop/sem_limits.h @@ -0,0 +1,81 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SEM_LIMITS_H__ +#define __GLIBTOP_SEM_LIMITS_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_IPC_SEMMAP 0 +#define GLIBTOP_IPC_SEMMNI 1 +#define GLIBTOP_IPC_SEMMNS 2 +#define GLIBTOP_IPC_SEMMNU 3 +#define GLIBTOP_IPC_SEMMSL 4 +#define GLIBTOP_IPC_SEMOPM 5 +#define GLIBTOP_IPC_SEMUME 6 +#define GLIBTOP_IPC_SEMUSZ 7 +#define GLIBTOP_IPC_SEMVMX 8 +#define GLIBTOP_IPC_SEMAEM 9 + +#define GLIBTOP_MAX_SEM_LIMITS 10 + +typedef struct _glibtop_sem_limits glibtop_sem_limits; + +struct _glibtop_sem_limits +{ + guint64 flags; + guint64 semmap; /* GLIBTOP_IPC_SEMMAP */ + guint64 semmni; /* GLIBTOP_IPC_SEMMNI */ + guint64 semmns; /* GLIBTOP_IPC_SEMMNS */ + guint64 semmnu; /* GLIBTOP_IPC_SEMMNU */ + guint64 semmsl; /* GLIBTOP_IPC_SEMMSL */ + guint64 semopm; /* GLIBTOP_IPC_SEMOPM */ + guint64 semume; /* GLIBTOP_IPC_SEMUME */ + guint64 semusz; /* GLIBTOP_IPC_SEMUSZ */ + guint64 semvmx; /* GLIBTOP_IPC_SEMVMX */ + guint64 semaem; /* GLIBTOP_IPC_SEMAEM */ +}; + +void glibtop_get_sem_limits(glibtop_sem_limits *buf); + +#if GLIBTOP_SUID_SEM_LIMITS +#define glibtop_get_sem_limits_r glibtop_get_sem_limits_p +#else +#define glibtop_get_sem_limits_r glibtop_get_sem_limits_s +#endif + +void glibtop_get_sem_limits_l (glibtop *server, glibtop_sem_limits *buf); + +#if GLIBTOP_SUID_SEM_LIMITS +void _glibtop_init_sem_limits_p (glibtop *server); +void glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf); +#else +void _glibtop_init_sem_limits_s (glibtop *server); +void glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/shm_limits.h b/include/glibtop/shm_limits.h new file mode 100644 index 0000000..3ddbb75 --- /dev/null +++ b/include/glibtop/shm_limits.h @@ -0,0 +1,93 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SHM_LIMITS_H__ +#define __GLIBTOP_SHM_LIMITS_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_IPC_SHMMAX 0 +#define GLIBTOP_IPC_SHMMIN 1 +#define GLIBTOP_IPC_SHMMNI 2 +#define GLIBTOP_IPC_SHMSEG 3 +#define GLIBTOP_IPC_SHMALL 4 + +#define GLIBTOP_MAX_SHM_LIMITS 5 + +typedef struct _glibtop_shm_limits glibtop_shm_limits; + +/** + * glibtop_shm_limits: + */ +struct _glibtop_shm_limits +{ + guint64 flags; + guint64 shmmax; /* GLIBTOP_IPC_SHMMAX */ + guint64 shmmin; /* GLIBTOP_IPC_SHMMIN */ + guint64 shmmni; /* GLIBTOP_IPC_SHMMNI */ + guint64 shmseg; /* GLIBTOP_IPC_SHMSEG */ + guint64 shmall; /* GLIBTOP_IPC_SHMALL */ +}; + +/** + * glibtop_get_shm_limits: + * @buf: a #glibtop_shm_limits + */ +void glibtop_get_shm_limits(glibtop_shm_limits *buf); + +#if GLIBTOP_SUID_SHM_LIMITS +#define glibtop_get_shm_limits_r glibtop_get_shm_limits_p +#else +#define glibtop_get_shm_limits_r glibtop_get_shm_limits_s +#endif + +/** + * glibtop_get_shm_limits_l: + * @server: a #glibtop server + * @buf: a #glibtop_shm_limits + */ +void glibtop_get_shm_limits_l (glibtop *server, glibtop_shm_limits *buf); + +#if GLIBTOP_SUID_SHM_LIMITS +void _glibtop_init_shm_limits_p (glibtop *server); +/** + * glibtop_get_shm_limits_p: + * @server: a #glibtop server + * @buf: a #glibtop_shm_limits + */ +void glibtop_get_shm_limits_p (glibtop *, glibtop_shm_limits *buf); +#else +void _glibtop_init_shm_limits_s (glibtop *server); +/** + * glibtop_get_shm_limits_s: + * @server: a #glibtop server + * @buf: a #glibtop_shm_limits + */ +void glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/signal.h b/include/glibtop/signal.h new file mode 100644 index 0000000..c812a2f --- /dev/null +++ b/include/glibtop/signal.h @@ -0,0 +1,45 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SIGNAL_H__ +#define __GLIBTOP_SIGNAL_H__ + +#include + +#ifdef HAVE_SYS_SIGNAL_H +#include +#endif + +G_BEGIN_DECLS + +typedef struct _glibtop_signame glibtop_signame; + +struct _glibtop_signame +{ + const int number; + const char *name, *label; +}; + +extern const glibtop_signame glibtop_sys_siglist []; + +G_END_DECLS + +#endif diff --git a/include/glibtop/swap.h b/include/glibtop/swap.h new file mode 100644 index 0000000..5c59d26 --- /dev/null +++ b/include/glibtop/swap.h @@ -0,0 +1,72 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SWAP_H__ +#define __GLIBTOP_SWAP_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_SWAP_TOTAL 0 +#define GLIBTOP_SWAP_USED 1 +#define GLIBTOP_SWAP_FREE 2 +#define GLIBTOP_SWAP_PAGEIN 3 +#define GLIBTOP_SWAP_PAGEOUT 4 + +#define GLIBTOP_MAX_SWAP 5 + +typedef struct _glibtop_swap glibtop_swap; + +struct _glibtop_swap +{ + guint64 flags; + guint64 total; /* GLIBTOP_SWAP_TOTAL */ + guint64 used; /* GLIBTOP_SWAP_USED */ + guint64 free; /* GLIBTOP_SWAP_FREE */ + guint64 pagein; /* GLIBTOP_SWAP_PAGEIN */ + guint64 pageout; /* GLIBTOP_SWAP_PAGEOUT */ +}; + +void +glibtop_get_swap(glibtop_swap *buf); + +#if GLIBTOP_SUID_SWAP +#define glibtop_get_swap_r glibtop_get_swap_p +#else +#define glibtop_get_swap_r glibtop_get_swap_s +#endif + +void glibtop_get_swap_l (glibtop *server, glibtop_swap *buf); + +#if GLIBTOP_SUID_SWAP +void _glibtop_init_swap_p (glibtop *server); +void glibtop_get_swap_p (glibtop *server, glibtop_swap *buf); +#else +void _glibtop_init_swap_s (glibtop *server); +void glibtop_get_swap_s (glibtop *server, glibtop_swap *buf); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/sysdeps.h b/include/glibtop/sysdeps.h new file mode 100644 index 0000000..a18c69e --- /dev/null +++ b/include/glibtop/sysdeps.h @@ -0,0 +1,114 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SYSDEPS_H__ +#define __GLIBTOP_SYSDEPS_H__ + +#include + +G_BEGIN_DECLS + +#define GLIBTOP_SYSDEPS_FEATURES 0 +#define GLIBTOP_SYSDEPS_CPU 1 +#define GLIBTOP_SYSDEPS_MEM 2 +#define GLIBTOP_SYSDEPS_SWAP 3 +#define GLIBTOP_SYSDEPS_UPTIME 4 +#define GLIBTOP_SYSDEPS_LOADAVG 5 +#define GLIBTOP_SYSDEPS_SHM_LIMITS 6 +#define GLIBTOP_SYSDEPS_MSG_LIMITS 7 +#define GLIBTOP_SYSDEPS_SEM_LIMITS 8 +#define GLIBTOP_SYSDEPS_PROCLIST 9 +#define GLIBTOP_SYSDEPS_PROC_STATE 10 +#define GLIBTOP_SYSDEPS_PROC_UID 11 +#define GLIBTOP_SYSDEPS_PROC_MEM 12 +#define GLIBTOP_SYSDEPS_PROC_TIME 13 +#define GLIBTOP_SYSDEPS_PROC_SIGNAL 14 +#define GLIBTOP_SYSDEPS_PROC_KERNEL 15 +#define GLIBTOP_SYSDEPS_PROC_SEGMENT 16 +#define GLIBTOP_SYSDEPS_PROC_ARGS 17 +#define GLIBTOP_SYSDEPS_PROC_MAP 18 +#define GLIBTOP_SYSDEPS_MOUNTLIST 19 +#define GLIBTOP_SYSDEPS_FSUSAGE 20 +#define GLIBTOP_SYSDEPS_NETLOAD 21 +#define GLIBTOP_SYSDEPS_PPP 22 +#define GLIBTOP_SYSDEPS_NETLIST 23 +#define GLIBTOP_SYSDEPS_PROC_OPEN_FILES 24 +#define GLIBTOP_SYSDEPS_PROC_WD 25 +#define GLIBTOP_SYSDEPS_PROC_AFFINITY 26 +#define GLIBTOP_SYSDEPS_PROC_IO 27 + +#define GLIBTOP_MAX_SYSDEPS 28 + +/* The 'features' args to glibtop_init_* is an unsigned long */ +G_STATIC_ASSERT((1UL << (GLIBTOP_MAX_SYSDEPS - 1)) <= ULONG_MAX); + +#define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1) + +typedef struct _glibtop_sysdeps glibtop_sysdeps; + +struct _glibtop_sysdeps +{ + guint64 flags; + guint64 features; /* server features */ + guint64 cpu; /* glibtop_cpu */ + guint64 mem; /* glibtop_mem */ + guint64 swap; /* glibtop_swap */ + guint64 uptime; /* glibtop_uptime */ + guint64 loadavg; /* glibtop_loadavg */ + guint64 shm_limits; /* glibtop_shm_limits */ + guint64 msg_limits; /* glibtop_msg_limits */ + guint64 sem_limits; /* glibtop_sem_limits */ + guint64 proclist; /* glibtop_proclist */ + guint64 proc_state; /* glibtop_proc_state */ + guint64 proc_uid; /* glibtop_proc_uid */ + guint64 proc_mem; /* glibtop_proc_mem */ + guint64 proc_time; /* glibtop_proc_time */ + guint64 proc_signal; /* glibtop_proc_signal */ + guint64 proc_kernel; /* glibtop_proc_kernel */ + guint64 proc_segment; /* glibtop_proc_segment */ + guint64 proc_args; /* glibtop_proc_args */ + guint64 proc_map; /* glibtop_proc_map */ + guint64 proc_open_files; /* glibtop_proc_open_files */ + guint64 mountlist; /* glibtop_mountlist */ + guint64 fsusage; /* glibtop_fsusage */ + guint64 netlist; /* glibtop_netlist */ + guint64 netload; /* glibtop_netload */ + guint64 ppp; /* glibtop_ppp */ + guint64 proc_wd; /* glibtop_proc_wd */ + guint64 proc_affinity; /* glibtop_proc_affinity */ + guint64 proc_io; /* glibtop_proc_io */ + guint64 reserved0; + guint64 reserved1; + guint64 reserved2; + guint64 reserved3; + guint64 reserved4; + guint64 reserved5; + guint64 reserved6; + guint64 reserved7; +}; + +void glibtop_get_sysdeps (glibtop_sysdeps *buf); +void glibtop_get_sysdeps_r (glibtop *server, glibtop_sysdeps *buf); + + +G_END_DECLS + +#endif diff --git a/include/glibtop/sysinfo.h b/include/glibtop/sysinfo.h new file mode 100644 index 0000000..bc24951 --- /dev/null +++ b/include/glibtop/sysinfo.h @@ -0,0 +1,63 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SYSINFO_H__ +#define __GLIBTOP_SYSINFO_H__ + +#include +#include +#include + +#include + +G_BEGIN_DECLS + +#define GLIBTOP_SYSINFO_NCPU 0 +#define GLIBTOP_SYSINFO_CPUINFO 1 + +#define GLIBTOP_MAX_SYSINFO 2 + +typedef struct _glibtop_sysinfo glibtop_sysinfo; + +typedef struct _glibtop_entry glibtop_entry; + +struct _glibtop_entry +{ + GPtrArray *labels; + GHashTable *values; /* key -> description */ + GHashTable *descriptions; /* unused */ +}; + +struct _glibtop_sysinfo +{ + guint64 flags; + guint64 ncpu; + glibtop_entry cpuinfo [GLIBTOP_NCPU]; +}; + +#define glibtop_get_sysinfo_r glibtop_get_sysinfo_s + +const glibtop_sysinfo *glibtop_get_sysinfo_s (glibtop *server); +const glibtop_sysinfo *glibtop_get_sysinfo (void); + +G_END_DECLS + +#endif diff --git a/include/glibtop/union.h b/include/glibtop/union.h new file mode 100644 index 0000000..334f021 --- /dev/null +++ b/include/glibtop/union.h @@ -0,0 +1,93 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_UNION_H__ +#define __GLIBTOP_UNION_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +G_BEGIN_DECLS + +typedef union _glibtop_union glibtop_union; + +union _glibtop_union +{ + glibtop_cpu cpu; + glibtop_mem mem; + glibtop_swap swap; + glibtop_uptime uptime; + glibtop_loadavg loadavg; + glibtop_shm_limits shm_limits; + glibtop_msg_limits msg_limits; + glibtop_sem_limits sem_limits; + glibtop_proclist proclist; + glibtop_proc_state proc_state; + glibtop_proc_uid proc_uid; + glibtop_proc_mem proc_mem; + glibtop_proc_time proc_time; + glibtop_proc_signal proc_signal; + glibtop_proc_kernel proc_kernel; + glibtop_proc_segment proc_segment; + glibtop_proc_args proc_args; + glibtop_proc_map proc_map; + glibtop_mountlist mountlist; + glibtop_fsusage fsusage; + glibtop_netlist netlist; + glibtop_netload netload; + glibtop_ppp ppp; + glibtop_proc_open_files proc_open_files; + glibtop_proc_wd proc_wd; + glibtop_proc_affinity proc_affinity; + glibtop_proc_io proc_io; +}; + +G_END_DECLS + +#endif diff --git a/include/glibtop/uptime.h b/include/glibtop/uptime.h new file mode 100644 index 0000000..8ef3fd0 --- /dev/null +++ b/include/glibtop/uptime.h @@ -0,0 +1,67 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_UPTIME_H__ +#define __GLIBTOP_UPTIME_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_UPTIME_UPTIME 0 +#define GLIBTOP_UPTIME_IDLETIME 1 +#define GLIBTOP_UPTIME_BOOT_TIME 2 + +#define GLIBTOP_MAX_UPTIME 3 + +typedef struct _glibtop_uptime glibtop_uptime; + +struct _glibtop_uptime +{ + guint64 flags; + double uptime; /* GLIBTOP_UPTIME_UPTIME */ + double idletime; /* GLIBTOP_UPTIME_IDLETIME */ + guint64 boot_time; +}; + +void glibtop_get_uptime (glibtop_uptime *buf); + +#if GLIBTOP_SUID_UPTIME +#define glibtop_get_uptime_r glibtop_get_uptime_p +#else +#define glibtop_get_uptime_r glibtop_get_uptime_s +#endif + +void glibtop_get_uptime_l (glibtop *server, glibtop_uptime *buf); + +#if GLIBTOP_SUID_UPTIME +void _glibtop_init_uptime_p (glibtop *server); +void glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf); +#else +void _glibtop_init_uptime_s (glibtop *server); +void glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/version.h b/include/glibtop/version.h new file mode 100644 index 0000000..65daa4d --- /dev/null +++ b/include/glibtop/version.h @@ -0,0 +1,39 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_VERSION_H__ +#define __GLIBTOP_VERSION_H__ + +#include + +#define LIBGTOP_VERSION_STRING "Libgtop %s server version %s (%u,%u,%u,%u)." + +G_BEGIN_DECLS + +#if _IN_LIBGTOP + +void glibtop_send_version (glibtop *server, int fd); + +#endif + +G_END_DECLS + +#endif diff --git a/include/glibtop/write.h b/include/glibtop/write.h new file mode 100644 index 0000000..432f923 --- /dev/null +++ b/include/glibtop/write.h @@ -0,0 +1,36 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_WRITE_H__ +#define __GLIBTOP_WRITE_H__ + +#include + +G_BEGIN_DECLS + +#define glibtop_write(p1, p2) glibtop_write(glibtop_global_server, p1, p2) + +void glibtop_write_l (glibtop *server, size_t size, void *buf); +void glibtop_write_s (glibtop *server, size_t size, void *buf); + +G_END_DECLS + +#endif diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..0b0fdcb --- /dev/null +++ b/install-sh @@ -0,0 +1,501 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2013-12-25.23; # UTC + +# 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. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/lib/Makefile.am b/lib/Makefile.am new file mode 100644 index 0000000..90b8286 --- /dev/null +++ b/lib/Makefile.am @@ -0,0 +1,55 @@ + +AM_CPPFLAGS = @AM_CPPFLAGS@ + +lib_LTLIBRARIES = libgtop-2.0.la + +libgtop_2_0_la_SOURCES = init.c open.c close.c command.c read.c \ + read_data.c write.c lib.c parameter.c \ + sysdeps.c boxed.c + +libgtop_2_0_la_LDFLAGS = $(LT_VERSION_INFO) -export-symbols $(srcdir)/libgtop.sym -no-undefined +libgtop_2_0_la_LIBADD = $(GLIB_LIBS) $(top_builddir)/sysdeps/common/libgtop_common-2.0.la $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps-2.0.la $(sysdeps_suid_lib) + +BUILT_SOURCES = lib.c + +lib.c: lib.pl $(top_builddir)/config.h $(top_srcdir)/features.def + $(PERL) $(srcdir)/lib.pl < $(top_srcdir)/features.def > lib-t + mv lib-t lib.c + +EXTRA_DIST = lib.pl libgtop.sym + +CLEANFILES = lib.c + +-include $(INTROSPECTION_MAKEFILE) +INTROSPECTION_GIRS = +INTROSPECTION_SCANNER_ARGS = --accept-unprefixed --warn-all +INTROSPECTION_COMPILER_ARGS = + +if HAVE_INTROSPECTION +introspection_sources = $(libgtop_2_0_la_SOURCES) lib.c ../glibtop.h ../libgtopconfig.h \ + ../include/glibtop/close.h ../include/glibtop/loadavg.h ../include/glibtop/prockernel.h ../include/glibtop/procstate.h \ + ../include/glibtop/sem_limits.h ../include/glibtop/uptime.h ../include/glibtop/command.h ../include/glibtop/mem.h ../include/glibtop/proclist.h \ + ../include/glibtop/proctime.h ../include/glibtop/shm_limits.h ../include/glibtop/cpu.h ../include/glibtop/msg_limits.h \ + ../include/glibtop/procmem.h ../include/glibtop/procuid.h ../include/glibtop/swap.h \ + ../include/glibtop/procsegment.h ../include/glibtop/sysdeps.h ../include/glibtop/global.h \ + ../include/glibtop/procsignal.h ../include/glibtop/union.h ../include/glibtop/gnuserv.h \ + ../include/glibtop/parameter.h ../include/glibtop/mountlist.h ../include/glibtop/fsusage.h ../include/glibtop/procmap.h ../include/glibtop/signal.h \ + ../include/glibtop/sysinfo.h ../include/glibtop/ppp.h ../include/glibtop/procargs.h ../include/glibtop/netload.h \ + ../include/glibtop/procwd.h ../include/glibtop/procaffinity.h ../include/glibtop/procio.h \ + ../include/glibtop/netlist.h ../include/glibtop/procopenfiles.h ../include/glibtop/open.h + +GTop-2.0.gir: libgtop-2.0.la +GTop_2_0_gir_AM_CPPFLAGS = GObject-2.0 +GTop_2_0_gir_CFLAGS = $(AM_CPPFLAGS) +GTop_2_0_gir_LIBS = libgtop-2.0.la +GTop_2_0_gir_FILES = $(introspection_sources) +INTROSPECTION_GIRS += GTop-2.0.gir + +girdir = $(datadir)/gir-1.0 +gir_DATA = $(INTROSPECTION_GIRS) + +typelibdir = $(libdir)/girepository-1.0 +typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) + +CLEANFILES += $(gir_DATA) $(typelib_DATA) +endif diff --git a/lib/Makefile.in b/lib/Makefile.in new file mode 100644 index 0000000..8f8a8c4 --- /dev/null +++ b/lib/Makefile.in @@ -0,0 +1,829 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@HAVE_INTROSPECTION_TRUE@am__append_1 = GTop-2.0.gir +@HAVE_INTROSPECTION_TRUE@am__append_2 = $(gir_DATA) $(typelib_DATA) +subdir = lib +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" \ + "$(DESTDIR)$(typelibdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libgtop_2_0_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(top_builddir)/sysdeps/common/libgtop_common-2.0.la \ + $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps-2.0.la \ + $(am__DEPENDENCIES_1) +am_libgtop_2_0_la_OBJECTS = init.lo open.lo close.lo command.lo \ + read.lo read_data.lo write.lo lib.lo parameter.lo sysdeps.lo \ + boxed.lo +libgtop_2_0_la_OBJECTS = $(am_libgtop_2_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgtop_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_2_0_la_LDFLAGS) $(LDFLAGS) -o \ + $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_2_0_la_SOURCES) +DIST_SOURCES = $(libgtop_2_0_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(gir_DATA) $(typelib_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +lib_LTLIBRARIES = libgtop-2.0.la +libgtop_2_0_la_SOURCES = init.c open.c close.c command.c read.c \ + read_data.c write.c lib.c parameter.c \ + sysdeps.c boxed.c + +libgtop_2_0_la_LDFLAGS = $(LT_VERSION_INFO) -export-symbols $(srcdir)/libgtop.sym -no-undefined +libgtop_2_0_la_LIBADD = $(GLIB_LIBS) $(top_builddir)/sysdeps/common/libgtop_common-2.0.la $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps-2.0.la $(sysdeps_suid_lib) +BUILT_SOURCES = lib.c +EXTRA_DIST = lib.pl libgtop.sym +CLEANFILES = lib.c $(am__append_2) +INTROSPECTION_GIRS = $(am__append_1) +INTROSPECTION_SCANNER_ARGS = --accept-unprefixed --warn-all +INTROSPECTION_COMPILER_ARGS = +@HAVE_INTROSPECTION_TRUE@introspection_sources = $(libgtop_2_0_la_SOURCES) lib.c ../glibtop.h ../libgtopconfig.h \ +@HAVE_INTROSPECTION_TRUE@ ../include/glibtop/close.h ../include/glibtop/loadavg.h ../include/glibtop/prockernel.h ../include/glibtop/procstate.h \ +@HAVE_INTROSPECTION_TRUE@ ../include/glibtop/sem_limits.h ../include/glibtop/uptime.h ../include/glibtop/command.h ../include/glibtop/mem.h ../include/glibtop/proclist.h \ +@HAVE_INTROSPECTION_TRUE@ ../include/glibtop/proctime.h ../include/glibtop/shm_limits.h ../include/glibtop/cpu.h ../include/glibtop/msg_limits.h \ +@HAVE_INTROSPECTION_TRUE@ ../include/glibtop/procmem.h ../include/glibtop/procuid.h ../include/glibtop/swap.h \ +@HAVE_INTROSPECTION_TRUE@ ../include/glibtop/procsegment.h ../include/glibtop/sysdeps.h ../include/glibtop/global.h \ +@HAVE_INTROSPECTION_TRUE@ ../include/glibtop/procsignal.h ../include/glibtop/union.h ../include/glibtop/gnuserv.h \ +@HAVE_INTROSPECTION_TRUE@ ../include/glibtop/parameter.h ../include/glibtop/mountlist.h ../include/glibtop/fsusage.h ../include/glibtop/procmap.h ../include/glibtop/signal.h \ +@HAVE_INTROSPECTION_TRUE@ ../include/glibtop/sysinfo.h ../include/glibtop/ppp.h ../include/glibtop/procargs.h ../include/glibtop/netload.h \ +@HAVE_INTROSPECTION_TRUE@ ../include/glibtop/procwd.h ../include/glibtop/procaffinity.h ../include/glibtop/procio.h \ +@HAVE_INTROSPECTION_TRUE@ ../include/glibtop/netlist.h ../include/glibtop/procopenfiles.h ../include/glibtop/open.h + +@HAVE_INTROSPECTION_TRUE@GTop_2_0_gir_AM_CPPFLAGS = GObject-2.0 +@HAVE_INTROSPECTION_TRUE@GTop_2_0_gir_CFLAGS = $(AM_CPPFLAGS) +@HAVE_INTROSPECTION_TRUE@GTop_2_0_gir_LIBS = libgtop-2.0.la +@HAVE_INTROSPECTION_TRUE@GTop_2_0_gir_FILES = $(introspection_sources) +@HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0 +@HAVE_INTROSPECTION_TRUE@gir_DATA = $(INTROSPECTION_GIRS) +@HAVE_INTROSPECTION_TRUE@typelibdir = $(libdir)/girepository-1.0 +@HAVE_INTROSPECTION_TRUE@typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgtop-2.0.la: $(libgtop_2_0_la_OBJECTS) $(libgtop_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_2_0_la_LINK) -rpath $(libdir) $(libgtop_2_0_la_OBJECTS) $(libgtop_2_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/boxed.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/command.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parameter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read_data.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysdeps.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-girDATA: $(gir_DATA) + @$(NORMAL_INSTALL) + @list='$(gir_DATA)'; test -n "$(girdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(girdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(girdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(girdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(girdir)" || exit $$?; \ + done + +uninstall-girDATA: + @$(NORMAL_UNINSTALL) + @list='$(gir_DATA)'; test -n "$(girdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(girdir)'; $(am__uninstall_files_from_dir) +install-typelibDATA: $(typelib_DATA) + @$(NORMAL_INSTALL) + @list='$(typelib_DATA)'; test -n "$(typelibdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(typelibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(typelibdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(typelibdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(typelibdir)" || exit $$?; \ + done + +uninstall-typelibDATA: + @$(NORMAL_UNINSTALL) + @list='$(typelib_DATA)'; test -n "$(typelibdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(typelibdir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(typelibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-girDATA install-typelibDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-girDATA uninstall-libLTLIBRARIES \ + uninstall-typelibDATA + +.MAKE: all check install install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-girDATA install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip install-typelibDATA installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-girDATA \ + uninstall-libLTLIBRARIES uninstall-typelibDATA + +.PRECIOUS: Makefile + + +lib.c: lib.pl $(top_builddir)/config.h $(top_srcdir)/features.def + $(PERL) $(srcdir)/lib.pl < $(top_srcdir)/features.def > lib-t + mv lib-t lib.c + +-include $(INTROSPECTION_MAKEFILE) + +@HAVE_INTROSPECTION_TRUE@GTop-2.0.gir: libgtop-2.0.la + +# 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: diff --git a/lib/boxed.c b/lib/boxed.c new file mode 100644 index 0000000..cfeff2b --- /dev/null +++ b/lib/boxed.c @@ -0,0 +1,47 @@ +/* Copyright (C) 2011 Red Hat + This file is part of LibGTop 1.0. + + Contributed by Jasper St. Pierre , November 2011 + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#define DEFINE_BOXED(type) \ + static type * \ + type##_copy (type *p) \ + { \ + type *n = g_new (type, 1); \ + memcpy (n, p, sizeof (type)); \ + return n; \ + } \ + \ + G_DEFINE_BOXED_TYPE (type, \ + type, \ + type##_copy, \ + g_free) + +DEFINE_BOXED (glibtop); +DEFINE_BOXED (glibtop_map_entry); +DEFINE_BOXED (glibtop_proc_map); +DEFINE_BOXED (glibtop_open_files_entry); +DEFINE_BOXED (glibtop_proc_open_files); +DEFINE_BOXED (glibtop_mountentry); +DEFINE_BOXED (glibtop_mountlist); diff --git a/lib/close.c b/lib/close.c new file mode 100644 index 0000000..46bf27f --- /dev/null +++ b/lib/close.c @@ -0,0 +1,50 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include + +/* Closes server. */ + +void +glibtop_close_r (glibtop *server) +{ + switch (server->method) { + case GLIBTOP_METHOD_UNIX: + case GLIBTOP_METHOD_INET: + glibtop_call_l (server, GLIBTOP_CMND_QUIT, + 0, NULL, 0, NULL); + + if (close (server->socket)) + glibtop_warn_io ("close"); + + break; + case GLIBTOP_METHOD_PIPE: + kill (server->pid, SIGKILL); + close (server->input [0]); + close (server->output [1]); + break; + } +} diff --git a/lib/command.c b/lib/command.c new file mode 100644 index 0000000..b6ccf1f --- /dev/null +++ b/lib/command.c @@ -0,0 +1,110 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +#include + +void * +glibtop_call_l (glibtop *server, unsigned command, size_t send_size, + const void *send_buf, size_t recv_size, void *recv_buf) +{ + glibtop_command cmnd = {0}; + glibtop_response response = {0}; + + glibtop_init_r (&server, 0, 0); + + g_assert(command >= GLIBTOP_CMND_QUIT && command < GLIBTOP_MAX_CMND); + + switch (command) { +#define CHECK_CMND(CMND) case (CMND): glibtop_debug("CALL: command %s sending %lu bytes", #CMND, (unsigned long)send_size); break + CHECK_CMND(GLIBTOP_CMND_QUIT); + CHECK_CMND(GLIBTOP_CMND_SYSDEPS); + CHECK_CMND(GLIBTOP_CMND_CPU); + CHECK_CMND(GLIBTOP_CMND_MEM); + CHECK_CMND(GLIBTOP_CMND_SWAP); + CHECK_CMND(GLIBTOP_CMND_UPTIME); + CHECK_CMND(GLIBTOP_CMND_LOADAVG); + CHECK_CMND(GLIBTOP_CMND_SHM_LIMITS); + CHECK_CMND(GLIBTOP_CMND_MSG_LIMITS); + CHECK_CMND(GLIBTOP_CMND_SEM_LIMITS); + CHECK_CMND(GLIBTOP_CMND_PROCLIST); + CHECK_CMND(GLIBTOP_CMND_PROC_STATE); + CHECK_CMND(GLIBTOP_CMND_PROC_UID); + CHECK_CMND(GLIBTOP_CMND_PROC_MEM); + CHECK_CMND(GLIBTOP_CMND_PROC_TIME); + CHECK_CMND(GLIBTOP_CMND_PROC_SIGNAL); + CHECK_CMND(GLIBTOP_CMND_PROC_KERNEL); + CHECK_CMND(GLIBTOP_CMND_PROC_SEGMENT); + CHECK_CMND(GLIBTOP_CMND_PROC_ARGS); + CHECK_CMND(GLIBTOP_CMND_PROC_MAP); + CHECK_CMND(GLIBTOP_CMND_MOUNTLIST); + CHECK_CMND(GLIBTOP_CMND_FSUSAGE); + CHECK_CMND(GLIBTOP_CMND_NETLOAD); + CHECK_CMND(GLIBTOP_CMND_PPP); + CHECK_CMND(GLIBTOP_CMND_NETLIST); + CHECK_CMND(GLIBTOP_CMND_PROC_OPEN_FILES); + CHECK_CMND(GLIBTOP_CMND_PROC_WD); + CHECK_CMND(GLIBTOP_CMND_PROC_AFFINITY); + CHECK_CMND(GLIBTOP_CMND_PROC_IO); + default: + glibtop_error_r(server, "CALL: command UNKNOWN(%d) sending %lu bytes", command, (unsigned long)send_size); break; + } +#undef CHECK_CMND + + cmnd.command = command; + + /* If send_size is less than _GLIBTOP_PARAM_SIZE (normally 16 Bytes), we + * send it together with command, so we only need one system call instead + * of two. */ + + if (send_size <= _GLIBTOP_PARAM_SIZE) { + memcpy (cmnd.parameter, send_buf, send_size); + cmnd.size = send_size; + } else { + cmnd.data_size = send_size; + } + + glibtop_write_l (server, sizeof (glibtop_command), &cmnd); + + glibtop_read_l (server, sizeof (glibtop_response), &response); + + glibtop_debug ("RESPONSE: offset=%lu - data_size=%lu", + response.offset, response.data_size); + + if (recv_buf) + memcpy (recv_buf, ((char *) &response) + response.offset, + recv_size); + + if (response.data_size) { + void *ptr = g_malloc (response.data_size); + + glibtop_read_l (server, response.data_size, ptr); + + return ptr; + } + + return NULL; +} diff --git a/lib/init.c b/lib/init.c new file mode 100644 index 0000000..2a52185 --- /dev/null +++ b/lib/init.c @@ -0,0 +1,256 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + + +#ifndef DEFAULT_PORT +#define DEFAULT_PORT 42800 +#endif + +static glibtop _glibtop_global_server; +glibtop *glibtop_global_server = &_glibtop_global_server; + +static void +_init_server (glibtop *server, const unsigned features) +{ + char *command, *temp; + + /* Try to get server command, but don't override if already + * set via glibtop_set_parameter () */ + + if (server->server_command == NULL) { + const char *temp = getenv ("LIBGTOP_SERVER") ? + getenv ("LIBGTOP_SERVER") : LIBGTOP_SERVER; + + server->server_command = g_strdup (temp); + } + + if (server->server_rsh == NULL) { + const char *temp = getenv ("LIBGTOP_RSH") ? + getenv ("LIBGTOP_RSH") : "/usr/bin/ssh"; + + server->server_rsh = g_strdup (temp); + } + + /* Try to get server method, but don't override if already + * set via glibtop_set_parameter () */ + + if (server->method) return; + + /* If server->command doesn't start with a colon, then it is + * the full pathname of the server executable. */ + + if (server->server_command [0] != ':') { + if (features & glibtop_server_features) { + /* We really need the server. */ + server->method = GLIBTOP_METHOD_PIPE; + } else { + /* Fine. No server is needed, so we call the + * sysdeps functions directly. */ + server->method = GLIBTOP_METHOD_DIRECT; + } + + return; + } + + + /* If the first character of 'server_command' is a colon, + * the first field is the method to connect to the server. */ + + /* Everything up to the next colon is the method. */ + + command = g_strdup (server->server_command+1); + temp = strstr (command, ":"); + if (temp) *temp = 0; + + /* Dispatch method. */ + + if (!strcmp (command, "direct")) { + /* Use sysdeps dir instead of connecting to server + * even if using the server would be required on + * the current system. */ + server->method = GLIBTOP_METHOD_DIRECT; + + } else if (!strcmp (command, "inet")) { + + server->method = GLIBTOP_METHOD_INET; + + /* Connect to internet server. */ + + if (temp == NULL) { + /* If no value was set, we use 'localhost'. */ + if (server->server_host == NULL) + server->server_host = g_strdup ("localhost"); + } else { + char *temp2 = strstr (temp+1, ":"); + if (temp2) *temp2 = 0; + + /* Override default. */ + if (server->server_host) + g_free ((char *) server->server_host); + + server->server_host = g_strdup (temp+1); + + temp = temp2; + } + + if (temp == NULL) { + /* If no value was set, we use DEFAULT_PORT. */ + if (server->server_port == 0) + server->server_port = DEFAULT_PORT; + } else { + char *temp2 = strstr (temp+1, ":"); + if (temp2) *temp2 = 0; + + if (sscanf (temp+1, "%ld", &server->server_port) != 1) + server->server_port = DEFAULT_PORT; + + temp = temp2 ? temp2 + 1 : temp2; + } + + } else if (!strcmp (command, "unix")) { + + /* Connect to unix domain socket. */ + server->method = GLIBTOP_METHOD_UNIX; + + } else if (!strcmp (command, "pipe")) { + + /* Open pipe to server. */ + server->method = GLIBTOP_METHOD_PIPE; + server->server_command = g_strdup(LIBGTOP_SERVER); + } else { + + glibtop_error_r (server, "Unknown server method '%s'", + server->server_command+1); + + } + + g_free (command); +} + +glibtop * +glibtop_init_r (glibtop **server_ptr, unsigned long features, unsigned flags) +{ + glibtop *server; + + if (server_ptr == NULL) + return NULL; + + if (*server_ptr == NULL) + *server_ptr = glibtop_global_server; + + server = *server_ptr; + + /* Should we do the initialization? */ + + if (flags & GLIBTOP_INIT_NO_INIT) + return server; + + /* Do the initialization, but only if not already initialized. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_INIT) == 0) { + + glibtop_machine_new (server); + + if (flags & GLIBTOP_FEATURES_EXCEPT) + features = ~features & GLIBTOP_SYSDEPS_ALL; + + if (features == 0) + features = GLIBTOP_SYSDEPS_ALL; + + if (flags & GLIBTOP_FEATURES_NO_SERVER) { + server->method = GLIBTOP_METHOD_DIRECT; + features = 0; + } + + server->features = features; + + _init_server (server, features); + + server->flags |= _GLIBTOP_INIT_STATE_INIT; + + switch (server->method) { + case GLIBTOP_METHOD_PIPE: + case GLIBTOP_METHOD_UNIX: + if (glibtop_server_features & features) + break; + + server->method = GLIBTOP_METHOD_DIRECT; + break; + } + } + + /* Should we open the server? */ + + if (flags & GLIBTOP_INIT_NO_OPEN) + return server; + + /* Open server, but only if not already opened. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_OPEN) == 0) + glibtop_open_l (server, "glibtop", + features, flags); + + return server; +} + +glibtop * +glibtop_init_s (glibtop **server_ptr, unsigned long features, unsigned flags) +{ + glibtop *server; + const _glibtop_init_func_t *init_fkt; + + glibtop_debug("init_s with features=%#0lx and flags=%#0x", features, flags); + + if (server_ptr == NULL) + return NULL; + + if (*server_ptr == NULL) + *server_ptr = glibtop_global_server; + + server = *server_ptr; + + /* Should we do the initialization? */ + + if (flags & GLIBTOP_INIT_NO_INIT) + return server; + + /* Do the initialization, but only if not already initialized. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SYSDEPS) == 0) { + glibtop_open_s (server, "glibtop", features, flags); + + for (init_fkt = _glibtop_init_hook_s; *init_fkt; init_fkt++) + (*init_fkt) (server); + + server->flags |= _GLIBTOP_INIT_STATE_SYSDEPS; + } + + return server; +} diff --git a/lib/lib.c b/lib/lib.c new file mode 100644 index 0000000..914307c --- /dev/null +++ b/lib/lib.c @@ -0,0 +1,1094 @@ +/* lib.c */ +/* This is a generated file. Please modify `lib.pl' */ + +#include + +#include +#include +#include + +#include +#include +#include + +#include + +/* Some required fields are missing. */ + +static void +_glibtop_missing_feature (glibtop *server, const char *feature, + const guint64 present, guint64 *required) +{ + guint64 old_required = *required; + + /* Return if we have all required fields. */ + if ((~present & old_required) == 0) + return; + + switch (server->error_method) { + case GLIBTOP_ERROR_METHOD_WARN_ONCE: + *required &= present; + case GLIBTOP_ERROR_METHOD_WARN: + glibtop_warn_r (server, + _("glibtop_get_%s (): Client requested " + "field mask %05lx, but only have %05lx."), + feature, (unsigned long) old_required, + (unsigned long) present); + break; + case GLIBTOP_ERROR_METHOD_ABORT: + glibtop_error_r (server, + _("glibtop_get_%s (): Client requested " + "field mask %05lx, but only have %05lx."), + feature, (unsigned long) old_required, + (unsigned long) present); + break; + } +} + +/* Library functions. */ + +void +glibtop_get_cpu_l (glibtop *server, glibtop_cpu *buf) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_CPU), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_CPU))) + { + const void *send_ptr = NULL; + const size_t send_size = 0; + + glibtop_call_l (server, GLIBTOP_CMND_CPU, + send_size, send_ptr, + sizeof (glibtop_cpu), buf); + } else { +#if (!GLIBTOP_SUID_CPU) + glibtop_get_cpu_s (server, buf); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_cpu"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.cpu) + _glibtop_missing_feature (server, "cpu", buf->flags, + &server->required.cpu); +} + +void +glibtop_get_mem_l (glibtop *server, glibtop_mem *buf) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_MEM), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_MEM))) + { + const void *send_ptr = NULL; + const size_t send_size = 0; + + glibtop_call_l (server, GLIBTOP_CMND_MEM, + send_size, send_ptr, + sizeof (glibtop_mem), buf); + } else { +#if (!GLIBTOP_SUID_MEM) + glibtop_get_mem_s (server, buf); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_mem"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.mem) + _glibtop_missing_feature (server, "mem", buf->flags, + &server->required.mem); +} + +void +glibtop_get_swap_l (glibtop *server, glibtop_swap *buf) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_SWAP), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_SWAP))) + { + const void *send_ptr = NULL; + const size_t send_size = 0; + + glibtop_call_l (server, GLIBTOP_CMND_SWAP, + send_size, send_ptr, + sizeof (glibtop_swap), buf); + } else { +#if (!GLIBTOP_SUID_SWAP) + glibtop_get_swap_s (server, buf); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_swap"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.swap) + _glibtop_missing_feature (server, "swap", buf->flags, + &server->required.swap); +} + +void +glibtop_get_uptime_l (glibtop *server, glibtop_uptime *buf) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_UPTIME), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_UPTIME))) + { + const void *send_ptr = NULL; + const size_t send_size = 0; + + glibtop_call_l (server, GLIBTOP_CMND_UPTIME, + send_size, send_ptr, + sizeof (glibtop_uptime), buf); + } else { +#if (!GLIBTOP_SUID_UPTIME) + glibtop_get_uptime_s (server, buf); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_uptime"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.uptime) + _glibtop_missing_feature (server, "uptime", buf->flags, + &server->required.uptime); +} + +void +glibtop_get_loadavg_l (glibtop *server, glibtop_loadavg *buf) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_LOADAVG), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_LOADAVG))) + { + const void *send_ptr = NULL; + const size_t send_size = 0; + + glibtop_call_l (server, GLIBTOP_CMND_LOADAVG, + send_size, send_ptr, + sizeof (glibtop_loadavg), buf); + } else { +#if (!GLIBTOP_SUID_LOADAVG) + glibtop_get_loadavg_s (server, buf); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_loadavg"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.loadavg) + _glibtop_missing_feature (server, "loadavg", buf->flags, + &server->required.loadavg); +} + +void +glibtop_get_shm_limits_l (glibtop *server, glibtop_shm_limits *buf) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_SHM_LIMITS), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_SHM_LIMITS))) + { + const void *send_ptr = NULL; + const size_t send_size = 0; + + glibtop_call_l (server, GLIBTOP_CMND_SHM_LIMITS, + send_size, send_ptr, + sizeof (glibtop_shm_limits), buf); + } else { +#if (!GLIBTOP_SUID_SHM_LIMITS) + glibtop_get_shm_limits_s (server, buf); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_shm_limits"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.shm_limits) + _glibtop_missing_feature (server, "shm_limits", buf->flags, + &server->required.shm_limits); +} + +void +glibtop_get_msg_limits_l (glibtop *server, glibtop_msg_limits *buf) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_MSG_LIMITS), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_MSG_LIMITS))) + { + const void *send_ptr = NULL; + const size_t send_size = 0; + + glibtop_call_l (server, GLIBTOP_CMND_MSG_LIMITS, + send_size, send_ptr, + sizeof (glibtop_msg_limits), buf); + } else { +#if (!GLIBTOP_SUID_MSG_LIMITS) + glibtop_get_msg_limits_s (server, buf); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_msg_limits"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.msg_limits) + _glibtop_missing_feature (server, "msg_limits", buf->flags, + &server->required.msg_limits); +} + +void +glibtop_get_sem_limits_l (glibtop *server, glibtop_sem_limits *buf) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_SEM_LIMITS), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_SEM_LIMITS))) + { + const void *send_ptr = NULL; + const size_t send_size = 0; + + glibtop_call_l (server, GLIBTOP_CMND_SEM_LIMITS, + send_size, send_ptr, + sizeof (glibtop_sem_limits), buf); + } else { +#if (!GLIBTOP_SUID_SEM_LIMITS) + glibtop_get_sem_limits_s (server, buf); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_sem_limits"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.sem_limits) + _glibtop_missing_feature (server, "sem_limits", buf->flags, + &server->required.sem_limits); +} + +pid_t* +glibtop_get_proclist_l (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg) +{ + pid_t* retval = (pid_t*) 0; + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PROCLIST), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PROCLIST))) + { + struct { + gint64 buf_which; + gint64 buf_arg; + } param_buf; + + param_buf.buf_which = which; + param_buf.buf_arg = arg; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + retval = glibtop_call_l (server, GLIBTOP_CMND_PROCLIST, + send_size, send_ptr, + sizeof (glibtop_proclist), buf); + } else { +#if (!GLIBTOP_SUID_PROCLIST) + retval = glibtop_get_proclist_s (server, buf, which, arg); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_proclist"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.proclist) + _glibtop_missing_feature (server, "proclist", buf->flags, + &server->required.proclist); + + /* Now we can return. */ + + return retval; +} + +void +glibtop_get_proc_state_l (glibtop *server, glibtop_proc_state *buf, + pid_t pid) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PROC_STATE), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PROC_STATE))) + { + struct { + pid_t buf_pid; + } param_buf; + + param_buf.buf_pid = pid; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + glibtop_call_l (server, GLIBTOP_CMND_PROC_STATE, + send_size, send_ptr, + sizeof (glibtop_proc_state), buf); + } else { +#if (!GLIBTOP_SUID_PROC_STATE) + glibtop_get_proc_state_s (server, buf, pid); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_proc_state"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.proc_state) + _glibtop_missing_feature (server, "proc_state", buf->flags, + &server->required.proc_state); +} + +void +glibtop_get_proc_uid_l (glibtop *server, glibtop_proc_uid *buf, + pid_t pid) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PROC_UID), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PROC_UID))) + { + struct { + pid_t buf_pid; + } param_buf; + + param_buf.buf_pid = pid; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + glibtop_call_l (server, GLIBTOP_CMND_PROC_UID, + send_size, send_ptr, + sizeof (glibtop_proc_uid), buf); + } else { +#if (!GLIBTOP_SUID_PROC_UID) + glibtop_get_proc_uid_s (server, buf, pid); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_proc_uid"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.proc_uid) + _glibtop_missing_feature (server, "proc_uid", buf->flags, + &server->required.proc_uid); +} + +void +glibtop_get_proc_mem_l (glibtop *server, glibtop_proc_mem *buf, + pid_t pid) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PROC_MEM), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PROC_MEM))) + { + struct { + pid_t buf_pid; + } param_buf; + + param_buf.buf_pid = pid; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + glibtop_call_l (server, GLIBTOP_CMND_PROC_MEM, + send_size, send_ptr, + sizeof (glibtop_proc_mem), buf); + } else { +#if (!GLIBTOP_SUID_PROC_MEM) + glibtop_get_proc_mem_s (server, buf, pid); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_proc_mem"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.proc_mem) + _glibtop_missing_feature (server, "proc_mem", buf->flags, + &server->required.proc_mem); +} + +void +glibtop_get_proc_time_l (glibtop *server, glibtop_proc_time *buf, + pid_t pid) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PROC_TIME), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PROC_TIME))) + { + struct { + pid_t buf_pid; + } param_buf; + + param_buf.buf_pid = pid; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + glibtop_call_l (server, GLIBTOP_CMND_PROC_TIME, + send_size, send_ptr, + sizeof (glibtop_proc_time), buf); + } else { +#if (!GLIBTOP_SUID_PROC_TIME) + glibtop_get_proc_time_s (server, buf, pid); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_proc_time"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.proc_time) + _glibtop_missing_feature (server, "proc_time", buf->flags, + &server->required.proc_time); +} + +void +glibtop_get_proc_signal_l (glibtop *server, glibtop_proc_signal *buf, + pid_t pid) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL))) + { + struct { + pid_t buf_pid; + } param_buf; + + param_buf.buf_pid = pid; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + glibtop_call_l (server, GLIBTOP_CMND_PROC_SIGNAL, + send_size, send_ptr, + sizeof (glibtop_proc_signal), buf); + } else { +#if (!GLIBTOP_SUID_PROC_SIGNAL) + glibtop_get_proc_signal_s (server, buf, pid); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_proc_signal"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.proc_signal) + _glibtop_missing_feature (server, "proc_signal", buf->flags, + &server->required.proc_signal); +} + +void +glibtop_get_proc_kernel_l (glibtop *server, glibtop_proc_kernel *buf, + pid_t pid) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PROC_KERNEL), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PROC_KERNEL))) + { + struct { + pid_t buf_pid; + } param_buf; + + param_buf.buf_pid = pid; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + glibtop_call_l (server, GLIBTOP_CMND_PROC_KERNEL, + send_size, send_ptr, + sizeof (glibtop_proc_kernel), buf); + } else { +#if (!GLIBTOP_SUID_PROC_KERNEL) + glibtop_get_proc_kernel_s (server, buf, pid); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_proc_kernel"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.proc_kernel) + _glibtop_missing_feature (server, "proc_kernel", buf->flags, + &server->required.proc_kernel); +} + +void +glibtop_get_proc_segment_l (glibtop *server, glibtop_proc_segment *buf, + pid_t pid) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT))) + { + struct { + pid_t buf_pid; + } param_buf; + + param_buf.buf_pid = pid; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + glibtop_call_l (server, GLIBTOP_CMND_PROC_SEGMENT, + send_size, send_ptr, + sizeof (glibtop_proc_segment), buf); + } else { +#if (!GLIBTOP_SUID_PROC_SEGMENT) + glibtop_get_proc_segment_s (server, buf, pid); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_proc_segment"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.proc_segment) + _glibtop_missing_feature (server, "proc_segment", buf->flags, + &server->required.proc_segment); +} + +char * +glibtop_get_proc_args_l (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len) +{ + char * retval = (char *) 0; + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PROC_ARGS), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PROC_ARGS))) + { + struct { + pid_t buf_pid; + unsigned buf_max_len; + } param_buf; + + param_buf.buf_pid = pid; + param_buf.buf_max_len = max_len; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + retval = glibtop_call_l (server, GLIBTOP_CMND_PROC_ARGS, + send_size, send_ptr, + sizeof (glibtop_proc_args), buf); + } else { +#if (!GLIBTOP_SUID_PROC_ARGS) + retval = glibtop_get_proc_args_s (server, buf, pid, max_len); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_proc_args"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.proc_args) + _glibtop_missing_feature (server, "proc_args", buf->flags, + &server->required.proc_args); + + /* Now we can return. */ + + return retval; +} + +glibtop_map_entry * +glibtop_get_proc_map_l (glibtop *server, glibtop_proc_map *buf, + pid_t pid) +{ + glibtop_map_entry * retval = (glibtop_map_entry *) 0; + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PROC_MAP), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PROC_MAP))) + { + struct { + pid_t buf_pid; + } param_buf; + + param_buf.buf_pid = pid; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + retval = glibtop_call_l (server, GLIBTOP_CMND_PROC_MAP, + send_size, send_ptr, + sizeof (glibtop_proc_map), buf); + } else { +#if (!GLIBTOP_SUID_PROC_MAP) + retval = glibtop_get_proc_map_s (server, buf, pid); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_proc_map"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.proc_map) + _glibtop_missing_feature (server, "proc_map", buf->flags, + &server->required.proc_map); + + /* Now we can return. */ + + return retval; +} + +glibtop_open_files_entry * +glibtop_get_proc_open_files_l (glibtop *server, glibtop_proc_open_files *buf, + pid_t pid) +{ + glibtop_open_files_entry * retval = (glibtop_open_files_entry *) 0; + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PROC_OPEN_FILES), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PROC_OPEN_FILES))) + { + struct { + pid_t buf_pid; + } param_buf; + + param_buf.buf_pid = pid; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + retval = glibtop_call_l (server, GLIBTOP_CMND_PROC_OPEN_FILES, + send_size, send_ptr, + sizeof (glibtop_proc_open_files), buf); + } else { +#if (!GLIBTOP_SUID_PROC_OPEN_FILES) + retval = glibtop_get_proc_open_files_s (server, buf, pid); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_proc_open_files"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.proc_open_files) + _glibtop_missing_feature (server, "proc_open_files", buf->flags, + &server->required.proc_open_files); + + /* Now we can return. */ + + return retval; +} + +glibtop_mountentry * +glibtop_get_mountlist_l (glibtop *server, glibtop_mountlist *buf, + int all_fs) +{ + glibtop_mountentry * retval = (glibtop_mountentry *) 0; + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_MOUNTLIST), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_MOUNTLIST))) + { + struct { + int buf_all_fs; + } param_buf; + + param_buf.buf_all_fs = all_fs; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + retval = glibtop_call_l (server, GLIBTOP_CMND_MOUNTLIST, + send_size, send_ptr, + sizeof (glibtop_mountlist), buf); + } else { + retval = glibtop_get_mountlist_s (server, buf, all_fs); + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.mountlist) + _glibtop_missing_feature (server, "mountlist", buf->flags, + &server->required.mountlist); + + /* Now we can return. */ + + return retval; +} + +void +glibtop_get_fsusage_l (glibtop *server, glibtop_fsusage *buf, + const char *mount_dir) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_FSUSAGE), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_FSUSAGE))) + { + + const void *send_ptr = mount_dir; + + const size_t send_size = + strlen (mount_dir) + 1; + + glibtop_call_l (server, GLIBTOP_CMND_FSUSAGE, + send_size, send_ptr, + sizeof (glibtop_fsusage), buf); + } else { + glibtop_get_fsusage_s (server, buf, mount_dir); + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.fsusage) + _glibtop_missing_feature (server, "fsusage", buf->flags, + &server->required.fsusage); +} + +void +glibtop_get_netload_l (glibtop *server, glibtop_netload *buf, + const char *interface) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_NETLOAD), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_NETLOAD))) + { + + const void *send_ptr = interface; + + const size_t send_size = + strlen (interface) + 1; + + glibtop_call_l (server, GLIBTOP_CMND_NETLOAD, + send_size, send_ptr, + sizeof (glibtop_netload), buf); + } else { +#if (!GLIBTOP_SUID_NETLOAD) + glibtop_get_netload_s (server, buf, interface); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_netload"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.netload) + _glibtop_missing_feature (server, "netload", buf->flags, + &server->required.netload); +} + +void +glibtop_get_ppp_l (glibtop *server, glibtop_ppp *buf, + unsigned short device) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PPP), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PPP))) + { + struct { + unsigned short buf_device; + } param_buf; + + param_buf.buf_device = device; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + glibtop_call_l (server, GLIBTOP_CMND_PPP, + send_size, send_ptr, + sizeof (glibtop_ppp), buf); + } else { +#if (!GLIBTOP_SUID_PPP) + glibtop_get_ppp_s (server, buf, device); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_ppp"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.ppp) + _glibtop_missing_feature (server, "ppp", buf->flags, + &server->required.ppp); +} + +char ** +glibtop_get_netlist_l (glibtop *server, glibtop_netlist *buf) +{ + char ** retval = (char **) 0; + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_NETLIST), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_NETLIST))) + { + const void *send_ptr = NULL; + const size_t send_size = 0; + + retval = glibtop_call_l (server, GLIBTOP_CMND_NETLIST, + send_size, send_ptr, + sizeof (glibtop_netlist), buf); + } else { +#if (!GLIBTOP_SUID_NETLIST) + retval = glibtop_get_netlist_s (server, buf); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_netlist"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.netlist) + _glibtop_missing_feature (server, "netlist", buf->flags, + &server->required.netlist); + + /* Now we can return. */ + + return retval; +} + +char ** +glibtop_get_proc_wd_l (glibtop *server, glibtop_proc_wd *buf, + pid_t pid) +{ + char ** retval = (char **) 0; + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PROC_WD), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PROC_WD))) + { + struct { + pid_t buf_pid; + } param_buf; + + param_buf.buf_pid = pid; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + retval = glibtop_call_l (server, GLIBTOP_CMND_PROC_WD, + send_size, send_ptr, + sizeof (glibtop_proc_wd), buf); + } else { +#if (!GLIBTOP_SUID_PROC_WD) + retval = glibtop_get_proc_wd_s (server, buf, pid); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_proc_wd"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.proc_wd) + _glibtop_missing_feature (server, "proc_wd", buf->flags, + &server->required.proc_wd); + + /* Now we can return. */ + + return retval; +} + +guint16* +glibtop_get_proc_affinity_l (glibtop *server, glibtop_proc_affinity *buf, + pid_t pid) +{ + guint16* retval = (guint16*) 0; + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PROC_AFFINITY), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PROC_AFFINITY))) + { + struct { + pid_t buf_pid; + } param_buf; + + param_buf.buf_pid = pid; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + retval = glibtop_call_l (server, GLIBTOP_CMND_PROC_AFFINITY, + send_size, send_ptr, + sizeof (glibtop_proc_affinity), buf); + } else { +#if (!GLIBTOP_SUID_PROC_AFFINITY) + retval = glibtop_get_proc_affinity_s (server, buf, pid); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_proc_affinity"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.proc_affinity) + _glibtop_missing_feature (server, "proc_affinity", buf->flags, + &server->required.proc_affinity); + + /* Now we can return. */ + + return retval; +} + +void +glibtop_get_proc_io_l (glibtop *server, glibtop_proc_io *buf, + pid_t pid) +{ + glibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_PROC_IO), 0); + + /* If neccessary, we ask the server for the requested + * feature. If not, we call the sysdeps function. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SERVER) && + (server->features & (1 << GLIBTOP_SYSDEPS_PROC_IO))) + { + struct { + pid_t buf_pid; + } param_buf; + + param_buf.buf_pid = pid; + + const void *send_ptr = ¶m_buf; + const size_t send_size = sizeof param_buf; + + glibtop_call_l (server, GLIBTOP_CMND_PROC_IO, + send_size, send_ptr, + sizeof (glibtop_proc_io), buf); + } else { +#if (!GLIBTOP_SUID_PROC_IO) + glibtop_get_proc_io_s (server, buf, pid); +#else + errno = ENOSYS; + glibtop_error_io_r (server, "glibtop_get_proc_io"); +#endif + } + + /* Make sure that all required fields are present. */ + + if (buf->flags & server->required.proc_io) + _glibtop_missing_feature (server, "proc_io", buf->flags, + &server->required.proc_io); +} + diff --git a/lib/lib.pl b/lib/lib.pl new file mode 100755 index 0000000..8c8baa0 --- /dev/null +++ b/lib/lib.pl @@ -0,0 +1,240 @@ +#!/usr/bin/perl + +$, = ' '; # set output field separator +$\ = "\n"; # set output record separator + +print '/* lib.c */'; +print "/* This is a generated file. Please modify `lib.pl' */"; +print ''; + +print '#include '; +print ''; +print '#include '; +print '#include '; +print '#include '; +print ''; +print '#include '; +print '#include '; +print '#include '; +print ''; +print '#include '; + +print ''; +print '/* Some required fields are missing. */'; +print ''; + +print 'static void'; +print '_glibtop_missing_feature (glibtop *server, const char *feature,'; +print "\t\t\t const guint64 present, guint64 *required)"; +print '{'; +print "\tguint64 old_required = *required;\n"; +print "\t/* Return if we have all required fields. */"; +print "\tif ((~present & old_required) == 0)"; +print "\t\treturn;\n"; +print "\tswitch (server->error_method) {"; +print "\tcase GLIBTOP_ERROR_METHOD_WARN_ONCE:"; +print "\t\t*required &= present;"; +print "\tcase GLIBTOP_ERROR_METHOD_WARN:"; +print "\t\tglibtop_warn_r (server,"; +print "\t\t\t\t_(\"glibtop_get_%s (): Client requested \""; +print "\t\t\t\t \"field mask %05lx, but only have %05lx.\"),"; +print "\t\t\t\t feature, (unsigned long) old_required,"; +print "\t\t\t\t (unsigned long) present);"; +print "\t\tbreak;"; +print "\tcase GLIBTOP_ERROR_METHOD_ABORT:"; +print "\t\tglibtop_error_r (server,"; +print "\t\t\t\t _(\"glibtop_get_%s (): Client requested \""; +print "\t\t\t\t \"field mask %05lx, but only have %05lx.\"),"; +print "\t\t\t\t feature, (unsigned long) old_required,"; +print "\t\t\t\t (unsigned long) present);"; +print "\t\tbreak;"; +print "\t}"; +print '}'; + +print ''; +print '/* Library functions. */'; +print ''; + +$convert{'long'} = 'gint64'; +$convert{'ulong'} = 'guint64'; +$convert{'pid_t'} = 'pid_t'; +$convert{'int'} = 'int'; +$convert{'ushort'} = 'unsigned short'; +$convert{'unsigned'} = 'unsigned'; + +while (<>) { + chop; # strip record separator + + if (/^[^#]/) { + &output($_); + } +} + +sub output { + local($line) = @_; + @line_fields = split(/\|/, $line, 9999); + $retval = $line_fields[0]; + $feature = $line_fields[1]; + $param_def = $line_fields[2]; + + $orig = $feature; + $feature =~ s/^@//; + $space = $feature; + $space =~ s/./ /g; + + print $retval; + if ($retval !~ /^void$/) { + $prefix = 'retval = '; + $prefix_space = ' '; + } + else { + $prefix = ''; + $prefix_space = ''; + } + + if ($param_def eq 'string') { + $call_param = ', ' . $line_fields[3]; + $param_buf = ''; + $buf_set = ''; + $param_decl = ",\n " . $space . ' const char *' . + + $line_fields[3]; + $send_ptr = "\n\tconst void *send_ptr = " . $line_fields[3] . ';'; + $send_size = "\n\tconst size_t send_size =\n\t\tstrlen (" . + + $line_fields[3] . ') + 1;'; + } + else { + $call_param = ''; + $param_decl = ''; + $send_size = ''; + $send_ptr = ''; + $param_buf = ''; + $buf_set = ''; + $nr_params = (@params = split(/:/, $param_def, 9999)); + if ($nr_params) { + $param_buf = "\t\tstruct {\n"; + } + for ($param = 0; $param < $nr_params; $param++) { + $list = $params[$param]; + $type = $params[$param]; + $type =~ s/\(.*//; + $list =~ s/^.*\(//; + $list =~ s/\)$//; + $count = (@fields = split(/,/, $list, 9999)); + + if ($count > 0) { + for ($field = 0; $field < $count; $field++) { + $param_buf .= "\t\t\t$convert{$type} buf_$fields[$field];\n"; + $buf_set .= "\t\tparam_buf.buf_$fields[$field] = $fields[$field];\n"; + } + } + + for ($field = 0; $field < $count; $field++) { + if ($param_decl eq '') { + $param_decl = ",\n " . $space . ' '; + } + else { + $param_decl = $param_decl . ', '; + } + $param_decl = $param_decl . '' . $convert{$type} . ' ' . + + $fields[$field]; + $call_param = $call_param . ', ' . $fields[$field]; + if ($send_ptr eq '') { + $send_ptr = "\t\tconst void *send_ptr = ¶m_buf;"; + } + } + } + if ($nr_params) { + $param_buf .= "\t\t} param_buf;\n"; + $send_size = "\t\tconst size_t send_size = sizeof param_buf;"; + } + else { + $send_size = "\t\tconst size_t send_size = 0;"; + } + if ($send_ptr eq '') { + $send_ptr = "\t\tconst void *send_ptr = NULL;"; + } + } + + print 'glibtop_get_' . $feature . '_l (glibtop *server, glibtop_' . + + $feature . ' *buf' . $param_decl . ')'; + + print "{"; + + if ($retval !~ /^void$/) { + print "\t" . $retval . ' retval = (' . $retval . ') 0;'; + } + + print "\tglibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_" . + + uc($feature) . '), 0);'; + + print ''; + print "\t/* If neccessary, we ask the server for the requested"; + print "\t * feature. If not, we call the sysdeps function. */"; + print ''; + + print "\tif ((server->flags & _GLIBTOP_INIT_STATE_SERVER) &&"; + print "\t (server->features & (1 << GLIBTOP_SYSDEPS_" . + + uc($feature) . ')))'; + print "\t{"; + + if ($param_buf) { + print $param_buf; + print $buf_set; + } + + print $send_ptr; + print $send_size; + print ''; + + print "\t\t" . $prefix . 'glibtop_call_l (server, GLIBTOP_CMND_' . + + uc($feature) . ','; + print "\t\t\t\t" . $prefix_space . 'send_size, send_ptr,'; + print "\t\t\t\t" . $prefix_space . 'sizeof (glibtop_' . $feature . + + '), buf);'; + + print "\t} else {"; + + if ($orig !~ /^@/) { + print '#if (!GLIBTOP_SUID_' . uc($feature) . ')'; + } + print "\t\t" . $prefix . 'glibtop_get_' . $feature . '_s (server, buf' . + + $call_param . ');'; + + if ($orig !~ /^@/) { + print '#else'; + print "\t\terrno = ENOSYS;"; + print "\t\tglibtop_error_io_r (server, \"glibtop_get_" . $feature . + + "\");"; + print '#endif'; + } + + print "\t}"; + + print ''; + print "\t/* Make sure that all required fields are present. */"; + print ''; + + print "\tif (buf->flags & server->required." . $feature . ')'; + print "\t\t_glibtop_missing_feature (server, \"" . $feature . + + "\", buf->flags,"; + print "\t\t\t\t\t &server->required." . $feature . ');'; + + if ($retval !~ /^void$/) { + print "\n\t/* Now we can return. */"; + print "\n\treturn retval;"; + } + + print '}'; + print ''; +} diff --git a/lib/libgtop.sym b/lib/libgtop.sym new file mode 100644 index 0000000..afa9d07 --- /dev/null +++ b/lib/libgtop.sym @@ -0,0 +1,79 @@ +glibtop_call_l +glibtop_close +glibtop_close_r +glibtop_get_cpu +glibtop_get_cpu_l +glibtop_get_fsusage +glibtop_get_fsusage_l +glibtop_get_loadavg +glibtop_get_loadavg_l +glibtop_get_mem +glibtop_get_mem_l +glibtop_get_mountlist +glibtop_get_mountlist_l +glibtop_get_msg_limits +glibtop_get_msg_limits_l +glibtop_get_netlist +glibtop_get_netlist_l +glibtop_get_netload +glibtop_get_netload_l +glibtop_get_parameter_l +glibtop_get_ppp +glibtop_get_ppp_l +glibtop_get_proc_args +glibtop_get_proc_args_l +glibtop_get_proc_argv +glibtop_get_proc_argv_l +glibtop_get_proc_kernel +glibtop_get_proc_kernel_l +glibtop_get_proclist +glibtop_get_proclist_l +glibtop_get_proc_map +glibtop_get_proc_map_l +glibtop_get_proc_mem +glibtop_get_proc_mem_l +glibtop_get_proc_open_files +glibtop_get_proc_open_files_l +glibtop_get_proc_segment +glibtop_get_proc_segment_l +glibtop_get_proc_signal +glibtop_get_proc_signal_l +glibtop_get_proc_state +glibtop_get_proc_state_l +glibtop_get_proc_time +glibtop_get_proc_time_l +glibtop_get_proc_uid +glibtop_get_proc_uid_l +glibtop_get_proc_wd +glibtop_get_proc_wd_l +glibtop_get_sem_limits +glibtop_get_sem_limits_l +glibtop_get_shm_limits +glibtop_get_shm_limits_l +glibtop_get_proc_affinity +glibtop_get_proc_affinity_l +glibtop_get_proc_io +glibtop_get_proc_io_l +glibtop_get_swap +glibtop_get_swap_l +glibtop_get_sysdeps +glibtop_get_sysdeps_r +glibtop_get_sysinfo +glibtop_get_uptime +glibtop_get_uptime_l +glibtop_global_server +glibtop_init +glibtop_init_r +glibtop_internet_addr +glibtop_make_connection +glibtop_open_l +glibtop_server_features +glibtop_set_parameter_l +glibtop_sys_siglist +glibtop_mountlist_get_type +glibtop_mountentry_get_type +glibtop_open_files_entry_get_type +glibtop_proc_open_files_get_type +glibtop_map_entry_get_type +glibtop_proc_map_get_type +glibtop_get_type diff --git a/lib/open.c b/lib/open.c new file mode 100644 index 0000000..6f0b314 --- /dev/null +++ b/lib/open.c @@ -0,0 +1,166 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* Opens pipe to gtop server. Returns 0 on success and -1 on error. */ + +void +glibtop_open_l (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags) +{ + int connect_type; + + server->name = program_name; + + /* It is important to set _GLIBTOP_INIT_STATE_OPEN here when we + * do recursive calls to glibtop_init_r (). */ + + server->flags |= _GLIBTOP_INIT_STATE_OPEN; + + server->error_method = GLIBTOP_ERROR_METHOD_DEFAULT; + + glibtop_debug ("SIZEOF: %zu - %zu - %zu - %zu - %zu - %zu", + sizeof (glibtop_command), sizeof (glibtop_response), + sizeof (glibtop_mountentry), sizeof (glibtop_union), + sizeof (glibtop_sysdeps), sizeof (glibtop_response_union)); + + switch (server->method) { + case GLIBTOP_METHOD_DIRECT: + server->features = 0; + break; + case GLIBTOP_METHOD_INET: + glibtop_debug ("Connecting to '%s' port %ld.", + server->server_host, server->server_port); + + connect_type = glibtop_make_connection + (server->server_host, server->server_port, + &server->socket); + + glibtop_debug ("Connect Type is %d.", connect_type); + + server->flags |= _GLIBTOP_INIT_STATE_SERVER; + + server->features = -1; + break; + case GLIBTOP_METHOD_UNIX: + glibtop_debug ("Connecting to Unix Domain Socket."); + + connect_type = glibtop_make_connection + ("unix", 0, &server->socket); + + glibtop_debug ("Connect Type is %d.", connect_type); + + server->flags |= _GLIBTOP_INIT_STATE_SERVER; + + server->features = -1; + break; + case GLIBTOP_METHOD_PIPE: + glibtop_debug ("Opening pipe to server (%s).", + server->server_command); + + if (pipe (server->input) || pipe (server->output)) + glibtop_error_io_r (server, "cannot make a pipe"); + + server->pid = fork (); + + if (server->pid < 0) { + glibtop_error_io_r (server, "fork failed"); + } else if (server->pid == 0) { + close (0); close (1); + close (server->input [0]); close (server->output [1]); + dup2 (server->input [1], 1); + dup2 (server->output [0], 0); + execl (server->server_command, "libgtop-server", NULL); + glibtop_error_io_r (server, "execl (%s)", + server->server_command); + _exit (2); + } + + close (server->input [1]); + close (server->output [0]); + + server->flags |= _GLIBTOP_INIT_STATE_SERVER; + + server->features = -1; + break; + } + + /* If the server has been started, ask it for its features. */ + + if (server->flags & _GLIBTOP_INIT_STATE_SERVER) { + char version [BUFSIZ], buffer [BUFSIZ]; + glibtop_sysdeps sysdeps; + size_t size, nbytes; + + /* First check whether the server version is correct. */ + + sprintf (version, LIBGTOP_VERSION_STRING, + LIBGTOP_VERSION, LIBGTOP_SERVER_VERSION, + (guint) sizeof (glibtop_command), + (guint) sizeof (glibtop_response), + (guint) sizeof (glibtop_union), + (guint) sizeof (glibtop_sysdeps)); + + size = strlen (version) + 1; + + glibtop_read_l (server, sizeof (nbytes), &nbytes); + + if (nbytes != size) + glibtop_error_r (server, + "Requested %u bytes but got %u.", + (unsigned)size, (unsigned)nbytes); + + glibtop_read_l (server, nbytes, buffer); + + if (memcmp (version, buffer, size)) + glibtop_error_r (server, "server version is not %s", + LIBGTOP_VERSION); + + /* Now ask it for its features. */ + + glibtop_call_l (server, GLIBTOP_CMND_SYSDEPS, 0, NULL, + sizeof (glibtop_sysdeps), &sysdeps); + + server->features = sysdeps.features; + + memcpy (&server->sysdeps, &sysdeps, sizeof (glibtop_sysdeps)); + + glibtop_debug ("Server features are %#0lx.", + server->features); + } + + /* In any case, we call the open functions of our own sysdeps + * directory. */ + + glibtop_debug ("Calling sysdeps open function."); + + glibtop_init_s (&server, features, flags); +} diff --git a/lib/parameter.c b/lib/parameter.c new file mode 100644 index 0000000..00fedbe --- /dev/null +++ b/lib/parameter.c @@ -0,0 +1,98 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#define _write_data(ptr,size) \ + if ((data_ptr == NULL) || (data_size < size)) return -size; \ + if (ptr == NULL) { char * const p = data_ptr; *p = '\0'; return 1; } \ + memcpy (data_ptr, ptr, size); \ + return size; + +#define _check_data(size) \ + if ((data_ptr == NULL) || (data_size != size)) { \ + glibtop_warn_r (server, "glibtop_set_parameter (%u): " \ + "Expected %lu bytes but got %lu.", \ + (unsigned) parameter, (unsigned long) size, (unsigned long) data_size); \ + return; \ + } + +#define _strlen(ptr) (ptr ? strlen (ptr) : 0) + +size_t +glibtop_get_parameter_l (glibtop *server, const unsigned parameter, + void *data_ptr, size_t data_size) +{ + switch (parameter) { + case GLIBTOP_PARAM_METHOD: + _write_data (&server->method, + sizeof (server->method)); + case GLIBTOP_PARAM_FEATURES: + _write_data (&server->features, + sizeof (server->features)); + case GLIBTOP_PARAM_COMMAND: + _write_data (server->server_command, + _strlen(server->server_command)); + case GLIBTOP_PARAM_HOST: + _write_data (server->server_host, + _strlen(server->server_host)); + case GLIBTOP_PARAM_PORT: + _write_data (&server->server_port, + sizeof (server->server_port)); + case GLIBTOP_PARAM_ERROR_METHOD: + _write_data (&server->error_method, + sizeof (server->error_method)); + case GLIBTOP_PARAM_REQUIRED: + _write_data (&server->required, + sizeof (server->required)); + } + + return 0; +} + +void +glibtop_set_parameter_l (glibtop *server, const unsigned parameter, + const void *data_ptr, size_t data_size) +{ + switch (parameter) { + case GLIBTOP_PARAM_METHOD: + _check_data (sizeof (server->method)); + memcpy (&server->method, data_ptr, data_size); + break; + case GLIBTOP_PARAM_FEATURES: + /* You should not be allowed to set this field. */ + glibtop_warn_r (server, "glibtop_set_parameter (%u): " \ + "Cannot modify read-only value.", + parameter); + break; + case GLIBTOP_PARAM_ERROR_METHOD: + _check_data (sizeof (server->error_method)); + memcpy (&server->error_method, data_ptr, data_size); + break; + case GLIBTOP_PARAM_REQUIRED: + _check_data (sizeof (server->required)); + memcpy (&server->required, data_ptr, data_size); + break; + } +} diff --git a/lib/read.c b/lib/read.c new file mode 100644 index 0000000..6e88062 --- /dev/null +++ b/lib/read.c @@ -0,0 +1,56 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + + + +void +glibtop_read_l (glibtop *server, size_t size, void *buf) +{ + int fd; + glibtop_init_r (&server, 0, 0); + + glibtop_debug("LIBRARY: really reading %d bytes.", (int)size); + + fd = server->socket ? server->socket : server->input[0]; + + while (size) { + ssize_t nread = read(fd, buf, size); + + if (nread < 0 && errno == EINTR) + continue; + + if (nread <= 0) + glibtop_error_io_r( + server, + ngettext ("read %d byte", + "read %d bytes", size), + (int)size); + + size -= nread; + buf = (char *)buf + nread; + } +} diff --git a/lib/read_data.c b/lib/read_data.c new file mode 100644 index 0000000..9ef08d8 --- /dev/null +++ b/lib/read_data.c @@ -0,0 +1,72 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include +#include +#include + +/* Reads some data from server. */ + +void * +glibtop_read_data_l (glibtop *server) +{ + size_t size; + void *ptr; + int ret; + + glibtop_init_r (&server, 0, 0); + + glibtop_debug ("LIBRARY: reading %lu data bytes.", + (unsigned long) sizeof (size_t)); + + if (server->socket) { + ret = recv (server->socket, &size, sizeof (size_t), 0); + } else { + ret = read (server->input [0], &size, sizeof (size_t)); + } + + if (ret < 0) + glibtop_error_io_r (server, _("read data size")); + + glibtop_debug ("LIBRARY: really reading %lu data bytes (ret = %d).", + (unsigned long) size, ret); + + if (!size) return NULL; + + ptr = g_malloc (size); + + if (server->socket) { + ret = recv (server->socket, ptr, size, 0); + } else { + ret = read (server->input [0], ptr, size); + } + + if (ret < 0) + glibtop_error_io_r (server, + ngettext ("read %lu byte of data", + "read %lu bytes of data", + (unsigned long) size), + (unsigned long) size); + + return ptr; +} diff --git a/lib/sysdeps.c b/lib/sysdeps.c new file mode 100644 index 0000000..e942fd4 --- /dev/null +++ b/lib/sysdeps.c @@ -0,0 +1,212 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +const unsigned long glibtop_server_features = +GLIBTOP_SUID_CPU + +GLIBTOP_SUID_MEM + +GLIBTOP_SUID_SWAP + +GLIBTOP_SUID_UPTIME + +GLIBTOP_SUID_LOADAVG + +GLIBTOP_SUID_SHM_LIMITS + +GLIBTOP_SUID_MSG_LIMITS + +GLIBTOP_SUID_SEM_LIMITS + +GLIBTOP_SUID_PROCLIST + +GLIBTOP_SUID_PROC_STATE + +GLIBTOP_SUID_PROC_UID + +GLIBTOP_SUID_PROC_MEM + +GLIBTOP_SUID_PROC_TIME + +GLIBTOP_SUID_PROC_SIGNAL + +GLIBTOP_SUID_PROC_KERNEL + +GLIBTOP_SUID_PROC_SEGMENT + +GLIBTOP_SUID_PROC_ARGS + +GLIBTOP_SUID_PROC_MAP + +GLIBTOP_SUID_NETLOAD + +GLIBTOP_SUID_NETLIST + +GLIBTOP_SUID_PROC_WD + +GLIBTOP_SUID_PROC_AFFINITY + +GLIBTOP_SUID_PPP + +GLIBTOP_SUID_PROC_IO; + +const _glibtop_init_func_t _glibtop_init_hook_s [] = { +#if !GLIBTOP_SUID_CPU + _glibtop_init_cpu_s, +#endif +#if !GLIBTOP_SUID_MEM + _glibtop_init_mem_s, +#endif +#if !GLIBTOP_SUID_SWAP + _glibtop_init_swap_s, +#endif +#if !GLIBTOP_SUID_UPTIME + _glibtop_init_uptime_s, +#endif +#if !GLIBTOP_SUID_LOADAVG + _glibtop_init_loadavg_s, +#endif +#if !GLIBTOP_SUID_SHM_LIMITS + _glibtop_init_shm_limits_s, +#endif +#if !GLIBTOP_SUID_MSG_LIMITS + _glibtop_init_msg_limits_s, +#endif +#if !GLIBTOP_SUID_SEM_LIMITS + _glibtop_init_sem_limits_s, +#endif +#if !GLIBTOP_SUID_PROCLIST + _glibtop_init_proclist_s, +#endif +#if !GLIBTOP_SUID_PROC_STATE + _glibtop_init_proc_state_s, +#endif +#if !GLIBTOP_SUID_PROC_UID + _glibtop_init_proc_uid_s, +#endif +#if !GLIBTOP_SUID_PROC_MEM + _glibtop_init_proc_mem_s, +#endif +#if !GLIBTOP_SUID_PROC_TIME + _glibtop_init_proc_time_s, +#endif +#if !GLIBTOP_SUID_PROC_SIGNAL + _glibtop_init_proc_signal_s, +#endif +#if !GLIBTOP_SUID_PROC_KERNEL + _glibtop_init_proc_kernel_s, +#endif +#if !GLIBTOP_SUID_PROC_SEGMENT + _glibtop_init_proc_segment_s, +#endif +#if !GLIBTOP_SUID_PROC_ARGS + _glibtop_init_proc_args_s, +#endif +#if !GLIBTOP_SUID_PROC_MAP + _glibtop_init_proc_map_s, +#endif +#if !GLIBTOP_SUID_NETLOAD + _glibtop_init_netload_s, +#endif +#if !GLIBTOP_SUID_NETLIST + _glibtop_init_netlist_s, +#endif +#if !GLIBTOP_SUID_PROC_WD + _glibtop_init_proc_wd_s, +#endif +#if !GLIBTOP_SUID_PROC_AFFINITY + _glibtop_init_proc_affinity_s, +#endif +#if !GLIBTOP_SUID_PPP + _glibtop_init_ppp_s, +#endif +#if !GLIBTOP_SUID_PROC_IO + _glibtop_init_proc_io_s, +#endif + NULL +}; + +const _glibtop_init_func_t _glibtop_init_hook_p [] = { +#if GLIBTOP_SUID_CPU + _glibtop_init_cpu_p, +#endif +#if GLIBTOP_SUID_MEM + _glibtop_init_mem_p, +#endif +#if GLIBTOP_SUID_SWAP + _glibtop_init_swap_p, +#endif +#if GLIBTOP_SUID_UPTIME + _glibtop_init_uptime_p, +#endif +#if GLIBTOP_SUID_LOADAVG + _glibtop_init_loadavg_p, +#endif +#if GLIBTOP_SUID_SHM_LIMITS + _glibtop_init_shm_limits_p, +#endif +#if GLIBTOP_SUID_MSG_LIMITS + _glibtop_init_msg_limits_p, +#endif +#if GLIBTOP_SUID_SEM_LIMITS + _glibtop_init_sem_limits_p, +#endif +#if GLIBTOP_SUID_PROCLIST + _glibtop_init_proclist_p, +#endif +#if GLIBTOP_SUID_PROC_STATE + _glibtop_init_proc_state_p, +#endif +#if GLIBTOP_SUID_PROC_UID + _glibtop_init_proc_uid_p, +#endif +#if GLIBTOP_SUID_PROC_MEM + _glibtop_init_proc_mem_p, +#endif +#if GLIBTOP_SUID_PROC_TIME + _glibtop_init_proc_time_p, +#endif +#if GLIBTOP_SUID_PROC_SIGNAL + _glibtop_init_proc_signal_p, +#endif +#if GLIBTOP_SUID_PROC_KERNEL + _glibtop_init_proc_kernel_p, +#endif +#if GLIBTOP_SUID_PROC_SEGMENT + _glibtop_init_proc_segment_p, +#endif +#if GLIBTOP_SUID_PROC_ARGS + _glibtop_init_proc_args_p, +#endif +#if GLIBTOP_SUID_PROC_MAP + _glibtop_init_proc_map_p, +#endif +#if GLIBTOP_SUID_NETLOAD + _glibtop_init_netload_p, +#endif +#if GLIBTOP_SUID_NETLIST + _glibtop_init_netlist_p, +#endif +#if GLIBTOP_SUID_PROC_WD + _glibtop_init_proc_wd_p, +#endif +#if GLIBTOP_SUID_PROC_AFFINITY + _glibtop_init_proc_affinity_p, +#endif +#if GLIBTOP_SUID_PPP + _glibtop_init_ppp_p, +#endif +#if GLIBTOP_SUID_PROC_IO + _glibtop_init_proc_io_p, +#endif + NULL +}; + +/* Checks which features are implemented. */ + +void +glibtop_get_sysdeps_r (glibtop *server, glibtop_sysdeps *buf) +{ + *buf = server->sysdeps; +} diff --git a/lib/write.c b/lib/write.c new file mode 100644 index 0000000..6720c7e --- /dev/null +++ b/lib/write.c @@ -0,0 +1,52 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +/* Writes some data to server. */ + +void +glibtop_write_l (glibtop *server, size_t size, void *buf) +{ + int ret; + int fd; + + glibtop_init_r (&server, 0, 0); + + if (size == 0) return; + + glibtop_debug("LIBRARY: really writing %d bytes.", (int)size); + + fd = server->socket ? server->socket : server->output[1]; + + while ((ret = write(fd, buf, size)) < 0 && errno == EINTR) + ; + + if (ret < 0) + glibtop_error_io_r (server, + ngettext("wrote %d byte", + "wrote %d bytes", size), + (int) size); +} diff --git a/libgtop-2.0.pc.in b/libgtop-2.0.pc.in new file mode 100644 index 0000000..e175332 --- /dev/null +++ b/libgtop-2.0.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libgtop +Description: Portable System Access Library +Requires: glib-2.0 +Version: @VERSION@ +Libs: -L${libdir} -lgtop-2.0 +Cflags: -I${includedir}/libgtop-2.0 + + diff --git a/libgtop-sysdeps.m4 b/libgtop-sysdeps.m4 new file mode 100644 index 0000000..421af0c --- /dev/null +++ b/libgtop-sysdeps.m4 @@ -0,0 +1,275 @@ +dnl This file is intended for use both internally in libgtop and in every program +dnl that wants to use it. +dnl +dnl It defines the following variables: +dnl +dnl * 'libgtop_sysdeps_dir' - sysdeps dir for libgtop. +dnl * 'libgtop_need_server' - is the server really needed? Defines 'LIBGTOP_NEED_SERVER' +dnl if true; defines conditional 'LIBGTOP_NEED_SERVER'. + +AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ + AC_REQUIRE([AC_CANONICAL_HOST]) + + AC_SUBST(libgtop_sysdeps_dir) + AC_SUBST(libgtop_need_server) + + AC_ARG_WITH(examples, + AS_HELP_STRING([--with-examples], + [Build the libgtop examples @<:@default=yes@:>@]),[ + build_examples="$withval"], [build_examples=yes]) + + AM_CONDITIONAL(EXAMPLES, test x"$build_examples" = xyes) + + AC_ARG_ENABLE(hacker-mode, + AS_HELP_STRING([--enable-hacker-mode], + [Enable building of unstable sysdeps]), + [hacker_mode="$enableval"], [hacker_mode=no]) + + AM_CONDITIONAL(HACKER_MODE, test x"$hacker_mode" = xyes) + + AC_MSG_CHECKING(for libgtop sysdeps directory) + + case "$host_os" in + linux*) + libgtop_sysdeps_dir=linux + libgtop_have_sysinfo=yes + libgtop_need_server=no + libgtop_sysdeps_private_mountlist=yes + libgtop_sysdeps_private_fsusage=yes + ;; + netbsd*|bsdi*) + libgtop_sysdeps_dir=bsd + libgtop_need_server=yes + libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod 2755 $(bindir)/libgtop_server2' + ;; + openbsd*) + libgtop_sysdeps_dir=openbsd + libgtop_need_server=yes + libgtop_sysdeps_private_mountlist=yes + libgtop_sysdeps_private_fsusage=yes + libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod 2555 $(bindir)/libgtop_server2' + ;; + freebsd*|kfreebsd*) + libgtop_sysdeps_dir=freebsd + libgtop_need_server=yes + libgtop_sysdeps_private_mountlist=yes + libgtop_sysdeps_private_fsusage=yes + libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod 2755 $(bindir)/libgtop_server2' + ;; + solaris*) + libgtop_sysdeps_dir=solaris + libgtop_need_server=yes + libgtop_postinstall='chgrp sys $(bindir)/libgtop_server && chmod 2755 $(bindir)/libgtop_server' + ;; + aix*) + libgtop_sysdeps_dir=aix + libgtop_need_server=yes + libgtop_have_sysinfo=yes + libgtop_postinstall='chgrp system $(bindir)/libgtop_server && chmod g+s $(bindir)/libgtop_server2' + ;; + darwin*) + libgtop_sysdeps_dir=darwin + libgtop_need_server=yes + libgtop_have_sysinfo=yes + libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod g+s $(bindir)/libgtop_server2' + ;; + cygwin*) + libgtop_sysdeps_dir=cygwin + libgtop_need_server=no + libgtop_have_sysinfo=yes + libgtop_sysdeps_private_mountlist=yes + ;; + *) + if test x$hacker_mode = xyes ; then + case "$host_os" in + sunos4*) + #Please note that this port is obsolete and not working at + #all. It is only useful for people who want to fix it ... :-) + libgtop_sysdeps_dir=sun4 + libgtop_need_server=yes + ;; + osf*) + libgtop_sysdeps_dir=osf1 + libgtop_need_server=yes + ;; + *) + libgtop_sysdeps_dir=stub + libgtop_need_server=no + ;; + esac + else + libgtop_sysdeps_dir=stub + libgtop_need_server=no + fi + ;; + esac + + test -z "$libgtop_postinstall" && libgtop_postinstall=: + + AC_MSG_RESULT($libgtop_sysdeps_dir) + + AC_SUBST(libgtop_sysdeps_dir) + AC_SUBST(libgtop_postinstall) + AC_SUBST(libgtop_have_sysinfo) + + case "$host_os" in + *bsd*) + AC_CHECK_LIB(kvm, kvm_open, KVM_LIBS=-lkvm, KVM_LIBS=) + AC_SUBST(KVM_LIBS) + + AC_CHECK_HEADERS(net/if_var.h,,, [ +#include +#include +#include ]) + AC_MSG_CHECKING([for I4B]) + AC_TRY_COMPILE([ +#include +#include + +#include +#include + +#ifdef HAVE_NET_IF_VAR_H +#include +#endif + +#include +#include + +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__FreeBSD_kernel__) +#include +#else +#include +#endif +],[ + size_t size = sizeof (struct sppp); +], have_i4b=yes, have_i4b=no) + AC_MSG_RESULT($have_i4b) + if test x$have_i4b = xyes; then + AC_DEFINE(HAVE_I4B, 1, [Define if I4B is available]) + AC_MSG_CHECKING([for I4B accounting]) + AC_TRY_COMPILE([ +#include +#include + +#include +#include + +#ifdef HAVE_NET_IF_VAR_H +#include +#endif + +#include +#include + +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__FreeBSD_kernel__) +#include +#else +#include +#endif + +#include +],[ + size_t size = sizeof (struct i4bisppp_softc); +], have_i4b_acct=yes, have_i4b_acct=no) + AC_MSG_RESULT($have_i4b_acct) + if test x$have_i4b_acct = xyes ; then + AC_DEFINE(HAVE_I4B_ACCT, 1, + [Define if I4B accounting is supported]) + else + AC_WARN([ +*** I4B accounting disabled - you won't get any PPP statistics. +*** Read "misc/i4b_acct.txt" in the LibGTop source directory +*** to see how to enable it.]) + fi + fi + + AC_MSG_CHECKING(what we need to define to get struct msginfo) + AC_CACHE_VAL(msginfo_cv_needs, + msginfo_cv_needs= + for def in nothing KERNEL _KERNEL; do + AC_COMPILE_IFELSE([AC_LANG_SOURCE([#define $def +#include +#include +#include +#include + +int +main (void) +{ + struct msginfo mi; + mi.msgmax = 0; + return 0; +}])], + [ + msginfo_cv_needs=$def + if test ${msginfo_cv_needs} = KERNEL; then + AC_DEFINE(STRUCT_MSGINFO_NEEDS_KERNEL, 1, + [Define to 1 if we need to define KERNEL to get 'struct msginfo']) + elif test ${msginfo_cv_needs} = _KERNEL; then + AC_DEFINE(STRUCT_MSGINFO_NEEDS__KERNEL, 1, + [Define to 1 if we need to define _KERNEL to get 'struct msginfo']) + fi + ] + ) + test -n "${msginfo_cv_needs}" && break + done + ) + AC_MSG_RESULT($msginfo_cv_needs) + if test -z "${msginfo_cv_needs}"; then + AC_MSG_ERROR([Could not find the definition of 'struct msginfo']) + fi + ;; + linux*) + os_major_version=`uname -r | sed 's/-pre[[0-9]]*//' | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + os_minor_version=`uname -r | sed 's/-pre[[0-9]]*//' | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + os_micro_version=`uname -r | sed 's/-pre[[0-9]]*//' | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + os_version_expr="$os_major_version 65536 * $os_minor_version 256 * + $os_micro_version + p q" + + AC_CHECK_HEADERS(linux/version.h, have_linux_version_h=yes, + have_linux_version_h=no) + + if test x$have_linux_version_h = xyes ; then + version_code=`cat /usr/include/linux/version.h | \ + grep \#define | grep LINUX_VERSION_CODE` + os_version_code=`echo $version_code | \ + sed 's/^.*LINUX_VERSION_CODE[[ \t]]*\([[0-9]]*\).*$/\1/'` + else + os_version_code=`echo "$os_version_expr" | dc` + fi + + AC_MSG_CHECKING(for Linux kernel version code) + AC_DEFINE_UNQUOTED(GLIBTOP_LINUX_VERSION_CODE, $os_version_code, + [Same as LINUX_VERSION_CODE either from or from the running kernel (if there are no configured kernel sources).]) + AC_MSG_RESULT($os_version_code) + ;; + solaris*) + os_major_version=`uname -r | sed 's/\([[0-9]]*\).\([[0-9]]*\)\.*\([[0-9]]*\)/\1/'` + os_minor_version=`uname -r | sed 's/\([[0-9]]*\).\([[0-9]]*\)\.*\([[0-9]]*\)/\2/'` + os_micro_version=`uname -r | sed 's/\([[0-9]]*\).\([[0-9]]*\)\.*\([[0-9]]*\)/\3/'` + test -z "$os_micro_version" && os_micro_version=0 + os_version_expr="$os_major_version 10000 * $os_minor_version 100 * + $os_micro_version + p q" + os_version_code=`echo "$os_version_expr" | dc` + + AC_MSG_CHECKING(for Solaris release code) + AC_DEFINE_UNQUOTED(GLIBTOP_SOLARIS_RELEASE, $os_version_code, + [Solaris release code (eg. 20501 for Solaris 2.5.1).]) + AC_MSG_RESULT($os_version_code) + ;; + esac + + AC_MSG_CHECKING(whether we need libgtop) + AC_MSG_RESULT($libgtop_need_server) + + if test x$libgtop_need_server = xyes ; then + AC_DEFINE(LIBGTOP_NEED_SERVER, 1, [Define if libgtop server is required]) + fi + + AM_CONDITIONAL(LIBGTOP_NEED_SERVER, test x$libgtop_need_server = xyes) + AM_CONDITIONAL(LIBGTOP_SYSDEPS_PRIVATE_MOUNTLIST, test x$libgtop_sysdeps_private_mountlist = xyes) + AM_CONDITIONAL(LIBGTOP_SYSDEPS_PRIVATE_FSUSAGE, test x$libgtop_sysdeps_private_fsusage = xyes) +]) + diff --git a/libgtop.doap b/libgtop.doap new file mode 100644 index 0000000..56a7d91 --- /dev/null +++ b/libgtop.doap @@ -0,0 +1,31 @@ + + + libgtop + LibGTop2 + + + + C + + + + Benoît Dejean + + bdejean + + + + + + Robert Roth + + robertroth + + + + + diff --git a/libgtop.spec b/libgtop.spec new file mode 100644 index 0000000..748dd86 --- /dev/null +++ b/libgtop.spec @@ -0,0 +1,126 @@ +# Note that this is NOT a relocatable package +%define ver 2.38.0 +%define RELEASE SNAP +%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} +%define prefix /usr + +Summary: LibGTop library +Name: libgtop +Version: %ver +Release: %rel +License: GPL +Group: X11/Libraries +Source: ftp://ftp.gnome.org/pub/GNOME/sources/libgtop/libgtop-%{ver}.tar.gz +BuildRoot: /tmp/libgtop-root +Packager: Martin Baulig +URL: http://www.home-of-linux.org/gnome/libgtop/ +Prereq: /sbin/install-info +Docdir: %{prefix}/doc + +%description + +A library that fetches information about the running system such as +cpu and memory usage, active processes etc. + +On Linux systems, these information are taken directly from the /proc +filesystem while on other systems a server is used to read those +information from /dev/kmem or whatever. + +%package devel +Summary: Libraries, includes, etc to develop LibGTop applications +Group: X11/libraries +Requires: libgtop + +%description devel +Libraries, include files, etc you can use to develop GNOME applications. + +%package examples +Summary: Examples for LibGTop +Group: X11/libraries +Requires: libgtop + +%description examples +Examples for LibGTop. + + +%changelog + +* Tue Aug 19 1998 Martin Baulig + +- released LibGTop 0.25.0 + +* Sun Aug 16 1998 Martin Baulig + +- first version of the RPM + +%prep +%setup + +%build +# Needed for snapshot releases. +if [ ! -f configure ]; then + CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh --prefix=%prefix --without-linux-table --with-libgtop-examples --with-libgtop-smp +else +%ifarch alpha + CFLAGS="$RPM_OPT_FLAGS" ./configure --host=alpha-redhat-linux --prefix=%prefix --without-linux-table --with-libgtop-inodedb --with-libgtop-examples --with-libgtop-smp +%else + CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix --without-linux-table --with-libgtop-examples --with-libgtop-smp +%endif +fi + +if [ "$SMP" != "" ]; then + (make "MAKE=make -k -j $SMP"; exit 0) + make +else + make +fi + +%install +rm -rf $RPM_BUILD_ROOT + +make prefix=$RPM_BUILD_ROOT%{prefix} install + +# +# msf - remove these as they are really supposed to come from gnome-libs +# +# martin - don't remove since they are no longer installed if build +# with GNOME +# +# rm -f $RPM_BUILD_ROOT/%{prefix}/lib/libgnomesupport.a +# rm -f $RPM_BUILD_ROOT/%{prefix}/lib/libgnomesupport.la +# rm -f $RPM_BUILD_ROOT/%{prefix}/lib/libgnomesupport.so.0 +# rm -f $RPM_BUILD_ROOT/%{prefix}/lib/libgnomesupport.so.0.0.0 + +rm -fr $RPM_BUILD_ROOT/%{prefix}/include/libgtop + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-, root, root) + +%doc RELNOTES-0.25 RELNOTES-1.0 AUTHORS ChangeLog NEWS README +%doc TODO NEWS.old copyright.txt +%doc src/inodedb/README.inodedb + +%{prefix}/lib/lib*.so.* +%{prefix}/share/* +%{prefix}/bin/* + +%files devel +%defattr(-, root, root) + +%{prefix}/lib/lib*.so +%{prefix}/lib/*a +%{prefix}/lib/*.sh +%{prefix}/lib/*.def +%{prefix}/include/* + +%files examples +%defattr(-,root,root) + +%{prefix}/libexec/libgtop diff --git a/libgtop.spec.in b/libgtop.spec.in new file mode 100644 index 0000000..5957868 --- /dev/null +++ b/libgtop.spec.in @@ -0,0 +1,126 @@ +# Note that this is NOT a relocatable package +%define ver @VERSION@ +%define RELEASE SNAP +%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} +%define prefix /usr + +Summary: LibGTop library +Name: libgtop +Version: %ver +Release: %rel +License: GPL +Group: X11/Libraries +Source: ftp://ftp.gnome.org/pub/GNOME/sources/libgtop/libgtop-%{ver}.tar.gz +BuildRoot: /tmp/libgtop-root +Packager: Martin Baulig +URL: http://www.home-of-linux.org/gnome/libgtop/ +Prereq: /sbin/install-info +Docdir: %{prefix}/doc + +%description + +A library that fetches information about the running system such as +cpu and memory usage, active processes etc. + +On Linux systems, these information are taken directly from the /proc +filesystem while on other systems a server is used to read those +information from /dev/kmem or whatever. + +%package devel +Summary: Libraries, includes, etc to develop LibGTop applications +Group: X11/libraries +Requires: libgtop + +%description devel +Libraries, include files, etc you can use to develop GNOME applications. + +%package examples +Summary: Examples for LibGTop +Group: X11/libraries +Requires: libgtop + +%description examples +Examples for LibGTop. + + +%changelog + +* Tue Aug 19 1998 Martin Baulig + +- released LibGTop 0.25.0 + +* Sun Aug 16 1998 Martin Baulig + +- first version of the RPM + +%prep +%setup + +%build +# Needed for snapshot releases. +if [ ! -f configure ]; then + CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh --prefix=%prefix --without-linux-table --with-libgtop-examples --with-libgtop-smp +else +%ifarch alpha + CFLAGS="$RPM_OPT_FLAGS" ./configure --host=alpha-redhat-linux --prefix=%prefix --without-linux-table --with-libgtop-inodedb --with-libgtop-examples --with-libgtop-smp +%else + CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix --without-linux-table --with-libgtop-examples --with-libgtop-smp +%endif +fi + +if [ "$SMP" != "" ]; then + (make "MAKE=make -k -j $SMP"; exit 0) + make +else + make +fi + +%install +rm -rf $RPM_BUILD_ROOT + +make prefix=$RPM_BUILD_ROOT%{prefix} install + +# +# msf - remove these as they are really supposed to come from gnome-libs +# +# martin - don't remove since they are no longer installed if build +# with GNOME +# +# rm -f $RPM_BUILD_ROOT/%{prefix}/lib/libgnomesupport.a +# rm -f $RPM_BUILD_ROOT/%{prefix}/lib/libgnomesupport.la +# rm -f $RPM_BUILD_ROOT/%{prefix}/lib/libgnomesupport.so.0 +# rm -f $RPM_BUILD_ROOT/%{prefix}/lib/libgnomesupport.so.0.0.0 + +rm -fr $RPM_BUILD_ROOT/%{prefix}/include/libgtop + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-, root, root) + +%doc RELNOTES-0.25 RELNOTES-1.0 AUTHORS ChangeLog NEWS README +%doc TODO NEWS.old copyright.txt +%doc src/inodedb/README.inodedb + +%{prefix}/lib/lib*.so.* +%{prefix}/share/* +%{prefix}/bin/* + +%files devel +%defattr(-, root, root) + +%{prefix}/lib/lib*.so +%{prefix}/lib/*a +%{prefix}/lib/*.sh +%{prefix}/lib/*.def +%{prefix}/include/* + +%files examples +%defattr(-,root,root) + +%{prefix}/libexec/libgtop diff --git a/libgtopconfig.h b/libgtopconfig.h new file mode 100644 index 0000000..e7e3203 --- /dev/null +++ b/libgtopconfig.h @@ -0,0 +1,8 @@ +#ifndef LIBGTOPCONFIG_H +#define LIBGTOPCONFIG_H + +#define LIBGTOP_MAJOR_VERSION 2 +#define LIBGTOP_MINOR_VERSION 38 +#define LIBGTOP_MICRO_VERSION 0 + +#endif /* LIBGTOPCONFIG_H */ diff --git a/libgtopconfig.h.in b/libgtopconfig.h.in new file mode 100644 index 0000000..c164e93 --- /dev/null +++ b/libgtopconfig.h.in @@ -0,0 +1,8 @@ +#ifndef LIBGTOPCONFIG_H +#define LIBGTOPCONFIG_H + +#define LIBGTOP_MAJOR_VERSION @LIBGTOP_MAJOR_VERSION@ +#define LIBGTOP_MINOR_VERSION @LIBGTOP_MINOR_VERSION@ +#define LIBGTOP_MICRO_VERSION @LIBGTOP_MICRO_VERSION@ + +#endif /* LIBGTOPCONFIG_H */ diff --git a/ltconfig b/ltconfig new file mode 100755 index 0000000..436acc5 --- /dev/null +++ b/ltconfig @@ -0,0 +1,3114 @@ +#! /bin/sh + +# ltconfig - Create a system-specific libtool. +# Copyright (C) 1996-1999 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# 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. + +# A lot of this script is taken from autoconf-2.10. + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} +echo=echo +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec "$SHELL" "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null`} + case X$UNAME in + *-DOS) PATH_SEPARATOR=';' ;; + *) PATH_SEPARATOR=':' ;; + esac +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string="`eval $cmd`") 2>/dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || + test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for dir in $PATH /usr/ucb; do + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running ltconfig again with it. + ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf "%s\n"' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then + # Cool, printf works + : + elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && + test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then + CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && + test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# The name of this program. +progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` + +# Constants: +PROGRAM=ltconfig +PACKAGE=libtool +VERSION=1.3.5 +TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +rm="rm -f" + +help="Try \`$progname --help' for more information." + +# Global variables: +default_ofile=libtool +can_build_shared=yes +enable_shared=yes +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +enable_static=yes +enable_fast_install=yes +enable_dlopen=unknown +enable_win32_dll=no +ltmain= +silent= +srcdir= +ac_config_guess= +ac_config_sub= +host= +nonopt= +ofile="$default_ofile" +verify_host=yes +with_gcc=no +with_gnu_ld=no +need_locks=yes +ac_ext=c +objext=o +libext=a +exeext= +cache_file= + +old_AR="$AR" +old_CC="$CC" +old_CFLAGS="$CFLAGS" +old_CPPFLAGS="$CPPFLAGS" +old_LDFLAGS="$LDFLAGS" +old_LD="$LD" +old_LN_S="$LN_S" +old_LIBS="$LIBS" +old_NM="$NM" +old_RANLIB="$RANLIB" +old_DLLTOOL="$DLLTOOL" +old_OBJDUMP="$OBJDUMP" +old_AS="$AS" + +# Parse the command line options. +args= +prev= +for option +do + case "$option" in + -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + eval "$prev=\$option" + prev= + continue + fi + + case "$option" in + --help) cat <&2 + echo "$help" 1>&2 + exit 1 + ;; + + *) + if test -z "$ltmain"; then + ltmain="$option" + elif test -z "$host"; then +# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 +# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then +# echo "$progname: warning \`$option' is not a valid host type" 1>&2 +# fi + host="$option" + else + echo "$progname: too many arguments" 1>&2 + echo "$help" 1>&2 + exit 1 + fi ;; + esac +done + +if test -z "$ltmain"; then + echo "$progname: you must specify a LTMAIN file" 1>&2 + echo "$help" 1>&2 + exit 1 +fi + +if test ! -f "$ltmain"; then + echo "$progname: \`$ltmain' does not exist" 1>&2 + echo "$help" 1>&2 + exit 1 +fi + +# Quote any args containing shell metacharacters. +ltconfig_args= +for arg +do + case "$arg" in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ltconfig_args="$ltconfig_args '$arg'" ;; + *) ltconfig_args="$ltconfig_args $arg" ;; + esac +done + +# A relevant subset of AC_INIT. + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 5 compiler messages saved in config.log +# 6 checking for... messages and results +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>>./config.log + +# NLS nuisances. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi +if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi + +if test -n "$cache_file" && test -r "$cache_file"; then + echo "loading cache $cache_file within ltconfig" + . $cache_file +fi + +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + +if test -z "$srcdir"; then + # Assume the source directory is the same one as the path to LTMAIN. + srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` + test "$srcdir" = "$ltmain" && srcdir=. +fi + +trap "$rm conftest*; exit 1" 1 2 15 +if test "$verify_host" = yes; then + # Check for config.guess and config.sub. + ac_aux_dir= + for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/config.guess; then + ac_aux_dir=$ac_dir + break + fi + done + if test -z "$ac_aux_dir"; then + echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 + echo "$help" 1>&2 + exit 1 + fi + ac_config_guess=$ac_aux_dir/config.guess + ac_config_sub=$ac_aux_dir/config.sub + + # Make sure we can run config.sub. + if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : + else + echo "$progname: cannot run $ac_config_sub" 1>&2 + echo "$help" 1>&2 + exit 1 + fi + + echo $ac_n "checking host system type""... $ac_c" 1>&6 + + host_alias=$host + case "$host_alias" in + "") + if host_alias=`$SHELL $ac_config_guess`; then : + else + echo "$progname: cannot guess host type; you must specify one" 1>&2 + echo "$help" 1>&2 + exit 1 + fi ;; + esac + host=`$SHELL $ac_config_sub $host_alias` + echo "$ac_t$host" 1>&6 + + # Make sure the host verified. + test -z "$host" && exit 1 + +elif test -z "$host"; then + echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 + echo "$help" 1>&2 + exit 1 +else + host_alias=$host +fi + +# Transform linux* to *-*-linux-gnu*, to support old configure scripts. +case "$host_os" in +linux-gnu*) ;; +linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` +esac + +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +case "$host_os" in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR cru $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +# Set a sane default for `AR'. +test -z "$AR" && AR=ar + +# Set a sane default for `OBJDUMP'. +test -z "$OBJDUMP" && OBJDUMP=objdump + +# If RANLIB is not set, then run the test. +if test "${RANLIB+set}" != "set"; then + result=no + + echo $ac_n "checking for ranlib... $ac_c" 1>&6 + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then + RANLIB="ranlib" + result="ranlib" + break + fi + done + IFS="$save_ifs" + + echo "$ac_t$result" 1>&6 +fi + +if test -n "$RANLIB"; then + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" +fi + +# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$AS" && AS=as + +# Check to see if we are using GCC. +if test "$with_gcc" != yes || test -z "$CC"; then + # If CC is not set, then try to find GCC or a usable CC. + if test -z "$CC"; then + echo $ac_n "checking for gcc... $ac_c" 1>&6 + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then + CC="gcc" + break + fi + done + IFS="$save_ifs" + + if test -n "$CC"; then + echo "$ac_t$CC" 1>&6 + else + echo "$ac_t"no 1>&6 + fi + fi + + # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". + if test -z "$CC"; then + echo $ac_n "checking for cc... $ac_c" 1>&6 + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + cc_rejected=no + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/cc || test -f $dir/cc$ac_exeext; then + if test "$dir/cc" = "/usr/ucb/cc"; then + cc_rejected=yes + continue + fi + CC="cc" + break + fi + done + IFS="$save_ifs" + if test $cc_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same name, so the bogon will be chosen + # first if we set CC to just the name; use the full file name. + shift + set dummy "$dir/cc" "$@" + shift + CC="$@" + fi + fi + + if test -n "$CC"; then + echo "$ac_t$CC" 1>&6 + else + echo "$ac_t"no 1>&6 + fi + + if test -z "$CC"; then + echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 + exit 1 + fi + fi + + # Now see if the compiler is really GCC. + with_gcc=no + echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 + echo "$progname:581: checking whether we are using GNU C" >&5 + + $rm conftest.c + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + with_gcc=yes + fi + $rm conftest.c + echo "$ac_t$with_gcc" 1>&6 +fi + +# Allow CC to be a program name with arguments. +set dummy $CC +compiler="$2" + +echo $ac_n "checking for object suffix... $ac_c" 1>&6 +$rm conftest* +echo 'int i = 1;' > conftest.c +echo "$progname:603: checking for object suffix" >& 5 +if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then + # Append any warnings to the config.log. + cat conftest.err 1>&5 + + for ac_file in conftest.*; do + case $ac_file in + *.c) ;; + *) objext=`echo $ac_file | sed -e s/conftest.//` ;; + esac + done +else + cat conftest.err 1>&5 + echo "$progname: failed program was:" >&5 + cat conftest.c >&5 +fi +$rm conftest* +echo "$ac_t$objext" 1>&6 + +echo $ac_n "checking for executable suffix... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_exeext="no" + $rm conftest* + echo 'main () { return 0; }' > conftest.c + echo "$progname:629: checking for executable suffix" >& 5 + if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then + # Append any warnings to the config.log. + cat conftest.err 1>&5 + + for ac_file in conftest.*; do + case $ac_file in + *.c | *.err | *.$objext ) ;; + *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; + esac + done + else + cat conftest.err 1>&5 + echo "$progname: failed program was:" >&5 + cat conftest.c >&5 + fi + $rm conftest* +fi +if test "X$ac_cv_exeext" = Xno; then + exeext="" +else + exeext="$ac_cv_exeext" +fi +echo "$ac_t$ac_cv_exeext" 1>&6 + +echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 +pic_flag= +special_shlib_compile_flags= +wl= +link_static_flag= +no_builtin_flag= + +if test "$with_gcc" = yes; then + wl='-Wl,' + link_static_flag='-static' + + case "$host_os" in + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + aix*) + # Below there is a dirty hack to force normal static linking with -ldl + # The problem is because libdl dynamically linked with both libc and + # libC (AIX C++ library), which obviously doesn't included in libraries + # list by gcc. This cause undefined symbols with -static flags. + # This hack allows C programs to be linked with "-static -ldl", but + # we not sure about C++ programs. + link_static_flag="$link_static_flag ${wl}-lC" + ;; + cygwin* | mingw* | os2*) + # We can build DLLs from non-PIC. + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + pic_flag='-m68020 -resident32 -malways-restore-a4' + ;; + sysv4*MP*) + if test -d /usr/nec; then + pic_flag=-Kconform_pic + fi + ;; + *) + pic_flag='-fPIC' + ;; + esac +else + # PORTME Check for PIC flags for the system compiler. + case "$host_os" in + aix3* | aix4*) + # All AIX code is PIC. + link_static_flag='-bnso -bI:/lib/syscalls.exp' + ;; + + hpux9* | hpux10* | hpux11*) + # Is there a better link_static_flag that works with the bundled CC? + wl='-Wl,' + link_static_flag="${wl}-a ${wl}archive" + pic_flag='+Z' + ;; + + irix5* | irix6*) + wl='-Wl,' + link_static_flag='-non_shared' + # PIC (with -KPIC) is the default. + ;; + + cygwin* | mingw* | os2*) + # We can build DLLs from non-PIC. + ;; + + osf3* | osf4* | osf5*) + # All OSF/1 code is PIC. + wl='-Wl,' + link_static_flag='-non_shared' + ;; + + sco3.2v5*) + pic_flag='-Kpic' + link_static_flag='-dn' + special_shlib_compile_flags='-belf' + ;; + + solaris*) + pic_flag='-KPIC' + link_static_flag='-Bstatic' + wl='-Wl,' + ;; + + sunos4*) + pic_flag='-PIC' + link_static_flag='-Bstatic' + wl='-Qoption ld ' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + pic_flag='-KPIC' + link_static_flag='-Bstatic' + wl='-Wl,' + ;; + + uts4*) + pic_flag='-pic' + link_static_flag='-Bstatic' + ;; + sysv4*MP*) + if test -d /usr/nec ;then + pic_flag='-Kconform_pic' + link_static_flag='-Bstatic' + fi + ;; + *) + can_build_shared=no + ;; + esac +fi + +if test -n "$pic_flag"; then + echo "$ac_t$pic_flag" 1>&6 + + # Check to make sure the pic_flag actually works. + echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 + $rm conftest* + echo "int some_variable = 0;" > conftest.c + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $pic_flag -DPIC" + echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 + if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then + # Append any warnings to the config.log. + cat conftest.err 1>&5 + + case "$host_os" in + hpux9* | hpux10* | hpux11*) + # On HP-UX, both CC and GCC only warn that PIC is supported... then they + # create non-PIC objects. So, if there were any warnings, we assume that + # PIC is not supported. + if test -s conftest.err; then + echo "$ac_t"no 1>&6 + can_build_shared=no + pic_flag= + else + echo "$ac_t"yes 1>&6 + pic_flag=" $pic_flag" + fi + ;; + *) + echo "$ac_t"yes 1>&6 + pic_flag=" $pic_flag" + ;; + esac + else + # Append any errors to the config.log. + cat conftest.err 1>&5 + can_build_shared=no + pic_flag= + echo "$ac_t"no 1>&6 + fi + CFLAGS="$save_CFLAGS" + $rm conftest* +else + echo "$ac_t"none 1>&6 +fi + +# Check to see if options -o and -c are simultaneously supported by compiler +echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 +$rm -r conftest 2>/dev/null +mkdir conftest +cd conftest +$rm conftest* +echo "int some_variable = 0;" > conftest.c +mkdir out +# According to Tom Tromey, Ian Lance Taylor reported there are C compilers +# that will create temporary files in the current directory regardless of +# the output directory. Thus, making CWD read-only will cause this test +# to fail, enabling locking or at least warning the user not to do parallel +# builds. +chmod -w . +save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -o out/conftest2.o" +echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 +if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then + + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s out/conftest.err; then + echo "$ac_t"no 1>&6 + compiler_c_o=no + else + echo "$ac_t"yes 1>&6 + compiler_c_o=yes + fi +else + # Append any errors to the config.log. + cat out/conftest.err 1>&5 + compiler_c_o=no + echo "$ac_t"no 1>&6 +fi +CFLAGS="$save_CFLAGS" +chmod u+w . +$rm conftest* out/* +rmdir out +cd .. +rmdir conftest +$rm -r conftest 2>/dev/null + +if test x"$compiler_c_o" = x"yes"; then + # Check to see if we can write to a .lo + echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 + $rm conftest* + echo "int some_variable = 0;" > conftest.c + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -c -o conftest.lo" + echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 +if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then + + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + echo "$ac_t"no 1>&6 + compiler_o_lo=no + else + echo "$ac_t"yes 1>&6 + compiler_o_lo=yes + fi + else + # Append any errors to the config.log. + cat conftest.err 1>&5 + compiler_o_lo=no + echo "$ac_t"no 1>&6 + fi + CFLAGS="$save_CFLAGS" + $rm conftest* +else + compiler_o_lo=no +fi + +# Check to see if we can do hard links to lock some files if needed +hard_links="nottested" +if test "$compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$ac_t$hard_links" 1>&6 + $rm conftest* + if test "$hard_links" = no; then + echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 + need_locks=warn + fi +else + need_locks=no +fi + +if test "$with_gcc" = yes; then + # Check to see if options -fno-rtti -fno-exceptions are supported by compiler + echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 + $rm conftest* + echo "int some_variable = 0;" > conftest.c + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" + echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 + if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then + + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + echo "$ac_t"no 1>&6 + compiler_rtti_exceptions=no + else + echo "$ac_t"yes 1>&6 + compiler_rtti_exceptions=yes + fi + else + # Append any errors to the config.log. + cat conftest.err 1>&5 + compiler_rtti_exceptions=no + echo "$ac_t"no 1>&6 + fi + CFLAGS="$save_CFLAGS" + $rm conftest* + + if test "$compiler_rtti_exceptions" = "yes"; then + no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' + else + no_builtin_flag=' -fno-builtin' + fi + +fi + +# Check for any special shared library compilation flags. +if test -n "$special_shlib_compile_flags"; then + echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 + if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : + else + echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 + can_build_shared=no + fi +fi + +echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 +$rm conftest* +echo 'main(){return(0);}' > conftest.c +save_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS $link_static_flag" +echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 +if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + echo "$ac_t$link_static_flag" 1>&6 +else + echo "$ac_t"none 1>&6 + link_static_flag= +fi +LDFLAGS="$save_LDFLAGS" +$rm conftest* + +if test -z "$LN_S"; then + # Check to see if we can use ln -s, or we need hard links. + echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 + $rm conftest.dat + if ln -s X conftest.dat 2>/dev/null; then + $rm conftest.dat + LN_S="ln -s" + else + LN_S=ln + fi + if test "$LN_S" = "ln -s"; then + echo "$ac_t"yes 1>&6 + else + echo "$ac_t"no 1>&6 + fi +fi + +# Make sure LD is an absolute path. +if test -z "$LD"; then + ac_prog=ld + if test "$with_gcc" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 + echo "$progname:991: checking for ld used by GCC" >&5 + ac_prog=`($CC -print-prog-name=ld) 2>&5` + 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 are not 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 $ac_n "checking for GNU ld... $ac_c" 1>&6 + echo "$progname:1015: checking for GNU ld" >&5 + else + echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 + echo "$progname:1018: checking for non-GNU ld" >&5 + fi + + 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 + 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. + if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" + fi + + if test -n "$LD"; then + echo "$ac_t$LD" 1>&6 + else + echo "$ac_t"no 1>&6 + fi + + if test -z "$LD"; then + echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 + exit 1 + fi +fi + +# Check to see if it really is or is not GNU ld. +echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 +# I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + with_gnu_ld=yes +else + with_gnu_ld=no +fi +echo "$ac_t$with_gnu_ld" 1>&6 + +# See if the linker supports building shared libraries. +echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 + +allow_undefined_flag= +no_undefined_flag= +need_lib_prefix=unknown +need_version=unknown +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +archive_cmds= +archive_expsym_cmds= +old_archive_from_new_cmds= +export_dynamic_flag_spec= +whole_archive_flag_spec= +thread_safe_flag_spec= +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no +hardcode_shlibpath_var=unsupported +runpath_var= +always_export_symbols=no +export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' +# include_expsyms should be a list of space-separated symbols to be *always* +# included in the symbol list +include_expsyms= +# exclude_expsyms can be an egrep regular expression of symbols to exclude +# it will be wrapped by ` (' and `)$', so one must not match beginning or +# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', +# as well as any symbol that contains `d'. +exclude_expsyms="_GLOBAL_OFFSET_TABLE_" +# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out +# platforms (ab)use it in PIC code, but their linkers get confused if +# the symbol is explicitly referenced. Since portable code cannot +# rely on this symbol name, it's probably fine to never include it in +# preloaded symbol tables. + +case "$host_os" in +cygwin* | mingw*) + # 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 "$with_gcc" != yes; then + with_gnu_ld=no + fi + ;; + +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case "$host_os" in + aix3* | aix4*) + # On AIX, the GNU linker is very broken + ld_shlibs=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + ;; + + amigaos*) + archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' + 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 | egrep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=yes + + # Extract the symbol export list from an `--export-all' def file, + # then regenerate the def file from the symbol export list, so that + # the compiled dll only exports the symbol export list. + # Be careful not to strip the DATA tag left by newer dlltools. + export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ + test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ + $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ + sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols' + + # If DATA tags from a recent dlltool are present, honour them! + archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ + _lt_hint=1; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \$# in + 2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;; + *) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;; + esac; + _lt_hint=`expr 1 + \$_lt_hint`; + done~ + test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ + test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ + $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ + $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ + $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' + + old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' + # can we support soname and/or expsyms with a.out? -oliva + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + case $host_os in + cygwin* | mingw*) + # dlltool doesn't understand --whole-archive et. al. + whole_archive_flag_spec= + ;; + *) + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + ;; + esac + fi +else + # PORTME fill in a description of your system's linker (not GNU ld) + case "$host_os" in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$with_gcc" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4*) + hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' + hardcode_libdir_separator=':' + if test "$with_gcc" = yes; then + 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 + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + shared_flag='-shared' + else + shared_flag='${wl}-bM:SRE' + hardcode_direct=yes + fi + allow_undefined_flag=' ${wl}-berok' + archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' + archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' + case "$host_os" in aix4.[01]|aix4.[01].*) + # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on + always_export_symbols=yes ;; + esac + ;; + + amigaos*) + archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + cygwin* | mingw*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs' + fix_srcfile_path='`cygpath -w $srcfile`' + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9* | hpux10* | hpux11*) + case "$host_os" in + hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; + *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; + esac + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_minus_L=yes # Not in the search PATH, but as the default + # location of the library. + export_dynamic_flag_spec='${wl}-E' + ;; + + irix5* | irix6*) + if test "$with_gcc" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF + fi + hardcode_libdir_flag_spec='${wl}-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + openbsd*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' + ;; + + osf3*) + if test "$with_gcc" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # As osf3* with the addition of the -msym flag + if test "$with_gcc" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + rhapsody*) + archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flags_spec='-L$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + sco3.2v5*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case "$host_os" in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts' + else + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' + hardcode_direct=yes + hardcode_minus_L=no + hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + unixware7*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac +fi +echo "$ac_t$ld_shlibs" 1>&6 +test "$ld_shlibs" = no && can_build_shared=no + +if test -z "$NM"; then + echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 + case "$NM" in + [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + NM="$ac_dir/nm -B" + break + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + NM="$ac_dir/nm -p" + break + else + NM=${NM="$ac_dir/nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + fi + fi + done + IFS="$ac_save_ifs" + test -z "$NM" && NM=nm + ;; + esac + echo "$ac_t$NM" 1>&6 +fi + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" + +# Define system-specific variables. +case "$host_os" in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" + ;; +irix*) + symcode='[BCDEGRST]' + ;; +solaris*) + symcode='[BDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then + symcode='[ABCDGISTW]' +fi + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. + global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + $rm conftest* + cat > conftest.c <&5 + if { (eval echo $progname:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then + # Now try to grab the symbols. + nlist=conftest.nm + if { echo "$progname:1657: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then + + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if egrep ' nm_test_var$' "$nlist" >/dev/null; then + if egrep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.c +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' + + cat <> conftest.c +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c + cat <<\EOF >> conftest.c + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$objext conftstm.$objext + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="conftstm.$objext" + CFLAGS="$CFLAGS$no_builtin_flag" + if { (eval echo $progname:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + pipe_works=yes + else + echo "$progname: failed program was:" >&5 + cat conftest.c >&5 + fi + LIBS="$save_LIBS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.c >&5 + fi + $rm conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + global_symbol_pipe= + fi +done +if test "$pipe_works" = yes; then + echo "${ac_t}ok" 1>&6 +else + echo "${ac_t}failed" 1>&6 +fi + +if test -z "$global_symbol_pipe"; then + global_symbol_to_cdecl= +fi + +# Check hardcoding attributes. +echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var"; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$hardcode_shlibpath_var" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +echo "$ac_t$hardcode_action" 1>&6 + + +reload_flag= +reload_cmds='$LD$reload_flag -o $output$reload_objs' +echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 +# PORTME Some linkers may need a different reload flag. +reload_flag='-r' +echo "$ac_t$reload_flag" 1>&6 +test -n "$reload_flag" && reload_flag=" $reload_flag" + +# PORTME Fill in your ld.so characteristics +library_names_spec= +libname_spec='lib$name' +soname_spec= +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +file_magic_cmd= +file_magic_test_file= +deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [regex]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given egrep regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. +echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 +case "$host_os" in +aix3*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}.so$major' + ;; + +aix4*) + version_type=linux + # AIX has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + # We preserve .a as extension for shared libraries though AIX4.2 + # and later linker supports .so + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' + shlibpath_var=LIBPATH + deplibs_check_method=pass_all + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}.so' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + deplibs_check_method=pass_all + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + file_magic_cmd=/usr/bin/file + file_magic_test_file=/shlib/libc.so + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + export_dynamic_flag_spec=-rdynamic + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw*) + version_type=windows + need_version=no + need_lib_prefix=no + if test "$with_gcc" = yes; then + library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' + else + library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' + fi + dynamic_linker='Win32 ld.exe' + deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + file_magic_cmd='${OBJDUMP} -f' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case "$version_type" in + freebsd-elf*) + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' + file_magic_cmd=/usr/bin/file + file_magic_test_file=`echo /usr/lib/libc.so*` + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + deplibs_check_method=unknown + library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case "$host_os" in + freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + dynamic_linker="$host_os dld.sl" + version_type=sunos + need_lib_prefix=no + need_version=no + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' + soname_spec='${libname}${release}.sl$major' + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + case "$host_os" in + hpux10.20*) + # TODO: Does this work for hpux-11 too? + deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + file_magic_cmd=/usr/bin/file + file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +irix5* | irix6*) + version_type=irix + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}.so.$major' + library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so' + case "$host_os" in + irix5*) + libsuff= shlibsuff= + # this will be overridden with pass_all, but let us keep it just in case + deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case "$LD" in # libtool.m4 will add one of these switches to LD + *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + file_magic_cmd=/usr/bin/file + file_magic_test_file=`echo /lib${libsuff}/libc.so*` + deplibs_check_method='pass_all' + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux-gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + deplibs_check_method=pass_all + + if test -f /lib/ld.so.1; then + dynamic_linker='GNU ld.so' + else + # Only the GNU ld.so supports shared libraries on MkLinux. + case "$host_cpu" in + powerpc*) dynamic_linker=no ;; + *) dynamic_linker='Linux ld.so' ;; + esac + fi + ;; + +netbsd*) + version_type=sunos + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' + soname_spec='${libname}${release}.so$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + ;; + +openbsd*) + version_type=sunos + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + need_version=no + fi + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + ;; + +os2*) + libname_spec='$name' + need_lib_prefix=no + library_names_spec='$libname.dll $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_version=no + soname_spec='${libname}${release}.so' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + shlibpath_var=LD_LIBRARY_PATH + # this will be overridden with pass_all, but let us keep it just in case + deplibs_check_method='file_magic COFF format alpha shared library' + file_magic_cmd=/usr/bin/file + file_magic_test_file=/shlib/libc.so + deplibs_check_method='pass_all' + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rhapsody*) + version_type=sunos + library_names_spec='${libname}.so' + soname_spec='${libname}.so' + shlibpath_var=DYLD_LIBRARY_PATH + deplibs_check_method=pass_all + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" + file_magic_cmd=/usr/bin/file + file_magic_test_file=/lib/libc.so + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + case "$host_vendor" in + sequent) + file_magic_cmd='/bin/file' + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + ncr) + deplibs_check_method='pass_all' + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + file_magic_cmd=/usr/bin/file + file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + esac + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' + soname_spec='$libname.so.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$ac_t$dynamic_linker" 1>&6 +test "$dynamic_linker" = no && can_build_shared=no + +# Report the final consequences. +echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 + +# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in +# configure.in, otherwise build static only libraries. +case "$host_os" in +cygwin* | mingw* | os2*) + if test x$can_build_shared = xyes; then + test x$enable_win32_dll = xno && can_build_shared=no + echo "checking if package supports dlls... $can_build_shared" 1>&6 + fi +;; +esac + +if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then + case "$deplibs_check_method" in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + egrep "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac +fi + +echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4*) + test "$enable_shared" = yes && enable_static=no + ;; +esac + +echo "$ac_t$enable_shared" 1>&6 + +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes + +echo "checking whether to build static libraries... $enable_static" 1>&6 + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +echo $ac_n "checking for objdir... $ac_c" 1>&6 +rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + objdir=_libs +fi +rmdir .libs 2>/dev/null +echo "$ac_t$objdir" 1>&6 + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else +if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then + lt_cv_dlopen=no lt_cv_dlopen_libs= +echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 +echo "$progname:2248: checking for dlopen in -ldl" >&5 +ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for dlopen""... $ac_c" 1>&6 +echo "$progname:2288: checking for dlopen" >&5 +if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen(); + +int main() { + +/* 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_dlopen) || defined (__stub___dlopen) +choke me +#else +dlopen(); +#endif + +; return 0; } +EOF +if { (eval echo $progname:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_dlopen=yes" +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_dlopen=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dlopen" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 +echo "$progname:2335: checking for dld_link in -ldld" >&5 +ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldld $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for shl_load""... $ac_c" 1>&6 +echo "$progname:2375: checking for shl_load" >&5 +if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load(); + +int main() { + +/* 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_shl_load) || defined (__stub___shl_load) +choke me +#else +shl_load(); +#endif + +; return 0; } +EOF +if { (eval echo $progname:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_shl_load=yes" +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_shl_load=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="shl_load" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 +echo "$progname:2423: checking for shl_load in -ldld" >&5 +ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldld $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + echo "$ac_t""no" 1>&6 +fi + + +fi + + +fi + + +fi + + +fi + +fi + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + fi + + case "$lt_cv_dlopen" in + dlopen) +for ac_hdr in dlfcn.h; do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "$progname:2488: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int fnord = 0; +EOF +ac_try="$ac_compile >/dev/null 2>conftest.out" +{ (eval echo $progname:2498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi +done + + if test "x$ac_cv_header_dlfcn_h" = xyes; then + CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + fi + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 +echo "$progname:2526: checking whether a program can dlopen itself" >&5 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + lt_cv_dlopen_self=cross + else + cat > conftest.c < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LTDL_GLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LTDL_GLOBAL DL_GLOBAL +# else +# define LTDL_GLOBAL 0 +# endif +#endif + +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LTDL_LAZY_OR_NOW +# ifdef RTLD_LAZY +# define LTDL_LAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LTDL_LAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LTDL_LAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LTDL_LAZY_OR_NOW DL_NOW +# else +# define LTDL_LAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +fnord() { int i=42;} +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); + if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); + if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } + +EOF +if { (eval echo $progname:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + lt_cv_dlopen_self=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + lt_cv_dlopen_self=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$lt_cv_dlopen_self" 1>&6 + + if test "$lt_cv_dlopen_self" = yes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 +echo "$progname:2599: checking whether a statically linked program can dlopen itself" >&5 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + lt_cv_dlopen_self_static=cross + else + cat > conftest.c < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LTDL_GLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LTDL_GLOBAL DL_GLOBAL +# else +# define LTDL_GLOBAL 0 +# endif +#endif + +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LTDL_LAZY_OR_NOW +# ifdef RTLD_LAZY +# define LTDL_LAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LTDL_LAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LTDL_LAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LTDL_LAZY_OR_NOW DL_NOW +# else +# define LTDL_LAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +fnord() { int i=42;} +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); + if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); + if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } + +EOF +if { (eval echo $progname:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + lt_cv_dlopen_self_static=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + lt_cv_dlopen_self_static=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 +fi + ;; + esac + + case "$lt_cv_dlopen_self" in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case "$lt_cv_dlopen_self_static" in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + +# Copy echo and quote the copy, instead of the original, because it is +# used later. +ltecho="$echo" +if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ltecho="$CONFIG_SHELL \$0 --fallback-echo" +fi +LTSHELL="$SHELL" + +LTCONFIG_VERSION="$VERSION" + +# Only quote variables if we're using ltmain.sh. +case "$ltmain" in +*.sh) + # Now quote all the things that may contain metacharacters. + for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ + old_LD old_LDFLAGS old_LIBS \ + old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ + AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ + reload_flag reload_cmds wl \ + pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ + thread_safe_flag_spec whole_archive_flag_spec libname_spec \ + library_names_spec soname_spec \ + RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ + old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ + file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ + finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ + hardcode_libdir_flag_spec hardcode_libdir_separator \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do + + case "$var" in + reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case "$ltecho" in + *'\$0 --fallback-echo"') + ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + + trap "$rm \"$ofile\"; exit 1" 1 2 15 + echo "creating $ofile" + $rm "$ofile" + cat < "$ofile" +#! $SHELL + +# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. +# +# Copyright (C) 1996-1999 Free Software Foundation, Inc. +# 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., 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. + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="sed -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +### BEGIN LIBTOOL CONFIG +EOF + cfgfile="$ofile" + ;; + +*) + # Double-quote the variables that need it (for aesthetics). + for var in old_CC old_CFLAGS old_CPPFLAGS \ + old_LD old_LDFLAGS old_LIBS \ + old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do + eval "$var=\\\"\$var\\\"" + done + + # Just create a config file. + cfgfile="$ofile.cfg" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + echo "creating $cfgfile" + $rm "$cfgfile" + cat < "$cfgfile" +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +EOF + ;; +esac + +cat <> "$cfgfile" +# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ +# LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ +# NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ +# DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ +# $0$ltconfig_args +# +# Compiler and other test output produced by $progname, useful for +# debugging $progname, is in ./config.log if it exists. + +# The version of $progname that generated this script. +LTCONFIG_VERSION=$LTCONFIG_VERSION + +# Shell to use when invoking shell scripts. +SHELL=$LTSHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$ltecho + +# The archiver. +AR=$AR + +# The default C compiler. +CC=$CC + +# The linker used to build libraries. +LD=$LD + +# Whether we need hard or soft links. +LN_S=$LN_S + +# A BSD-compatible nm program. +NM=$NM + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$reload_flag +reload_cmds=$reload_cmds + +# How to pass a linker flag through the compiler. +wl=$wl + +# Object file suffix (normally "o"). +objext="$objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$pic_flag + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$compiler_c_o + +# Can we write directly to a .lo ? +compiler_o_lo=$compiler_o_lo + +# Must we lock files when doing compilation ? +need_locks=$need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$link_static_flag + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$RANLIB +old_archive_cmds=$old_archive_cmds +old_postinstall_cmds=$old_postinstall_cmds +old_postuninstall_cmds=$old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$old_archive_from_new_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$archive_cmds +archive_expsym_cmds=$archive_expsym_cmds +postinstall_cmds=$postinstall_cmds +postuninstall_cmds=$postuninstall_cmds + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$global_symbol_to_cdecl + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$hardcode_libdir_separator + +# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$include_expsyms + +EOF + +case "$ltmain" in +*.sh) + echo '### END LIBTOOL CONFIG' >> "$ofile" + echo >> "$ofile" + case "$host_os" in + aix3*) + cat <<\EOF >> "$ofile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # Append the ltmain.sh script. + sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + + chmod +x "$ofile" + ;; + +*) + # Compile the libtool program. + echo "FIXME: would compile $ltmain" + ;; +esac + +test -n "$cache_file" || exit 0 + +# AC_CACHE_SAVE +trap '' 1 2 15 +cat > confcache <<\EOF +# 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. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# 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 \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +exit 0 + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/ltmain.sh b/ltmain.sh new file mode 100644 index 0000000..0f0a2da --- /dev/null +++ b/ltmain.sh @@ -0,0 +1,11147 @@ +#! /bin/sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2014-01-03.01 + +# libtool (GNU libtool) 2.4.6 +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996-2015 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. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.4.6 +package_revision=2.4.6 + + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2015-01-20.17; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# Copyright (C) 2004-2015 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. + +# 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 3 of the License, or +# (at your option) any later version. + +# As a special exception to the GNU General Public License, if you distribute +# this file as part of a program or library that is built using GNU Libtool, +# you may include this file under the same distribution terms that you use +# for the rest of that program. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNES 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, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac +fi + +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test set = \"\${$_G_var+set}\"; then + save_$_G_var=\$$_G_var + $_G_var=C + export $_G_var + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" + fi" +done + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Make sure IFS has a sensible default +sp=' ' +nl=' +' +IFS="$sp $nl" + +# There are apparently some retarded systems that use ';' as a PATH separator! +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + + +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + GREP=$func_path_progs_result +} + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase variable names are used for environment variables. These +# variables can be overridden by the user before calling a script that +# uses them if a suitable command of that name is not already available +# in the command search PATH. + +: ${CP="cp -f"} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} + + +## -------------------- ## +## Useful sed snippets. ## +## -------------------- ## + +sed_dirname='s|/[^/]*$||' +sed_basename='s|^.*/||' + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' + +# Same as above, but do not quote variable references. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' + +# Sed substitution that converts a w32 file name or path +# that contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-'\' parameter expansions in output of sed_double_quote_subst that +# were '\'-ed in input to the same. If an odd number of '\' preceded a +# '$' in input to sed_double_quote_subst, that '$' was protected from +# expansion. Since each input '\' is now two '\'s, look for any number +# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. +_G_bs='\\' +_G_bs2='\\\\' +_G_bs4='\\\\\\\\' +_G_dollar='\$' +sed_double_backslash="\ + s/$_G_bs4/&\\ +/g + s/^$_G_bs2$_G_dollar/$_G_bs&/ + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g + s/\n//g" + + +## ----------------- ## +## Global variables. ## +## ----------------- ## + +# Except for the global variables explicitly listed below, the following +# functions in the '^func_' namespace, and the '^require_' namespace +# variables initialised in the 'Resource management' section, sourcing +# this file will not pollute your global namespace with anything +# else. There's no portable way to scope variables in Bourne shell +# though, so actually running these functions will sometimes place +# results into a variable named after the function, and often use +# temporary variables in the '^_G_' namespace. If you are careful to +# avoid using those namespaces casually in your sourcing script, things +# should continue to work as you expect. And, of course, you can freely +# overwrite any of the functions or variables defined here before +# calling anything to customize them. + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +# Allow overriding, eg assuming that you follow the convention of +# putting '$debug_cmd' at the start of all your functions, you can get +# bash to show function call trace with: +# +# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +debug_cmd=${debug_cmd-":"} +exit_cmd=: + +# By convention, finish your script with: +# +# exit $exit_status +# +# so that you can set exit_status to non-zero if you want to indicate +# something went wrong during execution without actually bailing out at +# the point of failure. +exit_status=$EXIT_SUCCESS + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath=$0 + +# The name of this program. +progname=`$ECHO "$progpath" |$SED "$sed_basename"` + +# Make sure we have an absolute progpath for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` + progdir=`cd "$progdir" && pwd` + progpath=$progdir/$progname + ;; + *) + _G_IFS=$IFS + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS=$_G_IFS + test -x "$progdir/$progname" && break + done + IFS=$_G_IFS + test -n "$progdir" || progdir=`pwd` + progpath=$progdir/$progname + ;; +esac + + +## ----------------- ## +## Standard options. ## +## ----------------- ## + +# The following options affect the operation of the functions defined +# below, and should be set appropriately depending on run-time para- +# meters passed on the command line. + +opt_dry_run=false +opt_quiet=false +opt_verbose=false + +# Categories 'all' and 'none' are always available. Append any others +# you will pass as the first argument to func_warning from your own +# code. +warning_categories= + +# By default, display warnings according to 'opt_warning_types'. Set +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to +# treat the next displayed warning as a fatal error. +warning_func=func_warn_and_continue + +# Set to 'all' to display all warnings, 'none' to suppress all +# warnings, or a space delimited list of some subset of +# 'warning_categories' to display only the listed warnings. +opt_warning_types=all + + +## -------------------- ## +## Resource management. ## +## -------------------- ## + +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Call them using their associated +# 'require_*' variable to ensure that they are executed, at most, once. +# +# It's entirely deliberate that calling these functions can set +# variables that don't obey the namespace limitations obeyed by the rest +# of this file, in order that that they be as useful as possible to +# callers. + + +# require_term_colors +# ------------------- +# Allow display of bold text on terminals that support it. +require_term_colors=func_require_term_colors +func_require_term_colors () +{ + $debug_cmd + + test -t 1 && { + # COLORTERM and USE_ANSI_COLORS environment variables take + # precedence, because most terminfo databases neglect to describe + # whether color sequences are supported. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} + + if test 1 = "$USE_ANSI_COLORS"; then + # Standard ANSI escape sequences + tc_reset='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + else + # Otherwise trust the terminfo database after all. + test -n "`tput sgr0 2>/dev/null`" && { + tc_reset=`tput sgr0` + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` + tc_standout=$tc_bold + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` + } + fi + } + + require_term_colors=: +} + + +## ----------------- ## +## Function library. ## +## ----------------- ## + +# This section contains a variety of useful functions to call in your +# scripts. Take note of the portable wrappers for features provided by +# some modern shells, which will fall back to slower equivalents on +# less featureful shells. + + +# func_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. + + # We should try to minimise forks, especially on Windows where they are + # unreasonably slow, so skip the feature probes when bash or zsh are + # being used: + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then + : ${_G_HAVE_ARITH_OP="yes"} + : ${_G_HAVE_XSI_OPS="yes"} + # The += operator was introduced in bash 3.1 + case $BASH_VERSION in + [12].* | 3.0 | 3.0*) ;; + *) + : ${_G_HAVE_PLUSEQ_OP="yes"} + ;; + esac + fi + + # _G_HAVE_PLUSEQ_OP + # Can be empty, in which case the shell is probed, "yes" if += is + # useable or anything else if it does not work. + test -z "$_G_HAVE_PLUSEQ_OP" \ + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ + && _G_HAVE_PLUSEQ_OP=yes + +if test yes = "$_G_HAVE_PLUSEQ_OP" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_append_quoted VAR VALUE +# ---------------------------- +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then + eval 'func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1+=\\ \$func_quote_for_eval_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1=\$$1\\ \$func_quote_for_eval_result" + } +fi + + +# func_append_uniq VAR VALUE +# -------------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_uniq options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_uniq () +{ + $debug_cmd + + eval _G_current_value='`$ECHO $'$1'`' + _G_delim=`expr "$2" : '\(.\)'` + + case $_G_delim$_G_current_value$_G_delim in + *"$2$_G_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_arith TERM... +# ------------------ +# Set func_arith_result to the result of evaluating TERMs. + test -z "$_G_HAVE_ARITH_OP" \ + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ + && _G_HAVE_ARITH_OP=yes + +if test yes = "$_G_HAVE_ARITH_OP"; then + eval 'func_arith () + { + $debug_cmd + + func_arith_result=$(( $* )) + }' +else + func_arith () + { + $debug_cmd + + func_arith_result=`expr "$@"` + } +fi + + +# func_basename FILE +# ------------------ +# Set func_basename_result to FILE with everything up to and including +# the last / stripped. +if test yes = "$_G_HAVE_XSI_OPS"; then + # If this shell supports suffix pattern removal, then use it to avoid + # forking. Hide the definitions single quotes in case the shell chokes + # on unsupported syntax... + _b='func_basename_result=${1##*/}' + _d='case $1 in + */*) func_dirname_result=${1%/*}$2 ;; + * ) func_dirname_result=$3 ;; + esac' + +else + # ...otherwise fall back to using sed. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` + if test "X$func_dirname_result" = "X$1"; then + func_dirname_result=$3 + else + func_append func_dirname_result "$2" + fi' +fi + +eval 'func_basename () +{ + $debug_cmd + + '"$_b"' +}' + + +# func_dirname FILE APPEND NONDIR_REPLACEMENT +# ------------------------------------------- +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +eval 'func_dirname () +{ + $debug_cmd + + '"$_d"' +}' + + +# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT +# -------------------------------------------------------- +# Perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# For efficiency, we do not delegate to the functions above but instead +# duplicate the functionality here. +eval 'func_dirname_and_basename () +{ + $debug_cmd + + '"$_b"' + '"$_d"' +}' + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_echo_all ARG... +# -------------------- +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + + +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () +{ + $debug_cmd + + $require_term_colors + + _G_infix=$1; shift + _G_indent=$_G_infix + _G_prefix="$progname: $_G_infix: " + _G_message=$* + + # Strip color escape sequences before counting printable length + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" + do + test -n "$_G_tc" && { + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` + } + done + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + + func_echo_infix_1_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_infix_1_IFS + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + _G_prefix=$_G_indent + done + IFS=$func_echo_infix_1_IFS +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 +} + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + $debug_cmd + + func_error "$*" + exit $EXIT_FAILURE +} + + +# func_grep EXPRESSION FILENAME +# ----------------------------- +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $debug_cmd + + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_len STRING +# --------------- +# Set func_len_result to the length of STRING. STRING may not +# start with a hyphen. + test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` + } +fi + + +# func_mkdir_p DIRECTORY-PATH +# --------------------------- +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + $debug_cmd + + _G_directory_path=$1 + _G_dir_list= + + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then + + # Protect directory names starting with '-' + case $_G_directory_path in + -*) _G_directory_path=./$_G_directory_path ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$_G_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + _G_dir_list=$_G_directory_path:$_G_dir_list + + # If the last portion added has no slash in it, the list is done + case $_G_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` + done + _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` + + func_mkdir_p_IFS=$IFS; IFS=: + for _G_dir in $_G_dir_list; do + IFS=$func_mkdir_p_IFS + # mkdir can fail with a 'File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$_G_dir" 2>/dev/null || : + done + IFS=$func_mkdir_p_IFS + + # Bail out if we (or some other process) failed to create a directory. + test -d "$_G_directory_path" || \ + func_fatal_error "Failed to create '$1'" + fi +} + + +# func_mktempdir [BASENAME] +# ------------------------- +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, BASENAME is the basename for that directory. +func_mktempdir () +{ + $debug_cmd + + _G_template=${TMPDIR-/tmp}/${1-$progname} + + if test : = "$opt_dry_run"; then + # Return a directory name, but don't create it in dry-run mode + _G_tmpdir=$_G_template-$$ + else + + # If mktemp works, use that first and foremost + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` + + if test ! -d "$_G_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + _G_tmpdir=$_G_template-${RANDOM-0}$$ + + func_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$_G_tmpdir" + umask $func_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$_G_tmpdir" || \ + func_fatal_error "cannot create temporary directory '$_G_tmpdir'" + fi + + $ECHO "$_G_tmpdir" +} + + +# func_normal_abspath PATH +# ------------------------ +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +func_normal_abspath () +{ + $debug_cmd + + # These SED scripts presuppose an absolute path with a trailing slash. + _G_pathcar='s|^/\([^/]*\).*$|\1|' + _G_pathcdr='s|^/[^/]*||' + _G_removedotparts=':dotsl + s|/\./|/|g + t dotsl + s|/\.$|/|' + _G_collapseslashes='s|/\{1,\}|/|g' + _G_finalslash='s|/*$|/|' + + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` + while :; do + # Processed it all yet? + if test / = "$func_normal_abspath_tpath"; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result"; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + + +# func_notquiet ARG... +# -------------------- +# Echo program name prefixed message only when not in quiet mode. +func_notquiet () +{ + $debug_cmd + + $opt_quiet || func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + + +# func_relative_path SRCDIR DSTDIR +# -------------------------------- +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. +func_relative_path () +{ + $debug_cmd + + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=$func_dirname_result + if test -z "$func_relative_path_tlibdir"; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test -n "$func_stripname_result"; then + func_append func_relative_path_result "/$func_stripname_result" + fi + + # Normalisation. If bindir is libdir, return '.' else relative path. + if test -n "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + fi + + test -n "$func_relative_path_result" || func_relative_path_result=. + + : +} + + +# func_quote_for_eval ARG... +# -------------------------- +# Aesthetically quote ARGs to be evaled later. +# This function returns two values: +# i) func_quote_for_eval_result +# double-quoted, suitable for a subsequent eval +# ii) func_quote_for_eval_unquoted_result +# has all characters that are still active within double +# quotes backslashified. +func_quote_for_eval () +{ + $debug_cmd + + func_quote_for_eval_unquoted_result= + func_quote_for_eval_result= + while test 0 -lt $#; do + case $1 in + *[\\\`\"\$]*) + _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; + *) + _G_unquoted_arg=$1 ;; + esac + if test -n "$func_quote_for_eval_unquoted_result"; then + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" + else + func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + fi + + case $_G_unquoted_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_quoted_arg=\"$_G_unquoted_arg\" + ;; + *) + _G_quoted_arg=$_G_unquoted_arg + ;; + esac + + if test -n "$func_quote_for_eval_result"; then + func_append func_quote_for_eval_result " $_G_quoted_arg" + else + func_append func_quote_for_eval_result "$_G_quoted_arg" + fi + shift + done +} + + +# func_quote_for_expand ARG +# ------------------------- +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + $debug_cmd + + case $1 in + *[\\\`\"]*) + _G_arg=`$ECHO "$1" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; + *) + _G_arg=$1 ;; + esac + + case $_G_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_arg=\"$_G_arg\" + ;; + esac + + func_quote_for_expand_result=$_G_arg +} + + +# func_stripname PREFIX SUFFIX NAME +# --------------------------------- +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_stripname () + { + $debug_cmd + + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary variable first. + func_stripname_result=$3 + func_stripname_result=${func_stripname_result#"$1"} + func_stripname_result=${func_stripname_result%"$2"} + }' +else + func_stripname () + { + $debug_cmd + + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; + esac + } +fi + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + func_quote_for_expand "$_G_cmd" + eval "func_notquiet $func_quote_for_expand_result" + + $opt_dry_run || { + eval "$_G_cmd" + _G_status=$? + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_show_eval_locale CMD [FAIL_EXP] +# ------------------------------------ +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + $opt_quiet || { + func_quote_for_expand "$_G_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + $opt_dry_run || { + eval "$_G_user_locale + $_G_cmd" + _G_status=$? + eval "$_G_safe_locale" + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_tr_sh +# ---------- +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + $debug_cmd + + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $debug_cmd + + $opt_verbose && func_echo "$*" + + : +} + + +# func_warn_and_continue ARG... +# ----------------------------- +# Echo program name prefixed warning message to standard error. +func_warn_and_continue () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 +} + + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY, where this function +# elides messages where CATEGORY is not listed in the global variable +# 'opt_warning_types'. +func_warning () +{ + $debug_cmd + + # CATEGORY must be in the warning_categories list! + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category '$1'" ;; + esac + + _G_category=$1 + shift + + case " $opt_warning_types " in + *" $_G_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# 'sort -V' is not generally available. +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () +{ + $debug_cmd + + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} + +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: +#! /bin/sh + +# Set a version string for this script. +scriptversion=2014-01-07.03; # UTC + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# Copyright (C) 2010-2015 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. + +# 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 3 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, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# This file is a library for parsing options in your shell scripts along +# with assorted other useful supporting features that you can make use +# of too. +# +# For the simplest scripts you might need only: +# +# #!/bin/sh +# . relative/path/to/funclib.sh +# . relative/path/to/options-parser +# scriptversion=1.0 +# func_options ${1+"$@"} +# eval set dummy "$func_options_result"; shift +# ...rest of your script... +# +# In order for the '--version' option to work, you will need to have a +# suitably formatted comment like the one at the top of this file +# starting with '# Written by ' and ending with '# warranty; '. +# +# For '-h' and '--help' to work, you will also need a one line +# description of your script's purpose in a comment directly above the +# '# Written by ' line, like the one at the top of this file. +# +# The default options also support '--debug', which will turn on shell +# execution tracing (see the comment above debug_cmd below for another +# use), and '--verbose' and the func_verbose function to allow your script +# to display verbose messages only when your user has specified +# '--verbose'. +# +# After sourcing this file, you can plug processing for additional +# options by amending the variables from the 'Configuration' section +# below, and following the instructions in the 'Option parsing' +# section further down. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# You should override these variables in your script after sourcing this +# file so that they reflect the customisations you have added to the +# option parser. + +# The usage line for option parsing errors and the start of '-h' and +# '--help' output messages. You can embed shell variables for delayed +# expansion at the time the message is displayed, but you will need to +# quote other shell meta-characters carefully to prevent them being +# expanded when the contents are evaled. +usage='$progpath [OPTION]...' + +# Short help message in response to '-h' and '--help'. Add to this or +# override it after sourcing this library to reflect the full set of +# options your script accepts. +usage_message="\ + --debug enable verbose shell tracing + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -v, --verbose verbosely report processing + --version print version information and exit + -h, --help print short or long help message and exit +" + +# Additional text appended to 'usage_message' in response to '--help'. +long_help_message=" +Warning categories include: + 'all' show all warnings + 'none' turn off all the warnings + 'error' warnings are treated as fatal errors" + +# Help message printed before fatal option parsing errors. +fatal_help="Try '\$progname --help' for more information." + + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# to the main code. A hook is just a named list of of function, that can +# be run in order later on. + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# 'func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_fns " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a call to 'func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It is assumed that the list of hook functions contains nothing more +# than a whitespace-delimited list of legal shell function names, and +# no effort is wasted trying to catch shell meta-characters or preserve +# whitespace. +func_run_hooks () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook funcions.n" ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + eval $_G_hook '"$@"' + + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + done + + func_quote_for_eval ${1+"$@"} + func_run_hooks_result=$func_quote_for_eval_result +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list in your hook function, remove any +# options that you action, and then pass back the remaining unprocessed +# options in '_result', escaped suitably for +# 'eval'. Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# +# func_quote_for_eval ${1+"$@"} +# my_options_prep_result=$func_quote_for_eval_result +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# # Note that for efficiency, we parse as many options as we can +# # recognise in a loop before passing the remainder back to the +# # caller on the first unrecognised argument we encounter. +# while test $# -gt 0; do +# opt=$1; shift +# case $opt in +# --silent|-s) opt_silent=: ;; +# # Separate non-argument short options: +# -s*) func_split_short_opt "$_G_opt" +# set dummy "$func_split_short_opt_name" \ +# "-$func_split_short_opt_arg" ${1+"$@"} +# shift +# ;; +# *) set dummy "$_G_opt" "$*"; shift; break ;; +# esac +# done +# +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# } +# func_add_hook func_parse_options my_silent_option +# +# +# my_option_validation () +# { +# $debug_cmd +# +# $opt_silent && $opt_verbose && func_fatal_help "\ +# '--silent' and '--verbose' options are mutually exclusive." +# +# func_quote_for_eval ${1+"$@"} +# my_option_validation_result=$func_quote_for_eval_result +# } +# func_add_hook func_validate_options my_option_validation +# +# You'll alse need to manually amend $usage_message to reflect the extra +# options you parse. It's preferable to append if you can, so that +# multiple option parsing hooks can be added safely. + + +# func_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd + + func_options_prep ${1+"$@"} + eval func_parse_options \ + ${func_options_prep_result+"$func_options_prep_result"} + eval func_validate_options \ + ${func_parse_options_result+"$func_parse_options_result"} + + eval func_run_hooks func_options \ + ${func_validate_options_result+"$func_validate_options_result"} + + # save modified positional parameters for caller + func_options_result=$func_run_hooks_result +} + + +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propogate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before +# returning. +func_hookable func_options_prep +func_options_prep () +{ + $debug_cmd + + # Option defaults: + opt_verbose=false + opt_warning_types= + + func_run_hooks func_options_prep ${1+"$@"} + + # save modified positional parameters for caller + func_options_prep_result=$func_run_hooks_result +} + + +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () +{ + $debug_cmd + + func_parse_options_result= + + # this just eases exit handling + while test $# -gt 0; do + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + func_run_hooks func_parse_options ${1+"$@"} + + # Adjust func_parse_options positional parameters to match + eval set dummy "$func_run_hooks_result"; shift + + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break + + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; + + --warnings|--warning|-W) + test $# = 0 && func_missing_arg $_G_opt && break + case " $warning_categories $1" in + *" $1 "*) + # trailing space prevents matching last $1 above + func_append_uniq opt_warning_types " $1" + ;; + *all) + opt_warning_types=$warning_categories + ;; + *none) + opt_warning_types=none + warning_func=: + ;; + *error) + opt_warning_types=$warning_categories + warning_func=func_fatal_error + ;; + *) + func_fatal_error \ + "unsupported warning category: '$1'" + ;; + esac + shift + ;; + + --verbose|-v) opt_verbose=: ;; + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options (plugins may need this): + --*=*) func_split_equals "$_G_opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-v*|-x*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result=$func_quote_for_eval_result +} + + +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () +{ + $debug_cmd + + # Display all warnings if -W was not given. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" + + func_run_hooks func_validate_options ${1+"$@"} + + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE + + # save modified positional parameters for caller + func_validate_options_result=$func_run_hooks_result +} + + + +## ----------------- ## +## Helper functions. ## +## ----------------- ## + +# This section contains the helper functions used by the rest of the +# hookable option parser framework in ascii-betical order. + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + + +# func_help +# --------- +# Echo long help message to standard output and exit. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message" + exit 0 +} + + +# func_missing_arg ARGNAME +# ------------------------ +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $debug_cmd + + func_error "Missing argument for '$1'." + exit_cmd=exit +} + + +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables after +# splitting STRING at the '=' sign. +test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + test "x$func_split_equals_lhs" = "x$1" \ + && func_split_equals_rhs= + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` + func_split_equals_rhs= + test "x$func_split_equals_lhs" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# func_split_short_opt SHORTOPT +# ----------------------------- +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_usage +# ---------- +# Echo short help message to standard output and exit. +func_usage () +{ + $debug_cmd + + func_usage_message + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" + exit 0 +} + + +# func_usage_message +# ------------------ +# Echo short help message to standard output. +func_usage_message () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + echo + $SED -n 's|^# || + /^Written by/{ + x;p;x + } + h + /^Written by/q' < "$progpath" + echo + eval \$ECHO \""$usage_message"\" +} + + +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () +{ + $debug_cmd + + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /(C)/!b go + :more + /\./!{ + N + s|\n# | | + b more + } + :go + /^# Written by /,/# warranty; / { + s|^# || + s|^# *$|| + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + p + } + /^# Written by / { + s|^# || + p + } + /^warranty; /q' < "$progpath" + + exit $? +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: + +# Set a version string. +scriptversion='(GNU libtool) 2.4.6' + + +# func_echo ARG... +# ---------------- +# Libtool also displays the current mode in messages, so override +# funclib.sh func_echo with this custom definition. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () +{ + $debug_cmd + + $warning_func ${1+"$@"} +} + + +## ---------------- ## +## Options parsing. ## +## ---------------- ## + +# Hook in the functions to make sure our own options are parsed during +# the option parsing loop. + +usage='$progpath [OPTION]... [MODE-ARG]...' + +# Short help message in response to '-h'. +usage_message="Options: + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --mode=MODE use operation mode MODE + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message +" + +# Additional text appended to 'usage_message' in response to '--help'. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. When passed as first option, +'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. +Try '$progname --help --mode=MODE' for a more detailed description of MODE. + +When reporting a bug, please describe a test case to reproduce it and +include the following information: + + host-triplet: $host + shell: $SHELL + compiler: $LTCC + compiler flags: $LTCFLAGS + linker: $LD (gnu? $with_gnu_ld) + version: $progname (GNU libtool) 2.4.6 + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` + +Report bugs to . +GNU libtool home page: . +General help using GNU software: ." + exit 0 +} + + +# func_lo2o OBJECT-NAME +# --------------------- +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific +# object suffix. + +lo2o=s/\\.lo\$/.$objext/ +o2lo=s/\\.$objext\$/.lo/ + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_lo2o () + { + case $1 in + *.lo) func_lo2o_result=${1%.lo}.$objext ;; + * ) func_lo2o_result=$1 ;; + esac + }' + + # func_xform LIBOBJ-OR-SOURCE + # --------------------------- + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) + # suffix to a '.lo' libtool-object suffix. + eval 'func_xform () + { + func_xform_result=${1%.*}.lo + }' +else + # ...otherwise fall back to using sed. + func_lo2o () + { + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` + } + + func_xform () + { + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` + } +fi + + +# func_fatal_configuration ARG... +# ------------------------------- +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func__fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." +} + + +# func_config +# ----------- +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + + +# func_features +# ------------- +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test yes = "$build_libtool_libs"; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test yes = "$build_old_libs"; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + + +# func_enable_tag TAGNAME +# ----------------------- +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname=$1 + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf=/$re_begincf/,/$re_endcf/p + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + + +# func_check_version_match +# ------------------------ +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# libtool_options_prep [ARG]... +# ----------------------------- +# Preparation for options parsed by libtool. +libtool_options_prep () +{ + $debug_mode + + # Option defaults: + opt_config=false + opt_dlopen= + opt_dry_run=false + opt_help=false + opt_mode= + opt_preserve_dup_deps=false + opt_quiet=false + + nonopt= + preserve_args= + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + + # Pass back the list of options. + func_quote_for_eval ${1+"$@"} + libtool_options_prep_result=$func_quote_for_eval_result +} +func_add_hook func_options_prep libtool_options_prep + + +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () +{ + $debug_cmd + + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_opt=$1 + shift + case $_G_opt in + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + + --config) func_config ;; + + --dlopen|-dlopen) + opt_dlopen="${opt_dlopen+$opt_dlopen +}$1" + shift + ;; + + --preserve-dup-deps) + opt_preserve_dup_deps=: ;; + + --features) func_features ;; + + --finish) set dummy --mode finish ${1+"$@"}; shift ;; + + --help) opt_help=: ;; + + --help-all) opt_help=': help-all' ;; + + --mode) test $# = 0 && func_missing_arg $_G_opt && break + opt_mode=$1 + case $1 in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $_G_opt" + exit_cmd=exit + break + ;; + esac + shift + ;; + + --no-silent|--no-quiet) + opt_quiet=false + func_append preserve_args " $_G_opt" + ;; + + --no-warnings|--no-warning|--no-warn) + opt_warning=false + func_append preserve_args " $_G_opt" + ;; + + --no-verbose) + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --silent|--quiet) + opt_quiet=: + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --tag) test $# = 0 && func_missing_arg $_G_opt && break + opt_tag=$1 + func_append preserve_args " $_G_opt $1" + func_enable_tag "$1" + shift + ;; + + --verbose|-v) opt_quiet=false + opt_verbose=: + func_append preserve_args " $_G_opt" + ;; + + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + libtool_parse_options_result=$func_quote_for_eval_result +} +func_add_hook func_parse_options libtool_parse_options + + + +# libtool_validate_options [ARG]... +# --------------------------------- +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +libtool_validate_options () +{ + # save first non-option argument + if test 0 -lt $#; then + nonopt=$1 + shift + fi + + # preserve --debug + test : = "$debug_cmd" || func_append preserve_args " --debug" + + case $host in + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + test yes != "$build_libtool_libs" \ + && test yes != "$build_old_libs" \ + && func_fatal_configuration "not configured to build any kind of library" + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; then + func_error "unrecognized option '-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help=$help + help="Try '$progname --help --mode=$opt_mode' for more information." + } + + # Pass back the unparsed argument list + func_quote_for_eval ${1+"$@"} + libtool_validate_options_result=$func_quote_for_eval_result +} +func_add_hook func_validate_options libtool_validate_options + + +# Process options as early as possible so that --help and --version +# can return quickly. +func_options ${1+"$@"} +eval set dummy "$func_options_result"; shift + + + +## ----------- ## +## Main. ## +## ----------- ## + +magic='%%%MAGIC variable%%%' +magic_exe='%%%MAGIC EXE variable%%%' + +# Global variables. +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if 'file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case $lalib_p_line in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test yes = "$lalib_p" +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $debug_cmd + + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# 'FILE.' does not work on cygwin managed mounts. +func_source () +{ + $debug_cmd + + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case $lt_sysroot:$1 in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result='='$func_stripname_result + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $debug_cmd + + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with '--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=$1 + if test yes = "$build_libtool_libs"; then + write_lobj=\'$2\' + else + write_lobj=none + fi + + if test yes = "$build_old_libs"; then + write_oldobj=\'$3\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $debug_cmd + + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result= + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result"; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $debug_cmd + + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $debug_cmd + + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $debug_cmd + + if test -z "$2" && test -n "$1"; then + func_error "Could not determine host file name corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result=$1 + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $debug_cmd + + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " '$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result=$3 + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $debug_cmd + + case $4 in + $1 ) func_to_host_path_result=$3$func_to_host_path_result + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via '$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $debug_cmd + + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $debug_cmd + + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result=$1 +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result=$func_convert_core_msys_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via '$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $debug_cmd + + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd=func_convert_path_$func_stripname_result + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $debug_cmd + + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result=$1 +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_msys_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_path_wine_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_dll_def_p FILE +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4 +func_dll_def_p () +{ + $debug_cmd + + func_dll_def_p_tmp=`$SED -n \ + -e 's/^[ ]*//' \ + -e '/^\(;.*\)*$/d' \ + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ + -e q \ + "$1"` + test DEF = "$func_dll_def_p_tmp" +} + + +# func_mode_compile arg... +func_mode_compile () +{ + $debug_cmd + + # Get the compilation command and the source file. + base_compile= + srcfile=$nonopt # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg=$arg + arg_mode=normal + ;; + + target ) + libobj=$arg + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify '-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs=$IFS; IFS=, + for arg in $args; do + IFS=$save_ifs + func_append_quoted lastarg "$arg" + done + IFS=$save_ifs + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg=$srcfile + srcfile=$arg + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with '-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj=$func_basename_result + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from '$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name '$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname=$func_basename_result + xdir=$func_dirname_result + lobj=$xdir$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test yes = "$build_old_libs"; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test no = "$compiler_c_o"; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext + lockfile=$output_obj.lock + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test yes = "$need_locks"; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test warn = "$need_locks"; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test yes = "$build_libtool_libs"; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test no != "$pic_mode"; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test yes = "$suppress_opt"; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test yes = "$compiler_c_o"; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test no != "$need_locks"; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a '.o' file suitable for static linking + -static only build a '.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a 'standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix '.c' with the +library object suffix, '.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to '-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the '--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the 'install' or 'cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE use a list of object files found in FILE to specify objects + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with '-') are ignored. + +Every other argument is treated as a filename. Files ending in '.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in '.la', then a libtool library is created, +only library objects ('.lo' files) may be specified, and '-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created +using 'ar' and 'ranlib', or on Windows using 'lib'. + +If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode '$opt_mode'" + ;; + esac + + echo + $ECHO "Try '$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test : = "$opt_help"; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + $SED '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $debug_cmd + + # The first argument is the command name. + cmd=$nonopt + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "'$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "'$file' was not linked with '-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir=$func_dirname_result + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir=$func_dirname_result + ;; + + *) + func_warning "'-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir=$absdir + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic=$magic + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file=$progdir/$program + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file=$progdir/$program + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if $opt_dry_run; then + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + else + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd=\$cmd$args + fi +} + +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $debug_cmd + + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "'$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument '$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and '=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_quiet && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the '-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the '$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the '$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the '$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $debug_cmd + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac + then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=false + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=: ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test X-m = "X$prev" && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the '$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=: + if $isdir; then + destdir=$dest + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir=$func_dirname_result + destname=$func_basename_result + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "'$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "'$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir=$func_dirname_result + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking '$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname=$1 + shift + + srcname=$realname + test -n "$relink_command" && srcname=${realname}T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme=$stripme + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme= + ;; + esac + ;; + os2*) + case $realname in + *_dll.a) + tstripme= + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try 'ln -sf' first, because the 'ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib=$destdir/$realname + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name=$func_basename_result + instname=$dir/${name}i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest=$destfile + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to '$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test yes = "$build_old_libs"; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext= + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=.exe + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script '$wrapper'" + + finalize=: + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "'$lib' has not been installed in '$libdir'" + finalize=false + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test no = "$fast_install" && test -n "$relink_command"; then + $opt_dry_run || { + if $finalize; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file=$func_basename_result + outputname=$tmpdir/$file + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_quiet || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink '$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file=$outputname + else + func_warning "cannot relink '$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name=$func_basename_result + + # Set up the ranlib parameters. + oldlib=$destdir/$name + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run '$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test install = "$opt_mode" && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $debug_cmd + + my_outputname=$1 + my_originator=$2 + my_pic_p=${3-false} + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms=${my_outputname}S.c + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist=$output_objdir/$my_outputname.nm + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* External symbol declarations for the compiler. */\ +" + + if test yes = "$dlself"; then + func_verbose "generating symbol list for '$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from '$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols=$output_objdir/$outputname.exp + $opt_dry_run || { + $RM $export_symbols + eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from '$dlprefile'" + func_basename "$dlprefile" + name=$func_basename_result + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename= + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname"; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename=$func_basename_result + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename"; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + func_show_eval '$RM "${nlist}I"' + if test -n "$global_symbol_to_import"; then + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[];\ +" + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ +static void lt_syminit(void) +{ + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; + for (; symbol->name; ++symbol) + {" + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" + echo >> "$output_objdir/$my_dlsyms" "\ + } +}" + fi + echo >> "$output_objdir/$my_dlsyms" "\ +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{ {\"$my_originator\", (void *) 0}," + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ + {\"@INIT@\", (void *) <_syminit}," + fi + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + $my_pic_p && pic_flag_for_symtable=" $pic_flag" + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' + + # Transform the symbol file into the correct name. + symfileobj=$output_objdir/${my_outputname}S.$objext + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for '$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $debug_cmd + + win32_libid_type=unknown + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s|.*|import| + p + q + } + }'` + ;; + esac + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $debug_cmd + + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $debug_cmd + + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive that possess that section. Heuristic: eliminate + # all those that have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $debug_cmd + + if func_cygming_gnu_implib_p "$1"; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1"; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result= + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $debug_cmd + + f_ex_an_ar_dir=$1; shift + f_ex_an_ar_oldlib=$1 + if test yes = "$lock_old_archive_extraction"; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test yes = "$lock_old_archive_extraction"; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $debug_cmd + + my_gentop=$1; shift + my_oldlibs=${1+"$@"} + my_oldobjs= + my_xlib= + my_xabs= + my_xdir= + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib=$func_basename_result + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir=$my_gentop/$my_xlib_u + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + func_basename "$darwin_archive" + darwin_base_archive=$func_basename_result + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches; do + func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" + $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" + cd "unfat-$$/$darwin_base_archive-$darwin_arch" + func_extract_an_archive "`pwd`" "$darwin_base_archive" + cd "$darwin_curdir" + $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result=$my_oldobjs +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory where it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# 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+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ that is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options that match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test yes = "$fast_install"; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + \$ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* declarations of non-ANSI functions */ +#if defined __MINGW32__ +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined __CYGWIN__ +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined other_platform || defined ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined _MSC_VER +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +#elif defined __MINGW32__ +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined __CYGWIN__ +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined other platforms ... */ +#endif + +#if defined PATH_MAX +# define LT_PATHMAX PATH_MAX +#elif defined MAXPATHLEN +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ + defined __OS2__ +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free (stale); stale = 0; } \ +} while (0) + +#if defined LT_DEBUGWRAPPER +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + size_t tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined HAVE_DOS_BASED_FILE_SYSTEM + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined HAVE_DOS_BASED_FILE_SYSTEM + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = (size_t) (q - p); + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (STREQ (str, pat)) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + size_t len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + size_t orig_value_len = strlen (orig_value); + size_t add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + size_t len = strlen (new_value); + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[--len] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $debug_cmd + + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $debug_cmd + + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # what system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll that has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + os2dllname= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=false + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module=$wl-single_module + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test yes != "$build_libtool_libs" \ + && func_fatal_configuration "cannot build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg=$1 + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir=$arg + prev= + continue + ;; + dlfiles|dlprefiles) + $preload || { + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=: + } + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test no = "$dlself"; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test dlprefiles = "$prev"; then + dlself=yes + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test dlfiles = "$prev"; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols=$arg + test -f "$arg" \ + || func_fatal_error "symbol file '$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex=$arg + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir=$arg + prev= + continue + ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + if test none != "$pic_object"; then + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + fi + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file '$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + os2dllname) + os2dllname=$arg + prev= + continue + ;; + precious_regex) + precious_files_regex=$arg + prev= + continue + ;; + release) + release=-$arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test rpath = "$prev"; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds=$arg + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg=$arg + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "'-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test X-export-symbols = "X$arg"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between '-L' and '$1'" + else + func_fatal_error "need path for '-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of '$dir'" + dir=$absdir + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test X-lc = "X$arg" || test X-lm = "X$arg"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test X-lc = "X$arg" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc due to us having libc/libc_r. + test X-lc = "X$arg" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test X-lc = "X$arg" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test X-lc = "X$arg" && continue + ;; + esac + elif test X-lc_r = "X$arg"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -mllvm) + prev=mllvm + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module=$wl-multi_module + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "'-no-install' is ignored for $host" + func_warning "assuming '-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -os2dllname) + prev=os2dllname + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # -fstack-protector* stack protector flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -stdlib=* select c++ std lib with clang + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + -Z*) + if test os2 = "`expr $host : '.*\(os2\)'`"; then + # OS/2 uses -Zxxx to specify OS/2-specific options + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case $arg in + -Zlinker | -Zstack) + prev=xcompiler + ;; + esac + continue + else + # Otherwise treat like 'Some other compiler flag' below + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + fi + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + test none = "$pic_object" || { + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + } + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test dlfiles = "$prev"; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test dlprefiles = "$prev"; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the '$prevarg' option requires an argument" + + if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname=$func_basename_result + libobjs_save=$libobjs + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + # Definition is injected by LT_CONFIG during libtool generation. + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" + + func_dirname "$output" "/" "" + output_objdir=$func_dirname_result$objdir + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test lib = "$linkmode"; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=false + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test lib,link = "$linkmode,$pass"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs=$tmp_deplibs + fi + + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass"; then + libs=$deplibs + deplibs= + fi + if test prog = "$linkmode"; then + case $pass in + dlopen) libs=$dlfiles ;; + dlpreopen) libs=$dlprefiles ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test lib,dlpreopen = "$linkmode,$pass"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs=$dlprefiles + fi + if test dlopen = "$pass"; then + # Collect dlpreopened libraries + save_deplibs=$deplibs + deplibs= + fi + + for deplib in $libs; do + lib= + found=false + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test lib != "$linkmode" && test prog != "$linkmode"; then + func_warning "'-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test lib = "$linkmode"; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib=$searchdir/lib$name$search_ext + if test -f "$lib"; then + if test .la = "$search_ext"; then + found=: + else + found=false + fi + break 2 + fi + done + done + if $found; then + # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll=$l + done + if test "X$ll" = "X$old_library"; then # only static version available + found=false + func_dirname "$lib" "" "." + ladir=$func_dirname_result + lib=$ladir/$old_library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + else + # deplib doesn't seem to be a libtool library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + ;; # -l + *.ltframework) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test conv = "$pass" && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + if test scan = "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "'-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test link = "$pass"; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=false + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=: + fi + ;; + pass_all) + valid_a_lib=: + ;; + esac + if $valid_a_lib; then + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + else + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + fi + ;; + esac + continue + ;; + prog) + if test link != "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + elif test prog = "$linkmode"; then + if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=: + continue + ;; + esac # case $deplib + + $found || test -f "$lib" \ + || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "'$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir=$func_dirname_result + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass" || + { test prog != "$linkmode" && test lib != "$linkmode"; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test conv = "$pass"; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + elif test prog != "$linkmode" && test lib != "$linkmode"; then + func_fatal_error "'$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test yes = "$prefer_static_libs" || + test built,no = "$prefer_static_libs,$installed"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib=$l + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + + # This library was specified with -dlopen. + if test dlopen = "$pass"; then + test -z "$libdir" \ + && func_fatal_error "cannot -dlopen a convenience library: '$lib'" + if test -z "$dlname" || + test yes != "$dlopen_support" || + test no = "$build_libtool_libs" + then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of '$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir=$ladir + fi + ;; + esac + func_basename "$lib" + laname=$func_basename_result + + # Find the relevant object directory and library name. + if test yes = "$installed"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library '$lib' was moved." + dir=$ladir + absdir=$abs_ladir + libdir=$abs_ladir + else + dir=$lt_sysroot$libdir + absdir=$lt_sysroot$libdir + fi + test yes = "$hardcode_automatic" && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir=$ladir + absdir=$abs_ladir + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir=$ladir/$objdir + absdir=$abs_ladir/$objdir + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test dlpreopen = "$pass"; then + if test -z "$libdir" && test prog = "$linkmode"; then + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" + fi + case $host in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test lib = "$linkmode"; then + deplibs="$dir/$old_library $deplibs" + elif test prog,link = "$linkmode,$pass"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test prog = "$linkmode" && test link != "$pass"; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=false + if test no != "$link_all_deplibs" || test -z "$library_names" || + test no = "$build_libtool_libs"; then + linkalldeplibs=: + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if $linkalldeplibs; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test prog,link = "$linkmode,$pass"; then + if test -n "$library_names" && + { { test no = "$prefer_static_libs" || + test built,yes = "$prefer_static_libs,$installed"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then + # Make sure the rpath contains only unique directories. + case $temp_rpath: in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if $alldeplibs && + { test pass_all = "$deplibs_check_method" || + { test yes = "$build_libtool_libs" && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test built = "$use_static_libs" && test yes = "$installed"; then + use_static_libs=no + fi + if test -n "$library_names" && + { test no = "$use_static_libs" || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc* | *os2*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test no = "$installed"; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule= + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule=$dlpremoduletest + break + fi + done + if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then + echo + if test prog = "$linkmode"; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test lib = "$linkmode" && + test yes = "$hardcode_into_libs"; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname=$1 + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname=$dlname + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc* | *os2*) + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + esac + eval soname=\"$soname_spec\" + else + soname=$realname + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot=$soname + func_basename "$soroot" + soname=$func_basename_result + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from '$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for '$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test prog = "$linkmode" || test relink != "$opt_mode"; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test no = "$hardcode_direct"; then + add=$dir/$linklib + case $host in + *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; + *-*-sysv4*uw2*) add_dir=-L$dir ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir=-L$dir ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we cannot + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library"; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add=$dir/$old_library + fi + elif test -n "$old_library"; then + add=$dir/$old_library + fi + fi + esac + elif test no = "$hardcode_minus_L"; then + case $host in + *-*-sunos*) add_shlibpath=$dir ;; + esac + add_dir=-L$dir + add=-l$name + elif test no = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + relink) + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$dir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$absdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test yes != "$lib_linked"; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test prog = "$linkmode"; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test yes != "$hardcode_direct" && + test yes != "$hardcode_minus_L" && + test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test prog = "$linkmode" || test relink = "$opt_mode"; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$libdir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$libdir + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add=-l$name + elif test yes = "$hardcode_automatic"; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib"; then + add=$inst_prefix_dir$libdir/$linklib + else + add=$libdir/$linklib + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir=-L$libdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + fi + + if test prog = "$linkmode"; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test prog = "$linkmode"; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test unsupported != "$hardcode_direct"; then + test -n "$old_library" && linklib=$old_library + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test yes = "$build_libtool_libs"; then + # Not a shared library + if test pass_all != "$deplibs_check_method"; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system cannot link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test yes = "$module"; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test lib = "$linkmode"; then + if test -n "$dependency_libs" && + { test yes != "$hardcode_into_libs" || + test yes = "$build_old_libs" || + test yes = "$link_static"; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs=$temp_deplibs + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test no != "$link_all_deplibs"; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path=$deplib ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of '$dir'" + absdir=$dir + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names"; then + for tmp in $deplibrary_names; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl"; then + depdepl=$absdir/$objdir/$depdepl + darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" + func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" + path= + fi + fi + ;; + *) + path=-L$absdir/$objdir + ;; + esac + else + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "'$deplib' seems to be moved" + + path=-L$absdir + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test link = "$pass"; then + if test prog = "$linkmode"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs=$newdependency_libs + if test dlpreopen = "$pass"; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test dlopen != "$pass"; then + test conv = "$pass" || { + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + } + + if test prog,link = "$linkmode,$pass"; then + vars="compile_deplibs finalize_deplibs" + else + vars=deplibs + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + + # Add Sun CC postdeps if required: + test CXX = "$tagname" && { + case $host_os in + linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i= + ;; + esac + if test -n "$i"; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test prog = "$linkmode"; then + dlfiles=$newdlfiles + fi + if test prog = "$linkmode" || test lib = "$linkmode"; then + dlprefiles=$newdlprefiles + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "'-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "'-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs=$output + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form 'libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test no = "$module" \ + && func_fatal_help "libtool library '$output' must begin with 'lib'" + + if test no != "$need_lib_prefix"; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test pass_all != "$deplibs_check_method"; then + func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test no = "$dlself" \ + || func_warning "'-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test 1 -lt "$#" \ + && func_warning "ignoring multiple '-rpath's for a libtool library" + + install_libdir=$1 + + oldlibs= + if test -z "$rpath"; then + if test yes = "$build_libtool_libs"; then + # Building a libtool convenience library. + # Some compilers have problems with a '.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "'-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs=$IFS; IFS=: + set dummy $vinfo 0 0 0 + shift + IFS=$save_ifs + + test -n "$7" && \ + func_fatal_help "too many parameters to '-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major=$1 + number_minor=$2 + number_revision=$3 + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # that has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|freebsd-elf|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_revision + ;; + freebsd-aout|qnx|sunos) + current=$number_major + revision=$number_minor + age=0 + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_minor + lt_irix_increment=no + ;; + esac + ;; + no) + current=$1 + revision=$2 + age=$3 + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT '$current' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION '$revision' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE '$age' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE '$age' is greater than the current interface number '$current'" + func_fatal_error "'$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + # On Darwin other compilers + case $CC in + nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; + *) + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + esac + ;; + + freebsd-aout) + major=.$current + versuffix=.$current.$revision + ;; + + freebsd-elf) + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + irix | nonstopux) + if test no = "$lt_irix_increment"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring=$verstring_prefix$major.$revision + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test 0 -ne "$loop"; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring_prefix$major.$iface:$verstring + done + + # Before this point, $major must not contain '.'. + major=.$major + versuffix=$major.$revision + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=.$current.$age.$revision + verstring=$current.$age.$revision + + # Add in all the interfaces that we are compatible with. + loop=$age + while test 0 -ne "$loop"; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring:$iface.0 + done + + # Make executables depend on our current version. + func_append verstring ":$current.0" + ;; + + qnx) + major=.$current + versuffix=.$current + ;; + + sco) + major=.$current + versuffix=.$current + ;; + + sunos) + major=.$current + versuffix=.$current.$revision + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 file systems. + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + + *) + func_fatal_configuration "unknown library version type '$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring=0.0 + ;; + esac + if test no = "$need_version"; then + versuffix= + else + versuffix=.0.0 + fi + fi + + # Remove version info from name if versioning should be avoided + if test yes,no = "$avoid_version,$need_version"; then + major= + versuffix= + verstring= + fi + + # Check to see if the archive will have undefined symbols. + if test yes = "$allow_undefined"; then + if test unsupported = "$allow_undefined_flag"; then + if test yes = "$build_old_libs"; then + func_warning "undefined symbols not allowed in $host shared libraries; building static only" + build_libtool_libs=no + else + func_fatal_error "can't build $host shared library unless -no-undefined is specified" + fi + fi + else + # Don't allow undefined symbols. + allow_undefined_flag=$no_undefined_flag + fi + + fi + + func_generate_dlsyms "$libname" "$libname" : + func_append libobjs " $symfileobj" + test " " = "$libobjs" && libobjs= + + if test relink != "$opt_mode"; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) + if test -n "$precious_files_regex"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles=$dlfiles + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles=$dlprefiles + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test yes = "$build_libtool_libs"; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test yes = "$build_libtool_need_lc"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release= + versuffix= + major= + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib=$potent_lib + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | $SED 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; + *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib= + ;; + esac + fi + if test -n "$a_deplib"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib=$potent_lib # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs= + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + for i in $predeps $postdeps; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test none = "$deplibs_check_method"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test yes = "$droppeddeps"; then + if test yes = "$module"; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test no = "$allow_undefined"; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs=$new_libs + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test yes = "$build_libtool_libs"; then + # Remove $wl instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test yes = "$hardcode_into_libs"; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath=$finalize_rpath + test relink = "$opt_mode" || rpath=$compile_rpath$rpath + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath=$finalize_shlibpath + test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname=$1 + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname=$realname + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib=$output_objdir/$realname + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols=$output_objdir/$libname.uexp + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + func_dll_def_p "$export_symbols" || { + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols=$export_symbols + export_symbols= + always_export_symbols=yes + } + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs=$IFS; IFS='~' + for cmd1 in $cmds; do + IFS=$save_ifs + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test yes = "$try_normal_branch" \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=$output_objdir/$output_la.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS=$save_ifs + if test -n "$export_symbols_regex" && test : != "$skipped_export"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test : != "$skipped_export" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs=$tmp_deplibs + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test yes = "$compiler_needs_object" && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test : != "$skipped_export" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then + output=$output_objdir/$output_la.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then + output=$output_objdir/$output_la.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test yes = "$compiler_needs_object"; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-$k.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test -z "$objlist" || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test 1 -eq "$k"; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-$k.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-$k.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + ${skipped_export-false} && { + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + } + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs=$IFS; IFS='~' + for cmd in $concat_cmds; do + IFS=$save_ifs + $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + ${skipped_export-false} && { + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + } + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs=$IFS; IFS='~' + for cmd in $cmds; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test yes = "$module" || test yes = "$export_dynamic"; then + # On all known operating systems, these are identical. + dlname=$soname + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "'-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object '$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj=$output + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # if reload_cmds runs $LD directly, get rid of -Wl from + # whole_archive_flag_spec and hope we can get by with turning comma + # into space. + case $reload_cmds in + *\$LD[\ \$]*) wl= ;; + esac + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags + else + gentop=$output_objdir/${obj}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test yes = "$build_libtool_libs" || libobjs=$non_pic_objects + + # Create the old-style object. + reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs + + output=$obj + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + test yes = "$build_libtool_libs" || { + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + } + + if test -n "$pic_flag" || test default != "$pic_mode"; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output=$libobj + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "'-release' is ignored for programs" + + $preload \ + && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ + && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test CXX = "$tagname"; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " $wl-bind_at_load" + func_append finalize_command " $wl-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs=$new_libs + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath=$rpath + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath=$rpath + + if test -n "$libobjs" && test yes = "$build_old_libs"; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" false + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=: + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=false + ;; + *cygwin* | *mingw* ) + test yes = "$build_libtool_libs" || wrappers_required=false + ;; + *) + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then + wrappers_required=false + fi + ;; + esac + $wrappers_required || { + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command=$compile_command$compile_rpath + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.$objext"; then + func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' + fi + + exit $exit_status + } + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test yes = "$no_install"; then + # We don't need to create a wrapper script. + link_command=$compile_var$compile_command$compile_rpath + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + case $hardcode_action,$fast_install in + relink,*) + # Fast installation is not supported + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "'$output' will be relinked during installation" + ;; + *,yes) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + ;; + *,no) + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + ;; + *,needless) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command= + ;; + esac + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource=$output_path/$objdir/lt-$output_name.c + cwrapper=$output_path/$output_name.exe + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host"; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + case $build_libtool_libs in + convenience) + oldobjs="$libobjs_save $symfileobj" + addlibs=$convenience + build_libtool_libs=no + ;; + module) + oldobjs=$libobjs_save + addlibs=$old_convenience + build_libtool_libs=no + ;; + *) + oldobjs="$old_deplibs $non_pic_objects" + $preload && test -f "$symfileobj" \ + && func_append oldobjs " $symfileobj" + addlibs=$old_convenience + ;; + esac + + if test -n "$addlibs"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase=$func_basename_result + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj"; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test -z "$oldobjs"; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test yes = "$build_old_libs" && old_library=$libname.$libext + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test yes = "$hardcode_automatic"; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test yes = "$installed"; then + if test -z "$install_libdir"; then + break + fi + output=$output_objdir/${outputname}i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name=$func_basename_result + func_resolve_sysroot "$deplib" + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs=$newdependency_libs + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles=$newdlprefiles + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles=$newdlprefiles + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test -n "$bindir"; then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result/$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that cannot go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test no,yes = "$installed,$need_relink"; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +if test link = "$opt_mode" || test relink = "$opt_mode"; then + func_mode_link ${1+"$@"} +fi + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $debug_cmd + + RM=$nonopt + files= + rmforce=false + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=: ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir=$func_dirname_result + if test . = "$dir"; then + odir=$objdir + else + odir=$dir/$objdir + fi + func_basename "$file" + name=$func_basename_result + test uninstall = "$opt_mode" && odir=$dir + + # Remember odir for removal later, being careful to avoid duplicates + if test clean = "$opt_mode"; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif $rmforce; then + continue + fi + + rmfiles=$file + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case $opt_mode in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && test none != "$pic_object"; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && test none != "$non_pic_object"; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test clean = "$opt_mode"; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.$objext" + if test yes = "$fast_install" && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name"; then + func_append rmfiles " $odir/lt-$noexename.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the $objdir's in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then + func_mode_uninstall ${1+"$@"} +fi + +test -z "$opt_mode" && { + help=$generic_help + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode '$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# where we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/m4/gettext.m4 b/m4/gettext.m4 new file mode 100644 index 0000000..be247bf --- /dev/null +++ b/m4/gettext.m4 @@ -0,0 +1,401 @@ +# gettext.m4 serial 66 (gettext-0.18.2) +dnl Copyright (C) 1995-2014 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-2006, 2008-2010. + +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(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], + [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) + 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], + ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), + [yes])) + define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) + gt_NEEDS_INIT + AM_GNU_GETTEXT_NEED([$2]) + + 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 { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "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 Mac OS X, libintl requires linking with CoreFoundation. + gt_INTL_MACOSX + + dnl Set USE_NLS. + AC_REQUIRE([AM_NLS]) + + ifelse(gt_included_intl, yes, [ + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + ]) + LIBINTL= + LTLIBINTL= + POSUB= + + dnl Add a version number to the cache macros. + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + 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. + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#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 +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + ]])], + [eval "$gt_func_gnugettext_libc=yes"], + [eval "$gt_func_gnugettext_libc=no"])]) + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "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_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_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ]])], + [eval "$gt_func_gnugettext_libintl=yes"], + [eval "$gt_func_gnugettext_libintl=no"]) + dnl Now see whether libintl exists and depends on libiconv. + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ]])], + [LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_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 { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "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 $LIBTHREAD" + LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" + 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 { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "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 { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "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 gt_NEEDS_INIT ensures that the gt_needs variable is initialized. +m4_define([gt_NEEDS_INIT], +[ + m4_divert_text([DEFAULTS], [gt_needs=]) + m4_define([gt_NEEDS_INIT], []) +]) + + +dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) +AC_DEFUN([AM_GNU_GETTEXT_NEED], +[ + m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) +]) + + +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) diff --git a/m4/gtk-doc.m4 b/m4/gtk-doc.m4 new file mode 100644 index 0000000..3675543 --- /dev/null +++ b/m4/gtk-doc.m4 @@ -0,0 +1,88 @@ +dnl -*- mode: autoconf -*- + +# serial 2 + +dnl Usage: +dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) +AC_DEFUN([GTK_DOC_CHECK], +[ + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + + ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"]) + AC_MSG_CHECKING([for gtk-doc]) + PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no]) + AC_MSG_RESULT($have_gtk_doc) + + if test "$have_gtk_doc" = "no"; then + AC_MSG_WARN([ + You will not be able to create source packages with 'make dist' + because $gtk_doc_requires is not found.]) + fi + + dnl check for tools we added during development + dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that + dnl may not be writable by the user. Currently, automake requires that the + dnl test name must end in '.test'. + dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638 + AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test]) + AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check]) + AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) + AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) + + dnl for overriding the documentation installation directory + AC_ARG_WITH([html-dir], + AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, + [with_html_dir='${datadir}/gtk-doc/html']) + HTML_DIR="$with_html_dir" + AC_SUBST([HTML_DIR]) + + dnl enable/disable documentation building + AC_ARG_ENABLE([gtk-doc], + AS_HELP_STRING([--enable-gtk-doc], + [use gtk-doc to build documentation [[default=no]]]),, + [enable_gtk_doc=no]) + + AC_MSG_CHECKING([whether to build gtk-doc documentation]) + AC_MSG_RESULT($enable_gtk_doc) + + if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then + AC_MSG_ERROR([ + You must have $gtk_doc_requires installed to build documentation for + $PACKAGE_NAME. Please install gtk-doc or disable building the + documentation by adding '--disable-gtk-doc' to '[$]0'.]) + fi + + dnl don't check for glib if we build glib + if test "x$PACKAGE_NAME" != "xglib"; then + dnl don't fail if someone does not have glib + PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:]) + fi + + dnl enable/disable output formats + AC_ARG_ENABLE([gtk-doc-html], + AS_HELP_STRING([--enable-gtk-doc-html], + [build documentation in html format [[default=yes]]]),, + [enable_gtk_doc_html=yes]) + AC_ARG_ENABLE([gtk-doc-pdf], + AS_HELP_STRING([--enable-gtk-doc-pdf], + [build documentation in pdf format [[default=no]]]),, + [enable_gtk_doc_pdf=no]) + + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi + + if test -z "$AM_DEFAULT_VERBOSITY"; then + AM_DEFAULT_VERBOSITY=1 + fi + AC_SUBST([AM_DEFAULT_VERBOSITY]) + + AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes]) + AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) + AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) + AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) +]) diff --git a/m4/iconv.m4 b/m4/iconv.m4 new file mode 100644 index 0000000..4e37363 --- /dev/null +++ b/m4/iconv.m4 @@ -0,0 +1,271 @@ +# iconv.m4 serial 19 (gettext-0.18.2) +dnl Copyright (C) 2000-2002, 2007-2014 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). + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + 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_LINK_IFELSE will then fail, the second AC_LINK_IFELSE 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_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#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_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#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_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ + dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, + dnl Solaris 10. + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + ]], + [[int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; +]])], + [am_cv_func_iconv_works=yes], , + [case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac]) + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + ]) + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + AC_DEFINE([HAVE_ICONV], [1], + [Define if you have the iconv() function and it works.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + 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]) +]) + +dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to +dnl avoid warnings like +dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". +dnl This is tricky because of the way 'aclocal' is implemented: +dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. +dnl Otherwise aclocal's initial scan pass would miss the macro definition. +dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. +dnl Otherwise aclocal would emit many "Use of uninitialized value $1" +dnl warnings. +m4_define([gl_iconv_AC_DEFUN], + m4_version_prereq([2.64], + [[AC_DEFUN_ONCE( + [$1], [$2])]], + [m4_ifdef([gl_00GNULIB], + [[AC_DEFUN_ONCE( + [$1], [$2])]], + [[AC_DEFUN( + [$1], [$2])]])])) +gl_iconv_AC_DEFUN([AM_ICONV], +[ + AM_ICONV_LINK + if test "$am_cv_func_iconv" = yes; then + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL([am_cv_proto_iconv], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(_MSC_VER) || 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([ + $am_cv_proto_iconv]) + AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], + [Define as const if the declaration of iconv() needs const.]) + dnl Also substitute ICONV_CONST in the gnulib generated . + m4_ifdef([gl_ICONV_H_DEFAULTS], + [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + ]) + fi +]) diff --git a/m4/intlmacosx.m4 b/m4/intlmacosx.m4 new file mode 100644 index 0000000..8a045f6 --- /dev/null +++ b/m4/intlmacosx.m4 @@ -0,0 +1,56 @@ +# intlmacosx.m4 serial 5 (gettext-0.18.2) +dnl Copyright (C) 2004-2014 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 Checks for special options needed on Mac OS X. +dnl Defines INTL_MACOSX_LIBS. +AC_DEFUN([gt_INTL_MACOSX], +[ + dnl Check for API introduced in Mac OS X 10.2. + AC_CACHE_CHECK([for CFPreferencesCopyAppValue], + [gt_cv_func_CFPreferencesCopyAppValue], + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[CFPreferencesCopyAppValue(NULL, NULL)]])], + [gt_cv_func_CFPreferencesCopyAppValue=yes], + [gt_cv_func_CFPreferencesCopyAppValue=no]) + LIBS="$gt_save_LIBS"]) + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], + [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) + fi + dnl Check for API introduced in Mac OS X 10.3. + AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[CFLocaleCopyCurrent();]])], + [gt_cv_func_CFLocaleCopyCurrent=yes], + [gt_cv_func_CFLocaleCopyCurrent=no]) + LIBS="$gt_save_LIBS"]) + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], + [Define to 1 if you have the Mac OS 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]) +]) diff --git a/m4/introspection.m4 b/m4/introspection.m4 new file mode 100644 index 0000000..6dcbc33 --- /dev/null +++ b/m4/introspection.m4 @@ -0,0 +1,96 @@ +dnl -*- mode: autoconf -*- +dnl Copyright 2009 Johan Dahlin +dnl +dnl This file is free software; the author(s) gives unlimited +dnl permission to copy and/or distribute it, with or without +dnl modifications, as long as this notice is preserved. +dnl + +# serial 1 + +m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL], +[ + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([LT_INIT],[$0])dnl setup libtool first + + dnl enable/disable introspection + m4_if([$2], [require], + [dnl + enable_introspection=yes + ],[dnl + AC_ARG_ENABLE(introspection, + AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]], + [Enable introspection for this build]),, + [enable_introspection=auto]) + ])dnl + + AC_MSG_CHECKING([for gobject-introspection]) + + dnl presence/version checking + AS_CASE([$enable_introspection], + [no], [dnl + found_introspection="no (disabled, use --enable-introspection to enable)" + ],dnl + [yes],[dnl + PKG_CHECK_EXISTS([gobject-introspection-1.0],, + AC_MSG_ERROR([gobject-introspection-1.0 is not installed])) + PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], + found_introspection=yes, + AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME])) + ],dnl + [auto],[dnl + PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no) + ],dnl + [dnl + AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@]) + ])dnl + + AC_MSG_RESULT([$found_introspection]) + + INTROSPECTION_SCANNER= + INTROSPECTION_COMPILER= + INTROSPECTION_GENERATE= + INTROSPECTION_GIRDIR= + INTROSPECTION_TYPELIBDIR= + if test "x$found_introspection" = "xyes"; then + INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` + INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` + INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` + INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` + INTROSPECTION_GIRDIR=`echo ${INTROSPECTION_GIRDIR} | sed -e "s|${datadir}|\\\$(datadir)|"` + INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" + INTROSPECTION_TYPELIBDIR=`echo ${INTROSPECTION_TYPELIBDIR} | sed -e "s|${libdir}|\\\$(libdir)|"` + INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` + INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` + INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection + fi + AC_SUBST(INTROSPECTION_SCANNER) + AC_SUBST(INTROSPECTION_COMPILER) + AC_SUBST(INTROSPECTION_GENERATE) + AC_SUBST(INTROSPECTION_GIRDIR) + AC_SUBST(INTROSPECTION_TYPELIBDIR) + AC_SUBST(INTROSPECTION_CFLAGS) + AC_SUBST(INTROSPECTION_LIBS) + AC_SUBST(INTROSPECTION_MAKEFILE) + + AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes") +]) + + +dnl Usage: +dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version]) + +AC_DEFUN([GOBJECT_INTROSPECTION_CHECK], +[ + _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1]) +]) + +dnl Usage: +dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version]) + + +AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE], +[ + _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require]) +]) diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4 new file mode 100644 index 0000000..ddc569f --- /dev/null +++ b/m4/lib-ld.m4 @@ -0,0 +1,119 @@ +# lib-ld.m4 serial 6 +dnl Copyright (C) 1996-2003, 2009-2014 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/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid +dnl collision with libtool.m4. + +dnl From libtool-2.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 lds only accept -v. +case `$LD -v 2>&1 /dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +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 $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` + while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL([acl_cv_path_LD], +[if test -z "$LD"; then + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + 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 variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 = 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" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE([rpath], + [ --disable-rpath do not hardcode runtime library paths], + :, enable_rpath=yes) +]) + +dnl AC_LIB_FROMPACKAGE(name, package) +dnl declares that libname comes from the given package. The configure file +dnl will then not have a --with-libname-prefix option but a +dnl --with-package-prefix option. Several libraries can come from the same +dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar +dnl macro call that searches for libname. +AC_DEFUN([AC_LIB_FROMPACKAGE], +[ + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + define([acl_frompackage_]NAME, [$2]) + popdef([NAME]) + pushdef([PACK],[$2]) + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + define([acl_libsinpackage_]PACKUP, + m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) + popdef([PACKUP]) + popdef([PACK]) +]) + +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found +dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. +AC_DEFUN([AC_LIB_LINKFLAGS_BODY], +[ + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) + dnl Autoconf >= 2.61 supports dots in --with options. + pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_ARG_WITH(P_A_C_K[-prefix], +[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib + --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], +[ + if test "X$withval" = "Xno"; then + use_additional=no + 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/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + 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= + LIB[]NAME[]_PREFIX= + dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been + dnl computed. So it has to be reset here. + HAVE_LIB[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + 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= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + dnl The same code as in the loop below: + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + 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//'` + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + 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/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + 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 "$acl_hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + 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 "$acl_hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + 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 + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + 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/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + 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 "$acl_hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_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=\"$acl_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 + popdef([P_A_C_K]) + popdef([PACKLIBS]) + popdef([PACKUP]) + popdef([PACK]) + popdef([NAME]) +]) + +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, +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 +]) + +dnl For those cases where a variable contains several -L and -l options +dnl referring to unknown libraries and directories, this macro determines the +dnl necessary additional linker options for the runtime path. +dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) +dnl sets LDADDVAR to linker options needed together with LIBSVALUE. +dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, +dnl otherwise linking without libtool is assumed. +AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], +[ + AC_REQUIRE([AC_LIB_RPATH]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + $1= + if test "$enable_rpath" != no; then + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode directories into the resulting + dnl binary. + rpathdirs= + next= + for opt in $2; do + if test -n "$next"; then + dir="$next" + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then + rpathdirs="$rpathdirs $dir" + fi + next= + else + case $opt in + -L) next=yes ;; + -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then + rpathdirs="$rpathdirs $dir" + fi + next= ;; + *) next= ;; + esac + fi + done + if test "X$rpathdirs" != "X"; then + if test -n ""$3""; then + dnl libtool is used for linking. Use -R options. + for dir in $rpathdirs; do + $1="${$1}${$1:+ }-R$dir" + done + else + dnl The linker is used for linking directly. + if test -n "$acl_hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user + dnl must pass all path elements in one option. + alldirs= + for dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="$flag" + else + dnl The -rpath options are cumulative. + for dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="${$1}${$1:+ }$flag" + done + fi + fi + fi + fi + fi + AC_SUBST([$1]) +]) diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4 new file mode 100644 index 0000000..31f49e4 --- /dev/null +++ b/m4/lib-prefix.m4 @@ -0,0 +1,224 @@ +# lib-prefix.m4 serial 7 (gettext-0.18) +dnl Copyright (C) 2001-2005, 2008-2014 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_MULTILIB]) + 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/$acl_libdirstem" + 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/$acl_libdirstem"; 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/$acl_libdirstem"; 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" +]) + +dnl AC_LIB_PREPARE_MULTILIB creates +dnl - a variable acl_libdirstem, containing the basename of the libdir, either +dnl "lib" or "lib64" or "lib/64", +dnl - a variable acl_libdirstem2, as a secondary possible value for +dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or +dnl "lib/amd64". +AC_DEFUN([AC_LIB_PREPARE_MULTILIB], +[ + dnl There is no formal standard regarding lib and lib64. + dnl On glibc systems, the current practice is that on a system supporting + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under + dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine + dnl the compiler's default mode by looking at the compiler's library search + dnl path. If at least one of its elements ends in /lib64 or points to a + dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. + dnl Otherwise we use the default, namely "lib". + dnl On Solaris systems, the current practice is that on a system supporting + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under + dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or + dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. + AC_REQUIRE([AC_CANONICAL_HOST]) + acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment + dnl . + dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." + dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the + dnl symlink is missing, so we set acl_libdirstem2 too. + AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], + [AC_EGREP_CPP([sixtyfour bits], [ +#ifdef _LP64 +sixtyfour bits +#endif + ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) + ]) + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" +]) diff --git a/m4/libtool.m4 b/m4/libtool.m4 new file mode 100644 index 0000000..a644432 --- /dev/null +++ b/m4/libtool.m4 @@ -0,0 +1,8372 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 2014 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. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +]) + +# serial 58 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + +# _LT_CC_BASENAME(CC) +# ------------------- +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. +m4_defun([_LT_CC_BASENAME], +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from 'configure', and 'config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# 'config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain=$ac_aux_dir/ltmain.sh +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the 'libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to 'config.status' so that its +# declaration there will have the same value as in 'configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags='_LT_TAGS'dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into 'config.status', and then the shell code to quote escape them in +# for loops in 'config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# '#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test 0 = "$lt_write_fail" && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +'$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test 0 != $[#] +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try '$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try '$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test yes = "$silent" && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +_LT_COPYING +_LT_LIBTOOL_TAGS + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +_LT_PREPARE_MUNGE_PATH_LIST +_LT_PREPARE_CC_BASENAME + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS=$save_LDFLAGS + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[[012]][[,.]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test yes = "$lt_cv_ld_force_load"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + m4_if([$1], [CXX], +[ if test yes != "$lt_cv_apple_cc_single_mod"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script that will find a shell with a builtin +# printf (that we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case $ECHO in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], + [Search for dependent libraries within DIR (or the compiler's sysroot + if not specified).])], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([$with_sysroot]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and where our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test yes = "[$]$2"; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS +]) + +if test yes = "[$]$2"; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n "$lt_cv_sys_max_cmd_len"; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test yes = "$cross_compiling"; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen=shl_load], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen=dlopen], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links=nottested +if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test no = "$hard_links"; then + AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", + [Define to the sub-directory where libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then + + # We can hardcode non-existent directories. + if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && + test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || + test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_PREPARE_MUNGE_PATH_LIST +# --------------------------- +# Make sure func_munge_path_list() is defined correctly. +m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], +[[# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x@S|@2 in + x) + ;; + *:) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" + ;; + x:*) + eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" + ;; + *) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + esac +} +]])# _LT_PREPARE_PATH_LIST + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +AC_ARG_VAR([LT_SYS_LIBRARY_PATH], +[User-defined run-time library search path.]) + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a[(]lib.so.V[)]' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program that can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$1"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac]) +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program that can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test no = "$withval" || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + +# _LT_CHECK_MAGIC_METHOD +# ---------------------- +# how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_MAGIC_METHOD], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +AC_CACHE_CHECK([how to recognize dependent libraries], +lt_cv_deplibs_check_method, +[lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[[4-9]]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[[45]]*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi]) +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# _LT_DLL_DEF_P([FILE]) +# --------------------- +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with func_dll_def_p in the libtool script +AC_DEFUN([_LT_DLL_DEF_P], +[dnl + test DEF = "`$SED -n dnl + -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace + -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments + -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl + -e q dnl Only consider the first "real" line + $1`" dnl +])# _LT_DLL_DEF_P + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM=-lm) + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], + [Transform the output of nm into a list of symbols to manually relocate]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], + [The name lister interface]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test yes = "$GCC"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS=$save_LDFLAGS]) + if test yes = "$lt_cv_irix_exported_symbol"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(ld_shlibs, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + osf3*) + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting $shlibpath_var if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC=$CC +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report what library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC=$lt_save_CC +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + + _LT_TAGVAR(GCC, $1)=$GXX + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case @S|@2 in + .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; + *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)=$prev$p + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)=$p + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)=$p + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test no = "$F77"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_disable_F77"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)=$G77 + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_F77" + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test no = "$FC"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_disable_FC"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_FC" + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)=$LD +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)=$LD +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code=$lt_simple_compile_test_code + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f "$lt_ac_sed" && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test 10 -lt "$lt_ac_count" && break + lt_ac_count=`expr $lt_ac_count + 1` + if test "$lt_ac_count" -gt "$lt_ac_max"; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine what file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 new file mode 100644 index 0000000..94b0829 --- /dev/null +++ b/m4/ltoptions.m4 @@ -0,0 +1,437 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 8 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option '$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl 'shared' nor 'disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], + [_LT_WITH_AIX_SONAME([aix])]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the 'shared' and +# 'disable-shared' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the 'static' and +# 'disable-static' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the 'fast-install' +# and 'disable-fast-install' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the 'fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the 'disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_AIX_SONAME([DEFAULT]) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define([_LT_WITH_AIX_SONAME], +[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[[5-9]]*,yes) + AC_MSG_CHECKING([which variant of shared library versioning to provide]) + AC_ARG_WITH([aix-soname], + [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname], + [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) + with_aix_soname=$lt_cv_with_aix_soname]) + AC_MSG_RESULT([$with_aix_soname]) + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + +_LT_DECL([], [shared_archive_member_spec], [0], + [Shared archive member basename, for filename based shared library versioning on AIX])dnl +])# _LT_WITH_AIX_SONAME + +LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' +# LT_INIT options. +# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [pic_mode=m4_default([$1], [default])]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 new file mode 100644 index 0000000..48bc934 --- /dev/null +++ b/m4/ltsugar.m4 @@ -0,0 +1,124 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59, which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 new file mode 100644 index 0000000..fa04b52 --- /dev/null +++ b/m4/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 4179 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.6' +macro_revision='2.4.6' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 new file mode 100644 index 0000000..c6b26f8 --- /dev/null +++ b/m4/lt~obsolete.m4 @@ -0,0 +1,99 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/m4/nls.m4 b/m4/nls.m4 new file mode 100644 index 0000000..53cdc8b --- /dev/null +++ b/m4/nls.m4 @@ -0,0 +1,32 @@ +# nls.m4 serial 5 (gettext-0.18) +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 Free Software Foundation, +dnl 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]) + +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]) +]) diff --git a/m4/po.m4 b/m4/po.m4 new file mode 100644 index 0000000..43012dc --- /dev/null +++ b/m4/po.m4 @@ -0,0 +1,453 @@ +# po.m4 serial 24 (gettext-0.19) +dnl Copyright (C) 1995-2014 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.60]) + +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([AC_PROG_MKDIR_P])dnl + AC_REQUIRE([AC_PROG_SED])dnl + AC_REQUIRE([AM_NLS])dnl + + dnl Release version of the gettext macros. This is used to ensure that + dnl the gettext macros and po/Makefile.in.in are in sync. + AC_SUBST([GETTEXT_MACRO_VERSION], [0.19]) + + 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 Test whether it is GNU msgfmt >= 0.15. +changequote(,)dnl + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([MSGFMT_015]) +changequote(,)dnl + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([GMSGFMT_015]) + + 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 Test whether it is GNU xgettext >= 0.15. +changequote(,)dnl + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac +changequote([,])dnl + AC_SUBST([XGETTEXT_015]) + + 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 Installation directories. + dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we + dnl have to define it here, so that it can be used in po/Makefile. + test -n "$localedir" || localedir='${datadir}/locale' + AC_SUBST([localedir]) + + dnl Support for AM_XGETTEXT_OPTION. + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) + + AC_CONFIG_COMMANDS([po-directories], [[ + 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" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/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 assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assignment from automake < 1.5. + 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 < 1.5. + 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" + tab=`printf '\t'` + 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" <, 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 + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +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 +]) diff --git a/misc/Makefile.am b/misc/Makefile.am new file mode 100644 index 0000000..4f9aa50 --- /dev/null +++ b/misc/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = i4b_acct.h i4b_acct.txt + diff --git a/misc/Makefile.in b/misc/Makefile.in new file mode 100644 index 0000000..fe01bdf --- /dev/null +++ b/misc/Makefile.in @@ -0,0 +1,513 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = misc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = i4b_acct.h i4b_acct.txt +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu misc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu misc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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: diff --git a/misc/i4b_acct.h b/misc/i4b_acct.h new file mode 100644 index 0000000..87538f0 --- /dev/null +++ b/misc/i4b_acct.h @@ -0,0 +1,75 @@ +/* This file contains modified code from `/usr/src/i4b/driver/i4b_isppp.c' + * which belongs to the I4B package. + * + * The original copyright of this file [/usr/src/i4b/driver/i4b_isppp.c] is + * + * ----------------------------------------------------------------------------- + * + * Copyright (c) 1997 Joerg Wunsch. All rights reserved. + * + * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * 4. Altered versions must be plainly marked as such, and must not be + * misrepresented as being the original software and/or documentation. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * ----------------------------------------------------------------------------- + */ + +#define I4BISPPPACCT 1 /* enable accounting messages */ + +struct i4bisppp_softc { + /* + * struct sppp starts with a struct ifnet, but we gotta allocate + * more space for it. NB: do not relocate this union, it must + * be first in isppp_softc. The tls and tlf hooks below want to + * convert a ``struct sppp *'' into a ``struct isppp_softc *''. + */ + union { + struct ifnet scu_if; + struct sppp scu_sp; + } sc_if_un; +#define sc_if sc_if_un.scu_if + int sc_state; /* state of the interface */ +#ifndef __FreeBSD__ + int sc_unit; /* unit number for Net/OpenBSD */ +#endif + void *sc_cdp; /* ptr to call descriptor */ + +#ifdef I4BISPPPACCT + int sc_iinb; /* isdn driver # of inbytes */ + int sc_ioutb; /* isdn driver # of outbytes */ + int sc_inb; /* # of bytes rx'd */ + int sc_outb; /* # of bytes tx'd */ + int sc_linb; /* last # of bytes rx'd */ + int sc_loutb; /* last # of bytes tx'd */ + int sc_fn; /* flag, first null acct */ +#endif + +#if defined(__FreeBSD__) && __FreeBSD__ >= 3 + struct callout_handle sc_ch; +#endif +}; diff --git a/misc/i4b_acct.txt b/misc/i4b_acct.txt new file mode 100644 index 0000000..4fd7d02 --- /dev/null +++ b/misc/i4b_acct.txt @@ -0,0 +1,96 @@ +To get ISDN statistics with the I4B package do the following: + +* Look at the declaration of `struct i4bisppp_softc' in + /usr/src/i4b/driver/i4b_isppp.c. + + It is looking like this: + + struct i4bisppp_softc { + /* + * struct sppp starts with a struct ifnet, but we gotta allocate + * more space for it. NB: do not relocate this union, it must + * be first in isppp_softc. The tls and tlf hooks below want to + * convert a ``struct sppp *'' into a ``struct isppp_softc *''. + */ + union { + struct ifnet scu_if; + struct sppp scu_sp; + } sc_if_un; + #define sc_if sc_if_un.scu_if + int sc_state; /* state of the interface */ + #ifndef __FreeBSD__ + int sc_unit; /* unit number for Net/OpenBSD */ + #endif + call_desc_t *sc_cdp; /* ptr to call descriptor */ + + #ifdef I4BISPPPACCT + int sc_iinb; /* isdn driver # of inbytes */ + int sc_ioutb; /* isdn driver # of outbytes */ + int sc_inb; /* # of bytes rx'd */ + int sc_outb; /* # of bytes tx'd */ + int sc_linb; /* last # of bytes rx'd */ + int sc_loutb; /* last # of bytes tx'd */ + int sc_fn; /* flag, first null acct */ + #endif + + #if defined(__FreeBSD__) && __FreeBSD__ >= 3 + struct callout_handle sc_ch; + #endif + } i4bisppp_softc[NI4BISPPP]; + +* Create a new file /usr/include/machine/i4b_acct.h and put the declaration + of this structure in this file. + +* Replace `call_desc_t *' with `void *' in it. + +* The result should look like this: + + struct i4bisppp_softc { + /* + * struct sppp starts with a struct ifnet, but we gotta allocate + * more space for it. NB: do not relocate this union, it must + * be first in isppp_softc. The tls and tlf hooks below want to + * convert a ``struct sppp *'' into a ``struct isppp_softc *''. + */ + union { + struct ifnet scu_if; + struct sppp scu_sp; + } sc_if_un; + #define sc_if sc_if_un.scu_if + int sc_state; /* state of the interface */ + #ifndef __FreeBSD__ + int sc_unit; /* unit number for Net/OpenBSD */ + #endif + void *sc_cdp; /* ptr to call descriptor */ + + #ifdef I4BISPPPACCT + int sc_iinb; /* isdn driver # of inbytes */ + int sc_ioutb; /* isdn driver # of outbytes */ + int sc_inb; /* # of bytes rx'd */ + int sc_outb; /* # of bytes tx'd */ + int sc_linb; /* last # of bytes rx'd */ + int sc_loutb; /* last # of bytes tx'd */ + int sc_fn; /* flag, first null acct */ + #endif + + #if defined(__FreeBSD__) && __FreeBSD__ >= 3 + struct callout_handle sc_ch; + #endif + }; + +* Put a + + #define I4BISPPPACCT 1 /* enable accounting messages */ + + at the top of your /usr/include/machine/i4b_acct.h + +* This file should now look about like `misc/i4b_acct.h' in the LibGTop + source directory. + +* Done. + +This is necessary since LibGTop reads its data directly out of the kernel +and the `struct i4bisppp_softc' is only defined there and in no header file +(someone can tell the I4B people to put it in some header file ?). + +Martin diff --git a/missing b/missing new file mode 100755 index 0000000..f62bbae --- /dev/null +++ b/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2013-10-28.13; # UTC + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Originally written by Fran,cois 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, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/po/ChangeLog b/po/ChangeLog new file mode 100644 index 0000000..20bf836 --- /dev/null +++ b/po/ChangeLog @@ -0,0 +1,1967 @@ +2009-06-10 Manoj Kumar Giri + + * hi.po: Committed Hindi Translation on behalf of Rajesh Ranjan. + +2009-03-18 Djihed Afifi + + * ar.po: Updated Arabic translation by Khaled Hosny. + +2009-03-16 Ignacio Casal Quinteiro + + * gl.po: Updated Galician translation by Suso Baleato. + +2009-03-16 Amitakhya Phukan + + * LINGUAS: Added as. + * as.po: Updated Assamese translations. + +2009-03-15 Shankar Prasad + + * kn.po: Added Kannada translations. + * LINGUAS: Added Kannad (kn) to the list + +2009-03-10 Manoj Kumar Giri + + * or.po: Updated Oriya Translation. + +2009-02-09 Chao-Hsiung Liao + + * zh_HK.po: Updated Traditional Chinese translation(Hong Kong). + * zh_TW.po: Updated Traditional Chinese translation(Taiwan). + +2009-01-29 Changwoo Ryu + + * ko.po: Updated Korean translation. + +2009-01-25 Raivis Dejus + + * lv.po: Updated Latvian translation. + +2008-11-14 Thomas Thurman + + * la.po: added Latin translation by Rafael Garcia. + * LINGUAS: added Latin. + +2008-10-19 Djihed Afifi + + * ar.po: Updated Arabic Translation by Khaled Hosny. + +2008-09-20 Laurent Dhima + + * sq.po: Updated Albanian Translation. + +2008-09-19 Mugurel Tudor + + * ro.po: Updated Romanian translation by + Mişu Moldovan + +2008-09-18 Baris Cicek + + * tr.po: Fixed wrong plural forms + +2008-09-18 Djihed Afifi + + * ar.po: Updated Arabic Translation by Khaled Hosny. + +2008-09-15 Djihed Afifi + + * ar.po: Updated Arabic Translation by Khaled Hosny. + +2008-09-14 Baris Cicek + + * tr.po: Updated Turkish Translation. + +2008-09-09 Robert Sedak + + * hr.po: Updated Croatian translation. + +2008-08-25 Goran Rakic + + * LINGUAS, sr@latin.po, sr@Latn.po: Conversion from sr@Latn to sr@latin. + +2008-08-6 Djihed Afifi + + * ar.po: Updated Arabic Translation by Khaled Hosny. + +2008-07-29 Djihed Afifi + + * ar.po: Updated Arabic Translation by Khaled Hosny. + +2008-07-25 Leonardo Ferreira Fontenelle + + * pt_BR.po: Terminology improvement by Vladimir Melo. + +2008-06-11 Djihed Afifi + + * ar.po: Updated Arabic Translation by Khaled Hosny. + +2008-05-22 Djihed Afifi + + * ar.po: Updated Arabic Translation by Khaled Hosny. + +2008-05-19 Djihed Afifi + + * ar.po: Updated Arabic Translation by Khaled Hosny. + +2008-04-04 Eskild Hustvedt + + * nn.po: Updated Norwegian Nynorsk translation + +2008-03-16 Simos Xenitellis + + * el.po: Updated Greek translation. + +2008-03-09 Gabor Kelemen + + * hu.po: Translation updated + +2008-03-06 Marcel Telka + + * sk.po: Updated Slovak translation. + +2008-02-26 Changwoo Ryu + + * ko.po: Updated Korean translation. + +2008-02-14 Chao-Hsiung Liao + + * zh_HK.po: Updated Traditional Chinese translation(Hong Kong). + * zh_TW.po: Updated Traditional Chinese translation(Taiwan). + +2008-02-14 Pawan Chitrakar + + * ne.po: Updated Nepali Translation. + +2008-02-11 Petr Kovar + + * cs.po: Updated Czech translation by Lucas Lommer. + +2008-01-31 Djihed Afifi + + * ar.po: Updated Arabic Translation by Khaled Hosny. + +2008-01-12 Djihed Afifi + + * ar.po: Updated Arabic Translation by Khaled Hosny. + +2008-01-11 Inaki Larranaga Murgoitio + + * eu.po: Updated Basque translation. + +2007-12-31 Yannig Marchegay + + * oc.po: Updated Occitan translation. + +2007-12-28 Rahul Bhalerao + + * mr.po: Added Marathi translations from Sandeep Shedmake. + * LINGUAS: Added an entry for Marathi(mr). + +2007-11-28 Ignacio Casal Quinteiro + + * gl.po: Updated Galician Translation. + +2007-11-01 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + +2007-10-23 Djihed Afifi + + * ar.po: Updated Arabic Translation by Youssef Chahibi. + +2007-10-21 Djihed Afifi + + * ar.po: Updated Arabic Translation by Youssef Chahibi. + +2007-10-18 Matej Urbančič + + * sl.po: Updated Slovenian Translation. + +2007-10-15 Yair Hershkovitz + + * he.po: Updated Hebrew translation. + +2007-10-02 Alessio Frusciante + + * it.po: Updated Italian translation. + +2007-09-18 Alexander Shopov + + * bg.po: Updated Bulgarian translation by + Alexander Shopov + +2007-09-17 Artur Flinta + + * pl.po: Updated Polish translation by GNOME PL Team. + +2007-09-16 Kenneth Nielsen + + * da.po: Updated Danish translation + +2007-09-16 Gil Forcada + + * ca.po: Updated Catalan translation. + +2007-09-16 Gintautas Miliauskas + + * lt.po: Updated Lithuanian translation. + +2007-09-13 Djihed Afifi + + * ar.po: Updated Arabic Translation by Youssef Chahibi. + +2007-09-13 Gabor Kelemen + + * hu.po: Translation updated. + +2007-09-13 Mugurel Tudor + + * ro.po: Updated Romanian translation + by Mişu Moldovan + +2007-09-12 Maxim Dziumanenko + + * uk.po: Update Ukrainian translation. + +2007-09-12 Goran Rakić + + * sr.po, sr@Latn.po: Updated Serbian translation. + +2007-09-08 Duarte Loreto + + * pt.po: Updated Portuguese translation. + +2007-09-05 Nickolay V. Shmyrev + + * ru.po: Updated Russian translation. + +2007-09-03 Jovan Naumovski + + * mk.po: Updated Macedonian translation. + +2007-08-24 Stéphane Raimbault + + * fr.po: Updated French translation. + +2007-08-10 Runa Bhattacharjee + + * bn_IN.po: Updated Bengali India Translation. + +2007-08-07 Ankit Patel + + * gu.po: Updated Gujarati Translation. + +2007-08-06 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2007-08-05 Inaki Larranaga Murgoitio + + * eu.po: Updated Basque translation. + +2007-07-21 Leonardo Ferreira Fontenelle + + * pt_BR.po: Brazilian Portuguese translation updated by Og Maciel + . + +2007-07-19 Hendrik Richter + + * de.po: Updated German translation. + +2007-07-17 Wouter Bolsterlee + + * nl.po: Dutch translation updated by Wouter Bolsterlee. + +2007-07-16 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2007-07-09 I. Felix + + * ta.po: Tamil Translation updated by Tirumurthi Vasudevan + +2007-07-07 Takeshi AIHANA + + * ja.po: Updated Japanese translation. + +2007-06-27 Clytie Siddall + + * vi.po: Updated Vietnamese translation. + +2007-06-23 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + +2007-06-13 Pema Geyleg + + * dz.po: Updated dzongkha translation. + +2007-05-27 Daniel Nylander + + * sv.po: Updated Swedish translation. + +2007-05-18 Theppitak Karoonboonyanan + + * th.po: Updated Thai translation. + +2007-05-17 Priit Laes + + * et.po: Updated Estonian translation by Ivar Smolin . + +2007-05-15 David Lodge + + * en_GB.po: Updated British English translation + +2007-05-14 Jorge Gonzalez + + * es.po: Updated Spanish translation. + +2007-04-27 I Felix + + * ta.po: Updated Tamil Translation. + +2007-04-25 Benoît Dejean + + * ta.po: Updated Tamil translation. + Translated by Senthil Kumar . + +2007-03-25 Ignacio Casal Quinteiro + + * gl.po: Updated Galician Translation. + +2007-03-03 Artur Flinta + + * pl.po: Updated Polish translation by GNOME PL Team. + +2007-02-27 Gintautas Miliauskas + + * lt.po: Updated Lithuanian translation. + +2006-02-20 Maxim Dziumanenko + + * uk.po: Updated Ukrainian translation. + +2006-12-1 Djihed Afifi + + * ar.po: Updated Arabic Translation. + +2006-11-19 Wouter Bolsterlee + + * pl.po: Translation updated by GNOME PL Team. + +2006-11-18 Djihed Afifi + + * ar.po: Updated Arabic Translation. + +2006-10-30 Djihed Afifi + + * ar.po Updated Arabic Translation. + +2006-10-30 Satoru SATOH + + * ja.po: Fixed wrong plural form entries. + +2006-09-21 Pawan Chitrakar + + * ne.po: Updated Nepali Translation + +2006-09-19 Sunil Mohan Adapa + + * te.po: Added Telugu "te" translation done by + Sree Ganesh . + * LINGUAS: Added "te". + +2006-09-01 Runa Bhattacharjee + + * bn_IN.po: Fixed some typos. + +2006-08-27 Theppitak Karoonboonyanan + + * th.po: Fixed plural strings. + +2006-08-16 Gabor Kelemen + + * hu.po: Translation updated. + +2006-08-14 Matic Žgur + + * sl.po: Updated Slovenian translation. + +2006-08-07 Runa Bhattacharjee + + * bn_IN.po: Updated Bengali India Translation. + +2006-08-05 Ani Peter + + *ml.po Updated Malayalam Translation + +2006-07-05 Thierry Randrianiriana + + * mg.po: Added Malagasy translation + * LINGUAS: Added Malagasy code 'mg' to the list + +2006-07-03 Runa Bhattacharjee + + * bn_IN.po: Added Bengali India Translation + * LINGUAS: Added Bengali India (bn_IN) to the list of languages. + +2006-07-03 Simos Xenitellis + + * ne.po: Fixed ^M, bug #316750. + +2006-06-26 Abel Cheung + + * zh_HK.po, zh_TW.po: Updated traditional Chinese translation. + +2006-06-08 Gora Mohanty + + * LINGUAS: Added 'eo' (Esperanto) + * eo.po: Added Esperanto translation by Guillaume Savaton + + +2006-04-07 Ales Nyakhaychyk + + * be.po: Updated Belarusian translation. + +2006-04-02 Kjartan Maraas + + * POTFILES.skip: Remove non-existing files. + * nb.po: Updated Norwegian bokmål translation. + * no.po: Same. + +2006-03-27 Yair Hershkovitz + + * he.po: Updated Hebrew translation. + +2006-03-22 Gora Mohanty + + * or.po: Updated Oriya translation. + +2006-03-18 Vladimer Sichinava + + * ka.po: Updated Georgian translation. + +2006-03-03 Žygimantas Beručka + + * lt.po: Updated Lithuanian translation. + +2006-02-28 Clytie Siddall + + * lv.po: Updated Latvian translation by Raivis Dejus . + +2005-12-04 Theppitak Karoonboonyanan + + * th.po: Added Thai translation. + +2005-11-17 Timur Jamakeev + + * ky.po: Added Kirghiz translation. + +2005-11-16 Priit Laes + + * et.po: Translation updated by Ivar Smolin. + +2005-10-28 Erdal Ronahi + + * ku.po: Added Kurdish translation + +2005-10-03 Christian Rose + + * sv.po: Reverted unauthorized changes made by + user 'kloczek'. + +2005-10-01 Runa Bhattacharjee + + * bn.po: Updated Bengali (bn) translation. Translation by Mahay Alam Khan + +2005-09-08 Inaki Larranaga + + * eu.po: Updated Basque translation. + +2005-08-29 Telsa Gwynne + + * cy.po: Updated Welsh translation. + +2005-08-22 Mugurel Tudor + + * ro.po: Updated Romanian translation + by Mişu Moldovan + +2005-08-02 Dave Neary + + * tr.po: Fix a C formatting string translation. + +2005-06-28 Alexander Shopov + + * bg.po: Updated Bulgarian translation by + Alexander Shopov + +2005-07-04 Hendrik Richter + + * de.po: Fixed German translation by + Jens Seidel . + +2005-06-22 Abel Cheung + + * zh_TW.po: Fix language team reference. + +2005-06-15 Alexander Shopov + + * bg.po: Updated Bulgarian translation by + Rostislav Raykov + +2005-06-13 Ignacio Casal Quinteiro + + * gl.po: Updated Galician Translation. + +2005-04-01 Adi Attar + + * xh.po: Added Xhosa translation. + +2005-03-31 Steve Murphy + + * rw.po: Added Kinyarwanda translation. + +2005-03-19 Priit Laes + + * et.po: Translation updated by Ivar Smolin. + +2005-03-17 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-03-12 Baris Cicek + + * tr.po: Updated Turkish Translation + +2005-03-07 Dan Damian + + * ro.po: Updated Romanian translation by + Mişu Moldovan . + +2005-03-06 Danilo Šegan + + * sr.po, sr@Latn.po: Updated Serbian translation. + +2005-03-05 Abel Cheung + + * zh_TW.po: Updated traditional Chinese translation from GNOME HK Team + * bg.po: Mark wrong entry as fuzzy (msgfmt check failed). + +2005-03-04 Laszlo Dvornik + + * hu.po: Hungarian translation updated by Gabor Kelemen. + +2005-03-03 Alessio Frusciante + + * it.po: Updated Italian translation. + +2005-02-24 Artur Flinta + + * pl.po: Updated Polish translation by GNOME PL Team. + +2004-02-24 Ankit Patel + + * gu.po: Updated Gujarati Translation. + +2004-02-22 Roozbeh Pournader + + * fa.po: Updated Persian translation by + Azin Azadi . + +2005-02-22 Priit Laes + + * et.po: Translation updated by Ivar Smolin. + +2005-02-20 Raphael Higino + + * pt_BR.po: Updated Brazilian Portuguese translation. + +2005-02-18 Changwoo Ryu + + * ko.po: Updated Korean translation. + +2005-02-18 Kostas Papadimas + + * el.po: Updated Greek translation. + +2005-02-17 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-02-16 Jordi Mallach + + * ca.po: Updated Catalan translation. + +2005-02-15 Maxim Dziumanenko + + * uk.po: Updated Ukrainian translation. + +2005-02-14 Christophe Merlet + + * fr.po: Updated French translation. + +2005-02-14 Laurent Dhima + + * sq.po: Updated Albanian translation. + +2005-02-14 Benoît Dejean + + * fr.po: Updated French translation. + +2005-02-08 Leonid Kanter + + * ru.po: Updated Russian translation + +2005-02-07 David Lodge + + * en_GB.po: Updated British translation. + +2005-02-06 Ole Laursen + + * da.po: Updated Danish translation. + +2005-02-06 Pauli Virtanen + + * fi.po: Updated Finnish translation. + +2005-02-04 Priit Laes + + * et.po: Translation updated by Tõivo Leedjärv. + +2005-01-30 Žygimantas Beručka + + * lt.po: Updated Lithuanian translation. + +2005-01-28 Kjartan Maraas + + * nb.po: Update + * no.po: Update + +2005-01-27 Alexander Shopov + + * bg.po: Updated Bulgarian translation by + Iassen Pramatarov + +2005-01-26 Duarte Loreto + + * pt.po: Updated Portuguese translation. + +2005-01-24 Funda Wang + + * zh_CN.po: Updated Simplified Chinese translation. + +2005-01-24 Alexander Shopov + + * bg.po: Updated Bulgarian translation by + Vladimir Petkov + +2005-01-24 Benoît Dejean + + * POTFILES.in: + * POTFILES.skip: Removed lib/lib.c as it is generated. + Closes #165038. + +2005-01-17 Benoît Dejean + + * POTFILES.in: Updated. + +2005-01-16 Hendrik Richter + + * de.po: Updated German translation. + +2005-01-16 Takeshi AIHANA + + * ja.po: Updated Japanese translation. + +2005-01-13 Benoît Dejean + + * POTFILES.in: + * POTFILES.skip: Don't translate examples/smp.c. + +2005-01-13 Christian Rose + + * POTFILES.in: Added missing file. + +2005-01-02 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-12-29 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation + +2004-12-29 Marcel Telka + + * sk.po: Updated Slovak translation. + +2004-12-29 Christian Rose + + * sv.po: Updated Swedish translation. + +2004-12-29 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-12-29 Pawan Chitrakar + + * ne.po: Added Nepali Translation + +2004-12-29 Benoît Dejean + + * POTFILES.in: Removed a bunch of strings. + +2004-12-28 Christian Rose + + * POTFILES.in: Added comment and missing file. + * .cvsignore: Added entries and cleaned up. + * sv.po: Updated Swedish translation. + +2004-12-28 Kjartan Maraas + + * nb.po: Update + * no.po: Update + +2004-12-28 Marcel Telka + + * sk.po: Updated Slovak translation. + +2004-12-27 Benoît Dejean + + * POTFILES.in: Removed a lot of unused/useless files. + +2004-12-26 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-12-25 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-12-04 Žygimantas Beručka + + * lt.po: Updated Lithuanian translation. + +2004-11-23 Martin Willemoes Hansen + + * da.po: Updated Danish translation. + +2004-09-26 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-09-24 Benoît Dejean + + * POTFILES.in: Updated. + +2004-09-20 Alessio Frusciante + + * it.po: Updated Italian translation. + +2004-09-14 Gora Mohanty + + * or.po: Updated Oriya translation. + +2004-09-12 Laszlo Dvornik + + * hu.po: Updated Hungarian translation by Gabor Kelemen. + +2004-09-12 Dafydd Harries + + * cy.po: Updated Welsh translation. + +2004-09-10 Christophe Merlet + + * fr.po: Updated French translation from + Benoit Dejean . + +2004-09-07 Akagic Amila + + * bs.po: Updated Bosnian translation. + +2004-09-06 Mugurel Tudor + + * ro.po: Updated Romanian translation + by Misu Moldovan + +2004-09-06 Kostas Papadimas + + * el.po: Updated Greek translation. + +2004-09-05 Raphael Higino + + * pt_BR.po: Updated Brazilian Portuguese translation. + +2004-09-03 Baris Cicek + + * tr.po: Updated Turkish Translation + +2004-09-02 Hendrik Richter + + * de.po: Updated German translation + +2004-08-30 Nikos Charonitakis + + * el.po: Updated Greek translation. + +2004-08-28 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2004-08-28 Akagic Amila + + * bs.po: Added Bosnian translation. + +2004-08-26 Iñaki Larrañaga + + * eu.po: Updated Basque translation. + +2004-08-23 Maxim Dziumanenko + + * uk.po: Updated Ukrainian translation. + +2004-08-23 Martin Willemoes Hansen + + * da.po: Updated Danish translation. + +2004-08-21 Jordi Mallach + + * ca.po: Updated Catalan translation. + +2004-08-21 Kjartan Maraas + + * nb.po: Add this. + +2004-08-20 Laurent Dhima + + * sq.po: Updated Albanian translation. + +2004-08-18 Pauli Virtanen + + * fi.po: Updated Finnish translation. + +2004-08-18 Laurent Dhima + + * sq.po: Updated Albanian translation. + +2004-08-15 Duarte Loreto + + * pt.po: Fixed typo in Portuguese translation. + +2004-08-13 Tommi Vainikainen + + * fi.po: Unified some fields in po headers for Finnish team. + +2004-08-11 Dmitry G. Mastrukov + + * ru.po: Updated Russian translation + from Russian team . + +2004-08-10 Artur Flinta + + * pl.po: Updated Polish translation by GNOME PL Team. + +2004-08-08 Funda Wang + + * zh_CN.po: Updated Simplified Chinese translation. + +2004-08-07 Marcel Telka + + * sk.po: Updated Slovak translation. + +2004-08-07 Danilo Šegan + + * sr.po, sr@Latn.po: Updated Serbian translation. + +2004-08-04 Christian Rose + + * sv.po: Updated Swedish translation. + +2004-08-03 Benoît Dejean + + * am.po: + * ar.po: + * az.po: + * be.po: + * bg.po: + * bn.po: + * ca.po: + * cs.po: + * cy.po: + * da.po: + * de.po: + * el.po: + * en_CA.po: + * en_GB.po: + * es.po: + * et.po: + * eu.po: + * fa.po: + * fi.po: + * fr.po: + * ga.po: + * gl.po: + * gu.po: + * he.po: + * hi.po: + * hr.po: + * hu.po: + * id.po: + * it.po: + * ja.po: + * ko.po: + * lt.po: + * lv.po: + * mi.po: + * mk.po: + * ml.po: + * mn.po: + * ms.po: + * nl.po: + * nn.po: + * no.po: + * pa.po: + * pl.po: + * pt.po: + * pt_BR.po: + * ro.po: + * ru.po: + * sk.po: + * sl.po: + * sq.po: + * sr.po: + * sr@Latn.po: + * sv.po: + * ta.po: + * tr.po: + * uk.po: + * vi.po: + * zh_CN.po: + * zh_TW.po: Updated. + +2004-08-03 Changwoo Ryu + + * ko.po: Updated Korean translation. + +2004-08-01 Kjartan Maraas + + * no.po: Updated Norwegian translation. + +2004-07-31 Laszlo Dvornik + + * hu.po: Updated Hungarian translation by Gabor Kelemen. + +2004-07-31 Laszlo Dvornik + + * hu.po: Updated Hungarian translation by Gabor Kelemen. + +2004-07-31 Francisco Javier F. Serrador + + * es.po: Updated Spanih translation. + +2004-07-28 David Lodge + * en_GB.po: Updated British translation. + +2004-07-26 Duarte Loreto + + * pt.po: Updated Portuguese translation. + +2004-07-21 Metin Amiroff + + * az.po: Translation updated by Mətin Əmirov. + +2004-07-21 Takeshi AIHANA + + * ja.po: Updated Japanese translation. + +2004-07-21 Guntupalli Karunakar + + * hi.po: Updated Hindi translation. + +2004-07-21 Vincent van Adrighem + + * nl.po: Translation updated by Jeroen van der Vegt. + +2004-07-20 Benoît Dejean + + * am.po: + * ar.po: + * az.po: + * be.po: + * bg.po: + * bn.po: + * ca.po: + * cs.po: + * cy.po: + * da.po: + * de.po: + * el.po: + * en_CA.po: + * en_GB.po: + * es.po: + * et.po: + * eu.po: + * fa.po: + * fi.po: + * fr.po: + * ga.po: + * gl.po: + * gu.po: + * he.po: + * hi.po: + * hr.po: + * hu.po: + * id.po: + * it.po: + * ja.po: + * ko.po: + * lt.po: + * lv.po: + * mi.po: + * mk.po: + * ml.po: + * mn.po: + * ms.po: + * nl.po: + * nn.po: + * no.po: + * pa.po: + * pl.po: + * pt.po: + * pt_BR.po: + * ro.po: + * ru.po: + * sk.po: + * sl.po: + * sq.po: + * sr.po: + * sr@Latn.po: + * sv.po: + * ta.po: + * tr.po: + * uk.po: + * vi.po: + * zh_CN.po: + * zh_TW.po: Updated. + +2004-07-19 Laurent Dhima + + * sq.po: Updated Albanian translation. + +2004-07-19 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-07-18 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-07-18 Benoît Dejean + + * POTFILES.in: Updated. Closes #147822. + +2004-07-08 Alexander Shopov + + * bg.po: Updated Bulgarian translation by + Rostislav Raykov + +2004-06-28 Laurent Dhima + + * sq.po: Translation updated. + +2004-06-26 John C Barstow + + * mi.po: Translation added. + +2004-05-14 Baris Cicek + + * tr.po: Updated Turkish Translation + +2004-04-16 Iñaki Larrañaga + + * eu.po: Added Basque translation. + +2004-04-15 Andras Timar + + * hu.po: Updated Hungarian translation. + +2004-04-09 Guntupalli Karunakar + + * gu.po: Added Gujurati translation by + Gujarati Team . + +2004-03-30 Adam Weinberger + + * en_CA.po: Added Canadian English translation. + +2004-03-23 Åsmund Skjæveland + + * nn.po: Updated Norwegian Nynorsk translation. + +2004-03-22 Gareth Owen + + * en_GB.po: Added British translation + +2004-03-22 Guntupalli Karunakar + + * pa.po: Punjabi translation by + Amanpreet Singh Alam . + +2004-03-21 Andras Timar + + * hu.po: Added Hungarian translation. + +2004-03-18 Mugurel Tudor + + * ro.po: Updated Romanian translation by + Mişu Moldovan + +2004-03-16 Dafydd Harries + + * cy.po: Updated Welsh translation. + +2004-03-15 Alessio Frusciante + + * it.po: Updated Italian translation. + +2004-03-15 Yuriy Syrota + + * uk.po: Updated Ukrainian translation. + +2004-03-13 Ales Nyakhaychyk + + * be.po: Updated Belarusian translation. + +2004-03-12 Tomasz Kłoczko + + * hr.po: added Plural-Forms field in header and missing empty + entries. + +2004-03-11 Gustavo Maciel Dias Vieira + + * pt_BR.po: Updated Brazilian Portuguese translation done by + Medina . + +2004-03-11 Dmitry G. Mastrukov + + * ru.po: Updated Russian translation + from Russian team . + +2004-03-10 Alessio Frusciante + + * it.po: Updated Italian translation. + +2004-03-07 Funda Wang + + * zh_CN.po: Updated Simplified Chinese translation. + +2004-03-06 Mətin Əmirov + + * az.po: Translation updated. + +2004-02-26 Guntupalli Karunakar + + * hi.po: Updated Hindi translation. + +2004-02-23 Laurent Dhima + + * sq.po: Fixed Albanian translation. + +2004-02-21 Nikos Charonitakis + + * el.po: Updated Greek translation. + +2004-02-08 Changwoo Ryu + + * ko.po: Updated Korean translation. + +2004-02-07 Robert Sedak + + * hr.po: Updated Croatian translation. + +2004-02-05 Pauli Virtanen + + * fi.po: Updated Finnish translation. + +2004-02-02 Laurent Dhima + + * sq.po: Updated Albanian translation. + +2004-01-31 Mətin Əmirov + + * az.po: Translation updated. + +2004-01-28 Miloslav Trmac + + * cs.po: Fixed Czech translation. + +2004-01-26 Alastair McKinstry + + * ga.po: Updated Irish translation. + +2004-01-24 Alessio Frusciante + + * it.po: Updated Italian translation. + +2004-01-17 Changwoo Ryu + + * ko.po: Updated Korean translation. + +2004-01-15 Laurent Dhima + + * sq.po: Updated Albanian translation. + +2004-01-13 Artur Flinta + + * pl.po: Updated Polish translation by GNOME PL Team. + +2004-01-13 Kjartan Maraas + + * no.po: Updated Norwegian translation. + +2004-01-06 Christian Rose + + * sv.po: Updated Swedish translation. + +2004-01-06 Åsmund Skjæveland + + * nn.po: Updated Norwegian Nynorsk translation. + +2004-01-04 Sanlig Badral + + * mn.po: Updated Mongolian translation. + +2004-01-04 Christian Neumair + + * de.po: Updated German translation. + +2004-01-04 Christophe Merlet + + * fr.po: Updated French translation. + +2004-01-04 Duarte Loreto + + * pt.po: Updated and revised Portuguese translation. + +2004-01-03 Robert Sedak + + * hr.po: Updated Croatian translation. + +2004-01-02 Sanlig Badral + + * mn.po: Updated Mongolian translation. + +2003-12-14 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2003-12-03 Sanlig Badral + + * mn.po: Updated Mongolian translation. + +2003-12-02 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2003-11-20 Ole Laursen + + * da.po: Updated Danish translation. + +2002-03-10 Hasbullah Bin Pit + + * ms.po: Updated Malay translation. + +2003-11-07 Vincent van Adrighem + + * nl.po: Dutch translation updated by Jeroen van der Vegt. + +2003-11-04 Vincent van Adrighem + + * nl.po: Dutch translation updated by Jeroen van der Vegt. + +2003-11-03 Jordi Mallach + + * ca.po: Updated Catalan translation. + +2003-11-02 Žygimantas Beručka + + * lt.po: Added Lithuanian translation. + +2003-11-02 KAMAGASAKO Masatoshi + + * ja.po: Updated Japanese translation. + +2003-11-01 Marcel Telka + + * sk.po: Updated Slovak translation. + +2003-10-30 Kostas Papadimas + + * el.po: Updated Greek translation. + +2003-10-22 Danilo Šegan + + * sr.po, sr@Latn.po: Updated Serbian translation. + +2003-10-20 Bastien Nocera + + * POTFILES.in: fixed distchecking + +2003-10-19 Carlos Perelló Marín + + * POTFILES.ignore: Removed, we use now POTFILES.skip + +2003-10-01 Gustavo Maciel Dias Vieira + + * pt_BR.po: Applied revision by Augusta Marques da Silva + . + +2003-09-30 Laurent Dhima + + * sq.po: Added Albanian translation. + +2003-09-17 Fatih Demir + + * ta.po: Committed new Tamil translation by Dinesh. + +2003-09-13 Carlos Perelló Marín + + * es_ES.po, LEEME.es: Removed, it's only for one string that is a + comment and procman is not using it. This modules is not maintained + and all people tells that should die so I don't think that any other + application will use it in the near future. This one is related with + the bug #105676 + +2003-09-08 Mugurel Tudor + + * ro.po: Updated Romanian translation by + Mişu Moldovan + +2003-09-06 Taneem Ahmed + + * bn.po: Added Bangla translation by Vat + of Ankur group . + +2003-08-28 Pablo Gonzalo del Campo + + * es.po: Revision of Spanish translation by + Francisco Javier F. Serrador . + +2003-08-28 Alessio Frusciante + + * it.po: Updated Italian translation. + +2003-08-25 Duarte Loreto + + * pt.po: Fixed typos in Portuguese translation. + +2003-08-18 Metin Amiroff + + * az.po: Updated Azerbaijani translation. + +2003-08-13 Guntupalli Karunakar + + * hi.po: Added Hindi translation. + +2003-08-09 Dafydd Harries + + * cy.po: Added Welsh translation. + +2003-08-09 Wang Jian + + * zh_CN.po: Updated Simplified Chinese translation by + Funda Wang . + +2003-08-08 Danilo Šegan + + * sr.po, sr@Latn.po: Updated Serbian translation. + +2003-07-21 Arafat Medini + + * ar.po: Updated Arabic translation. + +2003-07-19 Arafat Medini + + * ar.po: Updated Arabic translation. + +2003-07-19 Arafat Medini + + * ar.po: Updated Arabic translation. + +2003-07-13 Metin Amiroff + + * az.po: Updated Azerbaijani translation. + +2003-06-25 Mohammad DAMT + + * id.po: Updated Indonesian translation + +2003-06-23 Vincent van Adrighem + + * nl.po: Dutch translation updated by Kees van den Broek. + +2003-06-14 Arafat Medini + + * ar.po: Updated Arabic translation. + +2003-06-12 Abel Cheung + + * zh_TW.po: Updated traditional Chinese translation. + +2003-06-04 Paul Duffy + + * ga.po: Updated Irish Translation. + +2003-05-25 Abel Cheung + + * he.po: Mark wrong entry as fuzzy (msgfmt check failed). + +2003-05-16 Danilo ©egan + + * sr.po, sr@Latn.po: Updated Serbian translation by Serbian + team (Prevod.org). + +2003-05-10 Danilo Segan + + * sr.po, sr@Latn.po: Added Serbian translation by Serbian team + (Prevod.org). + +2003-04-20 Abel Cheung + + * zh_TW.po: Updated traditional Chinese translation. + +2003-03-18 Gil "Dolfin" Osher + + * he.po: Updated Hebrew translation. + +2003-03-13 Christian Rose + + * ml.po: Added Malayalam translation by + FSF-India . + +2003-03-10 Roozbeh Pournader + + * fa.po: Added Persian translation. + +2003-03-08 Gil "Dolfin" Osher + + * he.po: Added Hebrew translation. + +2003-03-06 Yuriy Syrota + + * uk.po: Updated Ukrainian translation. + +2003-02-25 T?µivo Leedj?€rv + + * et.po: Added Estonian translation. + +2003-02-23 Abel Cheung + + * zh_TW.po: Updated traditional Chinese translation. + +2003-02-22 Jordi Mallach + + * ca.po: Barbarism fixes from Jordi Mas. + +2003-02-22 Abel Cheung + + * zh_TW.po: Updated traditional Chinese translation. + +2003-02-16 Mohammad DAMT + + * id.po: Added Indonesian translation + +2003-02-09 Christian Rose + + * sv.po: Some fixes for problems catched in translation review. + +2003-02-07 Miloslav Trmac + + * cs.po: Fixed typos in Czech translation. + +2003-01-25 Alessio Frusciante + + * it.po: Added Italian translation. + +2003-01-23 Marius Andreiana + + * ro.po: added ( thanks to Mi?Ÿu Moldovan ) + +2003-01-22 Christian Rose + + * mn.po: Added Mongolian translation by + Sanlig Badral . + +2003-01-20 Pablo Saratxaga + + * vi.po: Updated Vietnamese file + +2003-01-18 Abel Cheung + + * zh_TW.po: Updated traditional Chinese translation. + +2003-01-16 Daniel Yacob + + * am.po: Added Amharic translation. + +2003-01-16 Pablo Saratxaga + + * vi.po: Updated Vietnamese file + +2003-01-03 Andras Timar + + * hu.po: Updated Hungarian translation. + +2002-12-14 Christophe Merlet + + * fr.po: Updated French translation and converted to UTF-8. + +2002-11-25 Yanko Kaneti + + * *.po: Convert all to UTF-8. + +2002-11-07 Simos Xenitellis + + * el.po: Updated Greek translation. + +2002-11-04 Vincent van Adrighem + + * nl.po: Jeroen van der Vegt updated Dutch translation. + +2002-11-03 Dmitry G. Mastrukov + + * be.po: Added Belarusian translation + * from Belarusian team . + +2002-09-26 Stanislav Brabec + + * cs.po: Added Czech translation from Miloslav Trmac + . + +2002-09-19 Fatih Demir + + * tr.po: Committed updated Turkish translation by ?–mer. + +2002-09-02 Peteris Krisjanis + + * lv.po: Updated Latvian translation. + +2002-08-22 Andras Timar + + * hu.po: Updated Hungarian translation. + +2002-08-20 Peteris Krisjanis + + * lv.po (added): Latvian translation. + +2002-08-07 Christian Neumair + + * de.po: Updated German translation. + +2002-07-13 Jordi Mallach + + * ca.po: Updated Catalan translation. + +2002-06-25 Yanko Kaneti + + * bg.po (added): Bulgarian translation by + Borislav Aleksandrov . + +2002-06-22 Pablo Saratxaga + + * ca.po: Updated Catalan file + +2002-06-17 Pablo Saratxaga + + * vi.po: Updated Vietnamese file + +2002-06-13 Takayuki KUSANO + + * ja.po: Updated Japanese translation. + +2002-06-10 Pablo Saratxaga + + * vi.po: Updated Vientamese file + +2002-06-02 Germ??n Poo Caama?±o + + * es.po: Updated Spanish translation from + Juan Manuel Garc?­a Molina + +2002-06-02 Zbigniew Chyla + + * pl.po: Updated Polish translation by + GNOME PL Team . + +2002-06-02 Carlos Perell?³ Mar?­n + + * es.po: Fixed. + +2002-05-28 Carlos Perello Marin + + * LEEME.es: Updated. + +2002-05-28 Carlos Perello Marin + + * es.po, es_ES.po: Updated so the contry dependent string is + placed at es_ES.po for Spain and the US like number notation is + stored at es.po. It's much more easy mantain the es_ES.po file than + 4 or 5 files from American countries. + * es_DO.pom, es_GT.po, es_HN.po, es_MX.po, es_PA.po, es_PE.po, + es_SV.po: Removed, we only need to update es.po and es_ES.po now. + +2002-05-19 Vlad Harchev + + * ru.po: updated russian translation from Dmitry G. Mastrukov + . + +2002-05-10 Valek Filippov + + * ru.po: Updated russian translation from Dmitry Mastrukov. + +2002-05-08 Zbigniew Chyla + + * pl.po: Updated Polish translation by + GNOME PL Team . + +2002-05-08 Pablo Saratxaga + + * vi.po: Added Vietnamese file + +2002-05-06 Duarte Loreto + + * pt.po: Updated Portuguese translation and converted to UTF-8. + +2002-05-05 Christian Rose + + * sv.po: Updated Swedish translation. + +2002-04-25 Changwoo Ryu + + * ko.po: Updated Korean translation. + +2002-04-24 Stanislav Visnovsky + + * sk.po: Updated Slovak translation by Marcel Telka . + +2002-04-23 Kjartan Maraas + + * no.po: Updated Norwegian (bokm?¥l) translation. + +2002-04-19 Ole Laursen + + * da.po: Updated Danish translation. + +2002-04-19 Pauli Virtanen + + * fi.po: Updated Finnish translation. + +2002-04-09 Valek Filippov + + * ru.po: Updated russian translation from Dmitry Mastrukov. + +2002-04-02 Duarte Loreto + + * pt.po: Updated Portuguese translation. + +2002-03-31 Abel Cheung + + * .cvsignore: Added file. + * POTFILES.in: Added missing popt files. + +2002-03-25 Duarte Loreto + + * pt.po: Updated Portuguese translation. + +2002-03-23 Hasbullah Bin Pit + + * ms.po: Updated Malay Translation. + +2002-03-15 Valek Filippov + + * ru.po: Updated russian translation. + +2002-03-06 Kjartan Maraas + + * no.po: Updated Norwegian (bokm?¥l) translation. + +2002-03-06 Germ??n Poo-Caama?±o + + * es.po: Fixed spanish translation encoding. + +2002-03-06 Germ??n Poo-Caama?±o + + * es.po: Update spanish translation. + +2002-03-05 Matthias Warkus + + * de.po: Fixed German translation. + +2002-03-01 Zbigniew Chyla + + * pl.po: Updated Polish translation by + GNOME PL Team . + +2002-02-12 Kjartan Maraas + + * no.po: Updated Norwegian (bokm?¥l) translation. + +2002-02-09 Abel Cheung + + * zh_TW.po: Updated traditional Chinese translation. + +2002-02-05 Abel Cheung + + * zh_CN.GB2312.po -> zh_CN.po: Convert to UTF-8 encoding. + +2002-01-27 Christian Rose + + * README.tools, update.pl, update.sh: Removed, they are + obsoleted by intltool. + * sv.po: Updated and converted to UTF-8. + +2002-01-25 Roy-Magne Mo + + * nn.po: Updated Norwegian (nynorsk) translation. + +2002-01-14 Hasbullah Bin Pit + + * ms.po: Added Malay Translation. + +2001-11-26 Abel Cheung + + * stamp-cat-id: Removed, and add it to .cvsignore. + +2001-10-30 Zbigniew Chyla + + * pl.po: Updated Polish translation by + GNOME PL Team . + +2001-10-17 Carlos Perell?³ Mar?­n + + * pt.po: Added by Duarte Loreto + +2001-09-16 Abel Cheung + + * zh_TW.po: Added traditoinal Chinese translation. + +2001-07-16 Kjartan Maraas + + * nn.po: Added Norwegian (nynorsk) translation. + +2001-03-25 Fatih Demir + + * tr.po: %100'ification. + +2001-03-23 Fatih Demir + + * tr.po: Updated Turkish translation by G?¶rkem. + +2001-03-15 Valek Filippov + + * ru.po: Updated russian translation. + +2001-03-09 Pablo Saratxaga + + * az.po: converted to 8bit encoding as requested for Gnome 1.4 + +2001-02-25 Simos Xenitellis + + * el.po: Updated Greek translation. + +2001-02-23 Simos Xenitellis + + * el.po: Some more strings. + +2001-02-19 Simos Xenitellis + + * el.po: Update of Greek translation. + +2001-02-15 Christian Meyer + + * de.po: Some minor changes. + +2001-02-14 Jarkko Ranta + + * fi.po: Updated Finnish translation + +2001-02-14 Stanislav Visnovsky + + * sk.po: Updated Slovak translation from Marcel Telka + +2001-02-13 Szabolcs Ban + + * hu.po: Updated Hungarian translation from Robert Vanyi + +2001-02-13 Stanislav Visnovsky + + * sk.po: Added Slovak translation from Marcel Telka + +2001-02-13 Martin Baulig + + * fi.po: Reverted Jarkko Ranta's change; please do + not commit any compressed files in future. + +2001-02-10 Christophe Merlet + + * fr.po: Updated French translation. + +2001-02-09 Gustavo Maciel Dias Vieira + + * pt_BR.po: Updated Brazilian Portuguese translation. + +2001-02-08 Jarkko Ranta + + * fi.po: Updated Finnish translation by Pauli Virtanen + +2001-02-08 Valek Filippov + + * ru.po: Updated russian translation. + +2001-02-05 Christophe Merlet + + * fr.po: Updated French translation. + +2001-01-05 Pablo Saratxaga + + * az.po: Added Azeri file + * ja.po: fixed a syntax error (missing %c ) + +2000-10-15 Yukihiro Nakai + + * ja.po: Update Japanese translation. + +2000-10-11 Yukihiro Nakai + + * ja.po: Update Japanese translation. + +2000-09-19 Christian Meyer + + * de.po: Minor fix. + +2000-09-19 Christian Meyer + + * de.po: Updated German translation. + +2000-09-10 Christian Meyer + + * de.po: Updated German translation. + * update.pl: Added update.pl from menesis. + * README.tools: Added text file. + +2000-08-16 Kjartan Maraas + + * no.po: Updated Norwegian translation. + +2000-06-25 Takayuki KUSANO + + * ja.po: Updated Japanese translation. + +2000-05-26 Yuri Syrota + + * uk.po: Updated Ukrainian translation. + +2000-05-20 Manuel de Vega Barreiro + + * es.po: Updated Spanish translation. + +2000-05-18 Martin Norb?€ck + + * sv.po: Updated Swedish translation. + +2000-05-18 Jesus Bravo Alvarez + + * gl.po: Updated Galician translation. + +2000-05-17 Kjartan Maraas + + * no.po: Updated translation. + +2000-05-16 Kenneth Christiansen + + * POTFILES.in: New strings added + +2000-05-16 Kenneth Christiansen + + * da.po: New da translation + * update.sh: New update.sh script + +2000-05-16 Jesus Bravo Alvarez + + * *.po: Added and merged ca, el, ga, pt_BR, ru, uk and zh_CN + from HEAD branch + +2000-05-09 Andreas Hyden + + * update.sh: Added update.sh script. + +2000-04-01 Jesus Bravo Alvarez + + * gl.po: Updated Galician translation. + +1999-10-09 Jesus Bravo Alvarez + + * gl.po: Added Galician translation. + +1999-09-29 Kenneth ll?©phaane Christiansen + + * da.po: Updated. + +1999-09-27 Zbigniew Chyla + + * pl.po: Added translation. + +1999-09-22 Kjartan Maraas + + * da.po: Added Danish translation from Kenneth + Christiansen . + +1999-09-20 Vincent Renardias + + * fr.po: 100% complete. removed ~40 old translations. + +1999-09-17 Zbigniew Chyla + + * pl.po: Added translation. + +1999-09-16 Tomas Ogren + + * sv.po: Synced + +1999-07-11 Kjartan Maraas + + * no.po: Updated translation. + +1999-07-11 Tomas Ogren + + * sv.po: New file + +1999-01-27 Kjartan Maraas + + * no.po: Updated translation + +1998-12-22 Yukihiro Nakai + + * ja.po: New file - added Japanese translation + +1998-10-11 Martin Baulig + + * POTFILES.in: Removed `sysdeps/linux/procdata.c'. + +1998-10-11 Kjartan Maraas + + * no.po: New file - added norwegian translation. + +1998-10-07 Martin Baulig + + * de.po: New file - added german translation. + + * POTFILES.in: Regenerated. + +Sun, 31 May 1998 22:38:59 +0200 Vincent Renardias + + * fr.po: new file - ChangeLog isn't empty anymore _(; + +1998-05-21 Martin Baulig + + * ChangeLog: new file - currently empty diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 0000000..bc50b01 --- /dev/null +++ b/po/LINGUAS @@ -0,0 +1,88 @@ +# +# please keep this list sorted alphabetically +am +ar +as +ast +az +be +bg +bn +bn_IN +bs +ca +ca@valencia +cs +cy +da +de +dz +el +en_CA +en_GB +en@shaw +eo +es +et +eu +fa +fi +fr +fur +ga +gl +gu +he +hi +hr +hu +id +it +ja +ka +kn +ko +ku +ky +la +lt +lv +mai +mg +mi +mk +ml +mn +mr +ms +nb +ne +nl +nn +oc +or +pa +pl +pt +pt_BR +ro +ru +rw +sk +sl +sq +sr +sr@latin +sv +ta +te +tg +th +tr +ug +uk +vi +xh +zh_CN +zh_HK +zh_TW diff --git a/po/Makefile.in.in b/po/Makefile.in.in new file mode 100644 index 0000000..65184f6 --- /dev/null +++ b/po/Makefile.in.in @@ -0,0 +1,475 @@ +# Makefile for PO directory in any package using GNU gettext. +# Copyright (C) 1995-1997, 2000-2007, 2009-2010 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.19 +GETTEXT_MACRO_VERSION = 0.19 + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ + +SED = @SED@ +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ +datadir = @datadir@ +localedir = @localedir@ +gettextsrcdir = $(datadir)/gettext/po + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +# We use $(mkdir_p). +# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as +# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, +# @install_sh@ does not start with $(SHELL), so we add it. +# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined +# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake +# versions, $(mkinstalldirs) and $(install_sh) are unused. +mkinstalldirs = $(SHELL) @install_sh@ -d +install_sh = $(SHELL) @install_sh@ +MKDIR_P = @MKDIR_P@ +mkdir_p = @mkdir_p@ + +GMSGFMT_ = @GMSGFMT@ +GMSGFMT_no = @GMSGFMT@ +GMSGFMT_yes = @GMSGFMT_015@ +GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) +MSGFMT_ = @MSGFMT@ +MSGFMT_no = @MSGFMT@ +MSGFMT_yes = @MSGFMT_015@ +MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) +XGETTEXT_ = @XGETTEXT@ +XGETTEXT_no = @XGETTEXT@ +XGETTEXT_yes = @XGETTEXT_015@ +XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) +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 \ +$(POFILES) $(GMOFILES) \ +$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) + +POTFILES = \ + +CATALOGS = @CATALOGS@ + +POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot +POFILESDEPS_yes = $(POFILESDEPS_) +POFILESDEPS_no = +POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT)) + +DISTFILESDEPS_ = update-po +DISTFILESDEPS_yes = $(DISTFILESDEPS_) +DISTFILESDEPS_no = +DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO)) + +# Makevars gets inserted here. (Don't remove this line!) + +.SUFFIXES: +.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .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 --verbose -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -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: + +# Ensure that the gettext macros and this Makefile.in.in are in sync. +CHECK_MACRO_VERSION = \ + test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ + || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ + exit 1; \ + } + +# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no +# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because +# we don't want to bother translators with empty POT files). We assume that +# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. +# In this case, stamp-po is a nop (i.e. a phony target). + +# 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 + @$(CHECK_MACRO_VERSION) + test ! -f $(srcdir)/$(DOMAIN).pot || \ + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @test ! -f $(srcdir)/$(DOMAIN).pot || { \ + 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. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. +$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed + package_gnu="$(PACKAGE_GNU)"; \ + test -n "$$package_gnu" || { \ + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \ + -size -10000000c -exec grep 'GNU @PACKAGE@' \ + /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ + package_gnu=yes; \ + else \ + package_gnu=no; \ + fi; \ + }; \ + if test "$$package_gnu" = "yes"; then \ + package_prefix='GNU '; \ + else \ + package_prefix=''; \ + fi; \ + if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ + msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ + else \ + msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ + fi; \ + case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + ;; \ + *) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --package-name="$${package_prefix}@PACKAGE@" \ + --package-version='@VERSION@' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + ;; \ + esac + 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): $(POFILESDEPS) + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + if test -f "$(srcdir)/$${lang}.po"; then \ + test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) \ + && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ + esac; \ + }; \ + else \ + $(MAKE) $${lang}.po-create; \ + fi + + +install: install-exec install-data +install-exec: +install-data: install-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkdir_p) $(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 + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $(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 \ + $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ + else \ + : ; \ + fi +installdirs-data-no: +installdirs-data-yes: + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $(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: + test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) + @$(MAKE) dist2 +# This is a separate target because 'update-po' must be executed before. +dist2: stamp-po $(DISTFILES) + dists="$(DISTFILES)"; \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + dists="$$dists Makevars.template"; \ + fi; \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + dists="$$dists $(DOMAIN).pot stamp-po"; \ + 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) || exit 1; \ + else \ + cp -p $(srcdir)/$$file $(distdir) || exit 1; \ + fi; \ + done + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for creating PO files. + +.nop.po-create: + @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ + echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ + exit 1 + +# 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) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + esac; \ + }; 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) + @: + +# Recreate Makefile by invoking config.status. Explicitly invoke the shell, +# because execution permission bits may not work on the current file system. +# Use @SHELL@, which is the shell determined by autoconf for the use by its +# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. +Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ + cd $(top_builddir) \ + && @SHELL@ ./config.status $(subdir)/$@.in po-directories + +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: diff --git a/po/Makevars b/po/Makevars new file mode 100644 index 0000000..86b32a6 --- /dev/null +++ b/po/Makevars @@ -0,0 +1,78 @@ +# 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 = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --add-comments + +# 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 = libgtop contributors + +# This tells whether or not to prepend "GNU " prefix to the package +# name that gets inserted into the header of the $(DOMAIN).pot file. +# Possible values are "yes", "no", or empty. If it is empty, try to +# detect it automatically by scanning the files in $(top_srcdir) for +# "GNU packagename" string. +PACKAGE_GNU = no + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = https://bugzilla.gnome.org/enter_bug.cgi?product=libgtop&keywords=I18N+L10N&component=general + +# 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 = + +# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' +# context. Possible values are "yes" and "no". Set this to yes if the +# package uses functions taking also a message context, like pgettext(), or +# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. +USE_MSGCTXT = no + +# These options get passed to msgmerge. +# Useful options are in particular: +# --previous to keep previous msgids of translated messages, +# --quiet to reduce the verbosity. +MSGMERGE_OPTIONS = + +# These options get passed to msginit. +# If you want to disable line wrapping when writing PO files, add +# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and +# MSGINIT_OPTIONS. +MSGINIT_OPTIONS = + +# This tells whether or not to regenerate a PO file when $(DOMAIN).pot +# has changed. Possible values are "yes" and "no". Set this to no if +# the POT file is checked in the repository and the version control +# program ignores timestamps. +PO_DEPENDS_ON_POT = no + +# This tells whether or not to forcibly update $(DOMAIN).pot and +# regenerate PO files on "make dist". Possible values are "yes" and +# "no". Set this to no if the POT file and PO files are maintained +# externally. +DIST_DEPENDS_ON_UPDATE_PO = no diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..d10cb99 --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,20 @@ +# List of source files containing translatable strings. +# Please keep this file sorted alphabetically. +lib/close.c +lib/command.c +lib/init.c +lib/open.c +lib/parameter.c +lib/read.c +lib/read_data.c +lib/sysdeps.c +lib/write.c +src/daemon/gnuserv.c +src/daemon/io.c +src/daemon/main.c +src/daemon/server.c +src/daemon/slave.c +src/daemon/version.c +sysdeps/linux/siglist.c +sysdeps/osf1/siglist.c +sysdeps/sun4/siglist.c diff --git a/po/Rules-quot b/po/Rules-quot new file mode 100644 index 0000000..9dc9630 --- /dev/null +++ b/po/Rules-quot @@ -0,0 +1,58 @@ +# This file, Rules-quot, can be copied and used freely without restrictions. +# 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-create: + $(MAKE) en@quot.po-update +en@boldquot.po-create: + $(MAKE) en@boldquot.po-update + +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-tools"; 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) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ + | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \ + { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ + $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ + ;; \ + *) \ + $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ + ;; \ + esac } 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 diff --git a/po/am.gmo b/po/am.gmo new file mode 100644 index 0000000..3a93025 Binary files /dev/null and b/po/am.gmo differ diff --git a/po/am.po b/po/am.po new file mode 100644 index 0000000..c0fed3a --- /dev/null +++ b/po/am.po @@ -0,0 +1,206 @@ +# Translations into the Amharic Language. +# Copyright (C) 2002 Free Software Foundation, Inc. +# This file is distributed under the same license as the libgtop package. +# Ge'ez Frontier Foundation , 2002. +# +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-09-25 18:15+0200\n" +"PO-Revision-Date: 2003-01-16 08:39+EDT\n" +"Last-Translator: Ge'ez Frontier Foundation \n" +"Language-Team: Amharic \n" +"Language: am\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: lib/read.c:65 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/read_data.c:53 +msgid "read data size" +msgstr "" + +#: lib/read_data.c:72 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "" +msgstr[1] "" + +#: lib/write.c:52 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "" +msgstr[1] "" + +#: src/daemon/gnuserv.c:460 +msgid "Enable debugging" +msgstr "" + +#: src/daemon/gnuserv.c:460 +msgid "DEBUG" +msgstr "አስተካክል" + +#: src/daemon/gnuserv.c:462 +msgid "Enable verbose output" +msgstr "" + +#: src/daemon/gnuserv.c:462 +msgid "VERBOSE" +msgstr "" + +#: src/daemon/gnuserv.c:464 +msgid "Don't fork into background" +msgstr "" + +#: src/daemon/gnuserv.c:464 +msgid "NO-DAEMON" +msgstr "" + +#: src/daemon/gnuserv.c:466 +msgid "Invoked from inetd" +msgstr "" + +#: src/daemon/gnuserv.c:466 +msgid "INETD" +msgstr "" + +#: src/daemon/gnuserv.c:500 +#, c-format +msgid "" +"Error on option %s: %s.\n" +"Run '%s --help' to see a full list of available command line options.\n" +msgstr "" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Hangup" +msgstr "" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Interrupt" +msgstr "" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Quit" +msgstr "ውጣ" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Illegal instruction" +msgstr "" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Trace trap" +msgstr "" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "Abort" +msgstr "ውድቅ" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "EMT error" +msgstr "የEMT ስህተት" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Floating-point exception" +msgstr "" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Kill" +msgstr "አቋርጥ" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Bus error" +msgstr "የBus ስህተት" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Segmentation violation" +msgstr "" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Bad argument to system call" +msgstr "" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Broken pipe" +msgstr "የተሰበረ መተላለፊያ" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Alarm clock" +msgstr "" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Termination" +msgstr "" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Urgent condition on socket" +msgstr "" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Stop" +msgstr "አቁም" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Keyboard stop" +msgstr "" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Continue" +msgstr "ቀጥል" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Child status has changed" +msgstr "" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background read from tty" +msgstr "" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "Background write to tty" +msgstr "" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "I/O now possible" +msgstr "" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "CPU limit exceeded" +msgstr "" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "File size limit exceeded" +msgstr "" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Virtual alarm clock" +msgstr "" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Profiling alarm clock" +msgstr "" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Window size change" +msgstr "" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "Information request" +msgstr "" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 1" +msgstr "" + +#: sysdeps/osf1/siglist.c:58 sysdeps/sun4/siglist.c:58 +msgid "User defined signal 2" +msgstr "" diff --git a/po/ar.gmo b/po/ar.gmo new file mode 100644 index 0000000..a6c52ff Binary files /dev/null and b/po/ar.gmo differ diff --git a/po/ar.po b/po/ar.po new file mode 100644 index 0000000..47b30ad --- /dev/null +++ b/po/ar.po @@ -0,0 +1,206 @@ +# translation of libgtop.HEAD.po to Arabic +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# +# Arafat Medini , 2002,2003. +# Isam Bayazidi , 2002. +# Abdulaziz Al-Arfaj , 2004. +# Khaled Hosny , 2006, 2008. +msgid "" +msgstr "" +"Project-Id-Version: libgtop.HEAD\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&component=general\n" +"POT-Creation-Date: 2009-03-16 22:15+0000\n" +"PO-Revision-Date: 2008-07-28 19:26+0300\n" +"Last-Translator: Khaled Hosny \n" +"Language-Team: Arabic \n" +"Language: ar\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " +"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "قرأ صفر بايت" +msgstr[1] "قرأ بايت واحدة" +msgstr[2] "قرأ بايتين" +msgstr[3] "قرأ %Id بايتات" +msgstr[4] "قرأ %Id بايت" +msgstr[5] "قرأ %Id بايت" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "حجم البيانات المقروءة" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "قرأ صفر بايت من البيانات" +msgstr[1] "قرأ بايت واحدة من البيانات" +msgstr[2] "قرأ بايتين من البيانات" +msgstr[3] "قرأ %lu بايتات من البيانات" +msgstr[4] "قرأ %lu بايت من البيانات" +msgstr[5] "قرأ %lu بايت من البيانات" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "كتب صفر بايت" +msgstr[1] "كتب بايت واحدة" +msgstr[2] "كتب بايتين" +msgstr[3] "كتب %Id بايتات" +msgstr[4] "كتب %Id بايت" +msgstr[5] "كتب %Id بايت" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "فعّل التنقيح" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "فعّل الخرْج المسهِب" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "لا تشعّب إلى الخلفية" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "استُحضرت من inetd " + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "شغّل '%s --help' لرؤية قائمة كاملة لخيارات سطر الأوامر.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "علّق" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "قاطِع" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "اخرج" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "توجيه ممنوع" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "تتبع الأثر" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "اجهض" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "خطأ EMT" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "استثناء أرقام عشرية" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "اقتل" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "خطأ في ناقل" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "انتهاك اﻻنقسام" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "معطى سيء لنداء النظام" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "أنبوب مكسور" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "ساعة منبهة" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "إنهاء" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "حالة عاجلة عند المقبس" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "قف" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "إيقاف من لوحة المفاتيح" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "تابع" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "تغيرت حالة الابن" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "قراءة من tty في الخلفية" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "كتابة لـ tty في الخلفية" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "الدخْل/الخرْج ممكن الآن" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "تجاوز حد الـمعالج" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "تجاوز حد حجم الملف" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "ساعة تنبيه تخيّلية" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "تشخيص ساعة التنبيه" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "تغير حجم النافذة" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "طلب معلومات" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "إشارة 1 معرفة من طرف المستخدم" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "إشارة 2 معرفة من طرف المستخدم" diff --git a/po/as.gmo b/po/as.gmo new file mode 100644 index 0000000..ed77eb6 Binary files /dev/null and b/po/as.gmo differ diff --git a/po/as.po b/po/as.po new file mode 100644 index 0000000..f65206b --- /dev/null +++ b/po/as.po @@ -0,0 +1,192 @@ +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Amitakhya Phukan , 2009. +# Nilamdyuti Goswami , 2011. +msgid "" +msgstr "" +"Project-Id-Version: as\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug." +"cgi?product=libgtop&component=general\n" +"POT-Creation-Date: 2010-11-17 08:15+0000\n" +"PO-Revision-Date: 2011-08-17 16:13+0530\n" +"Last-Translator: Nilamdyuti Goswami \n" +"Language-Team: as_IN \n" +"Language: as\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Lokalize 1.0\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d বাইট পঢ়া হল" +msgstr[1] "%d বাইটসমূহ পঢ়া হল" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "তথ্যৰ আকাৰ পঢ়া হল" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "তথ্যৰ %lu বাইট পঢ়া হল" +msgstr[1] "তথ্যৰ %lu বাইটসমূহ পঢ়া হল" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d বাইট লিখা হল" +msgstr[1] "%d বাইট লিখা হল" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "ডিবাগিং সামৰ্থবান কৰক" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "ভাৰ্বোচ আউটপুট সামৰ্থবান কৰক" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "পটভূমিত fork নকৰিব" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "inetd ৰ পৰা আৱাহন কৰা হৈছে" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"উপলব্ধ কমান্ড শাৰী বিকল্পসমূহৰ এটা সম্পূৰ্ণ তালিকা চাবলে '%s --help' চলাওক। \n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "বন্ধ কৰক" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "বাধা দিয়ক" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "প্ৰস্থান কৰক" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "অবৈধ নিৰ্দেশ" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "ট্ৰেইচ ট্ৰ্যাপ" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "বাদ দিয়ক" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT ত্ৰুটি" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "দশমিক-বিন্দু ব্যতিক্ৰম" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Kill কৰক" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "বাচ ত্ৰুটি" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "বিভাজন অমান্যকৰণ" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "চিস্টেম কললে বেয়া তৰ্ক" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "ভঙা পাইপ" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "এলাৰ্ম ঘড়ি" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "সমাপ্তি" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "চকেটত গুৰুতৰ অবস্থা" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "বন্ধ কৰক" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "কিবৰ্ড বন্ধ কৰক" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "চলাই যাওক" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "চাইল্ডৰ অবস্থা সলনি হৈছে" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "tty ৰ পৰা পটভূমি পঢ়া" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "tty ৰ পৰা পটভূমি লিখা" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O বৰ্তমানত সম্ভব" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU ৰ সীমা পাৰ হৈছে" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "ফাইলৰ আকাৰৰ সীমা পাৰ হৈছে" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "ভাৰ্ছুৱেল এলাৰ্ম ঘড়ি" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "এলাৰ্ম ঘড়ি আলেখ্যন কৰা হৈছে" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "উইন্ডোৰ আকাৰত পৰিবৰ্তন" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "তথ্যৰ অনুৰোধ" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "ব্যবহাৰকাৰী নিৰ্ধাৰিত সংকেত ১" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "ব্যবহাৰকাৰী নিৰ্ধাৰিত সংকেত ২" + diff --git a/po/ast.gmo b/po/ast.gmo new file mode 100644 index 0000000..aa20707 Binary files /dev/null and b/po/ast.gmo differ diff --git a/po/ast.po b/po/ast.po new file mode 100644 index 0000000..7bd9c32 --- /dev/null +++ b/po/ast.po @@ -0,0 +1,221 @@ +# Asturian translation for libgtop. +# Copyright (C) 2010 libgtop's COPYRIGHT HOLDER +# This file is distributed under the same license as the libgtop package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop master\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop&component=general\n" +"POT-Creation-Date: 2009-11-12 10:53+0000\n" +"PO-Revision-Date: 2010-01-06 18:12+0100\n" +"Last-Translator: astur \n" +"Language-Team: Asturian \n" +"Language: ast\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Poedit-Language: asturian\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "lleíu %d byte" +msgstr[1] "lleíos %d bytes" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "lleíu tamañu de datos" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "lleíu %lu byte de datos" +msgstr[1] "lleíos %lu bytes de datos" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "escritu %d byte" +msgstr[1] "escritos %d bytes" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "Activar depuración" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "Activa salida detallada" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "Nun se pudo abrir un procesu en segundu planu" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "Invocáu dende inetd" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "Executa '%s --help' pa ver una llista ensembre de les opciones de llinia de comandos disponibles.\n" + +#: ../sysdeps/osf1/siglist.c:27 +#: ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Terminar" + +#: ../sysdeps/osf1/siglist.c:28 +#: ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interrupción" + +#: ../sysdeps/osf1/siglist.c:29 +#: ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Colar" + +#: ../sysdeps/osf1/siglist.c:30 +#: ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Instrucción illegal" + +#: ../sysdeps/osf1/siglist.c:31 +#: ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Atrapar traza" + +#: ../sysdeps/osf1/siglist.c:32 +#: ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Encaboxar" + +#: ../sysdeps/osf1/siglist.c:33 +#: ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Fallu EMT" + +#: ../sysdeps/osf1/siglist.c:34 +#: ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Esceición de coma flotante" + +#: ../sysdeps/osf1/siglist.c:35 +#: ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Matar" + +#: ../sysdeps/osf1/siglist.c:36 +#: ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Fallu de bus" + +#: ../sysdeps/osf1/siglist.c:37 +#: ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Violación de segmentu" + +#: ../sysdeps/osf1/siglist.c:38 +#: ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Argumentu malu na llamada al sistema" + +#: ../sysdeps/osf1/siglist.c:39 +#: ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Tubería rota" + +#: ../sysdeps/osf1/siglist.c:40 +#: ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarma de reló" + +#: ../sysdeps/osf1/siglist.c:41 +#: ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Terminación" + +#: ../sysdeps/osf1/siglist.c:42 +#: ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Condición urxente en socket" + +#: ../sysdeps/osf1/siglist.c:43 +#: ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Parar" + +#: ../sysdeps/osf1/siglist.c:44 +#: ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Parada de tecláu" + +#: ../sysdeps/osf1/siglist.c:45 +#: ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Siguir" + +#: ../sysdeps/osf1/siglist.c:46 +#: ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Cambiu d'estáu de fíu" + +#: ../sysdeps/osf1/siglist.c:47 +#: ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Llectura en segundu planu de tty" + +#: ../sysdeps/osf1/siglist.c:48 +#: ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Escritura en segundu planu a tty" + +#: ../sysdeps/osf1/siglist.c:49 +#: ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "E/S agora puédese" + +#: ../sysdeps/osf1/siglist.c:50 +#: ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Perpaseste la llende del CPU" + +#: ../sysdeps/osf1/siglist.c:51 +#: ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Tamañu llende de ficheru perpasáu" + +#: ../sysdeps/osf1/siglist.c:52 +#: ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Alarma de reló virtual" + +#: ../sysdeps/osf1/siglist.c:53 +#: ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Alarma de reló perfilada" + +#: ../sysdeps/osf1/siglist.c:54 +#: ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Cambéu del tamañu de ventana" + +#: ../sysdeps/osf1/siglist.c:55 +#: ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Solicitú d'información" + +#: ../sysdeps/osf1/siglist.c:56 +#: ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Señal 1 definida pol usuariu" + +#: ../sysdeps/osf1/siglist.c:57 +#: ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Señal 2 definida pol usuariu" + diff --git a/po/az.gmo b/po/az.gmo new file mode 100644 index 0000000..8ee2027 Binary files /dev/null and b/po/az.gmo differ diff --git a/po/az.po b/po/az.po new file mode 100644 index 0000000..dbe171c --- /dev/null +++ b/po/az.po @@ -0,0 +1,210 @@ +# translation of libgtop.HEAD.az.po to Azerbaijani Turkish +# Copyright (C) 2001, 2004 Free Software Foundation, Inc. +# Vasif Ismailoglu MD , 2001. +# Mətin Əmirov , 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop.HEAD.az\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-09-25 18:15+0200\n" +"PO-Revision-Date: 2004-01-12 19:43+0200\n" +"Last-Translator: Mətin Əmirov \n" +"Language-Team: Azerbaijani Turkish \n" +"Language: az\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.0.2\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: lib/read.c:65 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d bayt oxunub" +msgstr[1] "%d bayt oxunub" + +#: lib/read_data.c:53 +msgid "read data size" +msgstr "mə'lumat böyüklüyünü oxu" + +#: lib/read_data.c:72 +#, fuzzy, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%d bayt oxunub" +msgstr[1] "%d bayt oxunub" + +#: lib/write.c:52 +#, fuzzy, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d bayt yazıldı" +msgstr[1] "%d bayt yaz" + +#: src/daemon/gnuserv.c:460 +msgid "Enable debugging" +msgstr "Xəta yoxlamsını fəallaşdır" + +#: src/daemon/gnuserv.c:460 +msgid "DEBUG" +msgstr "DEBUG" + +#: src/daemon/gnuserv.c:462 +msgid "Enable verbose output" +msgstr "Sözlü çıxış ver" + +#: src/daemon/gnuserv.c:462 +msgid "VERBOSE" +msgstr "VERBOSE" + +#: src/daemon/gnuserv.c:464 +msgid "Don't fork into background" +msgstr "Arxaya qaçma" + +#: src/daemon/gnuserv.c:464 +msgid "NO-DAEMON" +msgstr "NO-DEAMON" + +#: src/daemon/gnuserv.c:466 +msgid "Invoked from inetd" +msgstr "inetd tərəfindən oyandırıldı" + +#: src/daemon/gnuserv.c:466 +msgid "INETD" +msgstr "INETD" + +#: src/daemon/gnuserv.c:500 +#, c-format +msgid "" +"Error on option %s: %s.\n" +"Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"%s şərhində xəta oldü %s.\n" +"'%s --help' əmrindən bütün əmr sətiri seçimləri üçün işə salın.\n" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Hangup" +msgstr "Hangup" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Interrupt" +msgstr "Interrupt" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Quit" +msgstr "Çıx" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Illegal instruction" +msgstr "Hökmsüz tə'limat" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Trace trap" +msgstr "İzləmə yolu" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "Abort" +msgstr "Ləğv Et" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "EMT error" +msgstr "EMT xətası" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Floating-point exception" +msgstr "Floating-point exception" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Kill" +msgstr "Öldür" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Bus error" +msgstr "Yol Xətası" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Segmentation violation" +msgstr "Seqmentlərə Bölmə Qaydası Pozulması" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Bad argument to system call" +msgstr "Sistem çağırışı üçün xətalı arqument" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Broken pipe" +msgstr "Qırıq boru" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Alarm clock" +msgstr "Zəngli saat" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Termination" +msgstr "Qurtarma" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Urgent condition on socket" +msgstr "Qapıdakı tə'cili hal" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Stop" +msgstr "Dayandır" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Keyboard stop" +msgstr "Klaviaturadan dayandır" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Continue" +msgstr "Davam Et" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Child status has changed" +msgstr "Törəmə halı dəyişdi" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background read from tty" +msgstr "tty-dən arxa plan gedişatı mə'lumatı" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "Background write to tty" +msgstr "tty-yə yazma əməliyyatı" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "I/O now possible" +msgstr "I/O indi mümkündür" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "CPU limit exceeded" +msgstr "CPU sərhədi aşıldı" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "File size limit exceeded" +msgstr "Dosye böyüklüyü sərhədi aşıldı" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Virtual alarm clock" +msgstr "Virtual Zəngli Saat" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Profiling alarm clock" +msgstr "Profil Zəngli Saati" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Window size change" +msgstr "Pəncərə Böyüklüyü Dəyişikliyi" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "Information request" +msgstr "Mə'lumat sifarişi" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 1" +msgstr "İstifadəçi siqnal 1 təsvir etdi" + +#: sysdeps/osf1/siglist.c:58 sysdeps/sun4/siglist.c:58 +msgid "User defined signal 2" +msgstr "İstifadəçi siqnal 2 təsvir etdi" diff --git a/po/be.gmo b/po/be.gmo new file mode 100644 index 0000000..2e12e4b Binary files /dev/null and b/po/be.gmo differ diff --git a/po/be.po b/po/be.po new file mode 100644 index 0000000..1133619 --- /dev/null +++ b/po/be.po @@ -0,0 +1,197 @@ +# Vital Khilko , 2003. +# Ales Nyakhaychyk , 2004. +# Ihar Hrachyshka , 2011. +# Yuras Shumovich , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop.master\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:26+0000\n" +"PO-Revision-Date: 2017-09-01 19:01+0300\n" +"Last-Translator: Yuras Shumovich \n" +"Language-Team: Belarusian \n" +"Language: be\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Poedit 1.8.11\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "прачытаны %d байт" +msgstr[1] "прачытана %d байты" +msgstr[2] "прачытана %d байтаў" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "прачытаны памер даных" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "прачытаны %lu байт даных" +msgstr[1] "прачытана %lu байты даных" +msgstr[2] "прачытана %lu байтаў даных" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "запісаны %d байт" +msgstr[1] "запісана %d байты" +msgstr[2] "запісана %d байтаў" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Уключыць адладачны код" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Уключыць падрабязны вывад" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Не адгаліноўваць фонавы працэс" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Запушчаны з дапамогай inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "" +"Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Каб убачыць спіс наяўных опцый загаднага радка, запусціце \"%s --help" +"\".\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Абрыў сувязі (HUP)" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Перарыў (INT)" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Выхад (QUIT)" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Забароненая інструкцыя (ILL)" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Захоп трасіроўкі (TRAP)" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Перарванне (ABRT)" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Памылка (EMT)" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Выключэнне float (FPE)" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Забойства (KILL)" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Памылка магістралі (BUS)" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Парушэнне сегментацыі (SEGV)" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Хібны аргумент сістэмнага выкліку (SYS)" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Зламаны канал (PIPE)" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Таймер (ALRM)" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Знішчэнне (TERM)" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Тэрміновыя даныя на сокеце (URG)" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Прыпыненне (STOP)" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Прыпыненне з клавіятуры (TSTP)" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Працяг працы (CONT)" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Змена стану нашчадка (CHLD)" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Фонавае чытанне з tty (TTIN)" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Фонавы запіс у tty (TTOU)" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "Магчымасць уводу/вываду (IO)" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Абмежаванне працэсара (XCPU)" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Абмежаванне памеру файла (XFSZ)" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Віртуальны таймер (VTALRM)" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Таймер прафілявання (PROF)" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Змена памераў акна (WINCH)" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Запыт інфармацыі (INFO)" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Карыстальніцкі сігнал 1 (USR1)" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Карыстальніцкі сігнал 2 (USR2)" diff --git a/po/bg.gmo b/po/bg.gmo new file mode 100644 index 0000000..9d141a3 Binary files /dev/null and b/po/bg.gmo differ diff --git a/po/bg.po b/po/bg.po new file mode 100644 index 0000000..1b695ae --- /dev/null +++ b/po/bg.po @@ -0,0 +1,192 @@ +# Bulgarian translation for libgtop po-file +# Copyright (C) 2002, 2004, 2005, 2007, 2017 Free Software Foundation, Inc. +# Borislav Aleksandrov , 2002. +# Yanko Kaneti , 2002. +# Rostislav Raykov , 2004. +# Vladimir Petkov , 2005. +# Alexander Shopov , 2007, 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop master\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-09-02 09:32+0300\n" +"PO-Revision-Date: 2017-08-25 11:00+0200\n" +"Last-Translator: Alexander Shopov \n" +"Language-Team: Bulgarian \n" +"Language: bg\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "прочетен %d байт" +msgstr[1] "прочетени %d байта" + +#: ../lib/read_data.c:49 +msgid "read data size" +msgstr "прочетен е размерът на данните" + +#: ../lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "прочетен %lu байт данни" +msgstr[1] "прочетени %lu байта данни" + +#: ../lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "записан %d байт" +msgstr[1] "записани %d байта" + +#: ../src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Включване на изчистване на грешките" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Включване на подробен изход" + +#: ../src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Да не се поражда процес във фонов режим" + +#: ../src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Извикан от inetd" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "Изпълнете „%s --help“ за пълния списък от опции за командата.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Затваряне на връзката" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Прекъсване" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Напускане" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Недопустима инструкция" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Точка на прекъсване" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Прекъсване" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Грешка на емулацията" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Изключение с плаваща запетая" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Убиване" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Грешка в шината" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Надхвърляне на сегмента" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Грешен аргумент на системно извикване" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Нарушен програмен канал" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Алармен часовник" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Завършване" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Неотложно състояние на socket" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Стоп" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Стоп от клавиатурата" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Продължаване" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Промяна в състоянието на дъщерни процеси" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Фоново четене от терминал" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Фонов запис в терминал" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "Възможен е вх./изх." + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Превишен процесорен лимит" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Превишено ограничение за размер на файл" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Виртуален алармен часовник" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Засичан алармен часовник" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Променяне размера на прозорец" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Заявка за данни" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Сигнал на потребител 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Сигнал на потребител 2" diff --git a/po/bn.gmo b/po/bn.gmo new file mode 100644 index 0000000..16c8709 Binary files /dev/null and b/po/bn.gmo differ diff --git a/po/bn.po b/po/bn.po new file mode 100644 index 0000000..9024ba8 --- /dev/null +++ b/po/bn.po @@ -0,0 +1,1245 @@ +# Bengali translation of libgtop. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is distributed under the same license as the libgtop package. +# Vat , 2003. +# Mahay Alam Khan , 2005. +# Samia Niamatullah , 2005. +# Israt Jahan , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: bn\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&component=general\n" +"POT-Creation-Date: 2009-04-17 10:17+0000\n" +"PO-Revision-Date: 2010-01-21 16:02+0600\n" +"Last-Translator: Israt Jahan \n" +"Language-Team: Bengali \n" +"Language: bn\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=0;\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d বাইট পড়েছি" +msgstr[1] "%d বাইট পড়েছি" + +# msgstr "%d বাইট পড়া গেছে" "ড়" এর জায়গায় "ডহ্হা" লেখা +# ######################################### +# দয়া করে "গেছে" এর পরিবর্তে "গিয়েছে" লিখেন +# ######################################### +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "ডাটা সাইজ পড়ো" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu বাইট তথ্য পড়েছি" +msgstr[1] "%lu বাইট তথ্য পড়েছি" + +# msgstr "%d বাইট তথ্য পড়া গেছে" +# msgstr "%d বাইট তথ্য পড়া হোক" +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d বাইট লিখেছি" +msgstr[1] "%d বাইট লিখেছি" + +# msgstr "%d বাইট লেখা হয়েছে" +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "ডিবাগিং চালু করুন" + +# msgstr "ডিবাগ" +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "বর্ণনাযুক্ত আউটপুট সক্রিয় করো" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "পশ্চাতে ফর্ক করা হবে না" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "inetd এর থেকে নেওয়া হয়েছে" + +#: ../src/daemon/gnuserv.c:495 +#| msgid "" +#| "Error on option %s: %s.\n" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "কমান্ড লাইন অপশনের সম্পূর্ণ তালিকা দেখার জন্য '%s --help' লিখুন।\n" + +# msgstr "সিস্টেম বুট হবার পর থেকে নিষ্ক্রিয় কাজে অতিবাহিত সময় (সেকেন্ডে)" +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "সংযোগ বিচ্ছিন্ন করুন" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "ইন্টেরাপ্ট" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "প্রস্থান" + +# msgstr "প্রস্থান" +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "অবৈধ ইনস্ট্রাকশন" + +# msgstr "অবৈধ ইনস্ট্রাকশন" +# Instruction এখানে Technical term। +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "ট্রেস ট্র্যাপ" + +# ২ এটা আসলে ঠিক বোঝা যাচ্ছে না। তাই মনে হয় বাদ রাখাই ভাল +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "বাতিল করো" + +# msgstr "বন্ধ করা" +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT সংক্রান্ত ভুল" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "দশমিক সংক্রান্ত ব্যতিক্রম" + +# msgstr "ভগ্নাংশ সংক্রান্ত ব্যতীক্রম" <-- বানান ভুল +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "কিল" + +# msgstr "শেষ করা (Kill)" +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "বাস সংক্রান্ত ভুল" + +# msgstr "বাস (Bus) সংক্রান্ত সমস্যা" +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "সেগমেন্ট সীমা লঙ্ঘন" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "সিস্টেম call এ ভুল মান প্রেরিত হয়েছে" + +# msgstr "সিস্টেম call এ ভুল মান প্রেরিত হয়েছে" +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "অচল পাইপ" + +# msgstr "অচল পাইপ" +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "এলার্ম ঘড়ি" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "সমাপন" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "সকেটে জরুরি অবস্থা" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "বন্ধ করুন" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "কিবোর্ড বন্ধ করুন" + +# ২ কীবোর্ড +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "চালিয়ে যান" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Child এর অবস্থা পরিবর্তিত হয়েছে" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "পশ্চাত থেকে tty পড়া" + +# ভাল হইলো না +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "পশ্চাত থেকে tty এ লেখা" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "এখন I/O সম্ভব" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU সীমা ছাড়িয়ে গেছে" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "ফাইলের সাইজ সীমা ছাড়িয়ে গেছে" + +# msgstr "ফাইলের আয়তন সীমা ছাড়িয়ে গেছে" +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "কাল্পনিক এলার্ম ঘড়ি" + +# msgstr "কাল্পনিক এলার্ম ঘড়ি" +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "এলার্ম ঘড়ি প্রোফাইল করা হচ্ছে" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "উইন্ডোর সাইজ পরিবর্তন" + +# msgstr "উইন্ডো'র আয়তন পরিবর্তন" +# Window এর বাংলা করার দরকার নাই +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "তথ্যের আবেদন" + +# msgstr "তথ্যের আবেদন" +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "ব্যবহারকারী নির্ধারিত সিগনাল ১" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "ব্যবহারকারী নির্ধারিত সিগনাল ২" + +# msgstr "ডিবাগ প্রক্রিয়া সক্রিয় করা হোক" +# ২ এটা কি বিবেচনা করা যায় না? অন্যান্য জায়গায় "ডিবাগ" লেখা হইছে, তাই এখানে অন্য রকম হয়ে যায়। +# আপনার আপত্তি থাকলে অবশ্য কোন কথা নাই। +#~ msgid "DEBUG" +#~ msgstr "ডিবাগ" + +# msgstr "ভার্বোস (Verbose) ফলাফল চালু করুন" +# msgstr "বর্ণনাযুক্ত ফলাফল দেখানো হোক" +#~ msgid "VERBOSE" +#~ msgstr "বর্ণনাযুক্ত" + +#~ msgid "NO-DAEMON" +#~ msgstr "NO-DAEMON" + +#~ msgid "INETD" +#~ msgstr "INETD" + +#~ msgid "Ticks (%ld per second):" +#~ msgstr "টিক (প্রতি সেকেন্ডে %ld সংখ্যক):" + +#~ msgid "Total" +#~ msgstr "মোট" + +#~ msgid "User" +#~ msgstr "ব্যবহারকারী" + +#~ msgid "Nice" +#~ msgstr "নাইস" + +#~ msgid "Idle" +#~ msgstr "নিস্ক্রিয়" + +# msgstr "নিষ্ক্রিয়" +# ২ বানান ভুল করছেন; ভাল করে খেয়াল করেন +#~ msgid "" +#~ "CPU (0x%08lx): %12.0f %12.0f %12.0f %12.0f %12.0f\n" +#~ "\n" +#~ msgstr "" +#~ "সিপিইউ (0x%08lx): %12.0f %12.0f %12.0f %12.0f %12.0f\n" +#~ "\n" + +#~ msgid "CPU %3d (0x%08lx): %12lu %12lu %12lu %12lu %12lu\n" +#~ msgstr "সিপিইউ %3d (0x%08lx): %12lu %12lu %12lu %12lu %12lu\n" + +#~ msgid "Percent:" +#~ msgstr "শতাংশ:" + +#~ msgid "Total (%)" +#~ msgstr "মোট (%)" + +#~ msgid "User (%)" +#~ msgstr "ব্যবহারকারী (%)" + +#~ msgid "Nice (%)" +#~ msgstr "সুন্দর (%)" + +#~ msgid "Idle (%)" +#~ msgstr "নিস্ক্রিয় (%)" + +# বানান +#~ msgid "" +#~ "CPU (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n" +#~ "\n" +#~ msgstr "" +#~ "সিপিইউ (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n" +#~ "\n" + +#~ msgid "CPU %3d (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n" +#~ msgstr "সিপিইউ %3d (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n" + +#~ msgid "Spin:" +#~ msgstr "আবর্তন:" + +# msgstr "তথ্যের মাপ পড়া গেছে" +# msgstr "তথ্যের মাপ পড়া হোক" +# ############################################# +# ############################################# +# ২ আচ্ছা +#, fuzzy +#~ msgid "read data %d byte" +#~ msgid_plural "read data %d bytes" +#~ msgstr[0] "%d বাইট তথ্য পড়া গিয়েছে" +#~ msgstr[1] "%d বাইট তথ্য পড়া গিয়েছে" + +# msgstr "সংক্ষিপ্ত ব্যবহার বিধি প্রদর্শন করা হোক" +#~ msgid "Total CPU Time" +#~ msgstr "মোট সিপিইউ সময়" + +#~ msgid "CPU Time in User Mode" +#~ msgstr "ইউজার মোডে (User Mode) ব্যয়িত সিপিইউ সময়" + +# এটা বোঝা যাচ্ছে না ;-( +# আরো ভাল কিছু মাথায় না আসলে এইটা Try করে: +# msgstr "ইউজার মোডে (User Mode) ব্যয়িত সিপিইউ সময়" +# User Mode এর বাংলা না করাই ভাল; কারণ এটা একটা Technical Term +#~ msgid "CPU Time in User Mode (nice)" +#~ msgstr "ইউজার মোডে (User Mode) ব্যয়িত সিপিইউ সময় (নাইস)" + +#~ msgid "CPU Time in System Mode" +#~ msgstr "সিস্টেম মোডে ব্যয়িত সিপিইউ সময়" + +# msgstr "সিস্টেম মোডে ব্যয়িত সিপিইউ সময়" +#~ msgid "CPU Time in the Idle Task" +#~ msgstr "নিস্ক্রিয় অবস্থায় ব্যয়িত সিপিইউ সময়" + +# msgstr "কর্মহীন অবস্থায় ব্যয়িত সিপিইউ সময়" +#~ msgid "Tick Frequency" +#~ msgstr "টিক (Tick) কম্পাঙ্ক" + +#~ msgid "SMP Total CPU Time" +#~ msgstr "এসএমপি মোট সিপিইউ সময়" + +# msgstr "মোট এসএমপি সিপিইউ সময়" +#~ msgid "SMP CPU Time in User Mode" +#~ msgstr "ইউজার মোডে ব্যয়িত এসএমপি সিপিইউ সময়" + +# msgstr "ইউজার মোডে ব্যয়িত এসএমপি সিপিইউ সময়" +#~ msgid "SMP CPU Time in User Mode (nice)" +#~ msgstr "ইউজার মোডে ব্যয়িত এসএমপি সিপিইউ সময় (নাইস)" + +# msgstr "ইউজার মোডে ব্যয়িত এসএমপি সিপিইউ সময় (নাইস)" +#~ msgid "SMP CPU Time in System Mode" +#~ msgstr "সিস্টেম মোডে ব্যয়িত এসএমপি সিপিইউ সময়" + +# msgstr "সিস্টেম মোডে ব্যয়িত এসএমপি সিপিইউ সময়" +#~ msgid "SMP CPU Time in the Idle Task" +#~ msgstr "নিস্ক্রিয় কাজের পেছনে ব্যয়িত এসএমপি সিপিইউ সময়" + +# msgstr "নিষ্ক্রিয় টাস্কের পেছনে ব্যয়িত এসএমপি সিপিইউ সময়" +# Task একটা Technical term +#~ msgid "Number of clock ticks since system boot" +#~ msgstr "সিস্টেম বুট হওয়ার পর অতিক্রান্ত ঘড়ির টিক (Tick) সংখ্যা" + +#~ msgid "Number of clock ticks the system spent in user mode" +#~ msgstr "ইউজার মোডে সিস্টেমটি যে সংখ্যক ঘড়ির টিক (Tick) অতিবাহিত করেছে" + +#~ msgid "Number of clock ticks the system spent in user mode (nice)" +#~ msgstr "ইউজার মোডে সিস্টেমটি যে সংখ্যক ঘড়ির টিক (Tick) অতিবাহিত করেছে (নাইস)" + +#~ msgid "Number of clock ticks the system spent in system mode" +#~ msgstr "সিস্টেম মোডে সিস্টেমটি যে সংখ্যক ঘড়ির টিক (Tick) অতিবাহিত করেছে" + +#~ msgid "Number of clock ticks the system spent in the idle task" +#~ msgstr "নিস্ক্রিয় অবস্থায় সিস্টেমটি যে সংখ্যক ঘড়ির টিক (Tick) অতিবাহিত করেছে" + +#~ msgid "Tick frequency (default is 100)" +#~ msgstr "টিক কম্পাঙ্ক (ডিফল্ট হল ১০০)" + +#~ msgid "Total blocks" +#~ msgstr "মোট ব্লক" + +# msgstr "মোট ব্লক" +#~ msgid "Free blocks" +#~ msgstr "ফাঁকা ব্লক" + +# msgstr "ফাঁকা ব্লক" +#~ msgid "Available blocks" +#~ msgstr "ব্যবহারযোগ্য ব্লক" + +# msgstr "ব্যবহারযোগ্য ব্লক" +#~ msgid "Total file nodes" +#~ msgstr "মোট ফাইল নোড" + +# msgstr "মোট ফাইল নোড" +#~ msgid "Free file nodes" +#~ msgstr "ফাঁকা ফাইল নোড" + +# msgstr "সংকেত (Signal)" +# msgstr "সিগন্যাল" +# এখানে Signal একটা Technical Term +#, fuzzy +#~ msgid "Block size" +#~ msgstr "আটকান আছে" + +# msgstr "ফাঁকা ফাইল নোড" +#~ msgid "Free blocks available to the superuser" +#~ msgstr "সুপারইউজারের ব্যবহারযোগ্য মুক্ত ব্লক" + +# msgstr "প্রধানব্যবহারকারীর ব্যবহারযোগ্য ফাঁকা ব্লক" +# msgstr "সুপারইউজারের ব্যবহারযোগ্য ফাঁকা ব্লক" <-- এইটার ব্যাপারে নিশ্চিত না +#~ msgid "Free blocks available to non-superusers" +#~ msgstr "সাধারন ব্যবহারকারীদের ব্যবহারযোগ্য মুক্ত ব্লক" + +# আগেরটার মত +#~ msgid "Load Average" +#~ msgstr "গড় বোঝা" + +# msgstr "গড় বোঝা" <- "গড়" বানান "গড" কেন ? +# msgstr "গড় কাজের পরিমাণ" +#~ msgid "Running Tasks" +#~ msgstr "চলন্ত কার্যসমূহ" + +# টাস্ক +#~ msgid "Number of Tasks" +#~ msgstr "কার্যসমূহের সংখ্যা" + +# msgstr "টাস্কের সংখ্যা" +#~ msgid "Last PID" +#~ msgstr "শেষ পিআইডি" + +#~ msgid "" +#~ "Number of jobs running simultaneously averaged over 1, 5 and 15 minutes" +#~ msgstr "গড়ে ১, ৫ ও ১৫ মিনিটের বেশি যুগপত্‍ চলা কাজগুলি সংখ্যায়" + +# msgstr "গড়ে ১,৫ ও ১৫ মিনিটের বেশি যুগপত্ চলা কাজগুলি সংখ্যায়" +# msgstr "গড়ে ১, ৫ ও ১৫ মিনিটের বেশি যুগপত্‍ত্চচলন্ত কাজের সংখ্যা" +# ইংরেজিটা বোঝা যাচ্ছে না বলে বাংলা নিয়েও Confusion আছে +#~ msgid "Number of tasks currently running" +#~ msgstr "বর্তমানে চলা কার্যসমূহের সংখ্যা" + +# msgstr "বর্তমানে চলন্ত টাস্কের সংখ্যা" +# "সংখ্যায়" না, বরং "সংখ্যা" +# "চলন্ত" কি ভাল শোনায় না ? +#~ msgid "Total number of tasks" +#~ msgstr "কার্যসমূহের মোট সংখ্যা" + +# msgstr "টাস্কের মোট সংখ্যা" +#~ msgid "Total Memory" +#~ msgstr "মোট মেমরি" + +# Memory-এর বাংলা করার দরকার নাই +#~ msgid "Used Memory" +#~ msgstr "ব্যবহৃত মেমরি" + +#~ msgid "Free Memory" +#~ msgstr "মুক্ত মেমরি" + +# msgstr "মুক্ত মেমরি" +# msgstr "ফাঁকা মেমরি" +#~ msgid "Shared Memory" +#~ msgstr "বন্টিত মেমরি" + +# msgstr "বন্টিত মেমরি" +# "Shared=বন্টিত", এটা সুন্দর হইছে +#~ msgid "Buffers" +#~ msgstr "বাফার" + +#~ msgid "Cached" +#~ msgstr "ক্যাশ-এ রক্ষিত" + +#~ msgid "Locked" +#~ msgstr "আটকান (Locked)" + +# msgstr "লক'কৃত (Locked)" +#~ msgid "Total physical memory in kB" +#~ msgstr "প্রকৃত মেমরির পরিমাণ (কিলোবাইট)" + +# msgstr "প্রকৃত মেমরির পরিমাণ (কিলোবাইট)" +#~ msgid "Used memory size in kB" +#~ msgstr "ব্যবহৃত মেমরির পরিমাণ (কিলোবাইট)" + +# আগেরটার মত +#~ msgid "Free memory size in kB" +#~ msgstr "মুক্ত মেমরির পরিমাণ (কিলোবাইট)" + +#~ msgid "Shared memory size in kB" +#~ msgstr "বন্টিত মেমরির পরিমাণ (কিলোবাইট)" + +#~ msgid "Size of buffers kB" +#~ msgstr "বাফারের আকার (কিলোবাইট)" + +#~ msgid "Size of cached memory in kB" +#~ msgstr "ক্যাশ মেমরির আকার (কিলোবাইট)" + +#~ msgid "Memory used from user processes in kB" +#~ msgstr "ইউজার প্রসেসসমূহের ব্যবহৃত মেমরির পরিমাণ (কিলোবাইট)" + +# msgstr "ইউজার প্রসেসসমূহের ব্যবহৃত মেমরির পরিমাণ (কিলোবাইট)" +#~ msgid "Memory in locked pages in kB" +#~ msgstr "আটকান (Locked) পৃষ্ঠাতে রক্ষিত মেমেরির পরিমাণ (কিলোবাইট)" + +# msgstr "লক'কৃত (Locked) পেজ-এ রক্ষিত মেমেরির পরিমাণ (কিলোবাইট)" +#~ msgid "Number of list elements" +#~ msgstr "তালিকাস্থ উপাদানের সংখ্যা" + +# msgstr "তালিকার উপাদানের সংখ্যা" +# msgstr "তালিকাস্থ উপাদানের সংখ্যা" +#~ msgid "Total size of list" +#~ msgstr "তালিকার মোট আয়তন" + +#~ msgid "Size of a single list element" +#~ msgstr "একক তালিকা উপাদানের আয়তন" + +# ২ এইটা কি আরেকটু ভাল করে লেখা যায় ? +#~ msgid "Size in kilobytes of message pool" +#~ msgstr "সঞ্চিত বার্তাসমূহের (Message pool) আকার (কিলোবাইট)" + +# এইটা নিয়ে Confusion আছে +#~ msgid "Number of entries in message map" +#~ msgstr "বার্তা ম্যাপে লিপিভুক্ত বিষয়গুলি সংখ্যায়" + +# ২ "সংখ্যা" +# ২ "গুলো" <- Sayamindu will ultimately change it and so it's better to change it now. +#~ msgid "Max size of message" +#~ msgstr "বার্তার সর্বাধিক আয়তন" + +#~ msgid "Default max size of queue" +#~ msgstr "সারির সর্বাধিক ডিফল্ট আয়তন" + +# msgstr "সারির সাধারন সর্বাধিক আয়তন" <-- বানান ভুল আছে +# বোঝা যাচ্ছে না +# Default এর বাংলা করলে বোঝা যায় না; তাই না করাই ভাল +#~ msgid "Max queues system wide" +#~ msgstr "নিয়মানুগ সর্বাধিক সারি" + +#~ msgid "Message segment size" +#~ msgstr "বার্তা-অংশের আয়তন" + +#~ msgid "Number of system message headers" +#~ msgstr "সিস্টেম বার্তা শিরোনামে সংখ্যা" + +# ২ ভাল করে পড়ে দেখেন +#~ msgid "Interface Flags" +#~ msgstr "ইন্টারফেস পতাকা" + +# msgstr "ইন্টারফেস পতাকা" +# msgstr "ইন্টারফেস ফ্ল্যাগ" +#~ msgid "MTU" +#~ msgstr "এমটিইউ" + +#, fuzzy +#~ msgid "IPv4 Subnet" +#~ msgstr "সাবনেট" + +#, fuzzy +#~ msgid "IPv4 Address" +#~ msgstr "ঠিকানা" + +#~ msgid "Packets In" +#~ msgstr "আগত প্যাকেট" + +#~ msgid "Packets Out" +#~ msgstr "বহিরাগত প্যাকেট" + +# msgstr "প্যাকেট গেছে" +# msgstr "প্রেরিত প্যাকেট" +# ২ "বহিরাগত" মানে "বাইরে থেকে আগত" - মনে হয় আপনি এটা বোঝাতে চাচ্ছেন না +#~ msgid "Packets Total" +#~ msgstr "মোট প্যাকেট সংখ্যা" + +#~ msgid "Bytes In" +#~ msgstr "আগত বাইট" + +#~ msgid "Bytes Out" +#~ msgstr "বহিরাগত বাইট" + +# msgstr "বাইট গেছে" +#~ msgid "Bytes Total" +#~ msgstr "মোট বাইট" + +#~ msgid "Errors In" +#~ msgstr "আগত ভুল" + +#~ msgid "Errors Out" +#~ msgstr "বহিরাগত ভুল" + +# আগের মত +#~ msgid "Errors Total" +#~ msgstr "মোট ভুল" + +#~ msgid "Collisions" +#~ msgstr "সংঘর্ষ" + +#, fuzzy +#~ msgid "IPv6 Address" +#~ msgstr "ঠিকানা" + +#~ msgid "Maximum Transfer Unit" +#~ msgstr "সর্বাধিক স্থানান্তরিত একক" + +# msgstr "সর্বাধিক একক স্থানান্তকরন" +# msgstr "সর্বাধিক স্থানান্তরিত একক" +#~ msgid "PPP State" +#~ msgstr "পিপিপি অবস্থা" + +#~ msgid "Input bytes" +#~ msgstr "আগত বাইট" + +# এটা ভাল হইছে; এটার মত "আগত প্যাকেট" লিখলে আরো ভাল হয়। +#~ msgid "Output bytes" +#~ msgstr "বহিরাগত বাইট" + +#~ msgid "Number of input bytes" +#~ msgstr "আগত বাইট সংখ্যা" + +#~ msgid "Number of output bytes" +#~ msgstr "বহিরাগত বাইট সংখ্যা" + +#~ msgid "Size" +#~ msgstr "আয়তন" + +#~ msgid "Length in bytes of the returned string." +#~ msgstr "ফিরিয়ে দেওয়া পংক্তির দৈর্ঘ্য (বাইটে)।" + +#~ msgid "" +#~ "Kernel flags of the process.\n" +#~ "\n" +#~ "On Linux, currently every flag has the math bit set, because crt0.s " +#~ "checks for math emulation, so this is not included in the output.\n" +#~ "\n" +#~ "This is probably a bug, as not every process is a compiled C program.\n" +#~ "\n" +#~ "The math bit should be a decimal 4, and the traced bit is decimal 10." +#~ msgstr "" +#~ "প্রসেসের কার্নেল পতাকা।\n" +#~ "\n" +#~ "লিনাক্সে, crt0.s এর গাণিতিক সমকক্ষতা (Math Emulation) পরীক্ষার জন্য বর্তমানে " +#~ "প্রতিটি ফ্ল্যাগের গাণিতিক বিট থাকে এবং একারণে এটি ফলাফলের অন্তর্ভুক্ত নয়।\n" +#~ "\n" +#~ "প্রতিটি প্রসেস কম্পাইল করা সি প্রোগ্রাম নয় বলে এটি সম্ভবত একটি প্রোগ্রাম সংক্রান্ত " +#~ "ত্রুটি (বাগ)।\n" +#~ "\n" +#~ "গাণিতিক বিট দশমিক ৪ এবং শনাক্তকৃত (Traced) বিটটি দশমিক ১০ হওয়া উচিত্‍।" + +# msgstr "" +# "প্রসেসের কার্নেল ফ্ল্যাগ।\n" +# "\n" +# "লিনাক্সে, crt0.s গাণিতিক সমকক্ষতা (Math Emulation) পরীক্ষা বলে বর্তমানে প্রতিটি ফ্ল্যাগের গাণিতিক বিট সক্রিয় থাকে এবং " +# "একারণে এটি ফলাফলের অন্তর্ভুক্ত নয়।\n" +# "\n" +# "প্রতিটি প্রোগ্রামই কম্পাইলকৃত সি প্রোগ্রাম নয় বলে এটি সম্ভবত একটি প্রোগ্রাম ত্রুটি (Bug)।\n" +# "\n" +# "গাণিতিক বিট দশমিক ৪ এবং শনাক্তকৃত (Traced) বিটটি দশমিক ১০ হওয়া উচিত্‍।" +# *************** Process এর বাংলা করার দরকার নাই *************************** +# ২ ৩য় লাইনে, "গাণিতিক বিট" কি অবস্থায় থাকে ? +#~ msgid "" +#~ "The number of minor faults the process has made, those which have not " +#~ "required loading a memory page from disk." +#~ msgstr "" +#~ "প্রক্রিয়ার করা গৌণ ফল্ট-এর সংখ্যা, যেগুলির ডিস্ক থেকে মেমরি পাতা আনার প্রয়োজন " +#~ "হয়নি।" + +# msgstr "প্রসেসটির গৌণ ফল্ট-এর সংখ্যা যার জন্য ডিস্ক থেকে মেমরি পেজ আনতে হয়নি।" +# এখানে Fault একটা Technical Term। তবে সব জায়গায় না ;-) +# ২ "প্রসেস" লিখলে খুবই ভাল হইতো +#~ msgid "" +#~ "The number of major faults the process has made, those which have " +#~ "required loading a memory page from disk." +#~ msgstr "" +#~ "প্রক্রিয়ার করা মুখ্য ফল্ট-এর সংখ্যা, যেগুলির ডিস্ক থেকে মেমরি পাতা আনার প্রয়োজন " +#~ "হয়েছে।" + +# msgstr "প্রসেসটির গৌণ ফল্ট-এর সংখ্যা যার জন্য ডিস্ক থেকে মেমরি পেজ আনতে হয়েছে।" +#~ msgid "" +#~ "The number of minor faults that the process and its children have made." +#~ msgstr "প্রসেস ও তার child দের করা গৌণ ফল্ট-এর সংখ্যা" + +# ঠিক করেন +#~ msgid "" +#~ "The number of major faults that the process and its children have made." +#~ msgstr "প্রসেস ও তার child দের করা মুখ্য ফল্ট-এর সংখ্যা" + +# ঠিক করেন +#~ msgid "" +#~ "The current value of esp (32-bit stack pointer), as found in the kernel " +#~ "stack page for the process." +#~ msgstr "" +#~ "প্রসেসটির জন্য কার্নেলের স্ট্যাক পেজে প্রাপ্ত esp (৩২-বিট স্ট্যাক পয়েন্টার) এর " +#~ "বর্তমান মান।" + +#~ msgid "The current EIP (32-bit instruction pointer)." +#~ msgstr "EIP এর বর্তমান মান (৩২-বিট ইনস্ট্রাকশন পয়েন্টার)।" + +#~ msgid "" +#~ "This is the \"channel\" in which the process is waiting. This is the " +#~ "address of a system call, and can be looked up in a namelist if you need " +#~ "a textual name. (If you have an up-to-date /etc/psdatabase, then try ps -" +#~ "l to see the WCHAN field in action)" +#~ msgstr "" +#~ "এটি \"channel\" যেখানে প্রক্রিয়া অপেক্ষা করছে। এটি সিস্টেম কলের ঠিকানা,এবং এর " +#~ "জন্য নথিতালিকা দেখা যেতে পারে যদি আপনার কোন পাঠযোগ্য নাম প্রয়োজন হয়। " +#~ "(যদিআপনার সাম্প্রতিক /etc/psdatabase থাকে, তাহলে কাজের WCHAN এলাকায় দেখার " +#~ "জন্য ps -l চেষ্টা করুন)" + +# ২ এটি সেই চ্যানেল যেখানে প্রসেসটি অপেক্ষা করছে............... +#~ msgid "This is the textual name of the `nwchan' field." +#~ msgstr "এটি 'nwchan' ক্ষেত্রের (Field) পাঠযোগ্য নাম" + +# msgstr "এটি 'nwchan' ক্ষেত্রের (Field) পাঠযোগ্য নাম" +#~ msgid "Virtual" +#~ msgstr "ভার্চুয়াল" + +# msgstr "ভার্চুয়াল" +# এখানে Virtual একটা Technical term। "ভার্চুয়াল মেমরি" থেকে আসছে। +#~ msgid "Resident" +#~ msgstr "রেসিডেন্ট" + +# msgstr "রেসিডেন্ট" +# আগেরটার মতই +#~ msgid "Share" +#~ msgstr "বন্টন" + +#~ msgid "Total # of pages of memory" +#~ msgstr "মেমরির মোট পাতার সংখ্যা" + +# মেমরি +#~ msgid "Number of pages of virtual memory" +#~ msgstr "ভার্চুয়াল মেমরির মোট পাতার সংখ্যা" + +#~ msgid "Number of pages of shared (mmap'd) memory" +#~ msgstr "বন্টিত মেমরির (mmap'd) মোট পাতার সংখ্যা" + +# "শেয়ার্‌ড মেমরি" বা "বন্টিত মেমরি"। বাংলা না করাই মনে হয় ভাল। +#~ msgid "" +#~ "Number of pages the process has in real memory, minus 3 for " +#~ "administrative purposes. This is just the pages which count towards text, " +#~ "data, or stack space. This does not include pages which have not been " +#~ "demand-loaded in, or which are swapped out." +#~ msgstr "" +#~ "বাস্তব মেমরির মোট পাতার সংখ্যা, পরিচালনার জন্য ৩ বাদ দিয়ে। এটি কেবল একটি " +#~ "পাতাযেটা অক্ষর, তথ্য, অথবা স্ট্যাকের জায়গা গননা করে। এটিতে সেই সমস্ত পাতা " +#~ "অম্তর্ভুক্ত নয় যেগুলি,চাহিদায়-নেওয়া (demand-loaded) নয় অথবা সরিয়ে ফেলা হয়েছে।" + +# ২ "গণনা", "অন্তর্ভুক্ত" +# ২ আগেরবার এটা কোন কারণে আমার চোখে পরে নাই ;-( +#~ msgid "" +#~ "Current limit in bytes on the rss of the process (usually 2,147,483,647)." +#~ msgstr "বাইটে প্রকাশিত প্রসেসের বর্তমান rss সীমা (সাধারণত ২,১৪৭,৪৮৩,৬৪৭)।" + +#~ msgid "Dirty Size" +#~ msgstr "অপরিচ্ছন্ন (Dirty) আয়তন" + +# msgstr "অপরিচ্ছন্ন (Dirty) আয়তন" +#~ msgid "Start_Code" +#~ msgstr "কোড_আরম্ভ" + +#~ msgid "End_Code" +#~ msgstr "কোড_শেষ" + +#~ msgid "Start_Stack" +#~ msgstr "স্ট্যাক_আরম্ভ" + +#~ msgid "Total size of dirty pages" +#~ msgstr "অপরিচ্ছন্ন (Dirty) পেজ-এর মোট আয়তন" + +# msgstr "অপরিচ্ছন্ন (Dirty) পেজ-এর মোট আয়তন" +#~ msgid "Address of beginning of code segment" +#~ msgstr "কোড সেগমেন্ট আরম্ভের ঠিকানা" + +# msgstr "কোড সেগমেন্ট আরম্ভের ঠিকানা" +#~ msgid "Address of end of code segment" +#~ msgstr "কোড সেগমেন্ট শেষের ঠিকানা" + +# msgstr "কোড সেগমেন্ট শেষ হওয়ার ঠিকানা" +#~ msgid "Address of the bottom of stack segment" +#~ msgstr "স্ট্যাক সেগমেন্ট-এর তলদেশের ঠিকানা" + +# msgstr "কোড অংশের নিচের ঠিকানা" <-- স্ট্যাক নাই +# সেগমেন্ট +#~ msgid "Signal" +#~ msgstr "সংকেত (Signal)" + +# msgstr "সংকেত (Signal)" +# msgstr "সিগন্যাল" +# এখানে Signal একটা Technical Term +#~ msgid "Blocked" +#~ msgstr "আটকান আছে" + +#~ msgid "Mask of pending signals" +#~ msgstr "অমীমাংসিত সংকেতের (Signal) মুখোশ" + +# msgstr "অমীমাংসিত সিগন্যাল-এর মুখোশ" +#~ msgid "Mask of blocked signals" +#~ msgstr "আটকে রাখা সংকেতের (Signal) মুখোশ" + +# সিগন্যাল +# ২ msgstr "সংকেত আটকে রাখার (Signal) মুখোশ" +#~ msgid "Mask of ignored signals" +#~ msgstr "প্রত্যাখ্যাত সংকেতের (Signal) মুখোশ" + +# সিগন্যাল +#~ msgid "Mask of caught signals" +#~ msgstr "গ্রহণ করা সংকেতের মুখোশ" + +#~ msgid "State" +#~ msgstr "অবস্থা" + +#~ msgid "UID" +#~ msgstr "ইউআইডি (UID)" + +#~ msgid "GID" +#~ msgstr "জিআইডি (GID)" + +#, fuzzy +#~ msgid "RGid" +#~ msgstr "জিআইডি (Gid)" + +# msgstr "প্রসেসটি কার্নেল মোডে যে পরিমাণ এসএমপি সিপিইউ সময় ব্যয় করেছে" +#, fuzzy +#~ msgid "RUid" +#~ msgstr "ইউআইডি (Uid)" + +#~ msgid "Basename of executable file in call to exec()" +#~ msgstr "exec() ডাকা এক্সিকিউটেবল ফাইলের মূল নাম" + +# ইংরেজি স্পষ্ট না; exec()'কে এক্সিকিউটেবল ডাকতেছে নাকি এক্সিকিউটেবল'কে exec() ডাকতেছে ? +#~ msgid "Single-Char code for process state (S=sleeping)" +#~ msgstr "একটি অক্ষর দিয়ে প্রসেসের অবস্থা প্রকাশের সংকেত (Code) (S=নিস্ক্রিয়)" + +# msgstr "একটি অক্ষর দিয়ে প্রসেসের অবস্থা প্রকাশের সংকেত (Code) (S=নিষ্ক্রিয়)" +#~ msgid "UID of process" +#~ msgstr "প্রসেসের UID" + +# প্রসেস +#~ msgid "GID of process" +#~ msgstr "প্রসেসের GID" + +# msgstr "একটি অক্ষর দিয়ে প্রসেসের অবস্থা প্রকাশের সংকেত (Code) (S=নিষ্ক্রিয়)" +#, fuzzy +#~ msgid "Real UID of process" +#~ msgstr "প্রসেসের UID" + +# প্রসেস +#, fuzzy +#~ msgid "Real GID of process" +#~ msgstr "প্রসেসের GID" + +#, fuzzy +#~ msgid "Processor" +#~ msgstr "প্রসেস আইডি" + +#~ msgid "Start_Time" +#~ msgstr "আরম্ভের_সময়" + +#~ msgid "TimeOut" +#~ msgstr "সময় শেষ" + +#~ msgid "Frequency" +#~ msgstr "কম্পাঙ্ক" + +#~ msgid "Start time of process in seconds since the epoch" +#~ msgstr "epoch এর পর থেকে প্রসেস শুরুর সময় (সেকেন্ডে)" + +#~ msgid "Real time accumulated by process (should be utime + stime)" +#~ msgstr "যে প্রকৃত সময় যাবত্‍ প্রসেসটি চলছে (utime+stime হওয়া উচিত্‍)" + +# msgstr "যে প্রকৃত সময় যাবত্‍ প্রসেসটি চলছে (utime+stime হওয়া উচিত্‍)" +#~ msgid "user-mode CPU time accumulated by process" +#~ msgstr "প্রসেসটি ইউজার মোডে যে পরিমাণ সিপিইউ সময় ব্যয় করেছে" + +#~ msgid "kernel-mode CPU time accumulated by process" +#~ msgstr "প্রসেসটি কার্নেল মোডে যে পরিমাণ সিপিইউ সময় ব্যয় করেছে" + +# msgstr "প্রসেসটি কার্নেল মোডে যে পরিমাণ সিপিইউ সময় ব্যয় করেছে" +#~ msgid "cumulative utime of process and reaped children" +#~ msgstr "প্রসেসের ক্রমবর্ধিত utime এবং অর্জিত children" + +# আরেকটু সহজ করা যায় না ? ;-) +#~ msgid "cumulative stime of process and reaped children" +#~ msgstr "প্রmsmsj ক্রমবর্ধিত stime এবং অর্জিত children" + +# ২ এইটা কিরকম হইলো ??? +#~ msgid "The time (in jiffies) of the process's next timeout" +#~ msgstr "পরবর্তীতে যখন প্রসেসটির সময় শেষ হয়ে যাবে (jiffies এ)" + +# msgstr "পরবর্তীতে যখন প্রসেসটির সময় শেষ হয়ে যাবে (jiffies এ)" +#~ msgid "" +#~ "The time (in jiffies) before the next SIGALRM is sent to the process due " +#~ "to an interval timer." +#~ msgstr "" +#~ "ইন্টারভেল টাইমারের কারণে আর যে সময় পর প্রসেসটির নিকট SIGALRM প্রেরণ করা হবে। " +#~ "(jiffies এ)" + +#~ msgid "Tick frequency" +#~ msgstr "টিক কম্পাঙ্ক" + +#~ msgid "SMP user-mode CPU time accumulated by process" +#~ msgstr "প্রসেসটি ইউজার মোডে যে পরিমাণ এসএমপি সিপিইউ সময় ব্যয় করেছে" + +#~ msgid "SMP kernel-mode CPU time accumulated by process" +#~ msgstr "প্রসেসটি কার্নেল মোডে যে পরিমাণ এসএমপি সিপিইউ সময় ব্যয় করেছে" + +# msgstr "প্রসেসটি কার্নেল মোডে যে পরিমাণ এসএমপি সিপিইউ সময় ব্যয় করেছে" +#~ msgid "Uid" +#~ msgstr "ইউআইডি (Uid)" + +#~ msgid "EUid" +#~ msgstr "ইইউআইডি (EUid)" + +#~ msgid "Gid" +#~ msgstr "জিআইডি (Gid)" + +# ২ ( এর আগে একটা Space দিয়ে দিছি +#~ msgid "EGid" +#~ msgstr "ইজিআইডি (EGid)" + +# msgstr "প্রসেসটি কার্নেল মোডে যে পরিমাণ এসএমপি সিপিইউ সময় ব্যয় করেছে" +#, fuzzy +#~ msgid "SUid" +#~ msgstr "ইউআইডি (Uid)" + +#, fuzzy +#~ msgid "SGid" +#~ msgstr "জিআইডি (Gid)" + +# msgstr "প্রসেসটি কার্নেল মোডে যে পরিমাণ এসএমপি সিপিইউ সময় ব্যয় করেছে" +#, fuzzy +#~ msgid "FSUid" +#~ msgstr "ইউআইডি (Uid)" + +#, fuzzy +#~ msgid "FSGid" +#~ msgstr "জিআইডি (Gid)" + +#~ msgid "Pid" +#~ msgstr "পিআইডি (Pid)" + +#~ msgid "PPid" +#~ msgstr "পিপিআইডি (PPid)" + +#~ msgid "PGrp" +#~ msgstr "পিজিআরপি (PGrp)" + +#~ msgid "Session" +#~ msgstr "অধিবেশন (session)" + +# msgstr "সেশন" +#~ msgid "Tty" +#~ msgstr "টিটিআই (Tty)" + +# ২ টিটিওয়াই - মনে হয় আমারই ভুল ;-( +#~ msgid "TPGid" +#~ msgstr "টিপিজিআইডি (TiGid)" + +#~ msgid "Priority" +#~ msgstr "অগ্রাধিকার" + +#, fuzzy +#~ msgid "NGroups" +#~ msgstr "গ্রুপের আইডি" + +#, fuzzy +#~ msgid "Groups" +#~ msgstr "গ্রুপের আইডি" + +#~ msgid "User ID" +#~ msgstr "ব্যবহারকারীর আইডি" + +# msgstr "ব্যবহারকারীর আইডি" +# অন্যান্য ফাইলে আইডি-ই লেখা হইছে +#~ msgid "Effective User ID" +#~ msgstr "সক্রিয় ব্যবহারকারীর আইডি" + +#~ msgid "Group ID" +#~ msgstr "গ্রুপের আইডি" + +# msgstr "গ্রুপ পরিচয়" +#~ msgid "Effective Group ID" +#~ msgstr "সক্রিয় গ্রুপের আইডি" + +#, fuzzy +#~ msgid "Set User ID" +#~ msgstr "ব্যবহারকারীর আইডি" + +#, fuzzy +#~ msgid "Set Group ID" +#~ msgstr "গ্রুপের আইডি" + +#, fuzzy +#~ msgid "Filesystem User ID" +#~ msgstr "ফাইল সিস্টেমের ব্যবহার" + +# msgstr "গ্রুপ পরিচয়" +#, fuzzy +#~ msgid "Filesystem Group ID" +#~ msgstr "সক্রিয় গ্রুপের আইডি" + +#~ msgid "Process ID" +#~ msgstr "প্রসেস আইডি" + +# msgstr "প্রক্রিয়াকরন পরিচয়" <-- "করণ" +# msgstr "প্রসেস আইডি" +#~ msgid "PID of parent process" +#~ msgstr "মূল (Parent) প্রসেসের পিআইডি" + +# msgstr "মূল (Parent) প্রসেসের পিআইডি" +#~ msgid "Process group ID" +#~ msgstr "প্রসেস গ্রুপ আইডি" + +# msgstr "গোষ্ঠি প্রক্রিয়াকরন পরিচয়" +# msgstr "প্রসেস গ্রুপ আইডি" +#~ msgid "Session ID" +#~ msgstr "অধিবেশন (session) আইডি" + +# msgstr "সেশন আইডি" +#~ msgid "Full device number of controlling terminal" +#~ msgstr "নিয়ন্ত্রণকারী প্রান্তের সমস্ত যন্ত্রের সংখ্যা" + +# msgstr "নিয়ন্ত্রন প্রান্তের সমস্ত যন্ত্রের সংখ্যা" <-- "নিয়ন্ত্রণ" বানান ভুল আছে +# msgstr "নিয়ন্ত্রণকারী টার্মিনালের পূর্ণ ডিভাইস নম্বর" +# ২ এটা কি ভাল করে খেয়াল করে ঠিক করছেন ? +#~ msgid "Terminal process group ID" +#~ msgstr "প্রান্তিক প্রসেসের গ্রুপ আইডি" + +# msgstr "টার্মিনাল প্রসেসের গ্রুপ আইডি" +#~ msgid "Kernel scheduling priority" +#~ msgstr "কার্নেল শিডিউলিং (scheduling) এর অগ্রাধিকার" + +# msgstr "কার্নেল শিডিউলিং (scheduling) এর অগ্রাধিকার" +# scheduling একটা দুর্ধর্ষ Technical Term। +#~ msgid "Standard unix nice level of process" +#~ msgstr "প্রসেসের সাধারণ ইউনিক্স নাইস স্তর" + +# msgstr "নিয়ন্ত্রন প্রান্তের সমস্ত যন্ত্রের সংখ্যা" <-- "নিয়ন্ত্রণ" বানান ভুল আছে +# msgstr "নিয়ন্ত্রণকারী টার্মিনালের পূর্ণ ডিভাইস নম্বর" +# ২ এটা কি ভাল করে খেয়াল করে ঠিক করছেন ? +#, fuzzy +#~ msgid "Number of additional process groups" +#~ msgstr "প্রান্তিক প্রসেসের গ্রুপ আইডি" + +# msgstr "নিয়ন্ত্রন প্রান্তের সমস্ত যন্ত্রের সংখ্যা" <-- "নিয়ন্ত্রণ" বানান ভুল আছে +# msgstr "নিয়ন্ত্রণকারী টার্মিনালের পূর্ণ ডিভাইস নম্বর" +# ২ এটা কি ভাল করে খেয়াল করে ঠিক করছেন ? +#, fuzzy +#~ msgid "Array of additional process groups" +#~ msgstr "প্রান্তিক প্রসেসের গ্রুপ আইডি" + +# msgstr "সাধারন ইউনিক্স সুন্দর স্তরের প্রক্রিয়া" +# msgstr "প্রসেসের প্রমিত ইউনিক্স নাইস স্তর" +# নাইস +#~ msgid "Number of entries in semaphore map" +#~ msgstr "সিমাফোর (semaphore) ম্যাপে অন্তর্ভুক্তির (Entry) সংখ্যা" + +# msgstr "সিমাফোর (semaphore) ম্যাপে অন্তর্ভুক্তির (Entry) সংখ্যা" +#~ msgid "Max number of arrays" +#~ msgstr "সর্বাধিক array এর সংখ্যা" + +#~ msgid "Max semaphores system wide" +#~ msgstr "নিয়মানুগ সর্বাধিক semaphore গুলো" + +# msgstr "নিয়মানুগ সর্বাধিক semaphore গুলি" +# msgstr "সিস্টেমে ব্যবহারযোগ্য সর্বাধিক সিমাফোর (Semaphor)" +#~ msgid "Number of undo structures system wide" +#~ msgstr "নিয়মানুগ শেষ পরিবর্তন বাতিলের গঠন সংখ্যা" + +#~ msgid "Max semaphores per array" +#~ msgstr "গুচ্ছ (Array) প্রতি সর্বাধিক সিমাফোর (Semaphore)" + +# msgstr "গুচ্ছ (Array) প্রতি সর্বাধিক সিমাফোর (Semaphore)" +#~ msgid "Max ops per semop call" +#~ msgstr "semop call প্রতি সর্বাধিক ops" + +#~ msgid "Max number of undo entries per process" +#~ msgstr "প্রসেস প্রতি শেষ পরিবর্তন বাতিল (Undo) অন্তর্ভুক্তির (Entry) সর্বাধিক সংখ্যা" + +# msgstr "প্রসেস প্রতি শেষ পরিবর্তন বাতিল (Undo) অন্তর্ভুক্তির (Entry) সর্বাধিক সংখ্যা" +#~ msgid "sizeof struct sem_undo" +#~ msgstr "struct sem_undo এর আয়তন" + +#~ msgid "Semaphore max value" +#~ msgstr "সিমাফোর (Semaphor) এর সর্বাধিক মান" + +# msgstr "সিমাফোর (Semaphor) এর সর্বাধিক মান" +#~ msgid "Adjust on exit max value" +#~ msgstr "বাহির হবার সময় সর্বাধিক মান বিন্যস্ত কর" + +# এটার বাংলা বা ইংরেজি কোনটাই বোঝা যাচ্ছে না +#~ msgid "Max segment size" +#~ msgstr "সেগমেন্টের সর্বোচ্চ আকার" + +# msgstr "সেগমেন্টের সর্বোচ্চ আকার" +#~ msgid "Min segment size" +#~ msgstr "সেগমেন্টের ন্যুনতম আকার" + +# আগেরটার মতই +#~ msgid "Max number of segments" +#~ msgstr "সেগমেন্টের সর্বোচ্চ সংখ্যা" + +# ঐ +#~ msgid "Max shared segments per process" +#~ msgstr "প্রসেস প্রতি সর্বাধিক বন্টিত সেগমেন্ট" + +# msgstr "প্রসেস প্রতি সর্বাধিক বন্টিত (Shared) সেগমেন্ট" +#~ msgid "Max total shared memory" +#~ msgstr "সর্বাধিক মোট বন্টিত মেমরি" + +# মেমরি +#~ msgid "Total Swap Space" +#~ msgstr "মোট সোয়াপ (Swap) জায়গা" + +# msgstr "মোট সোয়াপ (Swap)" +#~ msgid "Used Swap Space" +#~ msgstr "ব্যবহৃত সোয়াপ (Swap) জায়গা" + +# ঐ +#~ msgid "Free Swap Space" +#~ msgstr "মুক্ত সোয়াপ (Swap) জায়গা" + +#~ msgid "Page In" +#~ msgstr "আগত পাতা" + +#~ msgid "Page Out" +#~ msgstr "পাতা গেছে" + +# msgstr "পাতা (Page) গিয়েছে" +# ২ এটা মনে হয় খেয়াল করেন নাই +#~ msgid "" +#~ "Total number of swap pages that have been brought in since system boot" +#~ msgstr "সিস্টেম চালু হবার পর থেকে মোট যে সংখ্যক সোয়াপ (Swap) পাতা আনা হয়েছে" + +# msgstr "সিস্টেম চালু হবার পর থেকে মোট যে সংখ্যক সোয়াপ (Swap) পাতা (Page) আনা হয়েছে" +#~ msgid "" +#~ "Total number of swap pages that have been brought out since system boot" +#~ msgstr "সিস্টেম চালু হবার পর থেকে মোট যে সংখ্যক সোয়াপ পাতা আনা হয়েছে" + +# আগেরটার মতই +#~ msgid "Server Features" +#~ msgstr "সার্ভারের বৈশিষ্ট্যগুলো" + +# msgstr "সার্ভারের বৈশিষ্ট্যগুলি" <-- "গুলি" ভাল শোনায় না +# msgstr "সার্ভারের বৈশিষ্ট্যাবলী" +#~ msgid "CPU Usage" +#~ msgstr "সিপিইউ-এর ব্যবহার" + +#~ msgid "Memory Usage" +#~ msgstr "মেমরির ব্যবহার" + +# মেমরি +#~ msgid "Swap Usage" +#~ msgstr "সোয়াপের ব্যবহার" + +#~ msgid "System Uptime" +#~ msgstr "সিস্টেম চালু থাকার সময়" + +#~ msgid "Load Averange" +#~ msgstr "গড় ভার" + +# msgstr "গড় ভার" <- "গড" +# msgstr "গড় কাজের মাত্রা" +#~ msgid "Shared Memory Limits" +#~ msgstr "বন্টিত মেমরি সীমা" + +# মেমরি +#~ msgid "Message Queue Limits" +#~ msgstr "বার্তা সারির (Message Queue) সীমা" + +# msgstr "বার্তা সারির (Message Queue) ধারণক্ষমতা" +#~ msgid "Semaphore Set Limits" +#~ msgstr "Semaphore Set এর সীমা" + +#~ msgid "List of running Processes" +#~ msgstr "চলন্ত প্রসেসসমূহের তালিকা" + +# msgstr "চলন্ত প্রক্রিয়াকরনগুলির তালিকা" <- "করণ" +#~ msgid "Process Status information" +#~ msgstr "প্রসেসের অবস্থাসূচক তথ্যাবলী" + +# এটা কিছু বোঝা যাচ্ছে না। তাছাড়া "করুন" শব্দটা এখানে আসার কথা না। +# msgstr "প্রসেসের অবস্থাসূচক তথ্যাবলী" +#~ msgid "Process UID and TTY information" +#~ msgstr "ইউআইডি এবং টিটিওয়াই তথ্য প্রক্রিয়াকরন করুন" + +# msgstr "প্রসেসের ইউআইডি (UID) ও টিটিওয়াই (TTY) সংক্রান্ত তথ্যাবলী" +# ২ "প্রক্রিয়াকরণ" +# ২ এটা কি ভাল করে খেয়াল করছেন ? +#~ msgid "Process Memory information" +#~ msgstr "প্রসেসের মেমরি সংক্রান্ত তথ্যাবলী" + +# msgstr "প্রসেসের মেমরি সংক্রান্ত তথ্যাবলী" +#~ msgid "Process Time information" +#~ msgstr "প্রসেসের সময় সংক্রান্ত তথ্যাবলী" + +# msgstr "প্রসেসের সময় সংক্রান্ত তথ্যাবলী" +#~ msgid "Process Signal information" +#~ msgstr "প্রসেসের সিগন্যাল সংক্রান্ত তথ্যাবলী" + +# msgstr "প্রসেসের সিগন্যাল সংক্রান্ত তথ্যাবলী" +#~ msgid "Process Kernel Data information" +#~ msgstr "প্রসেসের কার্নেল তথ্যবিষয়ক তথ্যাবলী" + +# msgstr "প্রসেসের কার্নেল তথ্যবিষয়ক তথ্যাবলী" +#~ msgid "Process Segment information" +#~ msgstr "প্রসেসের সেগমেন্ট সংক্রান্ত তথ্যাবলী" + +# msgstr "প্রসেসের সেগমেন্ট সংক্রান্ত তথ্যাবলী" +#~ msgid "Process Arguments" +#~ msgstr "প্রসেসে প্রেরিত মান" + +# msgstr "প্রসেসের নিকট প্রেরিত মান" +#~ msgid "Process Memory Map" +#~ msgstr "প্রসেসের মেমরি ম্যাপ" + +# msgstr "প্রসেসের মেমরি ম্যাপ" +#~ msgid "Mount List" +#~ msgstr "মাউন্টের তালিকা" + +#~ msgid "File System Usage" +#~ msgstr "ফাইল সিস্টেমের ব্যবহার" + +# msgstr "ফাইলসিস্টেমের ব্যবহার" +#~ msgid "Network Load" +#~ msgstr "নেটওয়ার্ক ভার" + +# msgstr "নেটওয়ার্কের কাজের মাত্রা" +#~ msgid "PPP Statistics" +#~ msgstr "পিপিপি পরিসংখ্যান" + +#~ msgid "Command line arguments of the process" +#~ msgstr "কমান্ড লাইন থেকে প্রসেসকে প্রেরিত মান" + +# msgstr "কমান্ড লাইন থেকে প্রসেসকে প্রেরিত মান" +#~ msgid "List of currently mounted filesystems" +#~ msgstr "বর্তমানে মাউন্ট করা ফাইল-সিস্টেমের তালিকা" + +# msgstr "বর্তমানে মাউন্ট করা ফাইল-সিস্টেমের তালিকা" +#~ msgid "Uptime" +#~ msgstr "চালু থাকা সময়" + +# msgstr "চালু থাকার সময়" +# msgstr "সচল থাকার সময়" +#~ msgid "Idletime" +#~ msgstr "নিস্ক্রিয়ভাবে ব্যয়িত সময়" + +# msgstr "নিষ্ক্রিয়ভাবে ব্যয়িত সময়" +# নিষ্ক্রিয় +#~ msgid "Time in seconds since system boot" +#~ msgstr "সিস্টেম বুট হবার পর থেকে অতিবাহিত সময় (সেকেন্ডে)" + +#~ msgid "Time in seconds the system spent in the idle task since system boot" +#~ msgstr "সিস্টেম বুট হবার পর থেকে নিস্ক্রিয় কাজে অতিবাহিত সময় (সেকেন্ডে)" + +#, fuzzy +#~ msgid "Time of last system boot in seconds since the epoch" +#~ msgstr "epoch এর পর থেকে প্রসেস শুরুর সময় (সেকেন্ডে)" diff --git a/po/bn_IN.gmo b/po/bn_IN.gmo new file mode 100644 index 0000000..40268bc Binary files /dev/null and b/po/bn_IN.gmo differ diff --git a/po/bn_IN.po b/po/bn_IN.po new file mode 100644 index 0000000..397ed15 --- /dev/null +++ b/po/bn_IN.po @@ -0,0 +1,222 @@ +# Bengali India translation of libgtop. +# Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc. +# This file is distributed under the same license as the libgtop package. +# +# Vat , 2003. +# Mahay Alam Khan , 2005. +# Samia Niamatullah , 2005. +# Runa Bhattacharjee , 2007. +msgid "" +msgstr "" +"Project-Id-Version: bn_IN\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-05-14 03:41+0100\n" +"PO-Revision-Date: 2007-08-10 14:47+0530\n" +"Last-Translator: Runa Bhattacharjee \n" +"Language-Team: Bengali INDIA\n" +"Language: bn_IN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d বাইট পড়া হয়েছে" +msgstr[1] "%d বাইট পড়া হয়েছে" + +# msgstr "%d বাইট পড়া গেছে" "ড়" এর জায়গায় "ডহ্হা" লেখা +# ######################################### +# দয়া করে "গেছে" এর পরিবর্তে "গিয়েছে" লিখেন +# ######################################### +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "তথ্যের মাপ পড়া হবে" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu বাইট তথ্য পড়া হয়েছে" +msgstr[1] "%lu বাইট তথ্য পড়া হয়েছে" + +# msgstr "%d বাইট তথ্য পড়া গেছে" +# msgstr "%d বাইট তথ্য পড়া হোক" +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d বাইট লেখা হয়েছে" +msgstr[1] "%d বাইট লেখা হয়েছে" + +# msgstr "%d বাইট লেখা হয়েছে" +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "ডিবাগ ব্যবস্থা সক্রিয় করুন" + +# msgstr "ডিবাগ" +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "বিস্তারিত (ভার্বোস) আউটপুট সক্রিয় করা হবে" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "পটভূমিতে fork করা হবে না" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "inetd থেকে আরম্ভ করা হয়েছে" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"কমান্ড-লাইন থেকে ব্যবহারযোগ্য সমস্ত বিকল্পের সম্পূর্ণ তালিকা দেখতে '%s --help' প্রয়োগ " +"করুন।\n" + +# msgstr "সিস্টেম বুট হবার পর থেকে নিষ্ক্রিয় কাজে অতিবাহিত সময় (সেকেন্ডে)" +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "বন্ধ করুন" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "ইন্টারাপ্ট উৎপন্ন করা হবে" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "প্রস্থান" + +# msgstr "প্রস্থান" +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "অবৈধ নির্দেশ" + +# msgstr "অবৈধ ইনস্ট্রাকশন" +# Instruction এখানে Technical term। +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "ট্রেস ট্র্যাপ" + +# ২ এটা আসলে ঠিক বোঝা যাচ্ছে না। তাই মনে হয় বাদ রাখাই ভাল +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "অস্বাভাবিক প্রস্থান" + +# msgstr "বন্ধ করা" +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT সংক্রান্ত সমস্যা" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "ফ্লোটিং-পয়েন্ট এক্সেপশন" + +# msgstr "ভগ্নাংশ সংক্রান্ত ব্যতীক্রম" <-- বানান ভুল +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Kill করুন" + +# msgstr "শেষ করা (Kill)" +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "বাস সংক্রান্ত সমস্যা" + +# msgstr "বাস (Bus) সংক্রান্ত সমস্যা" +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "সেগমেন্টেশন সংক্রান্ত সমস্যা" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "সিস্টেম-কল'এ ভুল আর্গুমেন্ট প্রেরিত হয়েছে" + +# msgstr "সিস্টেম call এ ভুল মান প্রেরিত হয়েছে" +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "ক্ষতিগ্রস্ত পাইপ" + +# msgstr "অচল পাইপ" +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "অ্যালার্ম ঘড়ি" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "সমাপ্তি" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "সকেটে গুরুতর অবস্থা" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "বন্ধ করুন" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "কি-বোর্ড বন্ধ করুন" + +# ২ কীবোর্ড +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "এগিয়ে চলুন" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "চাইল্ডের অবস্থা পরিবর্তিত হয়েছে" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "পটভূমিতে tty'থেকে পড়া হচ্ছে" + +# ভাল হইলো না +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "পটভূমিতে tty'এ লেখা হচ্ছে" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O বর্তমানে করা সম্ভব" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU'র সীমা অতিক্রান্ত" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "ফাইলের মাপের সীমা অতিক্রান্ত" + +# msgstr "ফাইলের আয়তন সীমা ছাড়িয়ে গেছে" +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "ভার্চুয়াল অ্যালার্ম ঘড়ি" + +# msgstr "কাল্পনিক এলার্ম ঘড়ি" +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "অ্যালার্ম ঘড়ি প্রোফাইল করা হবে" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "উইন্ডোর মাপে পরিবর্তন" + +# msgstr "উইন্ডো'র আয়তন পরিবর্তন" +# Window এর বাংলা করার দরকার নাই +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "তথ্যের অনুরোধ" + +# msgstr "তথ্যের আবেদন" +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "ব্যবহারকারী নির্ধারিত সিগনাল ১" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "ব্যবহারকারী নির্ধারিত সিগনাল ২" + diff --git a/po/boldquot.sed b/po/boldquot.sed new file mode 100644 index 0000000..4b937aa --- /dev/null +++ b/po/boldquot.sed @@ -0,0 +1,10 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g +s/“/“/g +s/”/”/g +s/‘/‘/g +s/’/’/g diff --git a/po/bs.gmo b/po/bs.gmo new file mode 100644 index 0000000..047eb5b Binary files /dev/null and b/po/bs.gmo differ diff --git a/po/bs.po b/po/bs.po new file mode 100644 index 0000000..a451163 --- /dev/null +++ b/po/bs.po @@ -0,0 +1,192 @@ +msgid "" +msgstr "" +"Project-Id-Version: libgtop.HEAD\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2015-02-26 22:47+0000\n" +"PO-Revision-Date: 2013-01-30 21:42+0000\n" +"Last-Translator: Samir Ribić \n" +"Language-Team: Bosnian \n" +"Language: bs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Launchpad-Export-Date: 2014-10-23 07:17+0000\n" +"X-Generator: Launchpad (build 17203)\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "čitaj %d bajt" +msgstr[1] "čitaj %d bajta" +msgstr[2] "čitaj %d bajtova" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "veličina pročitanih podataka" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "pročitaj %lu bajt podataka" +msgstr[1] "pročitaj %lu bajta podataka" +msgstr[2] "pročitano %lu bajtova podataka" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "upisan %d bajt" +msgstr[1] "upisana %d bajta" +msgstr[2] "upisano %d bajtova" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "Uključi debugging" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "Uključi rječiti izlaz" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "Ne fork-uj u pozadinu" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "Pozvan iz inetd" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Pokrenite „%s --help“ da biste vidjeli cijelu listu dostupnih opcija " +"komandne linije.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Prekidanje veze" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Prekid" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Izađi" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Nedopuštena instrukcija" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Prati trap" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Odustani" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT greška" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Floating-point exception" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Ubij" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Sabirnička greška" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Povreda segmenta" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Neispravan argument za sistemski poziv" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Prekinut kanal" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarm" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Završavanje" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Hitno stanje na socketu" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Zaustavi" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Zaustavljanje tastature" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Nastavi" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Status djeteta je promijenjen" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Pozadinsko čitanje iz tty-a" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Pozadinsko pisanje na tty" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "U/I je sada moguć" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU granica iskorištena" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Prekoračeno ograničenje veličine spisa" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtualni alarmni sat" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profiliranje sata alarma" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Promjena veličine prozora" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Zahtjev za informacijom" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Korisnički definisan signal 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Korisnički definisan signal 2" diff --git a/po/ca.gmo b/po/ca.gmo new file mode 100644 index 0000000..9689430 Binary files /dev/null and b/po/ca.gmo differ diff --git a/po/ca.po b/po/ca.po new file mode 100644 index 0000000..3b0e745 --- /dev/null +++ b/po/ca.po @@ -0,0 +1,205 @@ +# Catalan translation of libgtop. +# Copyright © 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# Softcatalà , 2000, 2001, 2002. +# Jordi Mallach , 2002, 2003, 2004, 2005. +# Jordi Serratosa , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop 2.9.91\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-08-31 16:14+0000\n" +"PO-Revision-Date: 2017-09-01 00:54+0200\n" +"Last-Translator: Jordi Mallach \n" +"Language-Team: Catalan \n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n!=1;\n" +"X-Generator: Poedit 1.8.11\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "s'ha llegit %d octet" +msgstr[1] "s'ha llegit %d octets" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "llegeix la mida de les dades" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "s'ha llegit %lu octet de dades" +msgstr[1] "s'ha llegit %lu octets de dades" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "s'ha escrit %d octet" +msgstr[1] "s'ha escrit %d octets" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Activa la depuració" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Activa la sortida detallada" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "No bifurquis al segon pla" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Ha estat cridat des d'inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Executeu «%s --help» per veure una llista completa de les opcions " +"disponibles de la línia d'ordres.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Termina" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interromp" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Surt" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Instrucció il·legal" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Captura traça" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Interromp" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Error EMT" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Excepció de coma flotant" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Mata" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Error de bus" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Violació de segment" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Argument erroni a una crida al sistema" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Conducte trencat" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarma del rellotge" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Terminació" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Condició urgent en socket" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Parada" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Parada de teclat" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Continua" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "L'estat del fill ha canviat" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Lectura de tty en segon pla" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Escriptura a tty en segon pla" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "E/S ara és possible" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Límit de CPU excedit" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Límit de mida de fitxer excedit" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Alarma del rellotge virtual" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Alarma del rellotge perfilada" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Canvi de la mida de la finestra" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Sol·licitud d'informació" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Senyal 1 definit per l'usuari" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Senyal 2 definit per l'usuari" + +#~ msgid "DEBUG" +#~ msgstr "DEPURACIÓ" + +#~ msgid "VERBOSE" +#~ msgstr "DETALLA" + +#~ msgid "NO-DAEMON" +#~ msgstr "SENSE DIMONI" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/ca@valencia.gmo b/po/ca@valencia.gmo new file mode 100644 index 0000000..6b65032 Binary files /dev/null and b/po/ca@valencia.gmo differ diff --git a/po/ca@valencia.po b/po/ca@valencia.po new file mode 100644 index 0000000..25c9b50 --- /dev/null +++ b/po/ca@valencia.po @@ -0,0 +1,203 @@ +# Catalan translation of libgtop. +# Copyright © 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# Softcatalà , 2000, 2001, 2002. +# Jordi Mallach , 2002, 2003, 2004, 2005. +# Jordi Serratosa , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop 2.9.91\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-04-10 21:12+0200\n" +"PO-Revision-Date: 2011-04-04 22:04+0200\n" +"Last-Translator: Jordi Mallach \n" +"Language-Team: Catalan \n" +"Language: ca@valencia\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n!=1;\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "s'ha llegit %d byte" +msgstr[1] "s'ha llegit %d octets" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "llig la mida de les dades" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "s'ha llegit %lu byte de dades" +msgstr[1] "s'ha llegit %lu octets de dades" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "s'ha escrit %d byte" +msgstr[1] "s'ha escrit %d octets" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "Activa la depuració" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "Activa l'eixida detallada" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "No bifurquis al segon pla" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "Ha estat cridat des d'inetd" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Executeu «%s --help» per veure una llista completa de les opcions " +"disponibles de la línia d'ordes.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Termina" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interromp" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Ix" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Instrucció il·legal" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Captura traça" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Interromp" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Error EMT" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Excepció de coma flotant" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Mata" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Error de bus" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Violació de segment" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Argument erroni a una crida al sistema" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Conducte trencat" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarma del rellotge" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Terminació" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Condició urgent en socket" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Parada" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Parada de teclat" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Continua" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "L'estat del fill ha canviat" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Lectura de tty en segon pla" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Escriptura a tty en segon pla" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "E/S ara és possible" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Límit de CPU excedit" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Límit de mida de fitxer excedit" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Alarma del rellotge virtual" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Alarma del rellotge perfilada" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Canvi de la mida de la finestra" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Sol·licitud d'informació" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Senyal 1 definit per l'usuari" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Senyal 2 definit per l'usuari" + +#~ msgid "DEBUG" +#~ msgstr "DEPURACIÓ" + +#~ msgid "VERBOSE" +#~ msgstr "DETALLA" + +#~ msgid "NO-DAEMON" +#~ msgstr "SENSE DIMONI" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/cs.gmo b/po/cs.gmo new file mode 100644 index 0000000..03547a5 Binary files /dev/null and b/po/cs.gmo differ diff --git a/po/cs.po b/po/cs.po new file mode 100644 index 0000000..43a8d73 --- /dev/null +++ b/po/cs.po @@ -0,0 +1,198 @@ +# Czech translation of libgtop. +# This file is distributed under the same license as the libgtop package. +# Copyright (C) 2004 Miloslav Trmac . +# +# Miloslav Trmac , 2002, 2003, 2004. +# Lucas Lommer , 2008, 2010. +# Petr Kovar , 2008. +# Marek Černocký +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-08-02 02:21+0200\n" +"Last-Translator: Marek Černocký \n" +"Language-Team: Czech \n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "přečten %d bajt" +msgstr[1] "přečteny %d bajty" +msgstr[2] "přečteno %d bajtů" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "velikost přečtených dat" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "přečten %lu bajt dat" +msgstr[1] "přečteny %lu bajty dat" +msgstr[2] "přečteno %lu bajtů dat" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "zapsán %d bajt" +msgstr[1] "zapsány %d bajty" +msgstr[2] "zapsáno %d bajtů" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Povolit ladění" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Povolit podrobný výstup" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Nevětvit do pozadí" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Spuštěno z inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Spusťte prosím „%s --help“, chcete-li zobrazit všechny dostupné přepínače " +"příkazové řádky.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Zavěšení" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Přerušení" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Ukončení" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Neplatná instrukce" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Trasovací zachycení" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Přerušení" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Chyba EMT" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Výjimka v plovoucí řádové čárce" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Zabití" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Chyba sběrnice" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Porušení segmentace" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Špatný argument systémového volání" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Přerušená roura" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarm" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Přerušení" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Urgentní stav socketu" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Zastavení" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Zastavení z klávesnice" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Pokračování" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Stav potomka se změnil" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Čtení tty z pozadí" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Zápis na tty z pozadí" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O je nyní možné" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Překročen limit CPU" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Překročen limit velikosti souboru" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtuální alarm" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profilovací alarm" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Změna velikosti okna" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Požadavek na informaci" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Uživatelem definovaný signál 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Uživatelem definovaný signál 2" diff --git a/po/cy.gmo b/po/cy.gmo new file mode 100644 index 0000000..69a0883 Binary files /dev/null and b/po/cy.gmo differ diff --git a/po/cy.po b/po/cy.po new file mode 100644 index 0000000..2ef057d --- /dev/null +++ b/po/cy.po @@ -0,0 +1,208 @@ +# libgtop yn Gymraeg. +# This file is distributed under the same license as the libgtop package. +# Dafydd Harries , 2003 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-09-25 18:15+0200\n" +"PO-Revision-Date: 2005-08-29 20:39+0100\n" +"Last-Translator: Bryn Salisbury \n" +"Language-Team: Welsh \n" +"Language: cy\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Form: nplurals=2: plural=(n == 2) ? 1 : 0;\n" + +#: lib/read.c:65 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "darllen %d beit" +msgstr[1] "darllen %d feit" + +#: lib/read_data.c:53 +msgid "read data size" +msgstr "darllen maint data" + +#: lib/read_data.c:72 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "darllennwyd %lu beit" +msgstr[1] "darllennwyd %lu feit" + +#: lib/write.c:52 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "ysgrifennwyd %d beit" +msgstr[1] "ysgrifennwyd %d feit" + +#: src/daemon/gnuserv.c:460 +msgid "Enable debugging" +msgstr "Galluogi datnamu" + +#: src/daemon/gnuserv.c:460 +msgid "DEBUG" +msgstr "DATNAMU" + +#: src/daemon/gnuserv.c:462 +msgid "Enable verbose output" +msgstr "Galluogi allbwn amleiriog" + +#: src/daemon/gnuserv.c:462 +msgid "VERBOSE" +msgstr "AMLEIRIOG" + +#: src/daemon/gnuserv.c:464 +msgid "Don't fork into background" +msgstr "Peidio fforcio i'r cefndir" + +#: src/daemon/gnuserv.c:464 +msgid "NO-DAEMON" +msgstr "DIM-ELLYLL" + +#: src/daemon/gnuserv.c:466 +msgid "Invoked from inetd" +msgstr "Cychwynwyd o inetd" + +#: src/daemon/gnuserv.c:466 +msgid "INETD" +msgstr "INETD" + +#: src/daemon/gnuserv.c:500 +#, c-format +msgid "" +"Error on option %s: %s.\n" +"Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Gwall efo'r opsiwn %s: %s.\n" +"Rhedwch '%s --help' er mwyn gweld rhestr cyflawn o'r opsinnau llinell " +"gorchymyn sydd ar gael.\n" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Hangup" +msgstr "Hongian i fyny" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Interrupt" +msgstr "Ymyrryd" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Quit" +msgstr "Gadael" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Illegal instruction" +msgstr "Cyfarwyddiad anghyfriethlon" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Trace trap" +msgstr "Trap trywyddu" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "Abort" +msgstr "Terfynu" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "EMT error" +msgstr "Gwall EMT" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Floating-point exception" +msgstr "Eithriad pwynt symudol" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Kill" +msgstr "Lladd" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Bus error" +msgstr "Gwall bws" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Segmentation violation" +msgstr "Trosedd segmentu" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Bad argument to system call" +msgstr "Ymresymiad gwael i alwad system" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Broken pipe" +msgstr "Piben torredig" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Alarm clock" +msgstr "Cloc larwm" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Termination" +msgstr "Terfynnu" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Urgent condition on socket" +msgstr "Amod pwysig ar soced" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Stop" +msgstr "Atal" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Keyboard stop" +msgstr "Ataliad bysellfwrdd" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Continue" +msgstr "Parhau" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Child status has changed" +msgstr "Statws plentyn wedi newid" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background read from tty" +msgstr "Darllen cefndir o TTY" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "Background write to tty" +msgstr "Ysgrifennu cefndir at TTY" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "I/O now possible" +msgstr "I/O nawr yn bosib" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "CPU limit exceeded" +msgstr "Y tu hwnt i'r cyfwng CPU" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "File size limit exceeded" +msgstr "Y tu hwnt i'r cyfwng maint ffeil" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Virtual alarm clock" +msgstr "Cloc larwm rhithwir" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Profiling alarm clock" +msgstr "Cloc larm proffeilio" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Window size change" +msgstr "Newid maint ffenest" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "Information request" +msgstr "Cais gwybodaeth" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 1" +msgstr "Arwydd diffiniwyd gan y defnyddiwr 1" + +#: sysdeps/osf1/siglist.c:58 sysdeps/sun4/siglist.c:58 +msgid "User defined signal 2" +msgstr "Arwydd diffiniwyd gan y defnyddiwr 2" diff --git a/po/da.gmo b/po/da.gmo new file mode 100644 index 0000000..fb4da14 Binary files /dev/null and b/po/da.gmo differ diff --git a/po/da.po b/po/da.po new file mode 100644 index 0000000..3a31f53 --- /dev/null +++ b/po/da.po @@ -0,0 +1,205 @@ +# Danish translation of libgtop. +# Copyright (C) 1998, 2002, 03, 04, 05, 17 Free Software Foundation, Inc. +# This file is distributed under the same license as the libgtop package. +# Kenneth Christiansen , 1998, 1999. +# Keld Simonsen , 2000. +# Ole Laursen , 2002, 03, 05. +# Martin Willemoes Hansen , 2004. +# Ask Hjorth Larsen , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-09-10 17:51+0200\n" +"Last-Translator: Ole Laursen \n" +"Language-Team: Danish \n" +"Language: da\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "læste %d byte" +msgstr[1] "læste %d byte" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "læste datastørrelse" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "læste %lu byte" +msgstr[1] "læste %lu byte" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "skrev %d byte" +msgstr[1] "skrev %d byte" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Slå fejlfinding til" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Slå meddelsom udskrift til" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Forgren ikke til baggrund" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Kaldt fra inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "Kør “%s --help” for at få en liste over alle tilgængelige kommandolinjetilvalg.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Læg på" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Afbrud" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Afslut" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Ugyldig instruktion" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Spore fælde" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Afbryd" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT-fejl" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Flydende tals-undtagelse" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Afslut" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Bus-fejl" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmentovertrædelse" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Ugyldig argument til systemkald" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Brudt datakanal" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarmklokke" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Terminering" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Vigtig tilstand på sokkel" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Stop" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Tastaturstop" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Fortsæt" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Barnets status er ændret" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Læsing fra tty i baggrunden" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Skriving til tty i baggrunden" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O nu muligt" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Processor-grænse overskredet" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Grænse for filstørrelse overskredet" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtuel alarmklokke" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profilerer alarmklokken" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Ændring i vinduesstørrelse" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Informationsforespørsel" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Brugerdefineret signal 2" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Brugerdefineret signal 2" + +#~ msgid "DEBUG" +#~ msgstr "FEJLFINDING" + +#~ msgid "VERBOSE" +#~ msgstr "MEDDELSOM" + +#~ msgid "NO-DAEMON" +#~ msgstr "INGEN-SERVER" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/de.gmo b/po/de.gmo new file mode 100644 index 0000000..f80499e Binary files /dev/null and b/po/de.gmo differ diff --git a/po/de.po b/po/de.po new file mode 100644 index 0000000..103a80d --- /dev/null +++ b/po/de.po @@ -0,0 +1,197 @@ +# German libgtop translation. +# Martin Baulig , 1998-2000. +# Christian Meyer , 2000, 2001. +# Christian Neumair , 2002-2004. +# Hendrik Richter , 2004, 2005, 2007. +# Mario Blättermann , 2017. +# +# hmm... ein paar englische Strings sollte man lieber in Ruhe lassen...! -cm- +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop master\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-05-12 17:16+0200\n" +"Last-Translator: Mario Blättermann \n" +"Language-Team: German \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 2.0.1\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d Byte gelesen" +msgstr[1] "%d Bytes gelesen" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "Datenmenge lesen" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu Byte der Daten gelesen" +msgstr[1] "%lu Bytes der Daten gelesen" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d Byte geschrieben" +msgstr[1] "%d Bytes geschrieben" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Fehlerdiagnose einschalten" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Redselige Ausgabe einschalten" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Nicht in den Hintergrund abspalten" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Durch inetd aufgerufen" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "" +"Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Führen Sie »%s --help« aus, um eine vollständige Liste der verfügbaren " +"Optionen zu sehen.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Auflegen" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Unterbrechung" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Verlassen" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Unzulässige Anweisung" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Trace-Trap" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Abbrechen" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT-Fehler" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Gleitkomma-Ausnahme" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Töten" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Busfehler" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmentschutzverletzung" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Ungültiges Argument für Systemaufruf" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Gebrochene Pipe" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Wecker" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Beenden" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Dringender Socketzustand" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Stopp" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Tastatur-Stopp" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Fortfahren" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Kind-Status hat sich geändert" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Hintergrundlesen von tty" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Hintergrundschreiben auf tty" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "E/A nun möglich" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU-Limit überschritten" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Limit der Dateigröße überschritten" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtueller Wecker" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Genauer Wecker" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Veränderung der Fenstergröße" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Informationsanforderung" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Benutzerdefiniertes Signal 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Benutzerdefiniertes Signal 2" diff --git a/po/dz.gmo b/po/dz.gmo new file mode 100644 index 0000000..40105b6 Binary files /dev/null and b/po/dz.gmo differ diff --git a/po/dz.po b/po/dz.po new file mode 100644 index 0000000..9f575f7 --- /dev/null +++ b/po/dz.po @@ -0,0 +1,205 @@ +# translation of libgtop.HEAD.po to +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER, 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop.HEAD\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-05-14 03:41+0100\n" +"PO-Revision-Date: 2006-03-28 11:12-0500\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: dz\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" +"X-Poedit-Language: Dzongkha\n" +"X-Poedit-Country: BHUTAN\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Generator: KBabel 1.10.2\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "བའིཊི་ %d ལྷག" +msgstr[1] "བའིཊི་ %d ལྷག" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "གནད་སྡུད་ཀྱི་ཚད་ལྷག" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "གནས་སྡུད་ བའིཊི་ %lu ལྷག" +msgstr[1] "གནས་སྡུད་ བའིཊི་ %lu ལྷག" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "བའིཊི་ %d བྲིས་ཡི། " +msgstr[1] "བའིཊི་ %d བྲིས་ཡི།" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "རྐྱེན་སེལ་འབད་ནི་ ལྕོགས་ཅན་བཟོ།" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "ཚིག་མང་ཨའུཊི་པུཊི་ ལྕོགས་ཅན་བཟོ།" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "རྒྱབ་གཞིའི་ནང་ ཁ་མ་སྤེལ།" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "ཨའི་ཨེན་ཨི་ཊི་ཌི་ནང་ལས་ ལས་བཀོལ་འབད།" + +#: ../src/daemon/gnuserv.c:498 +#, fuzzy, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"གདམ་ཁ་%s: %sལུ་འཛོལ་བ། \n" +"འཐོབ་ཚུགས་པའི་ བརྡ་ལམ་གདམ་ཁའི་ ཐོ་ཡིག་ཧྲིལ་བུ་ཅིག་ལུ་ བལྟ་ནིའི་དོན་ལས་ '%s --help' གཡོག་བཀོལ།\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "ཐོགས་རྐྱེན།" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "བར་ཆད།" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "སྤངས།" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "ཁྲིམས་འགལ་བཀོད་རྒྱ།" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "ཧིང་ རྗེས་འཚོལ་འབད།" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "བར་བཤོལ་འབད།" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "ཨི་ཨེམ་ཊི་འཛོལ་བ།" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "ལྡིང་ཚད་དམིགས་བསལ།" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "གསད།" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "བརྡ་རྟགས་འགྲུལ་ལམ་གྱི་འཛོལ་བ།" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "ཆ་བགོ་བའི་འགལ་བ།" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "རིམ་ལུགས་བོད་བརྡ་ལུ་ སྒྲུབ་རྟགས་བྱང་ཉེས།" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "རྒྱུད་དུང་ཆད་པ།" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "འཇིགས་བརྡ་ཆེ་འཁོར།" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "རྩ་གྲོལ།" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "སོཀ་ཀེཊི་ལུ་ འཕྲལ་མཁོའི་གནས་སྟངས།" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "བཀག" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "ལྡེ་སྒྲོམ་བཀག" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "འཕྲོ་མཐུད།" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "རྩ་ལག་གི་གནས་ཚད་ བསྒྱུར་བཅོས་ཡར་སོ་ནུག" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "ཊི་ཊི་ཝའི་ནང་ལས་ རྒྱབ་གཞི་ལྷག་ཡོད།" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "ཊི་ཊི་ཝའི་ལུ་ རྒྱབ་གཞི་བྲིས།" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "ཨའི་/ཨོ་ ད་ལྟོ་ཚུགས་པས།" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "ལས་སྦྱོར་ལྟེ་བའི་ཚད་ལས་ ལྷག་སོ་ནུག" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "ཡིག་སྣོད་ཀྱི་ཚད་ལས་ ལྷག་སོ་ནུག" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "བར་ཅུ་ཡེལ་ འཇིགས་བརྡའི་ཆེ་འཁོར།" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "གསལ་སྡུད་འཇིགས་བརྡའི་ཆེ་འཁོར།" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "སྒོ་སྒྲིག་ཚད་ཀྱི་བསྒྱུར་བཅོས།" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "བརྡ་དོན་གྱི་ཞུ་བ།" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "ལག་ལེན་པའི་ ངེས་འཛིན་བརྡ་རྟགས་ ༡པ།" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "ལག་ལེན་པའི་ངེས་འཛིན་བརྡ་རྟགས་ ༢པ།" + +#~ msgid "DEBUG" +#~ msgstr "རྐྱེན་སེལ།" + +#~ msgid "VERBOSE" +#~ msgstr "ཚིག་མང་།" + +#~ msgid "NO-DAEMON" +#~ msgstr "ཌེ་མཱོན་མིན་འདུག" + +#~ msgid "INETD" +#~ msgstr "ཨའི་ཨེན་ཨི་ཊི་ཌི།" diff --git a/po/el.gmo b/po/el.gmo new file mode 100644 index 0000000..87ca72d Binary files /dev/null and b/po/el.gmo differ diff --git a/po/el.po b/po/el.po new file mode 100644 index 0000000..b2dc8a5 --- /dev/null +++ b/po/el.po @@ -0,0 +1,218 @@ +# translation of el.po to +# translation of el.po to Greek +# libgtop greek .po file +# Copyright (C) 2000-2001,2003, 2004, 2005 Free Software Foundation, Inc. +# +# sarantis: ~134 messages, (unknown), initial translation. +# simos: 240 messages, 19Feb2001, added more messages, still 65 left. +# simos: 308 messages, 25Feb2001, completed. +# simos: 310 messages, 07Nov2002, completed. +# kostas: 322 messages,30Oct2003, update for Gnome 2.6 +# Nikos: add plurals, minor fixes, 21Feb2004. +# Nikos: small update, 30Aug2004. +# Sarantis Paskalis , 2000. +# Simos Xenitellis , 2001. +# Kostas Papadimas , 2003, 2004, 2005. +# Nikos Charonitakis , 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: el\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2013-12-19 14:39+0000\n" +"PO-Revision-Date: 2014-07-09 13:59+0200\n" +"Last-Translator: Tom Tryfonidis \n" +"Language-Team: Greek \n" +"Language: el\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.6.5\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "ανάγνωση %d byte" +msgstr[1] "ανάγνωση %d bytes" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "ανάγνωση μεγέθους δεδομένων" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "ανάγνωση %lu byte δεδομένων" +msgstr[1] "ανάγνωση %lu bytes δεδομένων" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "εγγραφή %d byte" +msgstr[1] "εγγραφή %d bytes" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "Ενεργοποίηση αποσφαλμάτωσης" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "Ενεργοποίηση αναλυτικής εξόδου" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "Να μη γίνει διακλάδωση στο παρασκήνιο" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "Εκτελεσμένο από το inetd" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Εκτελέστε '%s --help' για να δείτε μια πλήρη λίστα των διαθέσιμων επιλογών " +"της γραμμής εντολών.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Κλείσιμο" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Διακοπή" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Έξοδος" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Μη επιτρεπτή εντολή" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Παγίδευση παρακολούθησης" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Εγκατάλειψη" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Σφάλμα EMT" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Εξαίρεση κινητής υποδιαστολής" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Βίαιος τερματισμός" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Σφάλμα διαύλου" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Παραβίαση κατάτμησης" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Ακατάλληλο όρισμα σε κλήση συστήματος" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Κατεστραμμένη διοχέτευση" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Ξυπνητήρι" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Τερματισμός" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Επείγουσα συνθήκη σε υποδοχέα" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Διακοπή" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Διακοπή πληκτρολογίου" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Συνέχεια" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Έχει αλλάξει η κατάσταση της θυγατρικής διεργασίας" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Ανάγνωση παρασκηνίου από tty" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Εγγραφή παρασκηνίου σε tty" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "Η I/O είναι τώρα δυνατή" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Έχει ξεπεραστεί το όριο της CPU" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Έχει ξεπεραστεί το όριο μεγέθους αρχείου" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Εικονικό ξυπνητήρι" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Έλεγχος απόδοσης ξυπνητηριού" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Αλλαγή μεγέθους παραθύρου" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Αίτηση πληροφορίας" + +# sysdeps/names/procsignal.c:49 +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Σήμα 1 οριζόμενο από το χρήστη" + +# sysdeps/names/procsignal.c:49 +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Σήμα 2 οριζόμενο από το χρήστη" + +#~ msgid "DEBUG" +#~ msgstr "ΕΚΣΦΑΛΜΑΤΩΣΗ" + +#~ msgid "VERBOSE" +#~ msgstr "VERBOSE" + +#~ msgid "NO-DAEMON" +#~ msgstr "ΧΩΡΊΣ-ΔΑΊΜΟΝΑ" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/en@boldquot.header b/po/en@boldquot.header new file mode 100644 index 0000000..fedb6a0 --- /dev/null +++ b/po/en@boldquot.header @@ -0,0 +1,25 @@ +# 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. +# diff --git a/po/en@quot.header b/po/en@quot.header new file mode 100644 index 0000000..a9647fc --- /dev/null +++ b/po/en@quot.header @@ -0,0 +1,22 @@ +# 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. +# diff --git a/po/en@shaw.gmo b/po/en@shaw.gmo new file mode 100644 index 0000000..54ca63e Binary files /dev/null and b/po/en@shaw.gmo differ diff --git a/po/en@shaw.po b/po/en@shaw.po new file mode 100644 index 0000000..7869312 --- /dev/null +++ b/po/en@shaw.po @@ -0,0 +1,188 @@ +# Shavian translation for libgtop. +# Copyright (C) 2010 The Gnome Foundation. +# Thomas Thurman , 2009. +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop&component=general\n" +"POT-Creation-Date: 2010-05-11 13:26+0000\n" +"PO-Revision-Date: 2010-05-12 18:37 -0400\n" +"Last-Translator: Thomas Thurman \n" +"Language-Team: Shavian \n" +"Language: en@shaw\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n!=1;\n" + +#, c-format +#: ../lib/read.c:51 +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "𐑮𐑧𐑛 %d 𐑚𐑲𐑑" +msgstr[1] "𐑮𐑧𐑛 %d 𐑚𐑲𐑑𐑕" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "𐑮𐑧𐑛 𐑛𐑱𐑑𐑩 𐑕𐑲𐑟" + +#, c-format +#: ../lib/read_data.c:70 +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "𐑮𐑧𐑛 %lu 𐑚𐑲𐑑 𐑝 𐑛𐑱𐑑𐑩" +msgstr[1] "𐑮𐑧𐑛 %lu 𐑚𐑲𐑑𐑕 𐑝 𐑛𐑱𐑑𐑩" + +#, c-format +#: ../lib/write.c:51 +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "𐑮𐑴𐑑 %d 𐑚𐑲𐑑" +msgstr[1] "𐑮𐑴𐑑 %d 𐑚𐑲𐑑𐑕" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "𐑦𐑯𐑱𐑚𐑩𐑤 𐑛𐑰𐑚𐑳𐑜𐑦𐑙" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "𐑦𐑯𐑱𐑚𐑩𐑤 𐑝𐑻𐑚𐑴𐑕 𐑬𐑑𐑐𐑫𐑑" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "𐑛𐑴𐑯𐑑 𐑓𐑹𐑒 𐑦𐑯𐑑𐑫 𐑚𐑨𐑒𐑜𐑮𐑬𐑯𐑛" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "𐑦𐑯𐑝𐑴𐑒𐑑 𐑓𐑮𐑪𐑥 inetd" + +#, c-format +#: ../src/daemon/gnuserv.c:495 +msgid "" +"Run '%s --help' to see a full list of available command line options.\n" +msgstr "𐑮𐑳𐑯 '%s --help' 𐑑 𐑕𐑰 𐑩 𐑓𐑫𐑤 𐑤𐑦𐑕𐑑 𐑝 𐑩𐑝𐑱𐑤𐑩𐑚𐑩𐑤 𐑒𐑩𐑥𐑭𐑯𐑛 𐑤𐑲𐑯 𐑪𐑐𐑖𐑩𐑯𐑟.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "𐑣𐑨𐑙𐑜𐑩𐑐" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "𐑦𐑯𐑑𐑻𐑳𐑐𐑑" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "𐑒𐑢𐑦𐑑" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "𐑦𐑤𐑰𐑜𐑩𐑤 𐑦𐑯𐑕𐑑𐑮𐑳𐑒𐑖𐑩𐑯" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "𐑑𐑮𐑱𐑕 𐑑𐑮𐑨𐑐" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "𐑩𐑚𐑹𐑑" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT 𐑻𐑼" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "𐑓𐑤𐑴𐑑𐑦𐑙-𐑐𐑶𐑯𐑑 𐑦𐑒𐑕𐑧𐑐𐑖𐑩𐑯" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "𐑒𐑦𐑤" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "𐑚𐑳𐑕 𐑻𐑼" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "𐑕𐑧𐑜𐑥𐑩𐑯𐑑𐑱𐑖𐑩𐑯 𐑝𐑲𐑩𐑤𐑱𐑖𐑩𐑯" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "𐑚𐑨𐑛 𐑸𐑜𐑿𐑥𐑩𐑯𐑑 𐑑 𐑕𐑦𐑕𐑑𐑩𐑥 𐑒𐑷𐑤" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "𐑚𐑮𐑴𐑒𐑩𐑯 𐑐𐑲𐑐" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "𐑩𐑤𐑸𐑥 𐑒𐑤𐑪𐑒" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "𐑑𐑻𐑥𐑩𐑯𐑱𐑖𐑩𐑯" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "𐑻𐑡𐑩𐑯𐑑 𐑒𐑩𐑯𐑛𐑦𐑖𐑩𐑯 𐑪𐑯 𐑕𐑪𐑒𐑩𐑑" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "𐑕𐑑𐑪𐑐" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "𐑒𐑰𐑚𐑪𐑮𐑛 𐑕𐑑𐑪𐑐" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "𐑒𐑩𐑯𐑑𐑦𐑯𐑿" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "𐑗𐑲𐑤𐑛 𐑕𐑑𐑱𐑑𐑫𐑕 𐑣𐑨𐑟 𐑗𐑱𐑯𐑡𐑛" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "𐑚𐑨𐑒𐑜𐑮𐑬𐑯𐑛 𐑮𐑧𐑛 𐑓𐑮𐑪𐑥 tty" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "𐑚𐑨𐑒𐑜𐑮𐑬𐑯𐑛 𐑮𐑲𐑑 𐑑 tty" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O 𐑯𐑬 𐑐𐑪𐑕𐑩𐑚𐑩𐑤" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU 𐑤𐑦𐑥𐑦𐑑 𐑩𐑒𐑕𐑰𐑛𐑩𐑛" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "𐑓𐑲𐑤 𐑕𐑲𐑟 𐑤𐑦𐑥𐑦𐑑 𐑩𐑒𐑕𐑰𐑛𐑩𐑛" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "𐑝𐑻𐑗𐑫𐑩𐑤 𐑩𐑤𐑸𐑥 𐑒𐑤𐑪𐑒" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "𐑐𐑮𐑴𐑓𐑲𐑤𐑦𐑙 𐑩𐑤𐑸𐑥 𐑒𐑤𐑪𐑒" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "𐑢𐑦𐑯𐑛𐑴 𐑕𐑲𐑟 𐑗𐑱𐑯𐑡" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "𐑦𐑯𐑓𐑼𐑥𐑱𐑖𐑩𐑯 𐑮𐑦𐑒𐑢𐑧𐑕𐑑" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "𐑿𐑟𐑼 𐑛𐑦𐑓𐑲𐑯𐑛 𐑕𐑦𐑜𐑯𐑩𐑤 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "𐑿𐑟𐑼 𐑛𐑦𐑓𐑲𐑯𐑛 𐑕𐑦𐑜𐑯𐑩𐑤 2" + diff --git a/po/en_CA.gmo b/po/en_CA.gmo new file mode 100644 index 0000000..d1e7a4b Binary files /dev/null and b/po/en_CA.gmo differ diff --git a/po/en_CA.po b/po/en_CA.po new file mode 100644 index 0000000..e3ce1c1 --- /dev/null +++ b/po/en_CA.po @@ -0,0 +1,209 @@ +# English/Canada translation of libgtop. +# Copyright (C) 2004 Adam Weinberger and the GNOME Foundation +# This file is distributed under the same license as the libgtop package. +# Adam Weinberger , 2004. +# +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-09-25 18:15+0200\n" +"PO-Revision-Date: 2004-12-29 15:51-0400\n" +"Last-Translator: Adam Weinberger \n" +"Language-Team: Canadian English \n" +"Language: en_CA\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: lib/read.c:65 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "read %d byte" +msgstr[1] "read %d bytes" + +#: lib/read_data.c:53 +msgid "read data size" +msgstr "read data size" + +#: lib/read_data.c:72 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "read %lu byte of data" +msgstr[1] "read %lu bytes of data" + +#: lib/write.c:52 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "wrote %d byte" +msgstr[1] "wrote %d bytes" + +#: src/daemon/gnuserv.c:460 +msgid "Enable debugging" +msgstr "Enable debugging" + +#: src/daemon/gnuserv.c:460 +msgid "DEBUG" +msgstr "DEBUG" + +#: src/daemon/gnuserv.c:462 +msgid "Enable verbose output" +msgstr "Enable verbose output" + +#: src/daemon/gnuserv.c:462 +msgid "VERBOSE" +msgstr "VERBOSE" + +#: src/daemon/gnuserv.c:464 +msgid "Don't fork into background" +msgstr "Don't fork into background" + +#: src/daemon/gnuserv.c:464 +msgid "NO-DAEMON" +msgstr "NO-DAEMON" + +#: src/daemon/gnuserv.c:466 +msgid "Invoked from inetd" +msgstr "Invoked from inetd" + +#: src/daemon/gnuserv.c:466 +msgid "INETD" +msgstr "INETD" + +#: src/daemon/gnuserv.c:500 +#, c-format +msgid "" +"Error on option %s: %s.\n" +"Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Error on option %s: %s.\n" +"Run '%s --help' to see a full list of available command line options.\n" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Hangup" +msgstr "Hangup" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Interrupt" +msgstr "Interrupt" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Quit" +msgstr "Quit" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Illegal instruction" +msgstr "Illegal instruction" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Trace trap" +msgstr "Trace trap" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "Abort" +msgstr "Abort" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "EMT error" +msgstr "EMT error" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Floating-point exception" +msgstr "Floating-point exception" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Kill" +msgstr "Kill" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Bus error" +msgstr "Bus error" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Segmentation violation" +msgstr "Segmentation violation" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Bad argument to system call" +msgstr "Bad argument to system call" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Broken pipe" +msgstr "Broken pipe" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Alarm clock" +msgstr "Alarm clock" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Termination" +msgstr "Termination" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Urgent condition on socket" +msgstr "Urgent condition on socket" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Stop" +msgstr "Stop" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Keyboard stop" +msgstr "Keyboard stop" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Continue" +msgstr "Continue" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Child status has changed" +msgstr "Child status has changed" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background read from tty" +msgstr "Background read from TTY" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "Background write to tty" +msgstr "Background write to TTY" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "I/O now possible" +msgstr "I/O now possible" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "CPU limit exceeded" +msgstr "CPU limit exceeded" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "File size limit exceeded" +msgstr "File size limit exceeded" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Virtual alarm clock" +msgstr "Virtual alarm clock" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Profiling alarm clock" +msgstr "Profiling alarm clock" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Window size change" +msgstr "Window size change" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "Information request" +msgstr "Information request" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 1" +msgstr "User defined signal 1" + +#: sysdeps/osf1/siglist.c:58 sysdeps/sun4/siglist.c:58 +msgid "User defined signal 2" +msgstr "User defined signal 2" diff --git a/po/en_GB.gmo b/po/en_GB.gmo new file mode 100644 index 0000000..df666c4 Binary files /dev/null and b/po/en_GB.gmo differ diff --git a/po/en_GB.po b/po/en_GB.po new file mode 100644 index 0000000..1d0f73a --- /dev/null +++ b/po/en_GB.po @@ -0,0 +1,231 @@ +# English (British) translation. +# Copyright (C) 2004 The GNOME Foundation +# This file is distributed under the same license as the libgtop package. +# Gareth Owen , David Lodge , 2004. +# Gareth Owen , 2004. +# +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-05-15 22:52+0100\n" +"PO-Revision-Date: 2007-05-15 22:52-0000\n" +"Last-Translator: David Lodge \n" +"Language-Team: English/GB \n" +"Language: en_GB\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "read %d byte" +msgstr[1] "read %d bytes" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "read data size" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "read %lu byte of data" +msgstr[1] "read %lu bytes of data" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "wrote %d byte" +msgstr[1] "wrote %d bytes" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "Enable debugging" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "Enable verbose output" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "Don't fork into background" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "Invoked from inetd" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "Run '%s --help' to see a full list of available command line options.\n" + +#: ../sysdeps/osf1/siglist.c:27 +#: ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Hangup" + +#: ../sysdeps/osf1/siglist.c:28 +#: ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interrupt" + +#: ../sysdeps/osf1/siglist.c:29 +#: ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Quit" + +#: ../sysdeps/osf1/siglist.c:30 +#: ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Illegal instruction" + +#: ../sysdeps/osf1/siglist.c:31 +#: ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Trace trap" + +#: ../sysdeps/osf1/siglist.c:32 +#: ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Abort" + +#: ../sysdeps/osf1/siglist.c:33 +#: ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT error" + +#: ../sysdeps/osf1/siglist.c:34 +#: ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Floating-point exception" + +#: ../sysdeps/osf1/siglist.c:35 +#: ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Kill" + +#: ../sysdeps/osf1/siglist.c:36 +#: ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Bus error" + +#: ../sysdeps/osf1/siglist.c:37 +#: ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmentation violation" + +#: ../sysdeps/osf1/siglist.c:38 +#: ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Bad argument to system call" + +#: ../sysdeps/osf1/siglist.c:39 +#: ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Broken pipe" + +#: ../sysdeps/osf1/siglist.c:40 +#: ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarm clock" + +#: ../sysdeps/osf1/siglist.c:41 +#: ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Termination" + +#: ../sysdeps/osf1/siglist.c:42 +#: ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Urgent condition on socket" + +#: ../sysdeps/osf1/siglist.c:43 +#: ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Stop" + +#: ../sysdeps/osf1/siglist.c:44 +#: ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Keyboard stop" + +#: ../sysdeps/osf1/siglist.c:45 +#: ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Continue" + +#: ../sysdeps/osf1/siglist.c:46 +#: ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Child status has changed" + +#: ../sysdeps/osf1/siglist.c:47 +#: ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Background read from tty" + +#: ../sysdeps/osf1/siglist.c:48 +#: ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Background write to tty" + +#: ../sysdeps/osf1/siglist.c:49 +#: ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O now possible" + +#: ../sysdeps/osf1/siglist.c:50 +#: ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU limit exceeded" + +#: ../sysdeps/osf1/siglist.c:51 +#: ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "File size limit exceeded" + +#: ../sysdeps/osf1/siglist.c:52 +#: ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtual alarm clock" + +#: ../sysdeps/osf1/siglist.c:53 +#: ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profiling alarm clock" + +#: ../sysdeps/osf1/siglist.c:54 +#: ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Window size change" + +#: ../sysdeps/osf1/siglist.c:55 +#: ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Information request" + +#: ../sysdeps/osf1/siglist.c:56 +#: ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "User defined signal 1" + +#: ../sysdeps/osf1/siglist.c:57 +#: ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "User defined signal 2" + +#~ msgid "DEBUG" +#~ msgstr "DEBUG" +#~ msgid "VERBOSE" +#~ msgstr "VERBOSE" +#~ msgid "NO-DAEMON" +#~ msgstr "NO-DAEMON" +#~ msgid "INETD" +#~ msgstr "INETD" + diff --git a/po/eo.gmo b/po/eo.gmo new file mode 100644 index 0000000..b310ffd Binary files /dev/null and b/po/eo.gmo differ diff --git a/po/eo.po b/po/eo.po new file mode 100644 index 0000000..2ccd808 --- /dev/null +++ b/po/eo.po @@ -0,0 +1,194 @@ +# Esperanto translation for libgtop. +# Copyright (C) 2006-2011 Free Software Foundation, Inc. +# This file is distributed under the same license as the libgtop package. +# Dominique PELLE , 2006. +# Kristjan SCHMIDT , 2010, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&component=general\n" +"POT-Creation-Date: 2011-03-31 17:35+0000\n" +"PO-Revision-Date: 2011-06-08 11:49+0200\n" +"Last-Translator: Kristjan SCHMIDT \n" +"Language-Team: Esperanto \n" +"Language: eo\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"X-Launchpad-Export-Date: 2011-06-08 09:44+0000\n" +"X-Generator: Launchpad (build 13144)\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "legis %d bajton" +msgstr[1] "legis %d bajtojn" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "grando de legita datumo" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "legis %lu bajton da datumo" +msgstr[1] "legis %lu bajtojn da datumo" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "skribis %d bajton" +msgstr[1] "skribis %d bajtojn" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "Enŝalti sencimigon" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "Enŝalti babileman eligon" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "Ne forki fonen" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "Alvokita de \"inetd\"" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Ruli '%s --help' por vidigi tutan liston de disponeblajn komandliniaj " +"opciojn.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Malkonekti" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interrompi" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Ĉesi" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Nevalida komando" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Spura escepto" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Ĉesigi" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT-eraro" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Glitpunkta escepto" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Mortigi" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Bus-eraro" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Aliro al nerezervita memoro" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Nevalida argumento al sistemvoko" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Rompita dukto" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarm-takto" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Finiĝo" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Urĝa kondiĉo ĉe kontaktoskatolo" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Haltigi" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Klavara halto" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Daŭrigi" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Stato de ido ŝanĝiĝis" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Fona lego de \"tty\"" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Fona skribo al \"tty\"" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "Eneligo nun eblas" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Limo de procesilo superitas" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Limo de dosiergrando superitas" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtuala alarm-takto" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profila alarm-takto" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Ŝanĝo de fenestrogrando" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Informpeto" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Uzant-difinita signalo 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Uzant-difinita signalo 2" diff --git a/po/es.gmo b/po/es.gmo new file mode 100644 index 0000000..d1022b6 Binary files /dev/null and b/po/es.gmo differ diff --git a/po/es.po b/po/es.po new file mode 100644 index 0000000..b13e54f --- /dev/null +++ b/po/es.po @@ -0,0 +1,200 @@ +# translation of libgtop.libgtop-GNOME-2-0-port.po to Spanish +# +# Pablo Saratxaga , 1998-2000. +# Germán Poo Caamaño , 2002. +# Pablo Saratxaga , 2002. +# Juan Manuel García Molina , 2002. +# Francisco Javier F. Serrador , 2003, 2004. +# Jorge González , 2007. +# Daniel Mustieles , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop.HEAD.es\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-06-05 16:18+0200\n" +"Last-Translator: Daniel Mustieles \n" +"Language-Team: es \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Gtranslator 2.91.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "leído %d byte" +msgstr[1] "leídos %d bytes" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "leído tamaño de datos" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "leído %lu byte de datos" +msgstr[1] "leídos %lu bytes de datos" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "escrito %d byte" +msgstr[1] "escritos %d bytes" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Activar depuración" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Activa salida detallada" + +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" +msgstr "No se pudo abrir un proceso en segundo plano" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Invocado desde inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Ejecute '%s --help' para ver una lista completa de las opciones de línea de " +"comandos disponibles.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Terminar" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interrumpir" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Salir" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Instrucción ilegal" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Atrapar traza" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Abortar" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Error EMT" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Excepción de coma flotante" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Matar" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Error de bus" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Violación de segmento" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Argumento incorrecto en llamada al sistema" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Tubería rota" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarma de reloj" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Terminación" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Condición urgente en socket" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Parada" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Parada de teclado" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Continuar" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Cambio de estado de hijo" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Lectura en segundo plano de tty" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Escritura en segundo plano a tty" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "E/S ahora posible" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Excedido límite de CPU" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Tamaño límite de archivo excedido" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Alarma de reloj virtual" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Alarma de reloj perfilada" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Cambio del tamaño de ventana" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Solicitud de información" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Señal 1 definida por el usuario" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Señal 2 definida por el usuario" diff --git a/po/et.gmo b/po/et.gmo new file mode 100644 index 0000000..d4ebbb6 Binary files /dev/null and b/po/et.gmo differ diff --git a/po/et.po b/po/et.po new file mode 100644 index 0000000..b3353b0 --- /dev/null +++ b/po/et.po @@ -0,0 +1,193 @@ +# libgtop eesti keele tõlge. +# Estonian translation of libgtop. +# +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2007 The GNOME Project. +# This file is distributed under the same license as the libgtop package. +# +# Tõivo Leedjärv , 2003. +# Ivar Smolin , 2005, 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop HEAD\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-05-14 03:41+0100\n" +"PO-Revision-Date: 2007-05-14 08:09+0300\n" +"Last-Translator: Ivar Smolin \n" +"Language-Team: Estonian \n" +"Language: et\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "loetud %d bait" +msgstr[1] "loetud %d baiti" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "loetud andmete hulk" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "loetud %lu bait andmeid" +msgstr[1] "loetud %lu baiti andmeid" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "kirjutatud %d bait" +msgstr[1] "kirjutatud %d baiti" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "Silumise lubamine" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "Teaberohke väljundi lubamine" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "Taustale siirdumine keelatud" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "Käivitatakse inetd abil" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "Kõigi käsureavõtmete nimekirja vaatamiseks käivita '%s --help'.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Toru hargilepanek" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Katkestamine" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Lõpetamine" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Lubamatu instruktsioon" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Jälitamispüünis" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Katkestamine" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT viga" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Ujukomaviga" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Kõrvaldamine" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Siini viga" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmenteerimisviga" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Vigane süsteemikutsungi argument" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Katkine toru" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarmkell" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Lõpetamine" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Sokli edasilükkamatu seisund" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Seiskamine" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Seiskamine klaviatuurilt" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Jätkamine" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Lapsprotsessi olek muudetud" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Taustalugemine tty'lt" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Taustakirjutamine tty'le" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "S/V on nüüd võimalik" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Protsessoriaja piirang ületatud" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Failisuuruse piirang ületatud" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtuaalne alarmkell" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Alarmkella profileerimine" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Akna suuruse muutmine" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Teabepäring" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Kasutaja kirjeldatud signaal 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Kasutaja kirjeldatud signaal 2" diff --git a/po/eu.gmo b/po/eu.gmo new file mode 100644 index 0000000..f2083fd Binary files /dev/null and b/po/eu.gmo differ diff --git a/po/eu.po b/po/eu.po new file mode 100644 index 0000000..25cba70 --- /dev/null +++ b/po/eu.po @@ -0,0 +1,198 @@ +# translation of libgtop.HEAD.po to Basque +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# +# Hizkuntza Politikarako Sailburuordetza , 2004. +# Iñaki Larrañaga Murgoitio , 2004, 2005, 2008. +# Iñaki Larrañaga Murgoitio , 2007, 2017. +msgid "" +msgstr "" +"Project-Id-Version: libgtop.HEAD\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-08-27 16:26+0200\n" +"Last-Translator: Iñaki Larrañaga Murgoitio \n" +"Language-Team: Basque \n" +"Language: eu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 1.5\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "byte %d irakurrita" +msgstr[1] "%d byte irakurrita" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "irakurri datuen tamaina" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "datuen byte %lu irakurrita" +msgstr[1] "datuen %lu byte irakurrita" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "byte %d idatzita" +msgstr[1] "%d byte idatzita" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Gaitu arazketa" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Gaitu irteera xehatua" + +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" +msgstr "Ez sardetu atzeko planoan" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "inetd-etik deitua" + +#: src/daemon/gnuserv.c:498 +#, c-format +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Exekutatu “%s --help“ komando-lerroko aukera erabilgarrien zerrenda " +"ikusteko.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Eseki" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Eten" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Irten" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Argibide ilegala" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Gelditze-puntuaren segimendua" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Abortatu" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT errorea" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Koma mugikorraren salbuespena" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Hil" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Bus errorea" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmentu-bortxaketa" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Argumentu okerra sistemaren deian" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Kanalizazio hautsia" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Iratzargailua" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Amaiera" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Presazko baldintza socket-ean" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Gelditu" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Teklatua gelditzea" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Jarraitu" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Umearen egoera aldatu egin da" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Irakurri tty atzeko planoan" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Idatzi tty-en atzeko planoan" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "S/I posible da orain" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "PUZaren muga gaindituta" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Fitxategi-tamainaren muga gaindituta" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Iratzargailu birtuala" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Iratzargailuaren profila" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Leihoaren tamaina aldatzea" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Informazio-eskaera" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Erabiltzaileak zehaztutako 1. seinalea" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Erabiltzaileak zehaztutako 2. seinalea" + diff --git a/po/fa.gmo b/po/fa.gmo new file mode 100644 index 0000000..d526bbc Binary files /dev/null and b/po/fa.gmo differ diff --git a/po/fa.po b/po/fa.po new file mode 100644 index 0000000..ccbb3e2 --- /dev/null +++ b/po/fa.po @@ -0,0 +1,233 @@ +# Persian translation of libgtop. +# Copyright (C) 2010, 2011 Iranian Free Software Users Group (IFSUG.org)translation team. +# Copyright (C) 2003, 2005 Sharif FarsiWeb, Inc. +# Roozbeh Pournader , 2003. +# Azin Azadi , 2005. +# Arash Mousavi , 2010, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop HEAD\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2011-04-04 20:06+0000\n" +"PO-Revision-Date: 2011-04-24 17:45+0330\n" +"Last-Translator: Arash Mousavi \n" +"Language-Team: Persian \n" +"Language: fa\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Poedit-Language: Persian\n" +"X-Poedit-Country: IRAN, ISLAMIC REPUBLIC OF\n" +"X-Poedit-SourceCharset: utf-8\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "خوانده شد %Id بایت" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "‌اندازه‌ی داده‌های خوانده شده" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu بایت اطلاعات خوانده شد" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%Id بایت نوشته شد" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "به کار انداختن اشکال‌زدایی" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "به کار انداختن خروجی مفصل" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "عدم انشعاب در پس‌زمینه" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "از inetd احضار شد" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "برای نمایش تمام گزینه‌های موجود خط فرمان «%s --help» را اجرا کنید.\n" + +#: ../sysdeps/osf1/siglist.c:27 +#: ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "معوق گذاشتن" + +#: ../sysdeps/osf1/siglist.c:28 +#: ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "وقفه" + +#: ../sysdeps/osf1/siglist.c:29 +#: ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "خروج" + +#: ../sysdeps/osf1/siglist.c:30 +#: ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "دستورالعمل غیرمجاز" + +#: ../sysdeps/osf1/siglist.c:31 +#: ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "ردگیری تله" + +#: ../sysdeps/osf1/siglist.c:32 +#: ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "قطع کردن" + +#: ../sysdeps/osf1/siglist.c:33 +#: ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "خطای EMT" + +#: ../sysdeps/osf1/siglist.c:34 +#: ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "استثنای ممیز شناور" + +#: ../sysdeps/osf1/siglist.c:35 +#: ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "خاموش کردن" + +#: ../sysdeps/osf1/siglist.c:36 +#: ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "خطای گذرگاه" + +#: ../sysdeps/osf1/siglist.c:37 +#: ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "تخلف قطعه قطعه کردن" + +#: ../sysdeps/osf1/siglist.c:38 +#: ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "آرگومان بد به فراخوانی سیستم" + +#: ../sysdeps/osf1/siglist.c:39 +#: ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "لوله‌ی شکسته" + +#: ../sysdeps/osf1/siglist.c:40 +#: ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "ساعت زنگی" + +#: ../sysdeps/osf1/siglist.c:41 +#: ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "پایان دادن" + +#: ../sysdeps/osf1/siglist.c:42 +#: ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "وضعیت اورژانس برای سوکت" + +#: ../sysdeps/osf1/siglist.c:43 +#: ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "توقف" + +#: ../sysdeps/osf1/siglist.c:44 +#: ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "توقف صفحه‌کلید" + +#: ../sysdeps/osf1/siglist.c:45 +#: ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "ادامه" + +#: ../sysdeps/osf1/siglist.c:46 +#: ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "وضعیت بچه عوض شد" + +#: ../sysdeps/osf1/siglist.c:47 +#: ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "خواندن پس‌زمینه از tty" + +#: ../sysdeps/osf1/siglist.c:48 +#: ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "نوشتن پس‌زمینه در tty" + +#: ../sysdeps/osf1/siglist.c:49 +#: ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "ورودی/خروجی اکنون امکان دارد" + +#: ../sysdeps/osf1/siglist.c:50 +#: ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "بیشتر از محدودیت واحد پردازش مرکزی شد" + +#: ../sysdeps/osf1/siglist.c:51 +#: ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "بیشتر از محدودیت اندازه‌ی پرونده شد" + +#: ../sysdeps/osf1/siglist.c:52 +#: ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "ساعت هشدار مجازی" + +#: ../sysdeps/osf1/siglist.c:53 +#: ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "درحال تنظیم زنگ هشدار" + +#: ../sysdeps/osf1/siglist.c:54 +#: ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "تغییر اندازه‌ی پنجره" + +#: ../sysdeps/osf1/siglist.c:55 +#: ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "درخواست اطلاعات" + +#: ../sysdeps/osf1/siglist.c:56 +#: ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "سیگنال تعریف شده توسط کاربر ۱" + +#: ../sysdeps/osf1/siglist.c:57 +#: ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "سیگنال تعریف شده توسط کاربر ۲" + +#~ msgid "DEBUG" +#~ msgstr "اشکال‌زدایی" + +#~ msgid "VERBOSE" +#~ msgstr "مفصل" + +#~ msgid "NO-DAEMON" +#~ msgstr "NO-DAEMON" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/fi.gmo b/po/fi.gmo new file mode 100644 index 0000000..354d0fc Binary files /dev/null and b/po/fi.gmo differ diff --git a/po/fi.po b/po/fi.po new file mode 100644 index 0000000..65180f2 --- /dev/null +++ b/po/fi.po @@ -0,0 +1,202 @@ +# libgtop (libgtop-GNOME-2-0-port) Finnish translation. +# Suomennos: http://gnome-fi.sourceforge.net/ +# +# Copyright (C) 2002 Free Software Foundation, Inc. +# Original translator is unknown. +# Pauli Virtanen , 2000-2002. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop 1.90.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-08-06 16:33+0300\n" +"PO-Revision-Date: 2005-01-29 15:17+0200\n" +"Last-Translator: Pauli Virtanen \n" +"Language-Team: Finnish \n" +"Language: fi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d tavun luku" +msgstr[1] "%d tavun luku" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "datan koon luku" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu tavun luku" +msgstr[1] "%lu tavun luku" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d tavun kirjoitus" +msgstr[1] "%d tavun kirjoitus" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "Käytä virheenetsintää" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "Näytä lisätietoja" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "Älä käynnistä taustaprosessia" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "Käynnistetty inetd-prosssista" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "Katso kaikki valitsimet käyttäen komentoa \"%s --help\".\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Katkeaminen" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Keskeytys" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Lopetus" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Virheellinen käsky" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Jäljitys" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Peruminen" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT-virhe" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Liukulukupoikkeus" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Tappo" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Väylävirhe" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Muistinkäsittelyvirhe" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Virheellinen järjestelmäkutsun parametri" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Rikkinäinen putki" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Ajastin" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Sulkeutuminen" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Kiireellinen tilanne pistokkeessa" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Pysäytys" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Näppäimistöpysäytys" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Jatkaminen" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Lapsen tila muuttunut" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Tty:n taustaluku" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Tty:n taustakirjoitus" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O nyt mahdollista" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU-raja ylittyi" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Tiedoston kokoraja ylittyi" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Valeajastin" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profilointiajastin" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Ikkunan koon muutos" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Tietojen pyyntö" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Käyttäjän määrittelemä signaali 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Käyttäjän määrittelemä signaali 2" + +#~ msgid "DEBUG" +#~ msgstr "VIRHEENETSINTÄ" + +#~ msgid "VERBOSE" +#~ msgstr "LISÄTIEDOT" + +#~ msgid "NO-DAEMON" +#~ msgstr "EI-DEMONIA" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/fr.gmo b/po/fr.gmo new file mode 100644 index 0000000..540ed17 Binary files /dev/null and b/po/fr.gmo differ diff --git a/po/fr.po b/po/fr.po new file mode 100644 index 0000000..237be17 --- /dev/null +++ b/po/fr.po @@ -0,0 +1,196 @@ +# French translation of libgtop. +# Copyright (C) 1998-2004 Free Software Foundation, Inc. +# This file is distributed under the GNU General Public License Version 2. +# +# Vincent Renardias , 1998-1999. +# Fabrice Bellet , 1999. +# Christophe Merlet , 2000-2004. +# Benoit Dejean , 2004. +# Stéphane Raimbault , 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop 2.9.91\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-08-15 09:18+0200\n" +"Last-Translator: Stéphane Raimbault \n" +"Language-Team: GNOME French Team \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n>1;\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d octet lu" +msgstr[1] "%d octets lus" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "taille des données lues" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "lecture de %lu octet de données" +msgstr[1] "lecture de %lu octets de données" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "écriture de %d octet" +msgstr[1] "écriture de %d octets" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Active le débogage" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Active la sortie bavarde" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Ne pas lancer en tâche de fond" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Invoqué à partir de inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Lancer « %s --help » pour afficher la liste des options de la ligne de " +"commande.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Hangup" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interruption" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Quitter" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Instruction illégale" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Point d'arrêt rencontré" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Annulation" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Erreur EMT" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Exception virgule flottante" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Tuer" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Erreur bus" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Violation de segmentation" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Mauvais argument d'appel système" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Tube cassé" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarme d'horloge" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Signal de fin" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Condition urgente sur socket" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Arrêt" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Arrêt depuis le clavier" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Continuer" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "L'état du fils a changé" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Lecture sur tty en arrière-plan" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Écriture sur tty en arrière-plan" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "E/S maintenant possible" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Limite de temps CPU dépassée" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Taille de fichier excessive" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Alarme virtuelle" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profile de l'alarme" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Redimensionnement de la fenêtre" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Demande d'information" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Signal utilisateur 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Signal utilisateur 2" diff --git a/po/fur.gmo b/po/fur.gmo new file mode 100644 index 0000000..b2a1d80 Binary files /dev/null and b/po/fur.gmo differ diff --git a/po/fur.po b/po/fur.po new file mode 100644 index 0000000..baa6d14 --- /dev/null +++ b/po/fur.po @@ -0,0 +1,193 @@ +# Friulian translation for libgtop. +# Copyright (C) 2012 libgtop's COPYRIGHT HOLDER +# This file is distributed under the same license as the libgtop package. +# TmTFx , 2012. +# Fabio Tomat , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop master\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-05-01 04:58+0000\n" +"PO-Revision-Date: 2017-05-03 07:37+0200\n" +"Last-Translator: Fabio Tomat \n" +"Language-Team: Friulian \n" +"Language: fur\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "let %d byte" +msgstr[1] "lets %d bytes" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "Dimension dai dâts lets" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "let %lu byte di dâts" +msgstr[1] "lets %lu bytes di dâts" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "scrit %d byte" +msgstr[1] "scrits %d bytes" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Abilite debug" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Abilite jessude verbôs" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "No sta fâ fork in background" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Clamât di inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Eseguìs “%s --help” par viodi une liste di dutis lis opzions disponibilis te " +"rie di comant.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Hangup" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interrupt" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Quit" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Istruzion no legâl" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Trace trap" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Abort" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT error" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Floating-point exception" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Kill" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Bus error" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmentation violation" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Bad argument to system call" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Broken pipe" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarm clock" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Termination" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Urgent condition on socket" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Stop" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Keyboard stop" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Continue" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Il stât dal fî al è cambiât" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Leture in background di tty" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Scriture in background su tty" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O cumò pussibil" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Limit CPU superât" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Limit di dimension di file superât" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtual alarm clock" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profiling alarm clock" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Window size change" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Information request" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Segnâl definît da l'utent 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Segnâl definît da l'utent 2" diff --git a/po/ga.gmo b/po/ga.gmo new file mode 100644 index 0000000..a82a0c8 Binary files /dev/null and b/po/ga.gmo differ diff --git a/po/ga.po b/po/ga.po new file mode 100644 index 0000000..e51d5e6 --- /dev/null +++ b/po/ga.po @@ -0,0 +1,202 @@ +# Irish translations for libgtop package. +# Copyright (C) 1998-2009 Free Software Foundation, Inc. +# This file is distributed under the same license as the libgtop package. +# Alastair McKinstry , 1998. +# Paul Duffy , 2003. +# Seán de Búrca , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop.master\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-08-20 09:28-0600\n" +"PO-Revision-Date: 2009-08-20 09:47-0600\n" +"Last-Translator: Seán de Búrca \n" +"Language-Team: Irish \n" +"Language: ga\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=5; plural=n==1 ? 0 : (n%10==1 || n%10==2) ? 1 : (n%" +"10>=3 && n%10<= 6) ? 2 : ((n%10>=7 && n%10<=9) || n==10) ? 3 : 4;\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "léigh %d bheart" +msgstr[1] "léigh %d bheart" +msgstr[2] "léigh %d bheart" +msgstr[3] "léigh %d mbeart" +msgstr[4] "léigh %d beart" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "léigh méid sonraí" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "léigh %lu bheart sonraí" +msgstr[1] "léigh %lu bheart sonraí" +msgstr[2] "léigh %lu bheart sonraí" +msgstr[3] "léigh %lu mbeart sonraí" +msgstr[4] "léigh %lu beart sonraí" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "scríobh %d bheart" +msgstr[1] "scríobh %d bheart" +msgstr[2] "scríobh %d bheart" +msgstr[3] "scríobh %d mbeart" +msgstr[4] "scríobh %d beart" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "Cumasaigh dífhabhtú" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "Cumasaigh aschur foclach" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "Ná forc isteach sa chúlra" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "Glaodh ó inetd" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Rith '%s --help' chun liosta iomlán roghanna líne na n-orduithe le fáil a " +"fheiceáil.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Croch" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Idirbhriseadh" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Scor" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Treoir neamhcheadaithe" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Gaiste loirg" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Tobscor" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Earráid EMT" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Eisceacht snámhphointe" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Marú" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Earráid bhus" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Sárú deighilte" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Drochargóint go glao córais" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Píopa briste" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Clog aláraim" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Críoch" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Staid práinneach ar shoicéad" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Stad" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Stad méarchláir" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Leanúint ar aghaidh" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Athraíodh stádas mic" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Léamh cúlrach ó tty" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Scríobh cúlrach go tty" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/A indéanta anois" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Imithe thar teorainn LAP" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Imithe thar teorainn mhéid chomhaid" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Clog aláraim fíorúil" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Clog aláraim próifílithe" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Athrú mhéid fhuinneoige" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Iarratas eolais" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Comhartha sainmhínithe ag an úsáideoir 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Comhartha sainmhínithe ag an úsáideoir 2" diff --git a/po/gl.gmo b/po/gl.gmo new file mode 100644 index 0000000..ff35915 Binary files /dev/null and b/po/gl.gmo differ diff --git a/po/gl.po b/po/gl.po new file mode 100644 index 0000000..ac85d91 --- /dev/null +++ b/po/gl.po @@ -0,0 +1,205 @@ +# translation of gl.po to Galego +# Galician translation of libgtop. +# Copyright (C) 1999, 2000 Jesus Bravo Alvarez +# Se desexas colaborar connosco na traducción de programas libres ó galego, +# vai mira-la páxina do noso grupo: http://www.ctv.es/USERS/jtarrio/trans +# Conclusion Date: 1999-10-09 23:46+0200 +# Se alguén me axuda coa revisión dalgunhas traduccións "pouco ortodoxas", +# agradeceríallo. ;-) +# Jesus Bravo Alvarez , 1999, 2000. +# Ignacio Casal Quinteiro , 2005. +# Ignacio Casal Quinteiro , 2007. +# Mancomún - Centro de Referencia e Servizos de Software Libre , 2009. +# Fran Diéguez , 2010. +# Fran Dieguez , 2017. +msgid "" +msgstr "" +"Project-Id-Version: gl\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=libgto" +"p&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:26+0000\n" +"PO-Revision-Date: 2017-08-12 12:25+0200\n" +"Last-Translator: Fran Dieguez \n" +"Language-Team: Galician\n" +"Language: gl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Virtaal 0.7.1\n" +"X-Project-Style: gnome\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "lido %d byte" +msgstr[1] "lidos %d bytes" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "tamaño dos datos lidos" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "lido %lu byte de datos" +msgstr[1] "lidos %lu bytes de datos" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "escrito %d byte" +msgstr[1] "escritos %d bytes" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Activar a depuración" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Activar a saída detallada" + +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" +msgstr "Non facer fork nunha tarefa de fondo" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Invocado desde inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Execute '%s --help' para ver a lista completa das opcións de liña de ordes " +"dispoñíbeis.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Colgar" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interromper" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Saír" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Instrución ilegal" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Captura do rastro" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Interromper" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Erro EMT" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Excepción de coma flotante" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Matar" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Erro de bus" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Violación de segmento" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Argumento incorrecto na chamada ao sistema" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Canalización danada" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Reloxo de alarma" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Finalización" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Condición urxente no socket" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Deter" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Detención co teclado" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Continuar" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "O estado do fillo cambiou" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Lectura en segundo plano do tty" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Escritura en segundo plano ao tty" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "A E/S é posíbel agora" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Límite de CPU excedido" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Excedeuse o límite de tamaño do ficheiro" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Reloxo de alarma virtual" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Reloxo de alarma con perfil" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Cambio do tamaño da xanela" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Petición de información" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Sinal 1 definido polo usuario" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Sinal 2 definido polo usuario" diff --git a/po/gu.gmo b/po/gu.gmo new file mode 100644 index 0000000..bf5ef14 Binary files /dev/null and b/po/gu.gmo differ diff --git a/po/gu.po b/po/gu.po new file mode 100644 index 0000000..88a9e84 --- /dev/null +++ b/po/gu.po @@ -0,0 +1,190 @@ +# translation of libgtop.HEAD.gu.po to Gujarati +# MagNet , 2004. +# Ankit Patel , 2004, 2005, 2007. +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +msgid "" +msgstr "" +"Project-Id-Version: libgtop.HEAD.gu\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-05-14 03:41+0100\n" +"PO-Revision-Date: 2007-08-07 12:42+0530\n" +"Last-Translator: Ankit Patel \n" +"Language-Team: Gujarati \n" +"Language: gu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n\n" +"\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d બાઈટ વાંચો" +msgstr[1] "%d બાઈટો વાંચો" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "માહિતિનું માપ વાંચો" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu બાઈટની માહિતી વાંચો" +msgstr[1] "%lu બાઈટોની માહિતી વાંચો" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d બાઈટ લખાયેલ હતો" +msgstr[1] "%d બાઈટો લખાયેલ હતા" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "ભૂલ શોધવાની પ્રક્રિયાને સક્રિય કરો" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "વર્ણનીય પરિણામને સક્રિય કરો" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "પાછળના ભાગમાં fork કરો નહિં" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "inetd માંથી શરુ કરાયેલુ" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "પ્રાપ્ય આદેશના વિકલ્પોની પૂર્ણ યાદિ જોવા માટે '%s --help' ચલાવો.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "અટકી ગયેલુ" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "ભંગાણ સૂચન" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "બહાર નીકળો" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "અસામાન્ય માહિતી" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "રેખાંકન અટકાવો" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "અધૂરુ રાખીને જવુ" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT ભૂલ" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "અપૂર્ણાંક અપવાદ" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "મારી નાખો" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Bus ની ભૂલ" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "વિભાગનુ ખંડન" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "સિસ્ટમ કોલ માટેની ખરાબ દલીલ" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "તૂટેલી પાઇપ" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "એલાર્મ ઘડિયાળ" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "પૂરું કરી રહ્યા છે" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "સોકેટ પરની તાત્કાલિક શરત" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "અટકો" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "કી બોર્ડ અટકાવો" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "ચાલુ રાખો" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "બાળ સ્થિતિ બદલાઇ ગઇ છે" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "પાછળના ભાગનું tty માંથી વંચાય છે" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "પાછળનો ભાગ tty માં લખે છે" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O હવે શક્ય છે" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU સીમા પાર થઇ ગઇ છે" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "ફાઇલના માપની સીમા પાર થઇ ગઇ છે" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "આભસી એલાર્મ ઘડિયાળ" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "રુપરેખાંકિત એલાર્મ ઘડિયાળ" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "વિન્ડોના માપમાં બદલાવ" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "જાણકારી માટે વિનંતી" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "વપરાશકર્તા દ્વારા વ્યાખ્યાયિત સંકેત ૧" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "વપરાશકર્તા દ્વારા વ્યાખ્યાયિત સંકેત ૨" + diff --git a/po/he.gmo b/po/he.gmo new file mode 100644 index 0000000..ff3d9e6 Binary files /dev/null and b/po/he.gmo differ diff --git a/po/he.po b/po/he.po new file mode 100644 index 0000000..8bef2bd --- /dev/null +++ b/po/he.po @@ -0,0 +1,204 @@ +# translation of libgtop.libgtop-GNOME-2-0-port.he.po to Hebrew +# translation of libgtop.libgtop-GNOME-2-0-port.po to Hebrew +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# Gil 'Dolfin' Osher , 2003 +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop.libgtop-GNOME-2-0-port.he\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-30 03:40+0100\n" +"PO-Revision-Date: 2003-03-18 18:06+0200\n" +"Last-Translator: Yair Hershkovitz \n" +"Language-Team: Hebrew \n" +"Language: he\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +# *** This library should not be translated (only copy the english msgs) *** +# *** Old hebrew translation is commented for backup sake *** +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "read %d byte" +msgstr[1] "read %d bytes" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "read data size" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "read %lu byte of data" +msgstr[1] "read %lu bytes of data" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "wrote %d byte" +msgstr[1] "wrote %d bytes" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "Enable debugging" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "Enable verbose output" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "Don't fork into background" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "Invoked from inetd" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "Run '%s --help' to see a full list of available command line options.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Hangup" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interrupt" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Quit" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Illegal instruction" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Trace trap" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Abort" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT error" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Floating-point exception" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Kill" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Bus error" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmentation violation" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Bad argument to system call" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Broken pipe" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarm clock" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Termination" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Urgent condition on socket" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Stop" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Keyboard stop" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Continue" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Child status has changed" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Background read from tty" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Background write to tty" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O now possible" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU limit exceeded" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "File size limit exceeded" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtual alarm clock" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profiling alarm clock" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Window size change" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Information request" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "User defined signal 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "User defined signal 2" + +#~ msgid "DEBUG" +#~ msgstr "DEBUG" + +#~ msgid "VERBOSE" +#~ msgstr "VERBOSE" + +#~ msgid "NO-DAEMON" +#~ msgstr "NO-DAEMON" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/hi.gmo b/po/hi.gmo new file mode 100644 index 0000000..460e352 Binary files /dev/null and b/po/hi.gmo differ diff --git a/po/hi.po b/po/hi.po new file mode 100644 index 0000000..de046e0 --- /dev/null +++ b/po/hi.po @@ -0,0 +1,197 @@ +# translation of libgtop.gnome-2-26.po to Hindi +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# +# Ashutosh Sahu , 2003. +# Ravishankar Shrivastava , 2004. +# Rajesh Ranjan , 2005. +# Rajesh Ranjan , 2009. +msgid "" +msgstr "" +"Project-Id-Version: libgtop.gnome-2-26\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop&component=general\n" +"POT-Creation-Date: 2009-04-18 19:52+0000\n" +"PO-Revision-Date: 2009-06-10 14:37+0530\n" +"Last-Translator: Rajesh Ranjan \n" +"Language-Team: Hindi \n" +"Language: hi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n\n" +"\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d बाइट पढ़ें" +msgstr[1] "%d बाइट पढ़ें" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "डेटा आकार पढ़ें" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu आंकड़ा का बाइट पढ़ें" +msgstr[1] "%lu आंकड़ा का बाइट्स पढ़ें" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d बाइट लिखा" +msgstr[1] "%d बाइट्स लिखा" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "डीबगिंग सक्षम करें" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "वाचाल आउटपुट सक्षम करें" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "पृष्ठभूमि में फॉर्क न करें" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr " inetd द्वारा बुलाया गया " + +#: ../src/daemon/gnuserv.c:495 +#, c-format +#| msgid "" +#| "Error on option %s: %s.\n" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "चलाएँ '%s --help' उपलब्ध कमांड लाइन विकल्प की पूरी सूची देखने हेतु.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "हैंगअप" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "इंटरप्ट" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "बाहर" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "अवैध निर्देश" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "ट्रेस ट्रैप" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "छोड़ें" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "ईएमटी त्रुटि" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "फ़्लोटिंग-पाइंट अपवाद" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "किल" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "बस त्रुटि" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "सेगमेंटेशन अतिक्रमण" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "सिस्टम काल को गलत आर्गुमेंट" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "टूटा पाइप" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "अलार्म घड़ी" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "समाप्त" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "सॉकेट पर अत्यावश्यक अवस्था" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "रोकें" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "कुंजीपटल रोकें" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "जारी रखें" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "शिशु स्थिति बदल चुकी है" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "टीटीवाई से पढ़ने का कार्य पृष्ठभूमि में करें" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "टीटीवाई पर लिखने का कार्य पृष्ठभूमि में करें" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "आई/ओ अब संभव" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "सीपीयू सीमा से बाहर पहुँच चुकी" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "फ़ाइल आकार सीमा से बाहर पहुँच चुकी" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "आभासी अलार्म घड़ी" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "प्रोफ़ाइलिंग अलार्म घड़ी" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "विंडो आकार परिवर्तन" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "जानकारी निवेदन" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "उपयोगकर्ता पारिभाषित संकेत १" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "उपयोगकर्ता पारिभाषित संकेत २" + diff --git a/po/hr.gmo b/po/hr.gmo new file mode 100644 index 0000000..b628e1a Binary files /dev/null and b/po/hr.gmo differ diff --git a/po/hr.po b/po/hr.po new file mode 100644 index 0000000..7e57656 --- /dev/null +++ b/po/hr.po @@ -0,0 +1,196 @@ +# Translation of libgtop to Croatiann +# Copyright (C) Croatiann team +# Translators: Automatski Prijevod <>,Robert Sedak , +msgid "" +msgstr "" +"Project-Id-Version: libgtop 0\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-11 17:09+0000\n" +"PO-Revision-Date: 2017-04-30 21:50+0200\n" +"Last-Translator: gogo \n" +"Language-Team: Croatian \n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Launchpad-Export-Date: 2016-09-15 11:39+0000\n" +"X-Generator: Poedit 1.8.7.1\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "čitaj %d bajt" +msgstr[1] "čitaj %d bajta" +msgstr[2] "čitaj %d bajtova" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "veličina podataka čitanja" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "čitaj %lu bajt podataka" +msgstr[1] "čitaj %lu bajta podataka" +msgstr[2] "čitaj %lu bajta podataka" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "zapisan %d bajt" +msgstr[1] "zapisano %d bajta" +msgstr[2] "zapisano %d bajtova" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Omogući otklanjanje grešaka" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Omogući opširniji ispis" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Bez grananja u pozadini" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Pozvano iz inetda" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "" +"Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Pokrenite \"%s --help\" kako bi vidjeli potpun popis mogućnosti " +"naredbenog redka.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Prekini vezu" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Prekid" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Zatvori" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Nedopuštena instrukcija" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Prati trap" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Prekini" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT greška" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Iznimka pomičnog zareza" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Ubij" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Greška sabirnice" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmentacijska povreda" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Neispravan argument za poziv sustava" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Prekinut slivnik" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Sat alarma" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Prekidanje" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Hitno stanje na priključnici" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Zaustavi" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Zaustavljanje tipkovnice" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Nastavi" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Nadređeno stanje je promijenjeno" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Pozadinsko čitanje iz tty-a" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Pozadinsko zapisivanje na tty" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "U/I je sada moguć" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU ograničenje iskorišteno" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Ograničenje veličine datoteke prekoračeno" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtualni sat alarma" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profiliranje sata alarma" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Promjena veličine prozora" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Zahtjev za informacijom" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Korisnički određen signal 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Korisnički određen signal 2" diff --git a/po/hu.gmo b/po/hu.gmo new file mode 100644 index 0000000..5b94bd2 Binary files /dev/null and b/po/hu.gmo differ diff --git a/po/hu.po b/po/hu.po new file mode 100644 index 0000000..82848ad --- /dev/null +++ b/po/hu.po @@ -0,0 +1,200 @@ +# Hungarian translation of libgtop. +# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2017 Free Software Foundation, Inc. +# This file is distributed under the same license as the libgtop package. +# +# Robert Vanyi , 2000, 2001. +# Andras Timar , 2002, 2003. +# Laszlo Dvornik , 2004. +# Gabor Kelemen , 2004, 2005, 2007, 2008. +# Balázs Úr , 2017. +msgid "" +msgstr "" +"Project-Id-Version: libgtop master\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-05-14 21:23+0200\n" +"Last-Translator: Balázs Úr \n" +"Language-Team: Hungarian \n" +"Language: hu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 1.2\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d bájt olvasása" +msgstr[1] "%d bájt olvasása" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "olvasási adatméret" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu bájt adat olvasása" +msgstr[1] "%lu bájt olvasása" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d bájt kiírva" +msgstr[1] "%d bájt kiírva" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Hibakeresés engedélyezése" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Részletes üzenetek bekapcsolása" + +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" +msgstr "Ne forkoljon a háttérbe" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "inetd-ből indítva" + +#: src/daemon/gnuserv.c:498 +#, c-format +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Futtassa a(z) „%s --help” parancsot az elérhető parancssori kapcsolók teljes " +"listájáért.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Felfüggesztés" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Megszakítás" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Kilépés" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Illegális utasítás" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Nyomkövetési csapda" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Megszakítás" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT hiba" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Lebegőpontos kivétel" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Kilövés" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Buszhiba" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Szegmentáció megsértése" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Rendszerhívás rossz argumentummal" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Megszakadt csővezeték" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Ébresztőóra" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Befejezés" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Sürgős állapot a foglalaton" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Leállítás" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Billentyűzet stop" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Folytatás" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "A gyermek állapota megváltozott" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Háttérbeli olvasás a tty-ről" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Háttérbeli írás a tty-re" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "Az I/O most lehetséges" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU-korlát túllépve" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Fájlméret korlátja túllépve" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtuális ébresztőóra" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Ébresztőóra profilírozása" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Ablakméret változása" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Információkérés" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Felhasználói szignál 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Felhasználói szignál 2" + diff --git a/po/id.gmo b/po/id.gmo new file mode 100644 index 0000000..5e320f1 Binary files /dev/null and b/po/id.gmo differ diff --git a/po/id.po b/po/id.po new file mode 100644 index 0000000..8caedad --- /dev/null +++ b/po/id.po @@ -0,0 +1,191 @@ +# Translation of libtop into Indonesian +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the libgtop package. +# Mohammad DAMT , 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop master\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-05-02 12:35+0700\n" +"Last-Translator: Kukuh Syafaat \n" +"Language-Team: GNOME Indonesian Translation Team \n" +"Language: id\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 1.8.11\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "baca %d byte" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "ukuran data saat membaca" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "baca data %lu byte" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "tulis %d byte" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Aktifkan debuging" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Aktifkan output yang lengkap" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Jangan fork ke background" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Diaktifkan dari inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "" +"Run “%s --help” to see a full list of available command line " +"options.\n" +msgstr "" +"Jalankan \"%s --help\" untuk melihat daftar penuh pilihan perintah " +"yang tersedia.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Hangup" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interupsi" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Keluar" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Instruksi ilegal" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Jebakan trace" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Batal" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Error EMT" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Eksepsi Floating-point" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Matikan" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Error bus" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Pelanggaran segmentasi" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Parameter ke sistem call salah" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Pipa rusak" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Jam alarm" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Penghentian" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Kondisi gawat pada soket" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Berhenti" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Hentikan papan tik" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Lanjutkan" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Status anak telah berubah" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Baca diam-diam dari tty" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Tulis diam-diam ke tty" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O dimungkinkan" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Batas CPU terlampaui" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Batas ukuran file terlampaui" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Jam alarm virtual" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Melakukan profil jam alarm" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Ukuran window berubah" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Permintaan informasi" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Sinyal 1 milik user" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Sinyal 2 milik user" diff --git a/po/insert-header.sin b/po/insert-header.sin new file mode 100644 index 0000000..b26de01 --- /dev/null +++ b/po/insert-header.sin @@ -0,0 +1,23 @@ +# 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 +} diff --git a/po/it.gmo b/po/it.gmo new file mode 100644 index 0000000..3883c6c Binary files /dev/null and b/po/it.gmo differ diff --git a/po/it.po b/po/it.po new file mode 100644 index 0000000..d1038fa --- /dev/null +++ b/po/it.po @@ -0,0 +1,191 @@ +# libgtop Italian translation +# Copyright (C) 2003, 2004, 2005, 2017 Free Software Foundation, Inc. +# Alessio Frusciante , 2003-2005 +# Milo Casagrande , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-08-25 09:15+0200\n" +"Last-Translator: Milo Casagrande \n" +"Language-Team: Italian \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.8.12\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "letto %d byte" +msgstr[1] "letti %d byte" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "dimensione dei dati letti" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "letto %lu byte di dati" +msgstr[1] "letti %lu byte di dati" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "scrittura di %d byte" +msgstr[1] "scrittura di %d byte" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Abilita debug" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Abilita output prolisso" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Non esegue una fork in background" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Invocato da inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Eseguire «%s --help» per l'elenco completo delle opzioni a riga di comando.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Hangup" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interrupt" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Quit" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Illegal instruction" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Trace trap" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Abort" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT error" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Floating-point exception" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Kill" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Bus error" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmentation violation" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Bad argument to system call" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Broken pipe" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarm clock" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Termination" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Urgent condition on socket" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Stop" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Keyboard stop" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Continue" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Lo stato del figlio è cambiato" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Lettura in background dalla tty" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Scrittura in background sulla tty" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O adesso possibile" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Superato il limite della CPU" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Superato il limite nella dimensione dei file" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtual alarm clock" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profiling alarm clock" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Window size change" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Information request" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Segnale definito dall'utente 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Segnale definito dall'utente 2" diff --git a/po/ja.gmo b/po/ja.gmo new file mode 100644 index 0000000..016a438 Binary files /dev/null and b/po/ja.gmo differ diff --git a/po/ja.po b/po/ja.po new file mode 100644 index 0000000..ae342ac --- /dev/null +++ b/po/ja.po @@ -0,0 +1,191 @@ +# libgtop ja.po. +# Copyright (C) 1998,2000,2002-2007,2009-2010 Free Software Foundation, Inc. +# Eiichiro ITANI , 1998 +# Takayuki KUSANO , 2000, 2002, 2010. +# Yukihiro Nakai , 2000. +# KAMAGASAKO Masatoshi , 2003. +# Takeshi AIHANA , 2004-2007,2009. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop master\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2011-09-08 07:27+0000\n" +"PO-Revision-Date: 2011-09-11 07:40+0900\n" +"Last-Translator: Jiro Matsuzawa \n" +"Language-Team: Japanese \n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%dバイト読み込み" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "データの読み込みサイズ" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%luバイトデータの読み込み" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%dバイトの書き込み" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "デバッグを有効にする" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "詳細な出力にする" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "子プロセスをバックグラウンドに回さない" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "`inetd` から起動する" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"利用可能なコマンド・ラインのオプション一覧を表示する場合は '%s --help' を実行" +"してください\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "ハングアップ" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "インタラプト" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "終了" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "不正なインストラクション" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "トレーストラップ" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "停止" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT エラー" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "浮動小数点例外" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "強制終了" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "バスエラー" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "セグメンテーションバイオレーション" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "システムコールの引数が誤っています" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "パイプ破壊" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "アラームクロック" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "ターミネーション" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "ソケットの緊急状態" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "ストップ" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "キーボード停止" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "コンティニュー" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "子プロセス状態が変更された" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "TTY からのバックグラウンド読み込み" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "TTY へのバックグラウンド書き込み" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O が使用可能" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU の限界を越えた" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "ファイルサイズの限界を越えた" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "仮想アラームクロック" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "アラームクロックのプロファイル" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "ウィンドウサイズの変更" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "情報リクエスト" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "ユーザー定義のシグナル1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "ユーザー定義のシグナル2" diff --git a/po/ka.gmo b/po/ka.gmo new file mode 100644 index 0000000..3516081 Binary files /dev/null and b/po/ka.gmo differ diff --git a/po/ka.po b/po/ka.po new file mode 100644 index 0000000..9238964 --- /dev/null +++ b/po/ka.po @@ -0,0 +1,221 @@ +# translation of libgtop.po to Georgian +# Copyright (C) 2006 Gnome Georgian Translators +# This file is distributed under the same license as the libgtop package. +# +# Alexander Didebulidze , 2006. +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-02-25 08:57+0100\n" +"PO-Revision-Date: 2006-03-18 03:28+0100\n" +"Last-Translator: Alexander Didebulidze \n" +"Language-Team: Georgian \n" +"Language: ka\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0" + +#: ../lib/read.c:65 +#, c-format +#, fuzzy +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "byte" + +#: ../lib/read_data.c:53 +#, fuzzy +msgid "read data size" +msgstr "სიდიდე" + +#: ../lib/read_data.c:72 +#, c-format +#, fuzzy +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "byte" + +#: ../lib/write.c:52 +#, c-format +#, fuzzy +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "byte" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable debugging" +msgstr "" + +#: ../src/daemon/gnuserv.c:460 +msgid "DEBUG" +msgstr "DEBUG" + +#: ../src/daemon/gnuserv.c:462 +msgid "Enable verbose output" +msgstr "" + +#: ../src/daemon/gnuserv.c:462 +msgid "VERBOSE" +msgstr "VERBOSE" + +#: ../src/daemon/gnuserv.c:464 +msgid "Don't fork into background" +msgstr "" + +#: ../src/daemon/gnuserv.c:464 +msgid "NO-DAEMON" +msgstr "" + +#: ../src/daemon/gnuserv.c:466 +msgid "Invoked from inetd" +msgstr "" + +#: ../src/daemon/gnuserv.c:466 +msgid "INETD" +msgstr "INETD" + +#: ../src/daemon/gnuserv.c:500 +#, c-format +#, fuzzy +msgid "" +"Error on option %s: %s.\n" +"Run '%s --help' to see a full list of available command line options.\n" +msgstr "შეცდომა -სკენ a ხაზი n" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Hangup" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Interrupt" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Quit" +msgstr "გამოსვლა" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Illegal instruction" +msgstr "არალეგალური ინსტრუქცია" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +#, fuzzy +msgid "Trace trap" +msgstr "გამოთვალე" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Abort" +msgstr "შეწყვეტა" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "EMT error" +msgstr "EMT შეცდომა" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Floating-point exception" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Kill" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +#, fuzzy +msgid "Bus error" +msgstr "შეცდომა" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Segmentation violation" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +#, fuzzy +msgid "Bad argument to system call" +msgstr "-სკენ" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Broken pipe" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Alarm clock" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Termination" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Urgent condition on socket" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Stop" +msgstr "შეჩერება" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +#, fuzzy +msgid "Keyboard stop" +msgstr "კლავიატურა" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Continue" +msgstr "გაგრძელება" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Child status has changed" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +#, fuzzy +msgid "Background read from tty" +msgstr "ფონი" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +#, fuzzy +msgid "Background write to tty" +msgstr "ფონი -სკენ" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "I/O now possible" +msgstr "I/O ახლა შესაძლებელია" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +#, fuzzy +msgid "CPU limit exceeded" +msgstr "CPU" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +#, fuzzy +msgid "File size limit exceeded" +msgstr "ფაილი სიდიდე" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Virtual alarm clock" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Profiling alarm clock" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +#, fuzzy +msgid "Window size change" +msgstr "ფანჯარა სიდიდე" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +#, fuzzy +msgid "Information request" +msgstr "ინფორმაცია" + +#: ../sysdeps/osf1/siglist.c:58 ../sysdeps/sun4/siglist.c:58 +#, fuzzy +msgid "User defined signal 1" +msgstr "მომხმარებელი 1" + +#: ../sysdeps/osf1/siglist.c:59 ../sysdeps/sun4/siglist.c:59 +#, fuzzy +msgid "User defined signal 2" +msgstr "მომხმარებელი 2" + diff --git a/po/kn.gmo b/po/kn.gmo new file mode 100644 index 0000000..0579131 Binary files /dev/null and b/po/kn.gmo differ diff --git a/po/kn.po b/po/kn.po new file mode 100644 index 0000000..13bfcda --- /dev/null +++ b/po/kn.po @@ -0,0 +1,222 @@ +# translation of libgtop.HEAD.po to Kannada +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Shankar Prasad , 2009. +msgid "" +msgstr "" +"Project-Id-Version: libgtop.HEAD\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=" +"libgtop&component=general\n" +"POT-Creation-Date: 2009-03-01 23:08+0000\n" +"PO-Revision-Date: 2009-03-14 10:31-0400\n" +"Last-Translator: Shankar Prasad \n" +"Language-Team: Kannada \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: kn\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Zanata 3.2.3\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d ಬೈಟನ್ನು ಓದಲಾಗಿದೆ" +msgstr[1] "%d ಬೈಟ್‌ಗಳನ್ನು ಓದಲಾಗಿದೆ" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "ಓದಲಾದ ದತ್ತಾಂಶದ ಗಾತ್ರ" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu ಬೈಟ್ ಗಾತ್ರವನ್ನು ಓದಲಾಗಿದೆ" +msgstr[1] "%lu ಬೈಟುಗಳ ಗಾತ್ರವನ್ನು ಓದಲಾಗಿದೆ" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d ಬೈಟನ್ನು ಬರೆಯಲಾಗಿದೆ" +msgstr[1] "%d ಬೈಟುಗಳನ್ನು ಬರೆಯಲಾಗಿದೆ" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "ದೋಷನಿವಾರಣೆಯನ್ನು ಶಕ್ತಗೊಳಿಸು" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "ವರ್ಬೋಸ್ ಔಟ್‌ಪುಟ್ ಅನ್ನು ಶಕ್ತಗೊಳಿಸು" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "ಹಿನ್ನಲೆಗೆ ಕವಲೊಡೆಸಬೇಡ" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "inetd ಇಂದ ರದ್ದು ಮಾಡಲಾದ" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"ಲಭ್ಯವಿರುವ ಆಜ್ಞೆಯ ಒಂದು ಸಂಪೂರ್ಣ ಪಟ್ಟಿಯನ್ನು ನೋಡಲು '%s --help' ಅನ್ನು ಚಲಾಯಿಸಿ.\n" + +#: ../sysdeps/osf1/siglist.c:27 +#: ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "ನೇತಾಡು" + +#: ../sysdeps/osf1/siglist.c:28 +#: ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "ತಡೆ" + +#: ../sysdeps/osf1/siglist.c:29 +#: ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "ತ್ಯಜಿಸು" + +#: ../sysdeps/osf1/siglist.c:30 +#: ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "ಅನಧೀಕೃತ ಸೂಚನೆ" + +#: ../sysdeps/osf1/siglist.c:31 +#: ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "ಜಾಡಿನ ಟ್ರಾಪ್" + +#: ../sysdeps/osf1/siglist.c:32 +#: ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "ಸ್ಥಗಿತಗೊಳಿಸು" + +#: ../sysdeps/osf1/siglist.c:33 +#: ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT ದೋಷ" + +#: ../sysdeps/osf1/siglist.c:34 +#: ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "ತೇಲುವ-ಬಿಂದುವಿನ ವಿನಾಯಿತಿ" + +#: ../sysdeps/osf1/siglist.c:35 +#: ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "ಕೊಲ್ಲು" + +#: ../sysdeps/osf1/siglist.c:36 +#: ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "ಬಸ್ ದೋಷ" + +#: ../sysdeps/osf1/siglist.c:37 +#: ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "ಸೆಗ್ಮೆಂಟೇಶನ್ ಉಲ್ಲಂಘನೆ" + +#: ../sysdeps/osf1/siglist.c:38 +#: ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "ವ್ಯವಸ್ಥೆಯ ಕೋಶಕ್ಕೆ ಸರಿಯಲ್ಲದ ಆರ್ಗ್ಯುಮೆಂಟ್" + +#: ../sysdeps/osf1/siglist.c:39 +#: ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "ತುಂಡಾದ ಪೈಪ್" + +#: ../sysdeps/osf1/siglist.c:40 +#: ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "ಅಲಾರಮ್ ಗಡಿಯಾರ" + +#: ../sysdeps/osf1/siglist.c:41 +#: ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "ಅಂತ್ಯಗೊಳಿಕೆ" + +#: ../sysdeps/osf1/siglist.c:42 +#: ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "ಸಾಕೆಟ್‌ನಲ್ಲಿ ತುರ್ತು ಪರಿಸ್ಥಿತಿ" + +#: ../sysdeps/osf1/siglist.c:43 +#: ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "ನಿಲ್ಲಿಸು" + +#: ../sysdeps/osf1/siglist.c:44 +#: ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "ಕೀಲಿಮಣೆ ನಿಲುಗಡೆ" + +#: ../sysdeps/osf1/siglist.c:45 +#: ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "ಮುಂದುವರೆ" + +#: ../sysdeps/osf1/siglist.c:46 +#: ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "ಚೈಲ್ಡಿನ ಸ್ಥಿತಿ ಬದಲಾಗಿದೆ" + +#: ../sysdeps/osf1/siglist.c:47 +#: ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "tty ಇಂದ ಓದಲಾದ ಹಿನ್ನಲೆ" + +#: ../sysdeps/osf1/siglist.c:48 +#: ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "tty ಗೆ ಹಿನ್ನಲೆ ಬರೆಯುವಿಕೆ" + +#: ../sysdeps/osf1/siglist.c:49 +#: ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O ಈಗ ಸಾಧ್ಯವಿದೆ" + +#: ../sysdeps/osf1/siglist.c:50 +#: ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU ಮಿತಿಯನ್ನು ಮೀರಲಾಗಿದೆ" + +#: ../sysdeps/osf1/siglist.c:51 +#: ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "ಕಡತದ ಗಾತ್ರದ ಮಿತಿಯನ್ನು ಮೀರಲಾಗಿದೆ" + +#: ../sysdeps/osf1/siglist.c:52 +#: ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "ವರ್ಚುವಲ್ ಅಲಾರಮ್ ಗಡಿಯಾರ" + +#: ../sysdeps/osf1/siglist.c:53 +#: ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "ಪ್ರೊಫೈಲಿಂಗ್ ಅಲಾರಮ್ ಗಡಿಯಾರ" + +#: ../sysdeps/osf1/siglist.c:54 +#: ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "ವಿಂಡೋ ಗಾತ್ರದ ಬದಲಾವಣೆ" + +#: ../sysdeps/osf1/siglist.c:55 +#: ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "ಮಾಹಿತಿಯ ಮನವಿ" + +#: ../sysdeps/osf1/siglist.c:56 +#: ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "ಬಳಕೆದಾರ ಸೂಚಿತ ಸಂಕೇತ ೧" + +#: ../sysdeps/osf1/siglist.c:57 +#: ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "ಬಳಕೆದಾರ ಸೂಚಿತ ಸಂಕೇತ ೨" diff --git a/po/ko.gmo b/po/ko.gmo new file mode 100644 index 0000000..bd2db86 Binary files /dev/null and b/po/ko.gmo differ diff --git a/po/ko.po b/po/ko.po new file mode 100644 index 0000000..2ec3b5a --- /dev/null +++ b/po/ko.po @@ -0,0 +1,185 @@ +# libgtop ko.po +# Sung-Hyun Nam , 1998 +# Changwoo Ryu , 2002, 2004, 2005, 2008, 2013, 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-08-28 20:28+0900\n" +"Last-Translator: Changwoo Ryu \n" +"Language-Team: GNOME Korea \n" +"Language: ko\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d바이트 읽음" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "읽은 데이터 크기" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "데이터 %lu바이트 읽음" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d바이트 씀" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "디버깅 사용" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "많은 출력 사용" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "백그라운드로 실행 안 함" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "inetd가 호출" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "사용할 수 있는 명령행 옵션을 모두 보려면 “%s --help”라고 실행하십시오.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "끊어짐" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "인터럽트" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "끝내기" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "잘못된 기계명령" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "추적 트랩" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "중지" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT 에러" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "실수연산 예외" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "죽임" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "버스 에러" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "세그먼테이션 위반" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "시스템 콜에 잘못된 인자" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "깨진 파이프" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "알람 클럭" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Termination" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "소켓에 위급한 조건" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "중지" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "키보드 중지" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "계속" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "하위 프로세스 상태가 바뀌었습니다" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "tty에서 백그라운드 읽기" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "tty로 백그라운드 쓰기" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O 이제 가능" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU 한계 초과" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "파일 크기 한계 초과" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "가상 알람 클럭" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profiling 알람 클럭" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "창 크기 바뀜" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "정보 요청" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "사용자 정의 신호 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "사용자 정의 신호 2" diff --git a/po/ku.gmo b/po/ku.gmo new file mode 100644 index 0000000..f519ae6 Binary files /dev/null and b/po/ku.gmo differ diff --git a/po/ku.po b/po/ku.po new file mode 100644 index 0000000..8bed45f --- /dev/null +++ b/po/ku.po @@ -0,0 +1,209 @@ +# translation of libgtop.HEAD.po to Kurdish +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# Erdal Ronahi , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop.HEAD\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-09-09 13:40+0200\n" +"PO-Revision-Date: 2005-10-15 16:41+0200\n" +"Last-Translator: Erdal Ronahi \n" +"Language-Team: Kurdish \n" +"Language: ku\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural= n != 1\n" +"X-Generator: KBabel 1.10\n" + +#: ../lib/read.c:65 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d bayt hat xwendin" +msgstr[1] "%d bayt hatin xwendin" + +#: ../lib/read_data.c:53 +msgid "read data size" +msgstr "" + +#: ../lib/read_data.c:72 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "" +msgstr[1] "" + +#: ../lib/write.c:52 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d bayt hat nivîsandin" +msgstr[1] "%d bayt hatin nivîsandin" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable debugging" +msgstr "" + +#: ../src/daemon/gnuserv.c:460 +msgid "DEBUG" +msgstr "" + +#: ../src/daemon/gnuserv.c:462 +msgid "Enable verbose output" +msgstr "" + +#: ../src/daemon/gnuserv.c:462 +msgid "VERBOSE" +msgstr "" + +#: ../src/daemon/gnuserv.c:464 +msgid "Don't fork into background" +msgstr "" + +#: ../src/daemon/gnuserv.c:464 +#, fuzzy +msgid "NO-DAEMON" +msgstr "DAEMON TUNE" + +#: ../src/daemon/gnuserv.c:466 +msgid "Invoked from inetd" +msgstr "" + +#: ../src/daemon/gnuserv.c:466 +msgid "INETD" +msgstr "" + +#: ../src/daemon/gnuserv.c:500 +#, c-format +msgid "" +"Error on option %s: %s.\n" +"Run '%s --help' to see a full list of available command line options.\n" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Hangup" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Interrupt" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Quit" +msgstr "Derkeve" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Illegal instruction" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Trace trap" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "Abort" +msgstr "Betal bike" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "EMT error" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Floating-point exception" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Kill" +msgstr "Bikuje" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Bus error" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Segmentation violation" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Bad argument to system call" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Broken pipe" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Alarm clock" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Termination" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Urgent condition on socket" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Stop" +msgstr "Bisekinîne" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Keyboard stop" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Continue" +msgstr "Bidomîne" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Child status has changed" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background read from tty" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "Background write to tty" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "I/O now possible" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "CPU limit exceeded" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "File size limit exceeded" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Virtual alarm clock" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Profiling alarm clock" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Window size change" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "Information request" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 1" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:58 ../sysdeps/sun4/siglist.c:58 +msgid "User defined signal 2" +msgstr "" + diff --git a/po/ky.gmo b/po/ky.gmo new file mode 100644 index 0000000..8ac3885 Binary files /dev/null and b/po/ky.gmo differ diff --git a/po/ky.po b/po/ky.po new file mode 100644 index 0000000..ed760f4 --- /dev/null +++ b/po/ky.po @@ -0,0 +1,192 @@ +# translation of libgtop to Kyrgyz +# Kirghiz translation of libgtop. +# Copyright (C) 1999, 2005 Free Software Foundation, Inc. +# This file is distributed under the same license as the libgtop package. +# +# Timur Zhamakeev , 2005, 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: ky\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2011-09-05 21:47+0000\n" +"PO-Revision-Date: 2012-09-27 12:10+0600\n" +"Last-Translator: Timur Zhamakeev \n" +"Language-Team: Kirghiz \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ky\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Lokalize 1.4\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d байт окулду" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "окулган маалымат көлөмү" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu байт маалымат окулду" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d байт жазылды" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "Ката издөөнү иштетүү" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "Кеңири чыгаруу" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "Фондук режимге бөлбөө" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "inetd аркылуу чакырылган" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Командалык саптын мүмкүн болгон бардык параметрлерин көрүү үчүн \"%s --help\" " +"командасын колдонуңуз.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Үзүү" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Убактылуу токтотуу" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Чыгуу" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Туура эмес инструкция" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Трассировканы кармоо" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Токтотуу" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT катасы" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Анык сан катасы" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Өлтүрүү" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Шина катасы" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Сегментациянын бузулушу" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Системалык чакыруудагы туура эмес аргумент" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Бузулган канал" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Таймер" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Аяктоо" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Көңүл бурууну талап кылган сокет" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Стоп" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Алиптергичти токтотуу" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Улантуу" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Туунду процесстин абалы өзгөрүлдү" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "tty-ден фондук режимде окуу" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "tty-ге фондук режимде жазуу" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "Киргизүү/Чыгаруу эми мүмкүн" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU пределинен ашты" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Файл көлөмү пределинен ашты" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Виртуалдык таймер" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Профилдик таймер" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Терезе өлчөмүн өзгөртүү" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Маалымат талап кылуу" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Колдонуучу аныктаган сигналы 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Колдонуучу аныктаган сигналы 2" + diff --git a/po/la.gmo b/po/la.gmo new file mode 100644 index 0000000..584a973 Binary files /dev/null and b/po/la.gmo differ diff --git a/po/la.po b/po/la.po new file mode 100644 index 0000000..0bc7d18 --- /dev/null +++ b/po/la.po @@ -0,0 +1,185 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2008-11-14 22:00-0500\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Latin \n" +"Language: la\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Desistere" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Sistere" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "" +msgstr[1] "%d octets lus" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "" +msgstr[1] "lecture de %lu octets de données" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "" +msgstr[1] "écriture de %d octets" diff --git a/po/libgtop.pot b/po/libgtop.pot new file mode 100644 index 0000000..cb01fa4 --- /dev/null +++ b/po/libgtop.pot @@ -0,0 +1,190 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the libgtop package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: libgtop 2.34.1\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop\n" +"POT-Creation-Date: 2016-11-27 20:06+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "" +msgstr[1] "" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "" +msgstr[1] "" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "" + +#: src/daemon/gnuserv.c:460 +msgid "Don't fork into background" +msgstr "" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "" diff --git a/po/lt.gmo b/po/lt.gmo new file mode 100644 index 0000000..7c4724e Binary files /dev/null and b/po/lt.gmo differ diff --git a/po/lt.po b/po/lt.po new file mode 100644 index 0000000..2609075 --- /dev/null +++ b/po/lt.po @@ -0,0 +1,205 @@ +# translation of lt.po to Lithuanian +# Lithuanian translation of libgtop library. +# Copyright (C) 2003-2006 Free Software Foundation. +# This file is distributed under the same license as the libgtop package. +# +# +# Tomas Kuliavas , 2003. +# Žygimantas Beručka , 2003-2006. +# Gintautas Miliauskas , 2007. +# Aurimas Černius , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: lt\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-08-22 23:25+0300\n" +"Last-Translator: Aurimas Černius \n" +"Language-Team: Lietuvių \n" +"Language: lt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" +"%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "perskaitytas %d baitas" +msgstr[1] "perskaityti %d baitai" +msgstr[2] "perskaityta %d baitų" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "perskaitytų duomenų dydis" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "perskaitytas %lu baitas duomenų" +msgstr[1] "perskaityti %lu baitai duomenų" +msgstr[2] "perskaityta %lu baitų duomenų" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "įrašytas %d baitas" +msgstr[1] "įrašyti %d baitai" +msgstr[2] "įrašyta %d baitų" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Įjungti testavimo veikseną" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Įjungti išsamią išvestį" + +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" +msgstr "Nepaleisti fonine veiksena" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Paleista iš inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Paleiskite „%s --help“, norėdami pamatyti visus galimus komandinės eilutės " +"parametrus.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Atsijungti" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Pertraukimas" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Išeiti" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Neleistina instrukcija" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Sekimo spąstai" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Nutraukti" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT klaida" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Slankaus kablelio klaida" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Nužudyti" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Magistralės klaida" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmentacijos pažeidimas" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Klaidingi sisteminio iškvietimo argumentai" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Netvarkingas nukreipimas" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Signalinis laikrodis" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Nutraukimas" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Ekstremalios jungties sąlygos " + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Stop" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Klaviatūros sustabdymas" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Tęsti" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Susijusio proceso būklė pakito" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Foninis skaitymas iš tty" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Foninis rašymas į tty" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "Dabar leistinas I/O" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU apribojimai viršyti" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Failų dydžio apribojimai viršyti" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtualus signalinis laikrodis" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profiliavimo signalinis laikrodis" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Lango dydžio keitimas" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Informacijos užklausa" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Pirmas naudotojo nurodytas signalas (USR1)" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Antras naudotojo nurodytas signalas (USR2)" diff --git a/po/lv.gmo b/po/lv.gmo new file mode 100644 index 0000000..d5edcf3 Binary files /dev/null and b/po/lv.gmo differ diff --git a/po/lv.po b/po/lv.po new file mode 100644 index 0000000..8a8f623 --- /dev/null +++ b/po/lv.po @@ -0,0 +1,203 @@ +# translation of lv.po to Latvian +# Latvian translation for LibGTop +# Copyright © 2006 Gnome i18n Project for Latvian. +# +# Peteris Krisjanis , 2002. +# Raivis Dejus , 2006, 2009. +# Peteris Krisjanis , 2010. +# Rūdolfs Mazurs , 2012, 2017. +msgid "" +msgstr "" +"Project-Id-Version: lv\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=libgtop" +"&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:26+0000\n" +"PO-Revision-Date: 2017-08-27 23:39+0200\n" +"Last-Translator: Rūdolfs Mazurs \n" +"Language-Team: Latvian \n" +"Language: lv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 :" +" 2);\n" +"X-Generator: Lokalize 2.0\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "lasīt %d baitu" +msgstr[1] "lasīt %d baitus" +msgstr[2] "lasīt %d baitu" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "lasīt datu izmēru" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "lasīt %lu baitu datu" +msgstr[1] "lasīt %lu baitus datu" +msgstr[2] "lasīt %lu baitu datus" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "ierakstīts %d baits" +msgstr[1] "ierakstīti %d baiti" +msgstr[2] "ierakstīti %d baitu" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Aktivēt atkļūdošanu" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Aktivēt detalizētu izvadi" + +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" +msgstr "Nesadalīties fonā" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Izsaukts no inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Palaidiet “%s --help”, lai redzētu pilnu pieejamo komandrindas opciju " +"sarakstu.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Iekārt" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Pātraukt" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Iziet" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Neatļauta instrukcija" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Izsekot slazdu" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Pārtraukt" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT kļūda" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Peldošā komata izņēmums" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Nobeigt" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Kopnes kļūda" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmentācijas pārkāpums" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Slikts parametrs sistēmas izsaukumam" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Bojāts kanāls" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Modinātājs" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Pārtraukšana" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Steidzama situācija ligzdā" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Apturēt" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Tastatūras apturēšana" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Turpināt" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Bērna statuss ir izmainījies" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Fona lasīšana no tty" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Fona rakstīšana uz tty" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O tagad iespējams" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU limits pārsniegts" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Datnes izmēra limits pārsniegts" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtuāls modinātājs" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profilēšanas modinātājs" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Loga izmēru maiņa" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Informācijas pieprasījums" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Lietotāja definēts signāls 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Lietotāja definēts signāls 2" + diff --git a/po/mai.gmo b/po/mai.gmo new file mode 100644 index 0000000..04eb1f2 Binary files /dev/null and b/po/mai.gmo differ diff --git a/po/mai.po b/po/mai.po new file mode 100644 index 0000000..0ba5be4 --- /dev/null +++ b/po/mai.po @@ -0,0 +1,190 @@ +# translation of libgtop.master.po to Maithili +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Sangeeta Kumari , 2009. +msgid "" +msgstr "" +"Project-Id-Version: libgtop.master\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop&component=general\n" +"POT-Creation-Date: 2009-09-02 16:38+0000\n" +"PO-Revision-Date: 2009-09-11 20:50+0530\n" +"Last-Translator: Sangeeta Kumari \n" +"Language-Team: Maithili \n" +"Language: mai\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d बाइट पढ़ू" +msgstr[1] "%d बाइट पढ़ू" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "आंकड़ाक आकार पढ़ू" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu आंकड़ाक बाइट पढ़ू" +msgstr[1] "%lu आंकड़ाक बाइट पढ़ू" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d बाइट लिखलक" +msgstr[1] "%d बाइट लिखलक" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "डिबगिंग सक्षम करू" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "वर्बोज आउटपुट सक्षम करू" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "पृष्ठभूमिमे फॉर्क नहि करू" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "inetd मारफत बोलाएल गेल" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "'%s --help' चलाबू उपलब्ध कमांड लाइन विकल्प देखबाक लेल.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "हैंगअप" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "रूकाबट" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "बाहर" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "अबैध निर्देश" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "ट्रेस ट्रैप" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "छोड़ू" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT त्रुटि" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "फ्लोटिंग-पाइंट अपबाद" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "मारू" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "बस त्रुटि" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "सेगमेंटेशन अतिक्रमण" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "सिस्टम कालमे गलत आर्गुमेंट" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "टूटल पाइप" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "अलार्म घड़ी" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "समाप्त" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "साकेट पर अत्यावश्यक अवस्था" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "रोकू" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "कीबोर्ड रोकू" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "जारी राखू" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "शिशुक स्थिति बदैल गेल अछि" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "टीटीवाइ सँ पढ़बाक काज पृष्ठभूमिमे करू" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "टीटीवाइ पर लिखबाक काज पृष्ठभूमिमे करू" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "आइ/ओ आब संभव" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "सीपीयू सीमा सँ बाहर पहुँच गेल" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "फाइलक आकार सीमा सँ बाहर पहुँच गेल" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "आभासी अलार्म घड़ी" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "प्रोफाइलिंग अलार्म घड़ी" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "विंडो आकार परिवर्तन" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "जानकारी निवेदन" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "प्रयोक्ता परिभाषित संकेत १" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "प्रयोक्ता परिभाषित संकेत २" + diff --git a/po/mg.gmo b/po/mg.gmo new file mode 100644 index 0000000..0a8426e Binary files /dev/null and b/po/mg.gmo differ diff --git a/po/mg.po b/po/mg.po new file mode 100644 index 0000000..5457efe --- /dev/null +++ b/po/mg.po @@ -0,0 +1,208 @@ +# Malagasy translation of LIBGTOP. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Thierry Randrianiriana , 2006. +# Fano Rajaonarisoa , 2006. +msgid "" +msgstr "" +"Project-Id-Version: LIBGTOP 2.16\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-07-05 15:53+0200\n" +"PO-Revision-Date: 2006-07-05 21:48+0300\n" +"Last-Translator: Fano Rajaonarisoa \n" +"Language-Team: Malagasy \n" +"Language: mg\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n>1;\n" + +#: ../lib/read.c:65 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d octet voavaky" +msgstr[1] "%d octet voavaky" + +#: ../lib/read_data.c:53 +msgid "read data size" +msgstr "hijery ny haben'ilay data" + +#: ../lib/read_data.c:72 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "Voavaky ny %lu amin'ilay data" +msgstr[1] "Voavaky ny %lu amin'ilay data" + +#: ../lib/write.c:53 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d octet voadika" +msgstr[1] "%d octet voadika" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable debugging" +msgstr "Alefaso ny debugging" + +#: ../src/daemon/gnuserv.c:460 +msgid "DEBUG" +msgstr "DEBUG" + +#: ../src/daemon/gnuserv.c:462 +msgid "Enable verbose output" +msgstr "Alefaso ny famoahana be resaka" + +#: ../src/daemon/gnuserv.c:462 +msgid "VERBOSE" +msgstr "BE RESAKA" + +#: ../src/daemon/gnuserv.c:464 +msgid "Don't fork into background" +msgstr "Aza manasaka any afara" + +#: ../src/daemon/gnuserv.c:464 +msgid "NO-DAEMON" +msgstr "TSIA-DAEMON" + +#: ../src/daemon/gnuserv.c:466 +msgid "Invoked from inetd" +msgstr "Nantsoina avy any amin'ny inetd" + +#: ../src/daemon/gnuserv.c:466 +msgid "INETD" +msgstr "INETD" + +#: ../src/daemon/gnuserv.c:500 +#, c-format +msgid "" +"Error on option %s: %s.\n" +"Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Tsy fetezana amin'ny safidy %s: %s.\n" +"Alefaso ny '%s --help' ahitana ireo safidin-dazam-baiko misy.\n" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Hangup" +msgstr "Ahatoy" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Interrupt" +msgstr "Tapao" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Quit" +msgstr "Ajanony" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Illegal instruction" +msgstr "Torolàlana tsy ara-dalàna" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "Trace trap" +msgstr "Trace trap" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Abort" +msgstr "Hiala" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "EMT error" +msgstr "Tsy fetezana EMT" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Floating-point exception" +msgstr "Fanavahan'ny floating-point" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Kill" +msgstr "Vonoy" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bus error" +msgstr "Tsy fetezan'ny mpampita" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Segmentation violation" +msgstr "Fanimbazimbana ny segmentation" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Bad argument to system call" +msgstr "Tondriky tsy mety ho an'ny antson'ny rafitra" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Broken pipe" +msgstr "Fantsona simba" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Alarm clock" +msgstr "Famantaranandro misy fanairana" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Termination" +msgstr "Fiafarana" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Urgent condition on socket" +msgstr "Toe-javatra mila jerena maika amin'ny socket" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Stop" +msgstr "Fijanonana" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Keyboard stop" +msgstr "Fijanonan'ny kitendry" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Continue" +msgstr "Tohizo" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Child status has changed" +msgstr "Niova ilay toetra zanaka" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "Background read from tty" +msgstr "Famakiana ny tty any afara" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "Background write to tty" +msgstr "Fanoratana ny tty any afara" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "I/O now possible" +msgstr "Mety amin'izay ny I/O" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "CPU limit exceeded" +msgstr "Nihoarana ny fetran'ny CPU" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "File size limit exceeded" +msgstr "Voahoatra ny fetran'ny haben-drakitra" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Virtual alarm clock" +msgstr "Famantaranandro virtoaly misy fanairana" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Profiling alarm clock" +msgstr "Manoritsoritra ilay famantaranandro misy fanairana" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "Window size change" +msgstr "Fanovana ny haben'ny fikandrana" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "Information request" +msgstr "Fangataha-panazavana" + +#: ../sysdeps/osf1/siglist.c:58 ../sysdeps/sun4/siglist.c:58 +msgid "User defined signal 1" +msgstr "Fambara 1 voafaritry ny mpampiasa" + +#: ../sysdeps/osf1/siglist.c:59 ../sysdeps/sun4/siglist.c:59 +msgid "User defined signal 2" +msgstr "Fambara 2 voafaritry ny mpampiasa" diff --git a/po/mi.gmo b/po/mi.gmo new file mode 100644 index 0000000..c7c6e79 Binary files /dev/null and b/po/mi.gmo differ diff --git a/po/mi.po b/po/mi.po new file mode 100644 index 0000000..f4d205d --- /dev/null +++ b/po/mi.po @@ -0,0 +1,213 @@ +# translation of libgtop.HEAD.po to Maori +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# John C Barstow , 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop.HEAD\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-09-25 18:15+0200\n" +"PO-Revision-Date: 2004-06-26 19:13+1200\n" +"Last-Translator: John C Barstow \n" +"Language-Team: Maori \n" +"Language: mi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.3.1\n" + +#: lib/read.c:65 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/read_data.c:53 +msgid "read data size" +msgstr "" + +#: lib/read_data.c:72 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "" +msgstr[1] "" + +#: lib/write.c:52 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "" +msgstr[1] "" + +#: src/daemon/gnuserv.c:460 +msgid "Enable debugging" +msgstr "" + +#: src/daemon/gnuserv.c:460 +msgid "DEBUG" +msgstr "" + +#: src/daemon/gnuserv.c:462 +msgid "Enable verbose output" +msgstr "" + +#: src/daemon/gnuserv.c:462 +msgid "VERBOSE" +msgstr "" + +#: src/daemon/gnuserv.c:464 +msgid "Don't fork into background" +msgstr "" + +#: src/daemon/gnuserv.c:464 +msgid "NO-DAEMON" +msgstr "" + +#: src/daemon/gnuserv.c:466 +msgid "Invoked from inetd" +msgstr "" + +#: src/daemon/gnuserv.c:466 +msgid "INETD" +msgstr "" + +#: src/daemon/gnuserv.c:500 +#, fuzzy, c-format +msgid "" +"Error on option %s: %s.\n" +"Run '%s --help' to see a full list of available command line options.\n" +msgstr "He āwhina" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Hangup" +msgstr "" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Interrupt" +msgstr "" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +#, fuzzy +msgid "Quit" +msgstr "Whakamutu" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Illegal instruction" +msgstr "" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Trace trap" +msgstr "" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "Abort" +msgstr "" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "EMT error" +msgstr "" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Floating-point exception" +msgstr "" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Kill" +msgstr "" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Bus error" +msgstr "" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Segmentation violation" +msgstr "" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Bad argument to system call" +msgstr "" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Broken pipe" +msgstr "" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Alarm clock" +msgstr "" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Termination" +msgstr "" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +#, fuzzy +msgid "Urgent condition on socket" +msgstr "Whāwhai" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +#, fuzzy +msgid "Stop" +msgstr "Whakamutua" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +#, fuzzy +msgid "Keyboard stop" +msgstr "whakamutua" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Continue" +msgstr "" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Child status has changed" +msgstr "" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background read from tty" +msgstr "" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "Background write to tty" +msgstr "" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "I/O now possible" +msgstr "" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "CPU limit exceeded" +msgstr "" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +#, fuzzy +msgid "File size limit exceeded" +msgstr "Te Kōnae" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Virtual alarm clock" +msgstr "" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Profiling alarm clock" +msgstr "" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +#, fuzzy +msgid "Window size change" +msgstr "Matapihi" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +#, fuzzy +msgid "Information request" +msgstr "Rongo" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 1" +msgstr "" + +#: sysdeps/osf1/siglist.c:58 sysdeps/sun4/siglist.c:58 +msgid "User defined signal 2" +msgstr "" diff --git a/po/mk.gmo b/po/mk.gmo new file mode 100644 index 0000000..5c5ff57 Binary files /dev/null and b/po/mk.gmo differ diff --git a/po/mk.po b/po/mk.po new file mode 100644 index 0000000..58adbad --- /dev/null +++ b/po/mk.po @@ -0,0 +1,201 @@ +# translation of libgtop.HEAD.po to Macedonian +# translation of libgtop-GNOME-2-0-port.mk.po to +# translation of libgtop-GNOME-2-0-port.mk.po to +# translation of mk.po to +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) 2004 THE PACKAGE'S COPYRIGHT HOLDER. +# +# Ivan Stojmirov , 2002,2003. +# Jovan Kostovski , 2003. +# Глигор Костоски , 2003. +# Arangel Angov , 2004. +# Арангел Ангов , 2005. +# Arangel Angov , 2007. +msgid "" +msgstr "" +"Project-Id-Version: libgtop.HEAD\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-05-14 03:41+0100\n" +"PO-Revision-Date: 2007-09-02 21:56+0200\n" +"Last-Translator: Arangel Angov \n" +"Language-Team: Macedonian \n" +"Language: mk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural= n==1 || n%10==1 ? 0 : 1\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "прочитан %d бајт" +msgstr[1] "прочитани %d бајти" +msgstr[2] "прочитани %d бајти" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "големина на прочитаните податоци" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "прочитан %lu бајт податоци" +msgstr[1] "прочитани %lu бајти податоци" +msgstr[2] "прочитани %lu бајти податоци" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "запишан %d бајт" +msgstr[1] "запишани %d бајти" +msgstr[2] "запишани %d бајти" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "Овозможи наоѓање грешки" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "Овозможи опширен излез" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "Не дели процеси во позадина" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "од" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "Изврши '%s --помош' за целосна листа на достапни опции за командни линии.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Спушти" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Прекин" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Излез" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Нелегална инструкција" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Следи ја замката" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Прекини" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "ЕМТ грешка" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Грешка во операција со реални броеви" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Убиј" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Грешка во магистралата" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Грешка при сегментација" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Грешен аргумент при системски повик" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Прекината цевка" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Будилник" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Прекинување" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Итна интервенција врз сокет" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Стоп" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Стоп на тастатура" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Продолжи" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Статусот на дете-процесот се смени" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Позадинско читање од терминал" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Позадинско запишување на терминал" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "Влезно/Излезната операција сега е возможна" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Процесорскиот лимит е пречекорен" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Големината на датотека ги надминува границите" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Виртуелен алармен часовник" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Аларм со профили" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Промена на големина на прозорец" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Барање за информации" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Сигнал 1 дефиниран од корисникот" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Сигнал 2 дефиниран од корисникот" + diff --git a/po/ml.gmo b/po/ml.gmo new file mode 100644 index 0000000..4e0d243 Binary files /dev/null and b/po/ml.gmo differ diff --git a/po/ml.po b/po/ml.po new file mode 100644 index 0000000..4b0d029 --- /dev/null +++ b/po/ml.po @@ -0,0 +1,195 @@ +# translation of libgtop.master.ml.po to +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# FSF-India , 2003. +# Ani Peter , 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop.master.ml\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop&component=general\n" +"POT-Creation-Date: 2009-04-17 10:17+0000\n" +"PO-Revision-Date: 2009-09-12 20:37+0530\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: ml\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d ബൈറ്റ് വായിക്കുക" +msgstr[1] "%d ബൈറ്റ്സ് വായിക്കുക" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "ഡേറ്റായുടെ വലിപ്പം വായിക്കുക" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu ബൈറ്റ് ഡേറ്റാ വായിക്കുക" +msgstr[1] "%lu ബൈറ്റ്സ് ഡേറ്റാ വായിക്കുക" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d ബൈറ്റ് എഴുതി" +msgstr[1] "%d ബൈറ്റ്സ് എഴുതി" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "ഡീബഗ്ഗിങ് പ്രവര്‍ത്തന സജ്ജമാക്കുക" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "വര്‍ബറോസ് ഔട്ട് പുട്ട് പ്രവര്‍ത്തന സജ്ജമാക്കുക" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "പശ്ചാത്തലത്തിലേക്ക് fork ചെയ്യുവാന്‍ പാടില്ല" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "inetd-ല്‍ നിന്നുമുളള വിളി" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +#| msgid "" +#| "Error on option %s: %s.\n" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "ലഭ്യമായ കമാന്‍ഡ് ലൈന്‍ ഉപാധികളുടെ മുഴുവന്‍ പട്ടികയ്ക്ക് '%s --help' പ്രവര്‍ത്തിപ്പിക്കുക.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "അവസാനിപ്പിക്കുക" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "ഇന്‍ററപ്റ്റ്" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "പുറത്ത് കടക്കുക" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "തെറ്റായ നിര്‍ദ്ദേശം" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "തടസ്സം കണ്ടുപിടിക്കുക" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "നിര്‍ത്തലാക്കുക" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT പിശക്" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "ഫ്ളോട്ടിങ്-പോയിന്‍റ് എക്സെപ്ഷന്‍" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "അവസാനിപ്പിക്കുക" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "ബസില്‍ പിശക്" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "സെഗ്മന്‍റേഷനില്‍ തെറ്റ്" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "സിസ്റ്റം കോളിലേക്ക് തെറ്റായ ആര്‍ഗ്യുമെന്‍റ്" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "പൊട്ടിയ പൈപ്പ്" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "അലാറം ക്ളോക്ക്" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "അവസാനിപ്പിക്കല്‍" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "സോക്കന്‍റില്‍ ഗുരുതരമായ അവസ്ഥ" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "നിര്‍ത്തുക" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "കീബോര്‍ഡ് നിര്‍ത്തുക" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "തുടരുക" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "ചൈള്‍ഡിന്‍റെ അവസ്ഥ മാറിയിരിക്കുന്നു" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "tty-ല്‍ നിന്നും പശ്ചാത്തലം വായിക്കുക" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "tty-ലേക്ക് പശ്ചാത്തലം എഴുതുക" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O ഇപ്പോള്‍ സാധ്യമാണ്" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU പരിമിധി കവിഞ്ഞു" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "ഫയലിന്‍റെ വലിപ്പ പരിമിധി കവിഞ്ഞു" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "വിര്‍ച്ച്വല്‍ അലാറം ക്ളോക്ക്" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "അലാറം ക്ളോക്ക് പ്രൊഫൈല്‍ ചെയ്യുന്നു" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "ജീലകത്തിന്‍റെ വലിപ്പത്തലുളള മാറ്റം" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "വിവരങ്ങള്‍ക്കായുളള അഭ്യര്‍ത്ഥന" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "യൂസര്‍ ഡിഫൈന്‍ഡ് സിഗ്നല്‍ 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "യൂസര്‍ ഡിഫൈന്‍ഡ് സിഗ്നല്‍ 2" + diff --git a/po/mn.gmo b/po/mn.gmo new file mode 100644 index 0000000..c5d9f01 Binary files /dev/null and b/po/mn.gmo differ diff --git a/po/mn.po b/po/mn.po new file mode 100644 index 0000000..947856c --- /dev/null +++ b/po/mn.po @@ -0,0 +1,212 @@ +# translation of mn.po to Mongolian +# translation of libgtop.HEAD.po to Mongolian +# translation of libgtop.libgtop-GNOME-2-0-port.de.po to Mongolian +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# Sanlig Badral , 2003. +# Sanlig Badral , 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: mn\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-09-25 18:15+0200\n" +"PO-Revision-Date: 2004-01-05 21:47+0100\n" +"Last-Translator: Sanlig Badral \n" +"Language-Team: Mongolian \n" +"Language: mn\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: KBabel 1.0.2\n" + +#: lib/read.c:65 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d байт унших" +msgstr[1] "%d байт унших" + +#: lib/read_data.c:53 +msgid "read data size" +msgstr "өгөгдлийн хэмжээг унших" + +#: lib/read_data.c:72 +#, fuzzy, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%d байт унших" +msgstr[1] "%d байт унших" + +#: lib/write.c:52 +#, fuzzy, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d байт бичих" +msgstr[1] "%d байт бичих" + +#: src/daemon/gnuserv.c:460 +msgid "Enable debugging" +msgstr "Алдаа оношлогчийг идэвхижүүлэх" + +#: src/daemon/gnuserv.c:460 +msgid "DEBUG" +msgstr "ОНОШИЛГОО" + +#: src/daemon/gnuserv.c:462 +msgid "Enable verbose output" +msgstr "Дэлгэрэнгүй гаралтыг нээх" + +#: src/daemon/gnuserv.c:462 +msgid "VERBOSE" +msgstr "ДЭЛГЭРЭНГҮЙ" + +#: src/daemon/gnuserv.c:464 +msgid "Don't fork into background" +msgstr "Дэвсгэр лүү чихэхгүй" + +#: src/daemon/gnuserv.c:464 +msgid "NO-DAEMON" +msgstr "ДАЙМОН АЛГА" + +#: src/daemon/gnuserv.c:466 +msgid "Invoked from inetd" +msgstr "inetd -р л дуудагдана" + +#: src/daemon/gnuserv.c:466 +msgid "INETD" +msgstr "INETD" + +#: src/daemon/gnuserv.c:500 +#, c-format +msgid "" +"Error on option %s: %s.\n" +"Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Сонголт %s-д алдаа: %s.\n" +"Та бүх сонголтын жигсаалтыг харахдаа »%s --help« гэж ажиллуулна уу. \n" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Hangup" +msgstr "Тавих" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Interrupt" +msgstr "Тасалдал" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Quit" +msgstr "Гарах" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Illegal instruction" +msgstr "Хүчингүй заавар" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Trace trap" +msgstr "Trace-Trap" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "Abort" +msgstr "Болих" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "EMT error" +msgstr "EMT-Алдаа" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Floating-point exception" +msgstr "Хөвдөг таслалтай онцлолт" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Kill" +msgstr "Алах" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Bus error" +msgstr "Bus алдаа" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Segmentation violation" +msgstr "Сегментийн гажуудал" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Bad argument to system call" +msgstr "Системийн дуудалтын хувьд хүчингүй аргумент" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Broken pipe" +msgstr "Тасарсан шугам" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Alarm clock" +msgstr "Сэрүүлэг" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Termination" +msgstr "Төгсгөх" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Urgent condition on socket" +msgstr "Чухал соккетийн төлөв" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Stop" +msgstr "Зогс" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Keyboard stop" +msgstr "Гар-зогсоох" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Continue" +msgstr "Үргэлжлүүлэх" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Child status has changed" +msgstr "Хүү төлөв өөрчилөгдлөө" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background read from tty" +msgstr "Дэвсгэр tty -аас унших" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "Background write to tty" +msgstr "Дэвсгэр tty -дээр бичих" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "I/O now possible" +msgstr "О/Г одоо боломжтой" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "CPU limit exceeded" +msgstr "CPU-хязгаараас халилаа" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "File size limit exceeded" +msgstr "Файлын хэмжээ хязгаараас халилаа" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Virtual alarm clock" +msgstr "Виртуал сэрүүлэг" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Profiling alarm clock" +msgstr "Яг таг сэрүүлэг" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Window size change" +msgstr "Цонхны хэмжээ өөрчилөх" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "Information request" +msgstr "Мэдээлийн хүсэлт" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 1" +msgstr "Хэрэглэгчийн тодорхойлсон сигнал 1" + +#: sysdeps/osf1/siglist.c:58 sysdeps/sun4/siglist.c:58 +msgid "User defined signal 2" +msgstr "Хэрэглэгчийн тодорхойлсон сигнал 2" diff --git a/po/mr.gmo b/po/mr.gmo new file mode 100644 index 0000000..f2aa56c Binary files /dev/null and b/po/mr.gmo differ diff --git a/po/mr.po b/po/mr.po new file mode 100644 index 0000000..befca9c --- /dev/null +++ b/po/mr.po @@ -0,0 +1,191 @@ +# translation of libgtop.HEAD.mr.po to marathi +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# sandeep shedmake , 2007. +msgid "" +msgstr "" +"Project-Id-Version: libgtop.HEAD.mr\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-12-11 03:56+0000\n" +"PO-Revision-Date: 2007-12-12 10:37+0530\n" +"Last-Translator: sandeep shedmake \n" +"Language-Team: marathi\n" +"Language: mr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n\n" +"\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d बाइट वाचा" +msgstr[1] "%d बाइट वाचा" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "माहिती आकार वाचा" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu बाइट माहिती वाचा" +msgstr[1] "%lu बाइट माहिती वाचा" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d बाइट लिहीले" +msgstr[1] "%d बाइट लिहीले" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "निर्धारण कार्यान्वीत करा" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "प्रदान वाचताजोगी करा" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "पार्श्वभूमीत विभाजीत करू नका" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "inetd पासून प्रेरीत" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "उपलब्ध आदेश ओळ पर्याय दर्शविण्याकरीता '%s --help' चालवा.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "स्तब्ध" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "अडथळा" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "बाहेर पडा" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "अवैध सूचना" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "शोध जतन करा" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "वगळा" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT त्रुटी" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "संख्यात्मक अपवाद" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "नष्ट करा" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "बस त्रुटी" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "अनैतिक विभागणी" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "प्रणाली कार्यपध्दतीकरीता खराब बाब" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "अवैध पाईप" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "सूचनात्मक घड्याळ" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "वगळा" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "सॉकेटवरील तातडीची परिस्थिती" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "थांबा" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "कळफलक अकार्यान्वीत" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "पुढे जा" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "उपकार्यांची स्थिती बदलली आहे" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "tty पासून पृष्ठभाग वाचन" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "tty कडे पृष्ठभाग लेखन" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O आता शक्य आहे" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU मर्यादा वाढल्या गेले" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "फाइल आकार मर्यादा पलीकडे" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "आभासी सूचनात्मक घड्याळ" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "सूचनात्मक घड्याळ संक्षिप्त चित्र बनवित आहे" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "चौकट आकार बदलवा" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "माहितीकरीता विनंती" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "वापरकर्ता व्याख्यीत संकेत 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "वापरकर्ता व्याख्यीत संकेत 2" + diff --git a/po/ms.gmo b/po/ms.gmo new file mode 100644 index 0000000..ed66a8d Binary files /dev/null and b/po/ms.gmo differ diff --git a/po/ms.po b/po/ms.po new file mode 100644 index 0000000..b3a849f --- /dev/null +++ b/po/ms.po @@ -0,0 +1,206 @@ +# [ Ruang untuk disewa ] +# Copyright (C) 2002 Free Software Foundation, Inc. +# Hasbullah Bin Pit (sebol), 2002. +msgid "" +msgstr "" +"Project-Id-Version: libgtop (libgtop-GNOME-2-0-port)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-09-25 18:15+0200\n" +"PO-Revision-Date: 2003-11-11 03:36+0800\n" +"Last-Translator: Hasbullah Bin Pit \n" +"Language-Team: Projek Gabai \n" +"Language: ms\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: lib/read.c:65 +#, fuzzy, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "baca saiz data" +msgstr[1] "baca saiz data" + +#: lib/read_data.c:53 +msgid "read data size" +msgstr "baca saiz data" + +#: lib/read_data.c:72 +#, fuzzy, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "baca saiz data" +msgstr[1] "baca saiz data" + +#: lib/write.c:52 +#, fuzzy, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "baca saiz data" +msgstr[1] "baca saiz data" + +#: src/daemon/gnuserv.c:460 +msgid "Enable debugging" +msgstr "Hidupkan pengnyahpepijatan" + +#: src/daemon/gnuserv.c:460 +msgid "DEBUG" +msgstr "NYAHPEPIJAT" + +#: src/daemon/gnuserv.c:462 +msgid "Enable verbose output" +msgstr "Hidupkan output berjela" + +#: src/daemon/gnuserv.c:462 +msgid "VERBOSE" +msgstr "BERJELA" + +#: src/daemon/gnuserv.c:464 +msgid "Don't fork into background" +msgstr "Jangan sepit ke latarbelakang" + +#: src/daemon/gnuserv.c:464 +msgid "NO-DAEMON" +msgstr "TIADA-DAEMON" + +#: src/daemon/gnuserv.c:466 +msgid "Invoked from inetd" +msgstr "Merujuk pada inetd" + +#: src/daemon/gnuserv.c:466 +msgid "INETD" +msgstr "INETD" + +#: src/daemon/gnuserv.c:500 +#, c-format +msgid "" +"Error on option %s: %s.\n" +"Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Ralat pada opsyen %s: %s.\n" +"Laksanakan '%s --help' untuk melihat senarai penuh opsyen arahan baris yang " +"ada.\n" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Hangup" +msgstr "Letak" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Interrupt" +msgstr "Gangguan" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Quit" +msgstr "Keluar" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Illegal instruction" +msgstr "Arahan terlarang" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Trace trap" +msgstr "Jerangkap Surih" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "Abort" +msgstr "Batal" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "EMT error" +msgstr "Ralat EMT" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Floating-point exception" +msgstr "Pengecualian Floating-point" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Kill" +msgstr "Bunuh" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Bus error" +msgstr "Ralat Bas" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Segmentation violation" +msgstr "" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Bad argument to system call" +msgstr "Hujah teruk ke panggilan sistem" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Broken pipe" +msgstr "Paip pecah" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Alarm clock" +msgstr "Jam loceng" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Termination" +msgstr "Penamatan" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Urgent condition on socket" +msgstr "Keadaan segera pada soket" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Stop" +msgstr "Henti" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Keyboard stop" +msgstr "Hentian papankekunci" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Continue" +msgstr "Teruskan" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Child status has changed" +msgstr "Status anak berubah" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background read from tty" +msgstr "Bacaan latar belakang daripada tty" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "Background write to tty" +msgstr "Penulisan latar belakang daripada tty" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "I/O now possible" +msgstr "I/O sekarang dibolehkan" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "CPU limit exceeded" +msgstr "CPU melebihi had" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "File size limit exceeded" +msgstr "Saiz fail melebihi had" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Virtual alarm clock" +msgstr "Jam loceng maya" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Profiling alarm clock" +msgstr "Memprofil jam loceng" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Window size change" +msgstr "Penukaran saiz tetingkap" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "Information request" +msgstr "Permintaan maklumat" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 1" +msgstr "Isyarat dinyatakan pengguna 1" + +#: sysdeps/osf1/siglist.c:58 sysdeps/sun4/siglist.c:58 +msgid "User defined signal 2" +msgstr "Isyarat dinyatakan pengguna 2" diff --git a/po/nb.gmo b/po/nb.gmo new file mode 100644 index 0000000..8351f1b Binary files /dev/null and b/po/nb.gmo differ diff --git a/po/nb.po b/po/nb.po new file mode 100644 index 0000000..077ed2e --- /dev/null +++ b/po/nb.po @@ -0,0 +1,189 @@ +# Norwegian bokmål translation for libgtop +# Copyright (C) 1998-2004 Free Software Foundation, Inc. +# Kjartan Maraas , 1998-2012. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop 2.28.x\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-01-28 16:53+0100\n" +"PO-Revision-Date: 2012-01-28 16:54+0100\n" +"Last-Translator: Kjartan Maraas \n" +"Language-Team: Norwegian bokmål \n" +"Language: nb\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "les %d byte" +msgstr[1] "les %d bytes" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "les størrelse på data" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "leste %lu byte med data" +msgstr[1] "leste %lu bytes med data" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "skrev %d byte" +msgstr[1] "skrev %d bytes" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "Slå på avlusing" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "Slå på utfyllende utskrift" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "Ikke forgren til bakgrunnen" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "Kalt fra inetd" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Kjør '%s --help' for å se en full liste av tilgjengelige " +"kommandolinjeflagg.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Frakobling" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Avbrudd" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Avslutt" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Ugyldig instruksjon" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Spor felle" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Aborter" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT-feil" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Flyttallsunntak" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Drep" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Buss-feil" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmentoverskridelse" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Ugyldig argument til systemkall" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Brukket rør" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarmklokke" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Terminering" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Viktig tilstand på socket" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Stopp" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Tastaturstopp" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Fortsett" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Barnets status er endret" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Lesing fra tty i bakgrunnen" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Skriving til tty i bakgrunnen" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O nå mulig" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU-grense oversteget" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Grense for filstørrelse overskredet" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtuell alarmklokke" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profilerer alarmklokken" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Endring i vindusstørrelse" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Informasjonsforespørsel" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Brukerdefinert signal 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Brukerdefinert signal 2" diff --git a/po/ne.gmo b/po/ne.gmo new file mode 100644 index 0000000..bcc243d Binary files /dev/null and b/po/ne.gmo differ diff --git a/po/ne.po b/po/ne.po new file mode 100644 index 0000000..beeec05 --- /dev/null +++ b/po/ne.po @@ -0,0 +1,199 @@ +# translation of libgtop.gnome-2-20.ne.po to Nepali +# Nepali Translation Project. +# This file is distributed under the same license as the libgtop package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# +# Pawan Chitrakar , 2004. +# Jaydeep Bhusal , 2005. +# Bishnu Adhikari , 2005. +# Shiva Pokharel , 2005. +# Mahesh subedi , 2006. +# Nabin Gautam , 2007. +msgid "" +msgstr "" +"Project-Id-Version: libgtop.gnome-2-20.ne\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-30 03:40+0100\n" +"PO-Revision-Date: 2007-12-19 12:53+0545\n" +"Last-Translator: Nabin Gautam \n" +"Language-Team: Nepali \n" +"Language: ne\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Nepali\n" +"X-Poedit-Country: NEPAL\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=n !=1\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d बाइट पढ्नुहोस्" +msgstr[1] "%d बाइट पढ्नुहोस्" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "डेटा साइज पढ्नुहोस्" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "डेटाको %lu बाइट पढ्नुहोस्" +msgstr[1] "डेटाको %lu बाइट पढ्नुहोस्" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d बाइट लेख्यो" +msgstr[1] "%d बाइट लेख्यो" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "डिबगिङ सक्षम पार्नुहोस्" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "भर्बोज निर्गत सक्षम पार्नुहोस्" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "पृष्ठभूमिमा बिभाजन नगर्नुहोस्" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "inetd बाट आह्वान गरिएको" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "उपलब्ध आदेश लाइन विकल्पको पूरै सूची हेर्न '%s --मद्दत' चलाउनुहोस् ।\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "ह्याङअप" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "रोकावट" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "अन्त्य गर्नुहोस्" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "अवैध निर्देशन" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "पदचिन्ह ट्रयाप" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "परित्याग गर्नुहोस्" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "इएमटी (EMT) त्रुटि" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "उत्प्लावन बिन्दु अपवाद" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "नष्ट गर्नुहोस्" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "बस त्रुटि" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "खण्डीकरण बिखण्डन" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "प्रणाली कलमा खराब तर्क" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "विच्छेद पाइप" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "सचेतक घडी" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "अन्त्य" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "सकेटमा आकस्मिक अवस्था" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "रोक्नुहोस्" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "कुञ्जिपाटी बन्द गर्नुहोस्" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "जारी राख्नुहोस्" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "चाइल्ड वस्तुस्थिति परिवर्तन गरिएको छ" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "tty बाट पृष्ठभूमि पढ्नुहोस्" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "tty मा पृष्ठभूमि लेख्नुहोस्" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O अब सम्भव छ" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "सीपीयू (CPU) सीमा नाघ्यो" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "फाइल साइज सीमा नाघ्यो" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "अवास्तविक सचेतक घडी" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "सचेतक घडीको प्रोफाइल हुँदैछ" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "सञ्झ्याल साइज परिवर्तन" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "सूचना अनुरोध" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "प्रयोगकर्ता परिभषित सङ्केत १" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "प्रयोगकर्ता परिभषित सङ्केत २" + diff --git a/po/nl.gmo b/po/nl.gmo new file mode 100644 index 0000000..cf09f85 Binary files /dev/null and b/po/nl.gmo differ diff --git a/po/nl.po b/po/nl.po new file mode 100644 index 0000000..4564029 --- /dev/null +++ b/po/nl.po @@ -0,0 +1,203 @@ +# Dutch translation of libgtop +# Copyright (C) 1998,1999 Free Software Foundation, Inc. +# Gert Dewit +# Jeroen van der Vegt , 2003 +# Tino Meinen , 2005 +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop CVS\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-07-17 18:54+0200\n" +"PO-Revision-Date: 2007-07-17 18:54+0200 \n" +"Last-Translator: Wouter Bolsterlee \n" +"Language-Team: Dutch \n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d byte gelezen" +msgstr[1] "%d bytes gelezen" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "grootte van de gelezen data" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu byte gelezen" +msgstr[1] "%lu bytes gelezen" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d byte geschreven" +msgstr[1] "%d bytes geschreven" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "Debuggen inschakelen" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "Extra uitvoer inschakelen" + +# niet naar achtergrond/niet naar achtergrond 'forken' +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "Niet naar de achtergrond 'forken'" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "Aangeroepen vanuit inetd" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "Start '%s --help' voor een lijst met opdrachtregelopties.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Ophangen" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Onderbreken" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Afsluiten" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Verboden instruktie" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Trace trap" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Afbreken" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT fout" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Floating-point uitzondering" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Vernietigen" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Busfout" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmentatiefout" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Verkeerd argument voor systeemaanroep" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Gebroken pipe" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Wekker" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Beëindiging" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Dringende situatie bij de socket" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Stoppen" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Keyboard stop" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Doorgaan" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "De status van de dochter is veranderd" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "In de achtergrond wordt tty uitgelezen" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "In de achtergrond wordt naar tty geschreven" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O is nu mogelijk" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Processor begrenzing overschreden" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Limiet bestandsomvang overschreden" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtuele wekker" + +# profileringswekker/profielwekker +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profiling-wekker" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Wijziging venstergrootte" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Verzoek om informatie" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Door gebruiker gedefinieerd signaal 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Door gebruiker gedefinieerd signaal 2" + +#~ msgid "DEBUG" +#~ msgstr "DEBUG" + +#~ msgid "VERBOSE" +#~ msgstr "VERBOSE" + +#~ msgid "NO-DAEMON" +#~ msgstr "NO-DEAMON" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/nn.gmo b/po/nn.gmo new file mode 100644 index 0000000..1c4c50c Binary files /dev/null and b/po/nn.gmo differ diff --git a/po/nn.po b/po/nn.po new file mode 100644 index 0000000..ca1ea09 --- /dev/null +++ b/po/nn.po @@ -0,0 +1,206 @@ +# translation of nn.po to Norwegian Nynorsk +# Norwegian (nynorsk) translation of libgtop. +# Copyright (C) 2001 Roy-Magne Mo +# +# Kjartan Maraas , 2001. +# Roy-Magne Mo , 2001. +# Åsmund Skjæveland , 2004. +# Åsmund Skjæveland , 2009. +msgid "" +msgstr "" +"Project-Id-Version: nn\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug." +"cgi?product=libgtop&component=general\n" +"POT-Creation-Date: 2009-05-25 20:29+0000\n" +"PO-Revision-Date: 2009-10-17 18:26+0200\n" +"Last-Translator: Åsmund Skjæveland \n" +"Language-Team: Norsk (nynorsk) \n" +"Language: nn\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 1.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "las %d byte" +msgstr[1] "las %d byte" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "lesestorleik på data" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "las %lu byte data" +msgstr[1] "las %lu byte data" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "skreiv %d byte" +msgstr[1] "skreiv %d byte" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "Skru på feilsøking" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "Skru på ordrike utdata" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "Ikkje fork av i bakgrunnen" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "Starta frå inetd" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Køyr «%s --help» for å sjå full liste over tilgjengelege kommandlinjeval.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Legg på" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Avbrot" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Avslutt" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Ulovleg instruksjon" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Sporingsfelle" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Avbryt" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT-feil" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Flyttalunntak" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Drep" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Bussfeil" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmenteringsovertramp" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Ugyldig argument til systemkall" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Brote røyr" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarmklokke" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Avslutting" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Hastesituasjon på sokkelen" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Stopp" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Tastaturstopp" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Hald fram" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Status på barn er endra" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Les frå tty i bakgrunnen" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Skriv til tty i bakgrunnen" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O no mogleg" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU-grense passert" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Filstorleikgrense passert" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtuell alarmklokke" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profilerer alarmklokke" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Endring i vindaugestorleik" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Informasjonsførespurnad" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Eigendefinert 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Eigendefinert 2" + +#~ msgid "DEBUG" +#~ msgstr "FEILSØK" + +#~ msgid "VERBOSE" +#~ msgstr "ORDRIK" + +#~ msgid "NO-DAEMON" +#~ msgstr "UTAN-NISSE" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/oc.gmo b/po/oc.gmo new file mode 100644 index 0000000..1b3ff65 Binary files /dev/null and b/po/oc.gmo differ diff --git a/po/oc.po b/po/oc.po new file mode 100644 index 0000000..c10218d --- /dev/null +++ b/po/oc.po @@ -0,0 +1,194 @@ +# Occitan translation of libgtop. +# Copyright (C) 1998-2004 Free Software Foundation, Inc. +# This file is distributed under the GNU General Public License Version 2. +# Cédric Valmary , 2015. +# Cédric Valmary (Tot en òc) , 2015. +# Cédric Valmary (totenoc.eu) , 2016. +msgid "" +msgstr "" +"Project-Id-Version: libgtop 2.9.91\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2016-05-05 20:08+0000\n" +"PO-Revision-Date: 2016-05-05 21:47+0200\n" +"Last-Translator: Cédric Valmary (totenoc.eu) \n" +"Language-Team: Tot En Òc\n" +"Language: oc\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Virtaal 0.7.1\n" +"X-Project-Style: gnome\n" + +#: ../lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d octet legit" +msgstr[1] "%d octets legits" + +#: ../lib/read_data.c:49 +msgid "read data size" +msgstr "talha de las donadas legidas" + +#: ../lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "lectura de %lu octet de donadas" +msgstr[1] "lectura de %lu octets de donadas" + +#: ../lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "escritura de %d octet" +msgstr[1] "escritura de %d octets" + +#: ../src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Activa lo desbugatge" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Activa la sortida verbosa" + +#: ../src/daemon/gnuserv.c:460 +msgid "Don't fork into background" +msgstr "Aviar pas en prètzfait de fons" + +#: ../src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Invocat a partir d'inetd" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Aviar « %s --help » per afichar la lista de las opcions de la linha de " +"comanda.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Hangup" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interrupcion" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Quitar" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Instruccion illegala" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Punt d'arrèst rencontrat" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Anullacion" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Error EMT" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Excepcion virgula flotanta" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Tuar" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Error bus" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Violacion de segmentacion" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Marrit argument d'apèl sistèma" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Tub copat" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarma de relòtge" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Senhal de fin" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Condicion urgenta sus socket" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Arrèst" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Arrèst dempuèi lo clavièr" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Contunhar" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "L'estat del filh a cambiat" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Lectura sus tty en rèireplan" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Escritura sus tty en rèireplan" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "E/S ara possibla" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Limit de temps CPU depassat" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Talha de fichièr excessiva" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Alarma virtuala" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Perfil de l'alarma" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Redimensionament de la fenèstra" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Demanda d'informacion" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Senhal utilizaire 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Senhal utilizaire 2" diff --git a/po/or.gmo b/po/or.gmo new file mode 100644 index 0000000..4e306c8 Binary files /dev/null and b/po/or.gmo differ diff --git a/po/or.po b/po/or.po new file mode 100644 index 0000000..f71fb32 --- /dev/null +++ b/po/or.po @@ -0,0 +1,195 @@ +# translation of or.po to Oriya +# Oriya translation of metacity.HEAD.pot. +# Copyright (C) 2004, 2006, 2009, Free Software Foundation, Inc. +# This file is distributed under the same license as the libgtop package. +# $Id: or.po,v 1.5 2006/03/21 18:44:20 gmohanty Exp $ +# +# Sony Mohanty , 2004. +# Jeeban , 2004. +# Gora Mohanty , 2006. +# Manoj Kumar Giri , 2009. +msgid "" +msgstr "" +"Project-Id-Version: or\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-11-07 14:35+0100\n" +"PO-Revision-Date: 2009-03-10 19:21+0530\n" +"Last-Translator: Manoj Kumar Giri \n" +"Language-Team: Oriya \n" +"Language: or\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d ବାଇଟ ପଢ଼ନ୍ତୁ" +msgstr[1] "%d ବାଇଟଗୁଡ଼ିକ ପଢ଼ନ୍ତୁ" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "ତଥ୍ଯ ଆକାର ପଢ଼ନ୍ତୁ" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu ବାଇଟ ପଢ଼ନ୍ତୁ" +msgstr[1] "%lu ବାଇଟଗୁଡ଼ିକ ପଢ଼ନ୍ତୁ" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d ବାଇଟ ଲେଖଗଲା" +msgstr[1] "%d ବାଇଟଗୁଡ଼ିକ ଲେଖାଗଲା" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "ତ୍ରୁଟିମୁକ୍ତ କରିବା ପାଇଁ ସମର୍ଥ" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "ଦୃଷ୍ଟ ସୂଚନାଯୁକ୍ତ ନିର୍ଗମ କରିବା ପାଇଁ ସକ୍ଷମ" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "ପୃଷ୍ଠଭୂମିକୁ ଶାଖାଯୁକ୍ତ କରନ୍ତୁ ନାହିଁ" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "ଆଇନେଟଡିରୁ ଡକାଯାଇଛି" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "ଉପଲବ୍ଧ ସମ୍ପୂର୍ଣ୍ଣ ପାଠ୍ଯ ନିର୍ଦ୍ଦେଶ ବିକଳ୍ପର ତାଲିକା ଦେଖିବା ପାଇଁ '%s --help' ଚଳାନ୍ତୁ.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "ସଂଯୋଗ ଛିନ୍ନ କରନ୍ତୁ" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "ବ୍ଯାହତ କରନ୍ତୁ" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "ବିଦାୟ ନିଅନ୍ତୁ" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "ଅବୈଧ ଅନୁଦେଶ" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "ଅନୁସନ୍ଧାନ ଯନ୍ତା" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "ପରିତ୍ଯାଗ" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "ଇ.ଏମ.ଟି. ତ୍ରୁଟି" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "ଅସ୍ଥାୟୀ ବିନ୍ଦୁ ତ୍ରୁଟି" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "ସମାପନ" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "ପରିପଥ ତ୍ରୁଟି" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "ଖଣ୍ଡକରଣ ଉଲଂଘନ" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "ତନ୍ତ୍ର ଡାକରାକୁ ଅବୈଧ ସ୍ବତନ୍ତ୍ରଚର" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "ଭଙ୍ଗା ପାଇପ" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "ସତର୍କ ଘଡ଼ି" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "ସମାପ୍ତି" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "ସକେଟରେ ଅତ୍ଯାଶ୍ଯକ ଅବସ୍ଥା" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "ବନ୍ଦ" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "ଚାବିପଟି ବନ୍ଦ" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "ଚାଲୁ ରଖନ୍ତୁ" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "ନିର୍ଭରକ ଅବସ୍ଥିତି ବଦଳି ଯାଇଛି" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "ଟି.ଟି.ୱାଇ.ଠାରୁ ପୃଷ୍ଠଭୂମି ପଠନ" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "ଟି.ଟି.ୱାଇ.କୁ ପୃଷ୍ଠଭୂମି ଲିଖନ" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "ବର୍ତ୍ତମାନ ନିବେଶ/ନିର୍ଗମ ସମ୍ଭବ" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "କେନ୍ଦ୍ରୀୟ ସଂସାଧକ ସୀମା ପାର ହୋଇଯାଇଛି" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "ଫାଇଲ ଆକାର ସୀମା ପାର ହୋଇଯାଇଛି" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "ଆଭାସୀ ସତର୍କ ଘଡ଼ି" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "ସତର୍କ ଘଡ଼ିର ରୂପରେଖ ପ୍ରସ୍ତୁତି" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "ୱିଣ୍ଡୋ ଆକାର ବଦଳା" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "ସୂଚନା ଅନୁରୋଧ" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "ଚାଳକ ନିର୍ଦ୍ଦିଷ୍ଟ ସଙ୍କେତ ୧" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "ଚାଳକ ନିର୍ଦ୍ଦିଷ୍ଟ ସଙ୍କେତ ୨" + diff --git a/po/pa.gmo b/po/pa.gmo new file mode 100644 index 0000000..15cfc8c Binary files /dev/null and b/po/pa.gmo differ diff --git a/po/pa.po b/po/pa.po new file mode 100644 index 0000000..f3457ad --- /dev/null +++ b/po/pa.po @@ -0,0 +1,203 @@ +# translation of libgtop.HEAD.po to Punjabi +# Punjabi translation of PACKAGE. +# Copyright (C) 2004 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# +# Amanpreet Singh Alam , 2004. +# A S Alam , 2004, 2005, 2007, 2009. +msgid "" +msgstr "" +"Project-Id-Version: libgtop.HEAD\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-11-07 14:35+0100\n" +"PO-Revision-Date: 2009-03-16 05:37+0000\n" +"Last-Translator: A S Alam \n" +"Language-Team: Punjabi/Panjabi \n" +"Language: pa\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 0.3\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d ਬਾਇਟ ਪੜ੍ਹੇ" +msgstr[1] "%d ਬਾਈਟ ਪੜ੍ਹੇ" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "ਡਾਟਾ ਆਕਾਰ ਪੜ੍ਹੇ" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu ਡਾਟਾ ਬਾਈਟ ਪੜ੍ਹੇ" +msgstr[1] "%lu ਡਾਟਾ ਬਾਈਟ ਪੜ੍ਹੇ" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d ਬਾਈਟ ਲਿਖੇ" +msgstr[1] "%d ਬਾਈਟ ਲਿਖੇ" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "ਡੀਬੱਗਇੰਗ ਚਾਲੂ ਕਰੋ" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "ਜਾਣਕਾਰੀ ਆਉਟਪੁੱਟ ਯੋਗ" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "ਬੈਕਗਰਾਊਂਡ 'ਚ ਫੋਰਕ" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "inetd ਤੋਂ ਸ਼ਾਮਿਲ ਹੈ" + +#: ../src/daemon/gnuserv.c:498, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "ਪੂਰੀ ਕਮਾਂਡ ਚੋਣ ਲਿਸਟ ਵੇਖਣ ਲਈ '%s --help' ਚਲਾਉ।\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "ਬੰਦ ਕਰੋ" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "ਰੁਕਾਵਟ" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "ਬਾਹਰ" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "ਗਲਤ ਹਦਾਇਤ" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "ਟਰੇਸ ਟਰੈਪ" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "ਅਧੂਰਾ ਛੱਡੋ" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT ਗਲਤੀ" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "ਦਸ਼ਮਲਵ ਅਪਵਾਦ" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "ਖਤਮ" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "ਬਸ ਗਲਤੀ" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "ਸਿਗਮੈਂਟੇਸ਼ਨ ਉਲੰਘਣਾ" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "ਸਿਸਟਮ ਕਾਲ ਲਈ ਗਲਤ ਆਰਗੂਮੈਂਟ" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "ਟੁੱਟਿਆ ਪਾਇਪ" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "ਆਲਰਮ ਘੜੀ" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "ਸਮਾਪਤੀ" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "ਸਾਕਟ ਲਈ ਜਰੂਰੀ ਸ਼ਰਤ" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "ਰੋਕੋ" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "ਕੀ-ਬੋਰਡ ਰੁੱਕ ਗਿਆ ਹੈ" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "ਜਾਰੀ ਰਹੋ" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "ਚਲਾਇਡ ਹਾਲਤ ਤਬਦੀਲ ਹੋਈ" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "tty ਤੋਂ ਬੈਕਗਰਾਊਂਡ ਪੜ੍ਹੋ" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "tty ਲਈ ਬੈਕਗਰਾਊਂਡ ਲਿਖੋ" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O ਹੁਣ ਸੰਭਵ" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU ਸੀਮਾ ਟੱਪੀ" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "ਫਾਇਲ ਆਕਾਰ ਸੀਮਾ ਟੱਪੀ" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "ਵੁਰਚੁਅਲ ਅਲਾਰਮ ਘੜੀ" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "ਅਲਾਰਮ ਘੜੀ ਰਾਹੀਂ ਪ੍ਰੋਫਾਇਲਿੰਗ" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "ਵਿੰਡੋ ਅਕਾਰ ਬਦਲੋ" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "ਜਾਣਕਾਰੀ ਲਈ ਬੇਨਤੀ" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "ਯੂਜ਼ਰ ਪ੍ਰਭਾਸ਼ਿਤ ਸਿਗਨਲ1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "ਯੂਜ਼ਰ ਪ੍ਰਭਾਸ਼ਿਤ ਸਿਗਨਲ 2" + +#~ msgid "DEBUG" +#~ msgstr "ਡੀਬੱਗ" + +#~ msgid "VERBOSE" +#~ msgstr "ਜਾਣਕਾਰੀ" + +#~ msgid "NO-DAEMON" +#~ msgstr "ਕੋਈ-ਡੇਮੋਨ ਨਹੀ" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/pl.gmo b/po/pl.gmo new file mode 100644 index 0000000..beacb8d Binary files /dev/null and b/po/pl.gmo differ diff --git a/po/pl.po b/po/pl.po new file mode 100644 index 0000000..738c86d --- /dev/null +++ b/po/pl.po @@ -0,0 +1,198 @@ +# Polish translation for libgtop. +# Copyright © 1999-2017 the libgtop authors. +# This file is distributed under the same license as the libgtop package. +# Zbigniew Chyla , 1999-2002. +# Artur Flinta , 2004-2007. +# Piotr Drąg , 2010-2017. +# Aviary.pl , 2010-2017. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:26+0000\n" +"PO-Revision-Date: 2017-04-07 13:44+0200\n" +"Last-Translator: Piotr Drąg \n" +"Language-Team: Polish \n" +"Language: pl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2);\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "odczytano %d bajt" +msgstr[1] "odczytano %d bajty" +msgstr[2] "odczytano %d bajtów" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "odczytano rozmiar danych" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "odczytano %lu bajt danych" +msgstr[1] "odczytano %lu bajty danych" +msgstr[2] "odczytano %lu bajtów danych" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "zapisano %d bajt" +msgstr[1] "zapisano %d bajty" +msgstr[2] "zapisano %d bajtów" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Włącza debugowanie" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Więcej informacji" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Bez przechodzenia w tło" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Wywołanie przez inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Polecenie „%s --help” wyświetli pełną listę dostępnych opcji wiersza " +"poleceń.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Zawieszenie" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Przerwanie" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Zakończenie" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Niedozwolona instrukcja" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Trace trap" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Przerwanie" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Błąd EMT" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Wyjątek związany z liczbą zmiennoprzecinkową" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Wymuszenie zakończenia" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Błąd magistrali" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Naruszenie ochrony pamięci" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Błędny parametr dla wywołania systemowego" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Uszkodzony potok" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Budzik" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Zakończenie" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Pilny warunek związany z gniazdem" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Zatrzymanie" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Zatrzymanie klawiatury" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Kontynuacja" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Zmiana stanu procesu potomnego" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Odczyt w tle z urządzenia TTY" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Zapis w tle do urządzenia TTY" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "Wejście/wyjście jest teraz dostępne" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Przekroczono ograniczenie procesora" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Przekroczono ograniczenie rozmiaru plików" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Wirtualny budzik" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profilowanie budzika" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Zmiana rozmiaru okna" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Żądanie informacji" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "1. sygnał określony przez użytkownika" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "2. sygnał określony przez użytkownika" diff --git a/po/pt.gmo b/po/pt.gmo new file mode 100644 index 0000000..9c60d31 Binary files /dev/null and b/po/pt.gmo differ diff --git a/po/pt.po b/po/pt.po new file mode 100644 index 0000000..316c872 --- /dev/null +++ b/po/pt.po @@ -0,0 +1,206 @@ +# libgtop's Portuguese Translation +# Copyright © 2001, 2002, 2003, 2004, 2005, 2007, 2013 libgtop +# Distributed under the same licence as the libgtop package +# Duarte Loreto , 2001, 2002, 2003, 2004, 2005, 2007, 2013. +# +# Pedro Albuquerque , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 3.8\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2014-02-08 10:53+0000\n" +"PO-Revision-Date: 2015-06-25 09:38+0100\n" +"Last-Translator: Pedro Albuquerque \n" +"Language-Team: Português \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Gtranslator 2.91.6\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d byte lido" +msgstr[1] "%d bytes lidos" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "tamanho dos dados lidos" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu byte de dados lido" +msgstr[1] "%lu bytes de dados lidos" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d byte escrito" +msgstr[1] "%d bytes escritos" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "Ativar depuração" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "Ativar resultados extensos" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "Não efetuar fork em fundo" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "Invocado pelo inetd" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Execute '%s --help' para consultar uma lista completa de opções de linha de " +"comando.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Pendurado" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interrompido" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Sair" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Instrução ilegal" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Armadilha de rasto" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Abortar" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Erro EMT" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Exceção de vírgula flutuante" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Matar" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Erro de bus" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Violação de segmentação" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Argumento inválido em chamada de sistema" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Canal interrompido" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarme" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Terminação" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Condição urgente no socket" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Parar" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Parar por teclado" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Continuar" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Alteração no estado do filho" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Leitura em fundo da tty" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Escrita em fundo para a tty" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "E/S agora possível" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Limite de CPU excedido" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Limite de tamanho de ficheiro excedido" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Alarme virtual" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Alarme de otimização" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Alteração de tamanho de janela" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Pedido de informação" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Sinal 1 definido pelo utilizador" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Sinal 2 definido pelo utilizador" + +#~ msgid "DEBUG" +#~ msgstr "DEPURAÇÃO" + +#~ msgid "VERBOSE" +#~ msgstr "EXTENSO" + +#~ msgid "NO-DAEMON" +#~ msgstr "NÃO-DAEMON" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/pt_BR.gmo b/po/pt_BR.gmo new file mode 100644 index 0000000..680f710 Binary files /dev/null and b/po/pt_BR.gmo differ diff --git a/po/pt_BR.po b/po/pt_BR.po new file mode 100644 index 0000000..b6968a7 --- /dev/null +++ b/po/pt_BR.po @@ -0,0 +1,211 @@ +# Brazilian Portuguese translation of libgtop. +# Copyright (C) 2001-2005 Free Software Foundation, Inc. +# This file is distributed under the same license as the libgtop package. +# E. A. Tacão , 2001. +# Evandro Fernandes Giovanini , 2004-2005. +# Og Maciel , 2007. +# Vladimir Melo +# Rafael Fontenelle , 2017. +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=libgto" +"p&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-09-03 11:58-0200\n" +"Last-Translator: Rafael Fontenelle \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Virtaal 1.0.0-beta1\n" +"X-Project-Style: gnome\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d byte lido" +msgstr[1] "%d bytes lidos" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "tamanho dos dados lidos" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu byte de dados lido" +msgstr[1] "%lu bytes de dados lidos" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d byte gravado" +msgstr[1] "%d bytes gravados" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Habilitar depuração" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Habilitar saída com mensagens detalhadas" + +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" +msgstr "Não bifurcar para o segundo plano" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Acionado pelo inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Execute “%s --help” para ver uma lista completa das opções de linha de " +"comando disponíveis.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Desligar" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Interromper" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Sair" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Instrução ilegal" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Rastrear interceptações" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Interromper" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Erro EMT" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Exceção de ponto flutuante" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Matar" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Erro do barramento" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Violação de segmentação" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Argumento inválido na chamada de sistema" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Conexão interrompida" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Despertador" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Terminação" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Condição urgente no soquete" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Parar" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Teclado parado" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Continuar" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Status do filho alterado" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Leitura de TTY em segundo plano" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Escrita para TTY em segundo plano" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "E/S possível agora" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Limite de CPU excedido" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Limite de tamenho de arquivo excedido" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Despertador virtual" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Personalizando despertador" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Alteração do tamanho da janela" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Requisição de informação" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Sinal 1 definido pelo usuário" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Sinal 2 definido pelo usuário" + +#~ msgid "DEBUG" +#~ msgstr "DEBUG" + +#~ msgid "VERBOSE" +#~ msgstr "VERBOSE" + +#~ msgid "NO-DAEMON" +#~ msgstr "NO-DAEMON" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/quot.sed b/po/quot.sed new file mode 100644 index 0000000..0122c46 --- /dev/null +++ b/po/quot.sed @@ -0,0 +1,6 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g diff --git a/po/remove-potcdate.sin b/po/remove-potcdate.sin new file mode 100644 index 0000000..2436c49 --- /dev/null +++ b/po/remove-potcdate.sin @@ -0,0 +1,19 @@ +# 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 +} diff --git a/po/ro.gmo b/po/ro.gmo new file mode 100644 index 0000000..3a79d90 Binary files /dev/null and b/po/ro.gmo differ diff --git a/po/ro.po b/po/ro.po new file mode 100644 index 0000000..b7d3038 --- /dev/null +++ b/po/ro.po @@ -0,0 +1,192 @@ +# Romanian translation for libgtop +# Copyright (C) 2003 - 2009, Free Software Foundation, Inc. +# Mișu Moldovan , 2003 - 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-13 08:49+0100\n" +"PO-Revision-Date: 2009-09-20 00:44+0300\n" +"Last-Translator: Mișu Moldovan \n" +"Language-Team: Romanian \n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3;plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?" +"2:1))\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "s-a citit un octet" +msgstr[1] "s-au citit %d octeți" +msgstr[2] "s-au citit %d de octeți" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "mărime date citite" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "s-a citit un octet de date" +msgstr[1] "s-au citit %lu octeți de date" +msgstr[2] "s-au citit %lu de octeți de date" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "s-a scris un octet" +msgstr[1] "s-au scris %d octeți" +msgstr[2] "s-au scris %d de octeți" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "Activează depanarea" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "Mesaje de ieșire explicite" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "Nu clona în fundal" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "Pornit de inetd" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "Încercați „%s --help” pentru a vedea o listă completă a opțiunilor.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Terminare" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Întrerupere" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Ieșire" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Instrucțiune ilegală" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Punct de oprire întâlnit" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Renunță" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Eroare EMT" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Excepție în virgulă mobilă" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Omoară" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Eroare de bus" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Violare a segmentului" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Argument greșit în apelul de sistem" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Filtru nefuncțional" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Ceas de alarmă" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Terminare" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Condiție de urgență în socket" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Stop" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Întrerupere de la tastatură" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Continuă" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Starea copilului s-a schimbat" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Citire în fundal de la tty" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Scriere în fundal către tty" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "Operațiile I/O sunt acum posibile" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Limită depășită CPU" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Limită depășită mărime fișier" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Ceas de alarmă virtual" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Ceas de alarmă pentru „profiling”" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Schimbare de mărime a ferestrei" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Cerere de informație" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Semnal 1 definit de utilizator" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Semnal 2 definit de utilizator" + diff --git a/po/ru.gmo b/po/ru.gmo new file mode 100644 index 0000000..a7b0861 Binary files /dev/null and b/po/ru.gmo differ diff --git a/po/ru.po b/po/ru.po new file mode 100644 index 0000000..a4e9f60 --- /dev/null +++ b/po/ru.po @@ -0,0 +1,196 @@ +# Russian translation for libgtop +# +# Copyright (C) 1999, 2005 Free Software Foundation, Inc. +# Valek Filippov , 1999. +# Dmitry G. Mastrukov , 2004. +# Leonid Kanter , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop trunk\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-05 19:11+0400\n" +"PO-Revision-Date: 2007-09-05 15:01+0200\n" +"Last-Translator: Nickolay V. Shmyrev \n" +"Language-Team: Russian \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "прочитан %d байт" +msgstr[1] "прочитано %d байта" +msgstr[2] "прочитано %d байтов" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "размер прочитанных данных" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "прочитан %lu байт данных" +msgstr[1] "прочитано %lu байта данных" +msgstr[2] "прочитано %lu байт данных" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "записан %d байт" +msgstr[1] "записано %d байта" +msgstr[2] "записано %d байт" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "Включить отладку" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "Включить подробный вывод" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "Не разветвлять в фоновый режим" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "Вызван из inetd" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Используйте \"%s --help\", чтобы увидеть полный список допустимых параметров " +"командной строки.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Разорвать" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Прервать" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Выйти" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Недопустимая инструкция" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Захват трассировки" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Прекратить" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Ошибка EMT" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Исключение плавающей точки" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Убить" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Ошибка шины" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Нарушение сегментации" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Неверный аргумент в системном вызове" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Нарушенный канал" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Таймер" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Завершение" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Требующие внимания условия сокета" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Остановить" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Останов клавиатуры" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Продолжить" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Состояние потомка было изменено" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Фоновое чтение из tty" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Фоновая запись в tty" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "Сейчас возможен ввод/вывод" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Превышен предел ЦПУ" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Превышен предел размера файла" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Виртуальный таймер" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Профилированный таймер" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Изменение размера окна" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Запрос информации" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Сигнал пользователя 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Сигнал пользователя 2" diff --git a/po/rw.gmo b/po/rw.gmo new file mode 100644 index 0000000..49d18e1 Binary files /dev/null and b/po/rw.gmo differ diff --git a/po/rw.po b/po/rw.po new file mode 100644 index 0000000..2e9a2f0 --- /dev/null +++ b/po/rw.po @@ -0,0 +1,234 @@ +# translation of libgtop to Kinyarwanda. +# Copyright (C) 2005 Free Software Foundation, Inc. +# This file is distributed under the same license as the libgtop package. +# Steve Murphy , 2005 +# Steve performed initial rough translation from compendium built from translations provided by the following translators: +# Philibert Ndandali , 2005. +# Viateur MUGENZI , 2005. +# Noëlla Mupole , 2005. +# Carole Karema , 2005. +# JEAN BAPTISTE NGENDAHAYO , 2005. +# Augustin KIBERWA , 2005. +# Donatien NSENGIYUMVA , 2005.. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop 2.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-09-25 18:15+0200\n" +"PO-Revision-Date: 2005-03-28 19:35-0700\n" +"Last-Translator: Steve Murphy \n" +"Language-Team: Kinyarwanda \n" +"Language: rw\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: lib/read.c:65 +#, fuzzy, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "Gusoma Bayite" + +#: lib/read_data.c:53 +#, fuzzy +msgid "read data size" +msgstr "Gusoma Ibyatanzwe Ingano" + +#: lib/read_data.c:72 +#, fuzzy, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "Gusoma Bayite Bya Ibyatanzwe" + +#: lib/write.c:52 +#, fuzzy, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "Bayite" + +#: src/daemon/gnuserv.c:460 +msgid "Enable debugging" +msgstr "" + +# Debug menu items +#: src/daemon/gnuserv.c:460 +#, fuzzy +msgid "DEBUG" +msgstr "Kosora amakosa" + +#: src/daemon/gnuserv.c:462 +#, fuzzy +msgid "Enable verbose output" +msgstr "Ibisohoka" + +#: src/daemon/gnuserv.c:462 +msgid "VERBOSE" +msgstr "" + +#: src/daemon/gnuserv.c:464 +#, fuzzy +msgid "Don't fork into background" +msgstr "Mbuganyuma" + +#: src/daemon/gnuserv.c:464 +msgid "NO-DAEMON" +msgstr "" + +#: src/daemon/gnuserv.c:466 +#, fuzzy +msgid "Invoked from inetd" +msgstr "Bivuye" + +#: src/daemon/gnuserv.c:466 +msgid "INETD" +msgstr "" + +#: src/daemon/gnuserv.c:500 +#, fuzzy, c-format +msgid "" +"Error on option %s: %s.\n" +"Run '%s --help' to see a full list of available command line options.\n" +msgstr "ku Ihitamo Kuri a Urutonde Bya Bihari Komandi: Umurongo Amahitamo" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Hangup" +msgstr "" + +# 3225 +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Interrupt" +msgstr "Hagarikira aho" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Quit" +msgstr "Kuvamo" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Illegal instruction" +msgstr "" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Trace trap" +msgstr "" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "Abort" +msgstr "Ntibyakunze" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +#, fuzzy +msgid "EMT error" +msgstr "Ikosa" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +#, fuzzy +msgid "Floating-point exception" +msgstr "Akadomo Irengayobora(-)" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Kill" +msgstr "" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +#, fuzzy +msgid "Bus error" +msgstr "Ikosa" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Segmentation violation" +msgstr "" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +#, fuzzy +msgid "Bad argument to system call" +msgstr "Kuri Sisitemu" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Broken pipe" +msgstr "" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Alarm clock" +msgstr "" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Termination" +msgstr "" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +#, fuzzy +msgid "Urgent condition on socket" +msgstr "Ibisabwa ku" + +# basctl/source\basicide\basidesh.src:RID_BASICIDE_OBJECTBAR.SID_BASICSTOP.text +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Stop" +msgstr "Guhagarara" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +#, fuzzy +msgid "Keyboard stop" +msgstr "Guhagarara" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Continue" +msgstr "Gukomeza" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +#, fuzzy +msgid "Child status has changed" +msgstr "Imimerere Byahinduwe" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +#, fuzzy +msgid "Background read from tty" +msgstr "Gusoma Bivuye" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +#, fuzzy +msgid "Background write to tty" +msgstr "Kuri" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +#, fuzzy +msgid "I/O now possible" +msgstr "NONEAHA" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "CPU limit exceeded" +msgstr "" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +#, fuzzy +msgid "File size limit exceeded" +msgstr "Idosiye Ingano" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Virtual alarm clock" +msgstr "" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Profiling alarm clock" +msgstr "" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +#, fuzzy +msgid "Window size change" +msgstr "Ingano Guhindura>>" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +#, fuzzy +msgid "Information request" +msgstr "Kubaza..." + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +#, fuzzy +msgid "User defined signal 1" +msgstr "1." + +#: sysdeps/osf1/siglist.c:58 sysdeps/sun4/siglist.c:58 +#, fuzzy +msgid "User defined signal 2" +msgstr "2." diff --git a/po/sk.gmo b/po/sk.gmo new file mode 100644 index 0000000..cd1fb6e Binary files /dev/null and b/po/sk.gmo differ diff --git a/po/sk.po b/po/sk.po new file mode 100644 index 0000000..7f013fd --- /dev/null +++ b/po/sk.po @@ -0,0 +1,197 @@ +# libgtop sk.po +# Copyright (C) 2001, 2002, 2003, 2004, 2008 Free Software Foundation, Inc. +# Marcel Telka , 2001, 2002, 2003, 2004, 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-09-02 10:17+0200\n" +"Last-Translator: Dušan Kazik \n" +"Language-Team: Slovak \n" +"Language: sk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural= (n==1) ? 1 : (n>=2 && n<=4) ? 2 : " +"0;\n" +"X-Generator: Poedit 2.0.3\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "načítaných %d bajtov" +msgstr[1] "načítaný %d bajt" +msgstr[2] "načítané %d bajty" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "veľkosť načítaných dát" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "načítaných %lu bajtov dát" +msgstr[1] "načítaný %lu bajt dát" +msgstr[2] "načítané %lu bajty dát" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "zapísaných %d bajtov" +msgstr[1] "zapísaný %d bajt" +msgstr[2] "zapísané %d bajty" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Povoliť ladenie" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Povoliť detailný výpis" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Nerozvetvovať do pozadia" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Vyvolaný cez inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "" +"Run “%s --help” to see a full list of available command line " +"options.\n" +msgstr "" +"Spustite '%s --help', aby ste videli úplný zoznam dostupných volieb " +"príkazového riadku.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Zavesenie" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Prerušenie" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Ukončiť" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Neplatná inštrukcia" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Ladiaci bod" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Prerušiť" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Chyba EMT" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Výnimka pri práci s pohyblivou rádovou čiarkou" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Zabiť" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Chyba na spoji" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Chyba segmentácie" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Nesprávny argument v systémvom volaní" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Prerušená rúra" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Budík" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Ukončenie" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Naliehavá situácia na zásuvke" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Zastaviť" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Prerušenie klávesnice" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Pokračovanie" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Stav potomka bol zmenený" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Čítanie z tty na pozadí" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Zápis do tty na pozadí" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "V/V je možné" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Prekročený limit procesora" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Prekročený limit veľkosti súboru" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtuálny budík" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Nastavenie budíka" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Zmena veľkosti okna" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Požiadavka na informáciu" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Používateľom definovaný signál 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Používateľom definovaný signál 2" diff --git a/po/sl.gmo b/po/sl.gmo new file mode 100644 index 0000000..8deae38 Binary files /dev/null and b/po/sl.gmo differ diff --git a/po/sl.po b/po/sl.po new file mode 100644 index 0000000..a6e041a --- /dev/null +++ b/po/sl.po @@ -0,0 +1,200 @@ +# Slovenian translations for libgtop. +# Copyright (C) 2005-2006 Free Software Foundation, Inc. +# This file is distributed under the same license as the libgtop package. +# +# Andraž Tori , 2000. +# Matic Žgur , 2006. +# Matej Urbančič , 2007–2017. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop master\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-05-05 13:58+0200\n" +"PO-Revision-Date: 2017-05-05 13:58+0200\n" +"Last-Translator: Matej Urbančič \n" +"Language-Team: Slovenian \n" +"Language: sl_SI\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Generator: Poedit 2.0.1\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "prebranih %d bajtov" +msgstr[1] "prebran %d bajt" +msgstr[2] "prebrana %d bajta" +msgstr[3] "prebrani %d bajti" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "prebrana velikost podatkov" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "prebranih %lu bajtov podatkov" +msgstr[1] "prebran %lu bajt podatkov" +msgstr[2] "prebrana %lu bajta podatkov" +msgstr[3] "prebrani %lu bajti podatkov" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "zapisanih %d bajtov" +msgstr[1] "zapisan %d bajt" +msgstr[2] "zapisana %d bajta" +msgstr[3] "zapisani %d bajti" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Omogoči razhroščevanje" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Omogoči podroben izpis" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Ne razveji v ozadje" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Poklican s programom inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "Za popoln seznam možnosti ukazne vrstice zaženite '%s --help'.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Odloži" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Prekinitev" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Končaj" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Neveljaven ukaz" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Past sledenja" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Prekliči" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Napaka EMT" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Izjema plavajoče vejice" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Uniči" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Napaka vodila" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Napaka razčlenjevanja" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Slab argument za sistemski klic" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Pretrgana cev" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Budilka" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Zaključek" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Nujno stanje na vtiču" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Zaustavi" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Zaustavitev tipkovnice" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Nadaljuj" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Stanje podrejenega procesa se je spremenilo" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Branje s tty v ozadju" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Pisanje na tty v ozadju" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "V/I je sedaj mogoč" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Prekoračena omejitev CPE" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Prekoračena omejitev dolžine datoteke" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Navidezna budilka" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Budilka profiliranja" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Sprememba velikosti okna" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Zahteva po podatkih" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Uporabniško določen signal 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Uporabniško določen signal 2" diff --git a/po/sq.gmo b/po/sq.gmo new file mode 100644 index 0000000..07cc7dd Binary files /dev/null and b/po/sq.gmo differ diff --git a/po/sq.po b/po/sq.po new file mode 100644 index 0000000..cf5e037 --- /dev/null +++ b/po/sq.po @@ -0,0 +1,189 @@ +# Përkthimi i mesazheve të libgtop në shqip +# This file is distributed under the same license as the libgtop package. +# Copyright (C) 2003-2008 Free Software Foundation, Inc. +# +# Laurent Dhima , 2003-2008. +msgid "" +msgstr "" +"Project-Id-Version: libgtop HEAD\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-05-14 03:41+0100\n" +"PO-Revision-Date: 2008-09-20 12:25+0200\n" +"Last-Translator: Laurent Dhima \n" +"Language-Team: albanian \n" +"Language: sq\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "u lexua %d byte" +msgstr[1] "u lexuan %d bytes" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "madhësia e të dhënave të lexuara" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "u lexua %lu byte me të dhëna" +msgstr[1] "u lexuan %lu bytes me të dhëna" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "u shkrua %d byte" +msgstr[1] "u shkruan %d bytes" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "Aktivo proçesin e kontrollit" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "Aktivo output e hollësishëm" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "Mos kryej fork në background" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "Thërritur nga inetd" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "Zbato '%s --help' për të shikuar listën e plotë të opsioneve të komandës.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Mbylle" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Ndërprit" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Dalja" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Instruktim ilegal" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Merr gjurmët" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Anullo" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Gabim EMT" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Floating-point exception" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Vrit" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Gabim i bus" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Violim i segmentimit" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Argument i gabuar në thirrjen e sistemit" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Pipe e ndërprerë" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarmi" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Përfundimi" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Konditë urgjente në socket " + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Ndal" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Ndalim nga tastiera" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Vazhdo" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Gjendja e birit ka ndryshuar" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Lexim në sfond nga tty" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Shkrim në sfond tek tty" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O tashmë e mundshme" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Limiti i CPU është tejkaluar" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Limiti i madhësisë së file është tejkaluar" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Alarm virtual" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Duke profiluar orën e alarmit" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Ndryshimi i madhësisë së dritares" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Kërkesë informacioni" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Sinjal 1 i përcaktuar nga përdoruesi" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Sinjal 2 i përcaktuar nga përdoruesi" + diff --git a/po/sr.gmo b/po/sr.gmo new file mode 100644 index 0000000..8eada33 Binary files /dev/null and b/po/sr.gmo differ diff --git a/po/sr.po b/po/sr.po new file mode 100644 index 0000000..7a72d54 --- /dev/null +++ b/po/sr.po @@ -0,0 +1,215 @@ +# Serbian translation of libgtop +# Courtesy of Prevod.org team (http://prevod.org/) -- 2003—2017. +# This file is distributed under the same license as the libgtop package. +# Бранко Ивановић +# Данило Шеган , 2005-03-06 +# Мирослав Николић , 2017. +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=libgto" +"p&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-08-14 21:53+0200\n" +"Last-Translator: Мирослав Николић \n" +"Language-Team: српски \n" +"Language: sr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=n==1? 3 : n%10==1 && n%100!=11 ? 0 : " +"n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Project-Style: gnome\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "прочитан је %d бајт" +msgstr[1] "прочитана су %d бајта" +msgstr[2] "прочитано је %d бајтова" +msgstr[3] "прочитан је један бајт" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "величина прочитаних података" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "прочитан је %lu бајт података" +msgstr[1] "прочитана су %lu бајта података" +msgstr[2] "прочитано је %lu бајтова података" +msgstr[3] "прочитан је један бајт података" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "уписан је %d бајт" +msgstr[1] "уписана су %d бајта" +msgstr[2] "уписано је %d бајтова" +msgstr[3] "уписан је један бајт" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Укључује исправљање грешака" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Укључује детаљни приказ" + +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" +msgstr "Не исцепљује у позадини" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Покренуто из „inetd“-а" + +#: src/daemon/gnuserv.c:498 +#, c-format +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Покрените „%s --help“ да видите читав списак доступних опција линије наредби." +"\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Обустави" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Прекини" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Изађи" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Неисправна инструкција" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Прати замку" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Одустани" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "ЕМТ грешка" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Изузетак са покретним зарезом" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Убиј" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Грешка у магистрали" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Погрешан приступ меморији (segv)" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Лош аргумент системског позива" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Оштећена спојка" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Будилник" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Окончање" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Критично стање утичнице" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Стани" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Заустави тастатуру" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Настави" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Стање порода се променило" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Позадинско читање са „tty“" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Позадинско писање на „tty“" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "У/И је сада могућ" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Прекорачено је ограничење процесора" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Прекорачено је ограничење величине датотеке" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Виртуелни будилник" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Профилисање будилника" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Промена величине прозора" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Захтев за информацијама" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Кориснички дефинисан сигнал 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Кориснички дефинисан сигнал 2" + +#~ msgid "DEBUG" +#~ msgstr "ИСПРАВЉАЊЕ ГРЕШАКА" + +#~ msgid "VERBOSE" +#~ msgstr "ДЕТАЉНО" + +#~ msgid "NO-DAEMON" +#~ msgstr "БЕЗ-УСЛУГЕ" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/sr@latin.gmo b/po/sr@latin.gmo new file mode 100644 index 0000000..21be34a Binary files /dev/null and b/po/sr@latin.gmo differ diff --git a/po/sr@latin.po b/po/sr@latin.po new file mode 100644 index 0000000..ce721b6 --- /dev/null +++ b/po/sr@latin.po @@ -0,0 +1,215 @@ +# Serbian translation of libgtop +# Courtesy of Prevod.org team (http://prevod.org/) -- 2003—2017. +# This file is distributed under the same license as the libgtop package. +# Branko Ivanović +# Danilo Šegan , 2005-03-06 +# Miroslav Nikolić , 2017. +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=libgto" +"p&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-08-14 21:53+0200\n" +"Last-Translator: Miroslav Nikolić \n" +"Language-Team: srpski \n" +"Language: sr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=n==1? 3 : n%10==1 && n%100!=11 ? 0 : " +"n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Project-Style: gnome\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "pročitan je %d bajt" +msgstr[1] "pročitana su %d bajta" +msgstr[2] "pročitano je %d bajtova" +msgstr[3] "pročitan je jedan bajt" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "veličina pročitanih podataka" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "pročitan je %lu bajt podataka" +msgstr[1] "pročitana su %lu bajta podataka" +msgstr[2] "pročitano je %lu bajtova podataka" +msgstr[3] "pročitan je jedan bajt podataka" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "upisan je %d bajt" +msgstr[1] "upisana su %d bajta" +msgstr[2] "upisano je %d bajtova" +msgstr[3] "upisan je jedan bajt" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Uključuje ispravljanje grešaka" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Uključuje detaljni prikaz" + +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" +msgstr "Ne iscepljuje u pozadini" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Pokrenuto iz „inetd“-a" + +#: src/daemon/gnuserv.c:498 +#, c-format +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Pokrenite „%s --help“ da vidite čitav spisak dostupnih opcija linije naredbi." +"\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Obustavi" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Prekini" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Izađi" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Neispravna instrukcija" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Prati zamku" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Odustani" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT greška" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Izuzetak sa pokretnim zarezom" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Ubij" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Greška u magistrali" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Pogrešan pristup memoriji (segv)" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Loš argument sistemskog poziva" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Oštećena spojka" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Budilnik" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Okončanje" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Kritično stanje utičnice" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Stani" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Zaustavi tastaturu" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Nastavi" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Stanje poroda se promenilo" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Pozadinsko čitanje sa „tty“" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Pozadinsko pisanje na „tty“" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "U/I je sada moguć" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Prekoračeno je ograničenje procesora" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Prekoračeno je ograničenje veličine datoteke" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Virtuelni budilnik" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profilisanje budilnika" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Promena veličine prozora" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Zahtev za informacijama" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Korisnički definisan signal 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Korisnički definisan signal 2" + +#~ msgid "DEBUG" +#~ msgstr "ISPRAVLJANJE GREŠAKA" + +#~ msgid "VERBOSE" +#~ msgstr "DETALJNO" + +#~ msgid "NO-DAEMON" +#~ msgstr "BEZ-USLUGE" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/stamp-po b/po/stamp-po new file mode 100644 index 0000000..9788f70 --- /dev/null +++ b/po/stamp-po @@ -0,0 +1 @@ +timestamp diff --git a/po/sv.gmo b/po/sv.gmo new file mode 100644 index 0000000..f031a7a Binary files /dev/null and b/po/sv.gmo differ diff --git a/po/sv.po b/po/sv.po new file mode 100644 index 0000000..bbfe574 --- /dev/null +++ b/po/sv.po @@ -0,0 +1,503 @@ +# Swedish messages for libgtop. +# Copyright © 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2017 Free Software Foundation, Inc. +# Daniel Nylander , 2007. +# Tomas Ögren , 1999. +# Martin Norbäck , 2000. +# Christian Rose , 2002, 2003, 2004. +# Anders Jonsson , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-04-07 21:10+0200\n" +"Last-Translator: Anders Jonsson \n" +"Language-Team: Swedish \n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.8.11\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "läste %d byte" +msgstr[1] "läste %d byte" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "läste datastorlek" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "läste %lu byte data" +msgstr[1] "läste %lu byte data" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "skrev %d byte" +msgstr[1] "skrev %d byte" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Aktivera felsökning" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Aktivera utförlig utskrift" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Grena inte i bakgrunden" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Startad från inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "" +"Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Kör ”%s --help” för att se hela listan över tillgängliga " +"kommandoradsflaggor.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Avringd" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Avbruten" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Lämnad" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Otillåten instruktion" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Spårningsfälla" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Avbruten (SIGABRT)" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Emulatorfälla" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Aritmetiskt fel" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Dödad" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Bussfel" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Segmenteringsfel" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Felaktigt argument till systemanrop" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Brutet rör" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarmklocka" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Avslutad" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Viktigt I/O-tillstånd" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Stoppad (signal)" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Stoppad" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Återupptagen" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Barnstatus ändrad" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Stoppad (terminalläsning)" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Stoppad (terminalskrivning)" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O möjligt" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Begränsning av CPU-tid överskriden" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Begränsning av filstorlek överskriden" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Alarmklocka - virtuell tid" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Profileringsklocka" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Ändrat fönster" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Informationsbegäran" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Användarsignal 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Användarsignal 2" + +#~ msgid "DEBUG" +#~ msgstr "FELSÖK" + +#~ msgid "VERBOSE" +#~ msgstr "UTFÖRLIG" + +#~ msgid "NO-DAEMON" +#~ msgstr "INGEN-DEMON" + +#~ msgid "INETD" +#~ msgstr "INETD" + +#~ msgid "Ticks (%ld per second):" +#~ msgstr "Tick (%ld per sekund):" + +#~ msgid "Total" +#~ msgstr "Totalt" + +#~ msgid "User" +#~ msgstr "Användare" + +#~ msgid "Nice" +#~ msgstr "Nice" + +#~ msgid "Sys" +#~ msgstr "Sys" + +#~ msgid "Idle" +#~ msgstr "Ledigt" + +#~ msgid "" +#~ "CPU (0x%08lx): %12.0f %12.0f %12.0f %12.0f %12.0f\n" +#~ "\n" +#~ msgstr "" +#~ "CPU (0x%08lx): %12.0f %12.0f %12.0f %12.0f %12.0f\n" +#~ "\n" + +#~ msgid "CPU %3d (0x%08lx): %12lu %12lu %12lu %12lu %12lu\n" +#~ msgstr "CPU %3d (0x%08lx): %12lu %12lu %12lu %12lu %12lu\n" + +#~ msgid "Percent:" +#~ msgstr "Procent:" + +#~ msgid "Total (%)" +#~ msgstr "Totalt (%)" + +#~ msgid "User (%)" +#~ msgstr "Användare (%)" + +#~ msgid "Nice (%)" +#~ msgstr "Nice (%)" + +#~ msgid "Sys (%)" +#~ msgstr "Sys (%)" + +#~ msgid "Idle (%)" +#~ msgstr "Ledig (%)" + +#~ msgid "" +#~ "CPU (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n" +#~ "\n" +#~ msgstr "" +#~ "CPU (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n" +#~ "\n" + +#~ msgid "CPU %3d (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n" +#~ msgstr "CPU %3d (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n" + +#~ msgid "Spin:" +#~ msgstr "Spinn:" + +#~ msgid "read data %lu byte" +#~ msgid_plural "read data %lu bytes" +#~ msgstr[0] "läste data %lu byte" +#~ msgstr[1] "läste data %lu byte" + +#~ msgid "write %d byte" +#~ msgid_plural "write %d bytes" +#~ msgstr[0] "skriv %d byte" +#~ msgstr[1] "skriv %d byte" + +#~ msgid "Total CPU Time" +#~ msgstr "Total processortid" + +#~ msgid "CPU Time in User Mode" +#~ msgstr "Processortid i användarläge" + +#~ msgid "CPU Time in User Mode (nice)" +#~ msgstr "Processortid i användarläge (nice)" + +#~ msgid "CPU Time in System Mode" +#~ msgstr "Processortid i systemläge" + +#~ msgid "CPU Time in the Idle Task" +#~ msgstr "Processortid i Idle Task" + +#~ msgid "Tick Frequency" +#~ msgstr "Tickfrekvens" + +#~ msgid "SMP Total CPU Time" +#~ msgstr "SMP total processortid" + +#~ msgid "SMP CPU Time in User Mode" +#~ msgstr "SMP processortid i användarläge" + +#~ msgid "SMP CPU Time in User Mode (nice)" +#~ msgstr "SMP processortid i användarläge (nice)" + +#~ msgid "SMP CPU Time in System Mode" +#~ msgstr "SMP processortid i systemläge" + +#~ msgid "SMP CPU Time in the Idle Task" +#~ msgstr "SMP processortid i Idle Task" + +#~ msgid "SMP CPU Flags" +#~ msgstr "SMP-processorflaggor" + +#~ msgid "Number of clock ticks since system boot" +#~ msgstr "Antal klocktick sedan systemstart" + +#~ msgid "Number of clock ticks the system spent in user mode" +#~ msgstr "Antal klocktick systemet har använt i användarläge" + +#~ msgid "Number of clock ticks the system spent in user mode (nice)" +#~ msgstr "Antal klocktick systemet har använt i användarläge (nice)" + +#~ msgid "Number of clock ticks the system spent in system mode" +#~ msgstr "Antal klocktick systemet har använt i systemläge" + +#~ msgid "Number of clock ticks the system spent in the idle task" +#~ msgstr "Antal klocktick systemet har använt i Idle Task" + +#~ msgid "Tick frequency (default is 100)" +#~ msgstr "Tickfrekvens (standard är 100)" + +#~ msgid "Bit field indicating which CPU is currently running" +#~ msgstr "Bitfält som indikerar vilken processor som för tillfället körs" + +#~ msgid "Total blocks" +#~ msgstr "Totalt antal block" + +#~ msgid "Free blocks" +#~ msgstr "Fria block" + +#~ msgid "Available blocks" +#~ msgstr "Tillgängliga block" + +#~ msgid "Total file nodes" +#~ msgstr "Totalt antal filnoder" + +#~ msgid "Free file nodes" +#~ msgstr "Fria filnoder" + +#~ msgid "Block size" +#~ msgstr "Blockstorlek" + +#~ msgid "Free blocks available to the superuser" +#~ msgstr "Fria block tillgängliga för superanvändaren" + +#~ msgid "Free blocks available to non-superusers" +#~ msgstr "Fria block tillgängliga för icke-superanvändare" + +#~ msgid "Load Average" +#~ msgstr "Medellast" + +#~ msgid "Running Tasks" +#~ msgstr "Körande program" + +#~ msgid "Number of Tasks" +#~ msgstr "Antal program" + +#~ msgid "Last PID" +#~ msgstr "Sista PID" + +#~ msgid "" +#~ "Number of jobs running simultaneously averaged over 1, 5 and 15 minutes" +#~ msgstr "Antal samtidigt körande jobb med medel över 1, 5 och 15 minuter" + +#~ msgid "Number of tasks currently running" +#~ msgstr "Antal jobb som körs just nu" + +#~ msgid "Total number of tasks" +#~ msgstr "Totalt antal jobb" + +#~ msgid "Total Memory" +#~ msgstr "Totalt minne" + +#~ msgid "Used Memory" +#~ msgstr "Använt minne" + +#~ msgid "Free Memory" +#~ msgstr "Ledigt minne" + +#~ msgid "Shared Memory" +#~ msgstr "Delat minne" + +#~ msgid "Buffers" +#~ msgstr "Buffertar" + +#~ msgid "Cached" +#~ msgstr "Cachat" + +#~ msgid "Locked" +#~ msgstr "Låst" + +#~ msgid "Total physical memory in kB" +#~ msgstr "Totalt fysiskt minne i kB" + +#~ msgid "Used memory size in kB" +#~ msgstr "Använt minne i kB" + +#~ msgid "Free memory size in kB" +#~ msgstr "Fritt minne i kB" + +#~ msgid "Shared memory size in kB" +#~ msgstr "Delat minne i kB" + +#~ msgid "Size of buffers kB" +#~ msgstr "Storleken på buffertar i kB" + +#~ msgid "Size of cached memory in kB" +#~ msgstr "Storleken på cachat minne i kB" + +#~ msgid "Memory used from user processes in kB" +#~ msgstr "Minne använt av användarprocesser i kB" + +#~ msgid "Memory in locked pages in kB" +#~ msgstr "Minne i låsta sidor i kB" + +#~ msgid "Number of list elements" +#~ msgstr "Antal listelement" + +#~ msgid "Total size of list" +#~ msgstr "Totala storleken på listan" + +#~ msgid "Size of a single list element" +#~ msgstr "Storleken på ett enda listelement" + +#~ msgid "Size in kilobytes of message pool" +#~ msgstr "Storleken på meddelandepoolen i kilobyte" + +#~ msgid "Number of entries in message map" +#~ msgstr "Antal poster i meddelandekartan" + +#~ msgid "Max size of message" +#~ msgstr "Maxstorlek på meddelande" + +#~ msgid "Default max size of queue" +#~ msgstr "Standard maxstorlek på kö" + +#~ msgid "Max queues system wide" +#~ msgstr "Max köer i hela systemet" + +#~ msgid "Message segment size" +#~ msgstr "Meddelandesegmentstorlek" + +#~ msgid "Number of system message headers" +#~ msgstr "Antal systemmeddelandehuvuden" + +#~ msgid "Interface Flags" +#~ msgstr "Gränssnittsflaggor" + +#~ msgid "MTU" +#~ msgstr "MTU" + +#~ msgid "IPv4 Subnet" +#~ msgstr "IPv4-subnät" + +#~ msgid "IPv4 Address" +#~ msgstr "IPv4-adress" + +#~ msgid "Packets In" +#~ msgstr "Inkommande paket" + +#~ msgid "Packets Out" +#~ msgstr "Utgående paket" + +#~ msgid "Packets Total" +#~ msgstr "Totalt paket" + +#~ msgid "Bytes In" +#~ msgstr "Inkommande byte" + +#~ msgid "Bytes Out" +#~ msgstr "Utgående byte" + +#~ msgid "Bytes Total" +#~ msgstr "Totalt byte" + +#~ msgid "Errors In" +#~ msgstr "Inkommande fel" + +#~ msgid "Errors Out" +#~ msgstr "Utgående fel" + +#~ msgid "Errors Total" +#~ msgstr "Totalt fel" + +#~ msgid "Collisions" +#~ msgstr "Kollisioner" + +#~ msgid "IPv6 Address" +#~ msgstr "IPv6-adress" + +#~ msgid "IPv6 Prefix" +#~ msgstr "IPv6-prefix" diff --git a/po/ta.gmo b/po/ta.gmo new file mode 100644 index 0000000..f5f0b97 Binary files /dev/null and b/po/ta.gmo differ diff --git a/po/ta.po b/po/ta.po new file mode 100644 index 0000000..c401d0a --- /dev/null +++ b/po/ta.po @@ -0,0 +1,232 @@ +# translation of ta.po to +# Tamil translation of Tamil Libgtop 2.4. +# Copyright (C) 2003, 2004,2007 Free Software Foundation, Inc. +# Dinesh Nadarajah , 2003. +# Jayaradha N , 2004. +# B.Senthil Kumar , 2007 +# +msgid "" +msgstr "" +"Project-Id-Version: ta\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-05-14 03:41+0100\n" +"PO-Revision-Date: 2007-07-08 17:29+0530\n" +"Last-Translator: Dr.T.Vasudevan \n" +"Language-Team: \n" +"Language: ta\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d பைட்கள் படி" +msgstr[1] "%d பைட்கள் படி" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "படித்த தகவல் அளவு" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "தரவின் %lu பைட்டை வாசிக்கவும்" +msgstr[1] "தரவின் %lu பைட்டுக்களை வாசிக்கவும்" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "எழுதிய %d பைட்" +msgstr[1] "எழுதிய %d பைட்டுகள்" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "பிழை திருத்தலை செயல்படுத்து" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "வெர்போஸ் விளைவை செயல்படுத்து" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "பின்னனியை பிளக்காதே" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "inetd லிருந்து செயல்படுத்து" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "Rus '%s--help' இயக்கி கட்டளைவரி தேர்வுகளை காணவும்.\n" + +#: ../sysdeps/osf1/siglist.c:27 +#: ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "தொங்கியது" + +#: ../sysdeps/osf1/siglist.c:28 +#: ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "தடை" + +#: ../sysdeps/osf1/siglist.c:29 +#: ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "வெளிச்செல்" + +#: ../sysdeps/osf1/siglist.c:30 +#: ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "தவறான செய்தி" + +#: ../sysdeps/osf1/siglist.c:31 +#: ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "தடம் காண்" + +#: ../sysdeps/osf1/siglist.c:32 +#: ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "தடைசெய்" + +#: ../sysdeps/osf1/siglist.c:33 +#: ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT பிழை" + +#: ../sysdeps/osf1/siglist.c:34 +#: ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "பின்ன பிழை" + +#: ../sysdeps/osf1/siglist.c:35 +#: ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "கொலை செய்" + +#: ../sysdeps/osf1/siglist.c:36 +#: ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "பஸ் பிழை" + +#: ../sysdeps/osf1/siglist.c:37 +#: ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "செக்மன்டேஷன் மீறல்" + +#: ../sysdeps/osf1/siglist.c:38 +#: ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "கணினி அழைப்புக்கு மோசமான அளவுரு" + +#: ../sysdeps/osf1/siglist.c:39 +#: ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "உடைந்த பாதை" + +#: ../sysdeps/osf1/siglist.c:40 +#: ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "அல்லாரம் கடிகாரம்" + +#: ../sysdeps/osf1/siglist.c:41 +#: ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "முடிவு" + +#: ../sysdeps/osf1/siglist.c:42 +#: ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "சாக்கெட்டின் அவசர நிலை" + +#: ../sysdeps/osf1/siglist.c:43 +#: ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "நிறுத்து" + +#: ../sysdeps/osf1/siglist.c:44 +#: ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "விசைப்பலகை நிறுத்தம்" + +#: ../sysdeps/osf1/siglist.c:45 +#: ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "தொடரவும்" + +#: ../sysdeps/osf1/siglist.c:46 +#: ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "சேய்நிலை மாற்றப்பட்டது" + +#: ../sysdeps/osf1/siglist.c:47 +#: ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "tty யின் பின்னியில் படி" + +#: ../sysdeps/osf1/siglist.c:48 +#: ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "tty யின் பின்னியில் எழுது" + +#: ../sysdeps/osf1/siglist.c:49 +#: ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O இப்போது முடியும்" + +#: ../sysdeps/osf1/siglist.c:50 +#: ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU எல்லை கடந்தது" + +#: ../sysdeps/osf1/siglist.c:51 +#: ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "முழு அளவு எல்லை கடந்தது" + +#: ../sysdeps/osf1/siglist.c:52 +#: ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "மெய்நிகர் எச்சரிக்கை கடிகாரம்" + +#: ../sysdeps/osf1/siglist.c:53 +#: ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "எச்சரிக்கை கடிகாத்தின் விவரம்" + +#: ../sysdeps/osf1/siglist.c:54 +#: ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "சாளர அளவு மாற்றம்" + +#: ../sysdeps/osf1/siglist.c:55 +#: ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "தகவல் கோரிக்கை" + +#: ../sysdeps/osf1/siglist.c:56 +#: ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "பயனீட்டாளர் குறித்த சங்கேதம் 1" + +#: ../sysdeps/osf1/siglist.c:57 +#: ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "பயனீட்டாளர் குறித்த சங்கேதம் 2" + +#~ msgid "DEBUG" +#~ msgstr "DEBUG(டீபக்)" +#~ msgid "VERBOSE" +#~ msgstr "VERBOSE(வெற்போஸ்)" +#~ msgid "NO-DAEMON" +#~ msgstr "NO-DAEMON(நோ-டொமொன்)" +#~ msgid "INETD" +#~ msgstr "INETD(இனிட்டி)" + diff --git a/po/te.gmo b/po/te.gmo new file mode 100644 index 0000000..9079fc9 Binary files /dev/null and b/po/te.gmo differ diff --git a/po/te.po b/po/te.po new file mode 100644 index 0000000..4bfe89d --- /dev/null +++ b/po/te.po @@ -0,0 +1,194 @@ +# translation of libgtop.master.te.po to Telugu +# Telugu translation of libgtop +# This file is distributed under the same license as the libgtop package. +# Copyright (C) Sree Ganesh , 2006. +# +# Krishna Babu K , 2009. +msgid "" +msgstr "" +"Project-Id-Version: libgtop.master.te\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop&component=general\n" +"POT-Creation-Date: 2009-09-12 15:13+0000\n" +"PO-Revision-Date: 2009-09-17 19:09+0530\n" +"Last-Translator: Krishna Babu K \n" +"Language-Team: Telugu \n" +"Language: te\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d బైట్ చదువు" +msgstr[1] "%d బైట్ చదువు" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "సమాచార సైజును చదువు" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "సమాచారంయొక్క %lu బైట్ చదువు" +msgstr[1] "సమాచారంయొక్క %lu బైట్ చదువు" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d బైట్ రాయి" +msgstr[1] "%d బైట్ రాయి" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "డిబగ్గింగ్ కుదరదు" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "వెర్బోస్ ఉద్గాతం కుదరదు" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "నేపధ్యంలోకి తిరగకండి" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "ఇన్ఎటిదడ్ నుండీ లే" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +#| msgid "" +#| "Error on option %s: %s.\n" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "అందుబాటులోవున్న ఆదేశ వరుస ఐచ్చికముల పూర్తి జాబితాను చూడుటకు '%s --help' నడుపుము.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "పైకివేలాడతీయి" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "అడ్డుపడు" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "వదులు" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "చట్టవ్యతిరేక నిర్దేశాలు" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "ట్రేస్ ట్రాప్" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "విరమింపచేయి" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "ఇఎంటి దోషం" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "చర-కేంద్ర మినహాయింపు" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "చంపు" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "బస్ దోషం" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "అంశీకరణ ఉల్లంఘన" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "కంప్యూటరు పిలుపుకు సరికాని వాదన" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "విరిగిన పైపు" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "అలారం గడియారం" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "ముగింపు" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "సాకెట్లో అత్యవసర స్థితి" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "ఆగు" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "కీబోర్డు ఆపు" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "కొనసాగించు" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "బాల్య స్థితి మార్చబడింది" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "టిటివైనుండీ నేపధ్యాన్ని చదువు" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "టిటివైకి నేపధ్యాన్ని రాయి" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "ఐ/ఒ ఇప్పుడు సాధ్యం" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "సిపియు అవధి మీరింది" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "ఫైలు పరిమాణం ఎక్కువైంది" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "సరైన అలారం గడియాయారం" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "ఆకృతీకరించిన అలారం గడియారం" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "విందో పరిమాణం మార్పు" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "సమాచారం కావాలి" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "వినియోగదారుని నిర్ధారనా చిహ్నం 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "వినియోగదారుని నిర్ధారనా చిహ్నం 2" + diff --git a/po/tg.gmo b/po/tg.gmo new file mode 100644 index 0000000..fc459cd Binary files /dev/null and b/po/tg.gmo differ diff --git a/po/tg.po b/po/tg.po new file mode 100644 index 0000000..17bdaea --- /dev/null +++ b/po/tg.po @@ -0,0 +1,192 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Victor Ibragimov , 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: Tajik Gnome\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2013-12-19 14:39+0000\n" +"PO-Revision-Date: 2013-12-20 13:36+0500\n" +"Last-Translator: Victor Ibragimov \n" +"Language-Team: \n" +"Language: tg\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=1;\n" +"X-Generator: Poedit 1.6.3\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d байти хондашуда" +msgstr[1] "%d байти хондашуда" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "андозаи иттилооти хондашуда" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu байти иттилооти хондашуда" +msgstr[1] "%lu байти иттилооти хондашуда" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d байти сабтшуда" +msgstr[1] "%d байти сабтшуда" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "Фаъол кардани ислоҳи хатоҳо" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "Фаъол кардани барориши ботафсил" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "Нагузаштан ба пасзамина" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "Дархостшуда аз inetd" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Барои намоиш додани рӯйхати ҳамаи фармонҳои имконпазир '%s --help'-ро иҷро " +"намоед.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Боздоштан" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Қатъ" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Баромад" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Дастури нодуруст" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Таҳлил" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Қатъ кардан" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Хатои EMT" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Истиснои нуқтаи тағйирёбанда" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Қатъ кардан" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Хатои гузаргоҳ" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Вайронии қисматбандӣ" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Аргументи нокифоя барои дархости системавӣ" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Вуруди вайроншуда" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Соати зангдор" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Анҷоми кор" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Шарти таъҷилӣ дар бастагоҳ" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Истодан" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Қатъи клавиатура" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Идома додан" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Вазъияти иловагӣ тағйир ёфт" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Пасзаминаи хониш аз tty" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Пасзаминаи сабт ба tty" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O ҳоло имконпазир аст" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Аз ҳудуди CPU афзуд" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Аз ҳудуди андозаи файл афзуд" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Соати зангдори виртуалӣ" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Соати зангдори профил" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Тағйири андозаи равзана" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Дархости иттилоот" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Сигнали интихобшудаи 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Сигнали интихобшудаи 2" diff --git a/po/th.gmo b/po/th.gmo new file mode 100644 index 0000000..98717ec Binary files /dev/null and b/po/th.gmo differ diff --git a/po/th.po b/po/th.po new file mode 100644 index 0000000..9fdf21e --- /dev/null +++ b/po/th.po @@ -0,0 +1,198 @@ +# Thai translation of libgtop. +# Copyright (C) 2005 Free Software Foundation +# This file is distributed under the same license as the libgtop package. +# Theppitak Karoonboonyanan , 2005-2007. +# +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop 2.11.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-05-18 17:22+0700\n" +"PO-Revision-Date: 2007-05-18 17:23+0700\n" +"Last-Translator: Theppitak Karoonboonyanan \n" +"Language-Team: Thai \n" +"Language: th\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "อ่าน %d ไบต์" + +#: lib/read_data.c:51 +msgid "read data size" +msgstr "อ่านขนาดข้อมูล" + +#: lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "อ่านข้อมูล %lu ไบต์" + +#: lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "เขียน %d ไบต์" + +#: src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "เปิดใช้การดีบั๊ก" + +#: src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "เปิดข้อความเอาต์พุตละเอียด" + +#: src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "ไม่ต้อง fork ไปทำงานเบื้องหลัง" + +#: src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "เรียกจาก inetd" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "เรียก '%s --help' เพื่อดูรายการตัวเลือกบรรทัดคำสั่งทั้งหมดที่ใช้ได้\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "ตัดการเชื่อมต่อ" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "ขัดจังหวะ" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "ออกทันที" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "รหัสคำสั่งผิดพลาด" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "หยุดเพื่อตรวจสอบ" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "เลิกทำงาน" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "ข้อผิดพลาด EMT" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "ความผิดพลาดเลขคณิตทศนิยม" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "ฆ่า" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "บัสผิดพลาด" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "การละเมิดพื้นที่หน่วยความจำ" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "การเรียกฟังก์ชันระบบผิดพลาด" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "ไปป์หลุด" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "นาฬิกาปลุก" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "จบการทำงาน" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "เงื่อนไขเร่งด่วนของซ็อกเก็ต" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "หยุด" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "หยุดด้วยแป้นพิมพ์" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "ทำงานต่อ" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "โพรเซสลูกเปลี่ยนสถานะ" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "โพรเซสเบื้องหลังอ่านเทอร์มินัล" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "โพรเซสเบื้องหลังเขียนเทอร์มินัล" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "ข้อมูลเข้า/ออกพร้อม" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "ทะลุขีดจำกัด CPU" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "ทะลุขีดจำกัดขนาดแฟ้ม" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "นาฬิกาปลุกเสมือน" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "นาฬิกาปลุกวัดประสิทธิภาพ" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "ขนาดหน้าต่างเทอร์มินัลเปลี่ยน" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "ร้องขอข้อมูล" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "สัญญาณผู้ใช้กำหนด 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "สัญญาณผู้ใช้กำหนด 2" + +#~ msgid "DEBUG" +#~ msgstr "DEBUG" + +#~ msgid "VERBOSE" +#~ msgstr "VERBOSE" + +#~ msgid "NO-DAEMON" +#~ msgstr "NO-DAEMON" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/tr.gmo b/po/tr.gmo new file mode 100644 index 0000000..4a1c82f Binary files /dev/null and b/po/tr.gmo differ diff --git a/po/tr.po b/po/tr.po new file mode 100644 index 0000000..0f08631 --- /dev/null +++ b/po/tr.po @@ -0,0 +1,207 @@ +# translation of libgtop to Turkish +# Copyright (C) 2004 Free Software Foundation, Inc. +# Görkem Çetin , 2001. +# Ömer Fadıl USTA ,2002. +# +# Baris Cicek , 2004, 2008. +# Emin Tufan Çetin , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" +"product=libgtop&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"PO-Revision-Date: 2017-09-05 07:33+0300\n" +"Last-Translator: Emin Tufan Çetin \n" +"Language-Team: Türkçe \n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d bayt okundu" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "okunan veri miktarı" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu bayt okundu" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d bayt yazıldı" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Hata ayıklamayı etkinleştir" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Detaylı çıktıyı etkinleştir" + +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" +msgstr "Arka plana çatallama" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "Inetd’den çalıştırıldı" + +#: src/daemon/gnuserv.c:498 +#, c-format +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Kullanılabilir tüm komut satırı seçeneklerinin tam listesini görmek için “%s " +"--help” çalıştırın.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Takılma" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Kesme" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Çıkış" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Tanımsız yönerge" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Takip hatası" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "İptal" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT hatası" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Kayar nokta (floating point) hatası" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Öldür" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Veriyolu hatası" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Bölümleme ihlali" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Sistem çağrısına hatalı argüman" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Kırık boru" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Alarm saati" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Sonlandırma" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Sokette acil durum" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Dur" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Klavyeden durdurma" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Devam" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Alt sürecin durumu değişti" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "tty’dan arka planda okuma" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "tty’a arka planda yazma" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "G/Ç mümkün" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "İşlemci sınırı aşıldı" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Dosya sınırı aşıldı" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Sanal alarm saati" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Alarm saati" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Pencere boyutu değişimi" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Bilgi isteği" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Kullanıcı tanımlı sinyal 1" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Kullanıcı tanımlı sinyal 2" + +#~ msgid "DEBUG" +#~ msgstr "HATA AYIKLA" + +#~ msgid "VERBOSE" +#~ msgstr "DETAYLI" + +#~ msgid "NO-DAEMON" +#~ msgstr "SERVİS-YOK" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/ug.gmo b/po/ug.gmo new file mode 100644 index 0000000..8f24958 Binary files /dev/null and b/po/ug.gmo differ diff --git a/po/ug.po b/po/ug.po new file mode 100644 index 0000000..326ffe2 --- /dev/null +++ b/po/ug.po @@ -0,0 +1,186 @@ +# Uyghur translation for libgtop. +# Copyright (C) 2010 libgtop's COPYRIGHT HOLDER +# This file is distributed under the same license as the libgtop package. +# Gheyret Kenji , 2010. +# Sahran , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop master\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop&component=general\n" +"POT-Creation-Date: 2010-12-23 18:26+0000\n" +"PO-Revision-Date: 2010-10-08 10:12+0600\n" +"Last-Translator: Sahran \n" +"Language-Team: Uyghur Computer Science Association \n" +"Language: ug\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d بايت ئوقۇ" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "ئوقۇلىدىغان سانلىق-مەلۇماتنىڭ چوڭلۇقى" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu بايت سانلىق-مەلۇمات ئوقۇدى" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "%d بايت سانلىق-مەلۇمات يازدى" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "سازلاشنى قوزغات" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "تەپسىلىي چىقىرىشنى قوزغات" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "ئارقا سۇپىدا تارماق جەريان ھاسىل قىلما" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "«inetd» ئارقىلىق قوزغىتىلغان" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "'%s --help' ئىجرا قىلىنسا بۇيرۇق قۇرى تاللانمىسىنىڭ تولۇق تىزىملىكى كۆرۈنىدۇ.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "ئېسىپ قوي" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "ئۆزەك" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "چېكىن" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "خاتا بۇيرۇق" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "ئىزلاش توزىقى" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "توختات" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT خاتالىقى" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "كەسىر سان خاتالىق" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "ئاخىرلاشتۇر" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "باش لىنىيە خاتالىقى" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "جەريان بۆلىكى توقۇنۇشى" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "سىستېما چاقىرغان پارامېتىر خاتا" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "بۇزۇلغان نەيچە" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "قوڭغۇراقلىق سائەت" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "توختات" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "socket دىكى جىددىي ئەھۋال" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "توختا" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "ھەرپتاختا توختات" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "داۋاملاشتۇر" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "بالا پروگراممىنىڭ ھالىتى ئۆزگەردى" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "TTY دىن ئارقىدىن ئوقۇ" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "TTY غا ئارقىدىن ياز" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "I/O نى ئىشلەتكىلى بولىدۇ" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "CPU نىڭ چەكلىمىسىدىن ئېشىپ كەتتى" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "ھۆججەتنىڭ ئۇزۇنلۇقى چەكتىن ئېشىپ كەتتى" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "مەۋھۇم قوڭغۇراقلىق سائەت" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "قوڭغۇراقلىق سائەتنىڭ سەپلىمىسى" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "كۆزنەك چوڭلۇقىنىڭ ئۆزگىرىشى" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "ئۇچۇر ئىلتىماسى" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "ئىشلەتكۈچى بېكىتكەن سىگنال 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "ئىشلەتكۈچى بېكىتكەن سىگنال 2" diff --git a/po/uk.gmo b/po/uk.gmo new file mode 100644 index 0000000..cec078e Binary files /dev/null and b/po/uk.gmo differ diff --git a/po/uk.po b/po/uk.po new file mode 100644 index 0000000..7c11eb5 --- /dev/null +++ b/po/uk.po @@ -0,0 +1,204 @@ +# Copyright (C) 2000 Free Software Foundation, Inc. +# Yuri Syrota , 2000. +# Maxim Dziumanenko , 2004-2007 +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop 1.1.3\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-12 16:15+0300\n" +"PO-Revision-Date: 2007-09-12 11:35+0300\n" +"Last-Translator: Maxim Dziumanenko \n" +"Language-Team: Ukrainian \n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "зчитано %d байт" +msgstr[1] "зчитано %d байти" +msgstr[2] "зчитано %d байтів" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "розмір прочитаних даних" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "зчитано %lu байт даних" +msgstr[1] "зчитано %lu байти даних" +msgstr[2] "зчитано %lu байтів даних" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "записано %d байт даних" +msgstr[1] "записано %d байти даних" +msgstr[2] "записано %d байтів даних" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "Увімкнути налагодження" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "Увімкнути докладний вивід" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "Не переходити у фоновий режим" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "Викликаний з inetd" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Запустіть '%s --help' щоб побачити повний список доступних параметрів.\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Розірвати" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Перервати" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Вихід" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Неправильна команда" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Захоплення трасування" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Припинити" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Помилка EMT" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Виключення операції з плаваючою крапкою" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Знищити" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Помилка шини" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Помилка сегментації" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Неправильний аргумент у системному виклику" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Розірвано канал" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Таймер" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Завершення" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Стан сокету, що вимагає уваги" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Зупинити" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Клавіатурний сигнал зупинки" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Продовжити" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Було змінено стан дочірнього процесу" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Фонове зчитування з TTY" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Фоновий запис у TTY" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "Ввід-вивід наразі можливий" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Перевищено обмеження ЦП" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Перевищено обмеження розміру файла" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Віртуальний таймер" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Сигнал таймера профілювання" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Зміна розмірів вікна" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Запит інформації" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Визначений користувачем сигнал 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Визначений користувачем сигнал 2" + +#~ msgid "DEBUG" +#~ msgstr "НАЛАГОДЖЕННЯ" + +#~ msgid "VERBOSE" +#~ msgstr "ДЕТАЛЬНО" + +#~ msgid "NO-DAEMON" +#~ msgstr "БЕЗ-ДЕМОНУ" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/vi.gmo b/po/vi.gmo new file mode 100644 index 0000000..410b21c Binary files /dev/null and b/po/vi.gmo differ diff --git a/po/vi.po b/po/vi.po new file mode 100644 index 0000000..4f91cd1 --- /dev/null +++ b/po/vi.po @@ -0,0 +1,229 @@ +# Vietnamese translation for libgtop. +# Copyright © 2007 Gnome i18n Project for Vietnamese. +# Nguyễn Thái Ngọc Duy , 2002. +# Clytie Siddall , 2005-2007. +# +msgid "" +"" +msgstr "Project-Id-Version: libgtop GNOME 2.20\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-05-14 03:41+0100\n" +"PO-Revision-Date: 2007-06-27 17:37+09300\n" +"Last-Translator: Clytie Siddall \n" +"Language-Team: Vietnamese \n" +"Language: vi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: LocFactoryEditor 1.6.4a5\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "đã đọc %d byte" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "đã đọc kích cỡ dữ liệu" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "đã đọc %lu byte dữ liệu" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "đã ghi %d byte" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "Bật khả năng gỡ lỗi" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "Bật khả năng xuất chi tiết" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "Không tạo tiến trình con vào nền" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "Được gọi từ inetd" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "Chạy lệnh « %s --help » để xem danh sách các tùy chọn dòng lệnh sẵn sàng.\n" + +#: ../sysdeps/osf1/siglist.c:27 +#: ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Treo máy" + +#: ../sysdeps/osf1/siglist.c:28 +#: ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Ngắt" + +#: ../sysdeps/osf1/siglist.c:29 +#: ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Thoát" + +#: ../sysdeps/osf1/siglist.c:30 +#: ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Lệnh bị cấm" + +#: ../sysdeps/osf1/siglist.c:31 +#: ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Bẫy theo vết" + +#: ../sysdeps/osf1/siglist.c:32 +#: ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Hủy" + +#: ../sysdeps/osf1/siglist.c:33 +#: ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "Lỗi EMT" + +#: ../sysdeps/osf1/siglist.c:34 +#: ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Ngoại lệ điểm phù động" + +#: ../sysdeps/osf1/siglist.c:35 +#: ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Buộc chấm dứt" + +#: ../sysdeps/osf1/siglist.c:36 +#: ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Lỗi mạch" + +#: ../sysdeps/osf1/siglist.c:37 +#: ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Vi phạm phân đoạn" + +#: ../sysdeps/osf1/siglist.c:38 +#: ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Đối số sai với cuộc gọi hệ thống" + +#: ../sysdeps/osf1/siglist.c:39 +#: ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Ống dẫn bị ngắt" + +#: ../sysdeps/osf1/siglist.c:40 +#: ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Đồng hồ báo động" + +#: ../sysdeps/osf1/siglist.c:41 +#: ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Kết thúc" + +#: ../sysdeps/osf1/siglist.c:42 +#: ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Hoàn cảnh khẩn trên ổ cắm" + +#: ../sysdeps/osf1/siglist.c:43 +#: ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Dừng" + +#: ../sysdeps/osf1/siglist.c:44 +#: ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Dừng bàn phím" + +#: ../sysdeps/osf1/siglist.c:45 +#: ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Tiếp tục" + +#: ../sysdeps/osf1/siglist.c:46 +#: ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Trạng thái tiến trình con đã thay đổi" + +#: ../sysdeps/osf1/siglist.c:47 +#: ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Đọc từ tty (chế độ nền)" + +#: ../sysdeps/osf1/siglist.c:48 +#: ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Ghi vào tty (chế độ nền)" + +#: ../sysdeps/osf1/siglist.c:49 +#: ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "giờ có thể dùng Vào/Ra" + +#: ../sysdeps/osf1/siglist.c:50 +#: ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "Vượt quá giới hạn CPU" + +#: ../sysdeps/osf1/siglist.c:51 +#: ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Vượt quá giới hạn kích cỡ tập tin" + +#: ../sysdeps/osf1/siglist.c:52 +#: ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Đồng hồ báo động ảo" + +#: ../sysdeps/osf1/siglist.c:53 +#: ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Đồng hồ bảo động đo hiệu suất" + +#: ../sysdeps/osf1/siglist.c:54 +#: ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Thay đổi kích cỡ cửa sổ" + +#: ../sysdeps/osf1/siglist.c:55 +#: ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Yêu cầu thông tin" + +#: ../sysdeps/osf1/siglist.c:56 +#: ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Tín hiệu do người dùng xác định 1" + +#: ../sysdeps/osf1/siglist.c:57 +#: ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Tín hiệu do người dùng xác định 2" + +#~ msgid "DEBUG" +#~ msgstr "GỠ LỖI" + +#~ msgid "VERBOSE" +#~ msgstr "CHI TIẾT" + +#~ msgid "NO-DAEMON" +#~ msgstr "KHÔNG TRÌNH NỀN" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/xh.gmo b/po/xh.gmo new file mode 100644 index 0000000..2bfaf85 Binary files /dev/null and b/po/xh.gmo differ diff --git a/po/xh.po b/po/xh.po new file mode 100644 index 0000000..1c9d2fc --- /dev/null +++ b/po/xh.po @@ -0,0 +1,210 @@ +# Xhosa translation of libgtop +# Copyright (C) 2005 Canonical Ltd. +# This file is distributed under the same license as the libgtop package. +# Translation by Canonical Ltd with thanks to +# Translation World CC in South Africa, 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-09-25 18:15+0200\n" +"PO-Revision-Date: 2005-03-30 22:54+0200\n" +"Last-Translator: Canonical Ltd \n" +"Language-Team: Xhosa \n" +"Language: xh\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n!=1;\n" + +#: lib/read.c:65 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "funda %d ye byte" +msgstr[1] "funda %d yee-byte" + +#: lib/read_data.c:53 +msgid "read data size" +msgstr "funda ubungakanani bee-data" + +#: lib/read_data.c:72 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "funda %lu byte ye-data" +msgstr[1] "funda %lu ii-byte ze-data" + +#: lib/write.c:52 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "ibhale %d ye byte" +msgstr[1] "ibhale %d yee-byte" + +#: src/daemon/gnuserv.c:460 +msgid "Enable debugging" +msgstr "Yenza ibe nako ukulungisa isiphene kwinkqubo" + +#: src/daemon/gnuserv.c:460 +msgid "DEBUG" +msgstr "LUNGISA ISIPHENE KWINKQUBO" + +#: src/daemon/gnuserv.c:462 +msgid "Enable verbose output" +msgstr "Yenza ukuba kubekho iziphumo ezingumlembelele" + +#: src/daemon/gnuserv.c:462 +msgid "VERBOSE" +msgstr "UMLEMBELELE" + +#: src/daemon/gnuserv.c:464 +msgid "Don't fork into background" +msgstr "Musa ukujika-jikisa kokungasemva" + +#: src/daemon/gnuserv.c:464 +msgid "NO-DAEMON" +msgstr "i-NO-DAEMON" + +#: src/daemon/gnuserv.c:466 +msgid "Invoked from inetd" +msgstr "Ibizwe isuswa kwi inetd" + +#: src/daemon/gnuserv.c:466 +msgid "INETD" +msgstr "i-INETD" + +#: src/daemon/gnuserv.c:500 +#, c-format +msgid "" +"Error on option %s: %s.\n" +"Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"Impazamo kokungakhethwa kuko i %s: %s.\n" +"Phumeza i '%s --help' ukwenzela ukuba ubone uluhlu oluzeleyo lwezinto " +"ekungakhethwa kuzo ezifumanekayo zomgca womyalelo.\n" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Hangup" +msgstr "Beka umnxeba" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Interrupt" +msgstr "Phazamisa" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Quit" +msgstr "Phuma" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Illegal instruction" +msgstr "Umyalelo ongekho semthethweni" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Trace trap" +msgstr "Khuphela umjelo wenkqubo" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "Abort" +msgstr "Yeka" + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "EMT error" +msgstr "Impazamo ye EMT" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Floating-point exception" +msgstr "Incam-etshintsha-tshintshayo ekhethekileyo" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Kill" +msgstr "Bulala" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Bus error" +msgstr "Impazamo yebhasi" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Segmentation violation" +msgstr "Ukwaphulwa kwenkqubo" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Bad argument to system call" +msgstr "Isiphumezi-miyalelo esingalunganga kubizo lwenkqubo" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Broken pipe" +msgstr "Umbhobho wothungelwano owophukileyo" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Alarm clock" +msgstr "Iwotshi enkulu yokuvusa" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Termination" +msgstr "Ukuphelisa" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Urgent condition on socket" +msgstr "Imeko engxamisekileyo kwisokhethi" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Stop" +msgstr "Yima" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Keyboard stop" +msgstr "Ukuma kwe-keyboard" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Continue" +msgstr "Qhubeka" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Child status has changed" +msgstr "Ubume benkqubo engumntwana butshintshile" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background read from tty" +msgstr "Okungasemva kufundwe kwi-tty" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "Background write to tty" +msgstr "Ukukhuphela ulwazi lokungasemva kwi-tty" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "I/O now possible" +msgstr "i-I/O ingenzeka ngoku" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "CPU limit exceeded" +msgstr "Umda we CPU ugqithisiwe" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "File size limit exceeded" +msgstr "Umda wobungakanani befayili ugqithisiwe" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Virtual alarm clock" +msgstr "Iwotshi enkulu yokuvusa eyelelanisiweyo" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Profiling alarm clock" +msgstr "Iwotshi enkulu yokuvusa yenkangeleko" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Window size change" +msgstr "Utshintsho lobungakanani befestile" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "Information request" +msgstr "Isicelo senkcazelo" + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 1" +msgstr "Umqondiso ochazwa ngumsebenzi woku 1" + +#: sysdeps/osf1/siglist.c:58 sysdeps/sun4/siglist.c:58 +msgid "User defined signal 2" +msgstr "Umqondiso ochazwa ngumsebenzi wesi 2" diff --git a/po/zh_CN.gmo b/po/zh_CN.gmo new file mode 100644 index 0000000..4d5ca21 Binary files /dev/null and b/po/zh_CN.gmo differ diff --git a/po/zh_CN.po b/po/zh_CN.po new file mode 100644 index 0000000..2ae53cf --- /dev/null +++ b/po/zh_CN.po @@ -0,0 +1,198 @@ +# translation of libgtop.po to simplified chinese. +# Copyright (C) 2001,2003 Free Software Foundation, Inc. +# Dillion Chen , 2003. +# Funda Wang , 2004 +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-05-14 03:41+0100\n" +"PO-Revision-Date: 2007-09-07 17:29+0800\n" +"Last-Translator: Funda Wang \n" +"Language-Team: zh_CN \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "读取 %d 字节" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "读取数据大小" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "读取了 %lu 字节数据" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "写入了 %d 字节" + +#: ../src/daemon/gnuserv.c:458 +msgid "Enable debugging" +msgstr "允许调试" + +#: ../src/daemon/gnuserv.c:460 +msgid "Enable verbose output" +msgstr "允许详细输出" + +#: ../src/daemon/gnuserv.c:462 +msgid "Don't fork into background" +msgstr "不能在后台生成子进程" + +#: ../src/daemon/gnuserv.c:464 +msgid "Invoked from inetd" +msgstr "从 inetd 调用" + +#: ../src/daemon/gnuserv.c:498 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"运行“%s --help”可查看可用命令行选项的完整列表\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "挂起" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "中断" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "退出" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "非法指令" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "跟踪陷阱" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "中止" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT 错误" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "浮点意外" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "杀死" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "总线错误" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "进程段异常" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "系统调用参数错误" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "损坏的通道" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "警告时钟" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "终止" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "套接字紧急条件" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "停止" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "键盘停止" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "继续" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "子状态变更" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "后台从 tty 读取" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "后台写到 tty" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "现可以 I/O" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "达到 CPU 限制" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "达到文件大小限制" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "虚拟警报时钟" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "个性化警报时钟" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "窗口大小更改" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "信息请求" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "用户自定义信号 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "用户自定义信号 2" + +#~ msgid "DEBUG" +#~ msgstr "调试" + +#~ msgid "VERBOSE" +#~ msgstr "详细" + +#~ msgid "NO-DAEMON" +#~ msgstr "NO-DAEMON" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/zh_HK.gmo b/po/zh_HK.gmo new file mode 100644 index 0000000..a98688d Binary files /dev/null and b/po/zh_HK.gmo differ diff --git a/po/zh_HK.po b/po/zh_HK.po new file mode 100644 index 0000000..83e5c42 --- /dev/null +++ b/po/zh_HK.po @@ -0,0 +1,196 @@ +# Chinese (Hong Kong) translation for libgtop. +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +# Abel Cheung , 2001-2003. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop 2.25.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-02-09 08:05+0800\n" +"PO-Revision-Date: 2009-02-09 08:06+0800\n" +"Last-Translator: Abel Cheung \n" +"Language-Team: Chinese (Hong Kong) \n" +"Language: zh_HK\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "讀入 %d 位元組" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "讀入資料大小" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "讀入 %lu 位元組的資料" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "寫入 %d 位元組" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "啟用除錯碼" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "顯示詳細的輸出訊息" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "不要放置於背景執行" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "透過 inetd 執行" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "請執行‘%s --help’查看完整的指令列選項清單。\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "掛斷(Hangup)" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "中斷(Interrupt)" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "結束" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "不合法硬件指示" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "TRAP 硬件錯誤" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "不正常中止" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT 硬件錯誤" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "浮點數運算出現例外情況" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "強行中止 (Kill)" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "匯流排錯誤" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "記憶體區段錯誤" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "系統函數參數錯誤" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "管線中斷" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "系統時鐘訊號" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "強行中止 (Term)" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "socket 緊急情況" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "暫停進程" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "鍵盤停止" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "繼續進程" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "副進程狀態已改變" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "背景進程從 tty 讀入資料" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "背景進程向 tty 輸出資料" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "可重新進行輸入/輸出" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "超過 CPU 限制" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "超過檔案大小限制" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "虛擬時鐘訊號" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "效能測試計時器週期結束" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "更改視窗尺寸" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "要求進程資訊" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "用戶自定訊號 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "用戶自定訊號 2" + +#~ msgid "DEBUG" +#~ msgstr "偵錯" + +#~ msgid "VERBOSE" +#~ msgstr "詳細訊息" + +#~ msgid "NO-DAEMON" +#~ msgstr "NO-DAEMON" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/po/zh_TW.gmo b/po/zh_TW.gmo new file mode 100644 index 0000000..edd417e Binary files /dev/null and b/po/zh_TW.gmo differ diff --git a/po/zh_TW.po b/po/zh_TW.po new file mode 100644 index 0000000..ebb273b --- /dev/null +++ b/po/zh_TW.po @@ -0,0 +1,196 @@ +# Chinese (Taiwan) translation for libgtop. +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +# Abel Cheung , 2001-2003. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop 2.25.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-02-09 08:05+0800\n" +"PO-Revision-Date: 2008-02-14 23:04+0800\n" +"Last-Translator: Abel Cheung \n" +"Language-Team: Chinese (Taiwan) \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: ../lib/read.c:51 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "讀入 %d 位元組" + +#: ../lib/read_data.c:51 +msgid "read data size" +msgstr "讀入資料大小" + +#: ../lib/read_data.c:70 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "讀入 %lu 位元組的資料" + +#: ../lib/write.c:51 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "寫入 %d 位元組" + +#: ../src/daemon/gnuserv.c:455 +msgid "Enable debugging" +msgstr "啟用除錯碼" + +#: ../src/daemon/gnuserv.c:457 +msgid "Enable verbose output" +msgstr "顯示詳細的輸出訊息" + +#: ../src/daemon/gnuserv.c:459 +msgid "Don't fork into background" +msgstr "不要放置於背景執行" + +#: ../src/daemon/gnuserv.c:461 +msgid "Invoked from inetd" +msgstr "透過 inetd 執行" + +#: ../src/daemon/gnuserv.c:495 +#, c-format +msgid "Run '%s --help' to see a full list of available command line options.\n" +msgstr "請執行‘%s --help’查看完整的指令列選項清單。\n" + +#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "掛斷(Hangup)" + +#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "中斷(Interrupt)" + +#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "結束" + +#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "不合法硬體指示" + +#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "TRAP 硬體錯誤" + +#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "不正常中止" + +#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT 硬體錯誤" + +#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "浮點數運算出現例外情況" + +#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "強行中止 (Kill)" + +#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "匯流排錯誤" + +#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "記憶體區段錯誤" + +#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "系統函式參數錯誤" + +#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "管線中斷" + +#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "系統時鐘訊號" + +#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "強行中止 (Term)" + +#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "socket 緊急情況" + +#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "暫停進程" + +#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "鍵盤停止" + +#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "繼續進程" + +#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "副進程狀態已改變" + +#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "背景進程從 tty 讀入資料" + +#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "背景進程向 tty 輸出資料" + +#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "可重新進行輸入/輸出" + +#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "超過 CPU 限制" + +#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "超過檔案大小限制" + +#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "虛擬時鐘訊號" + +#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "效能測試計時器週期結束" + +#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "更改視窗尺寸" + +#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "要求進程資訊" + +#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "用戶自定訊號 1" + +#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "用戶自定訊號 2" + +#~ msgid "DEBUG" +#~ msgstr "偵錯" + +#~ msgid "VERBOSE" +#~ msgstr "詳細訊息" + +#~ msgid "NO-DAEMON" +#~ msgstr "NO-DAEMON" + +#~ msgid "INETD" +#~ msgstr "INETD" diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..d9dbf4d --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,10 @@ +if LIBGTOP_NEED_SERVER +daemon_SUBDIRS = daemon +else +daemon_SUBDIRS = +endif + +SUBDIRS = $(daemon_SUBDIRS) + +DIST_SUBDIRS = daemon + diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 0000000..a4cbc76 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,695 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +@LIBGTOP_NEED_SERVER_FALSE@daemon_SUBDIRS = +@LIBGTOP_NEED_SERVER_TRUE@daemon_SUBDIRS = daemon +SUBDIRS = $(daemon_SUBDIRS) +DIST_SUBDIRS = daemon +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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: diff --git a/src/daemon/ChangeLog b/src/daemon/ChangeLog new file mode 100644 index 0000000..d342feb --- /dev/null +++ b/src/daemon/ChangeLog @@ -0,0 +1,156 @@ +2005-03-25 Benoît Dejean + + * gnuserv.c: (syslog_io_message): s/strerror/g_strerror. + +2005-02-15 Benoît Dejean + + * daemon.h: + * gnuserv.c: (syslog_message), (syslog_io_message): + * main.c: (handle_parent_connection): + * slave.c: (handle_slave_connection), (handle_slave_command): Misc. cleanups. + +2004-09-19 Benoît Dejean + + * gnuserv.c: (setup_table): 'screen' is only defined when AUTH_MAGIC_COOKIE + is defined. + Added missing initializers for popt options. + +2004-05-25 Benoît Dejean + + * gnuserv.c: (permitted): Cast to size_t to remove warning. + +2004-03-04 Bastien Nocera + + * Makefile.am: + * gnuserv.c: link explicitely to popt and use libgtop-i18n.h + instead of libgnome + +2003-10-20 Bastien Nocera + + * Makefile.am: + * daemon.h: + * gnuserv.c: (main): fixed compilation + +2003-10-20 Bastien Nocera + + * main.c: (handle_parent_connection): + * slave.c: (handle_slave_connection): + replace all the xmalloc crap by glib memory management functions + +2003-10-20 Bastien Nocera + + * Makefile.am: removed traces of guile, intllibs and libgnomesupport + +2003-10-20 Bastien Nocera + + * Makefile.am: + * gnuserv.c: remove guile and libgnome-support stuff + +2003-10-20 Bastien Nocera + + * Makefile.am: make it compile + +2003-05-11 Andrew Sobala + + * gnuserv.c: (permitted): fix buffer overflow vulnerability + +2001-02-14 Martin Baulig + + * Makefile.am (libgtop_server_LDADD): Removed @LIBSUPPORT@. + +1999-11-28 Martin Baulig + + * gnuserv.c (setup_table): Don't dump core when the table of + permitted host names contains a NULL pointer. + +1999-07-29 Martin Baulig + + * Makefile.am: Link the `libgtop_daemon' and the `libgtop_server' + statically if possible. + +1999-05-07 Martin Baulig + + * server.c (main): There's some problem with uname () - some systems + like Solaris or Digital Unix return a nonnegative value on success, + some others like Linux return 0. Since all known systems seem to return + a negative value on failure, we simply check whether the return value is + not negative here. + +1999-02-19 Martin Baulig + + * Makefile.am (LIBGTOP_COMPILE_SYSTEM): Hardcoded system name. + (LIBGTOP_COMPILE_RELEASE): Hardcoded system release. + (LIBGTOP_COMPILE_MACHINE): Hardcoded machine type. + + * src/daemon/Makefile.am (libgtop_server_SOURCES): Don't use + `@INTLLIBS@' for the server. + + * server.c (main): Abort if not running on the system the server + was compiled on. + +1999-02-10 Martin Baulig + + * gnuserv.c (program_invocation_*_name): Declare this as `extern' + if necessary. + +1998-12-17 Martin Baulig + + * gnuserv.c: Don't include . + (program_invocation_name, program_invocation_short_name): Define + this here. + +1998-12-09 Martin Baulig + + Larger changes to the daemon: + + - Dropped all the unix domain socket stuff - we don't need it for + connections on the local host, here we behave just like any normal + application. + - Added poptimization: use the --help parameter to get usage info + - Made it a real daemon, fork into background and write to syslog. + - It's now possible to invoke the daemon from inetd, you'll get + GNU_SECURE authentication in this case. + - Don't make this executable suid/sgid - if invoked as root it + sets uid/gid to SERVER_UID/SERVER_GID as defined in server_config.h + - Added missing features, so you can now really use this thing. + +1998-11-11 Martin Baulig + + * gnuserv.c (main): Set `server->features' directly rather than + calling glibtop_set_parameter_l () since this function no longer + allows to modify the features. + + * gnuserv.c, main.c: Use LIBGTOP_ENABLE_DEBUG rather than DEBUG. + +1998-11-01 Marc Ewing + + * Makefile.am: Added $(GLIB_LIBS) to libs. Not sure + how it ever built without it. + +1998-10-20 Martin Baulig + + * Makefile.am: Added a notice that this file *requires* + libtool 1.2. It may work with 1.1 as well, but that's untested. + +1998-10-11 Martin Baulig + + * Makefile.am (install-exec-hook): Always run `libgtop_postinstall', + it's `:' if there's nothing to do since the empty string is no + valid shell syntax here. + +1998-10-01 Martin Baulig + + * Makefile.am (install-exec-hook): Use `libgtop_postinstall' + here to make the server suid root or sgid kmem if required. + +1998-08-25 Martin Baulig + + * daemon.h (handle_parent_connection): Added prototype. + * write.c, io.c: Added cast to `const void *' in calls to + `write' and `send' to avoid compiler warnings. + * gnuserv.c (handle_signal): Declared static. + (main): Casting return value of `getuid' to `int' in + debugging statement. + + * ChangeLog: New file. + diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am new file mode 100644 index 0000000..f29d0a6 --- /dev/null +++ b/src/daemon/Makefile.am @@ -0,0 +1,56 @@ +## You need libtool 1.2 or newer for this Makefile.am to work. +## +## It _may_ work with an older version of libtool, but it also may fail. +## So if you get any undefined symbols here, please make sure you really +## have libtool 1.2 or better before reporting this as bug. +## +## You'll require libtool 1.2 for other parts of GNOME anyway. +## +## Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2.tar.gz +## (or a newer version if it is available) +## +## Martin +## + +AM_CPPFLAGS = $(LIBGTOP_CFLAGS) @AM_CPPFLAGS@ -D_BSD \ + -DLIBGTOP_COMPILE_SYSTEM="\"`uname -s`\"" \ + -DLIBGTOP_COMPILE_RELEASE="\"`uname -r`\"" \ + -DLIBGTOP_COMPILE_VERSION="\"`uname -v`\"" \ + -DLIBGTOP_COMPILE_MACHINE="\"`uname -m`\"" + +if LIBGTOP_NEED_SERVER +suid_sysdeps = $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps_suid-2.0.la +suid_common = $(top_builddir)/sysdeps/common/libgtop_suid_common-2.0.la +else +suid_sysdeps = +suid_common = +endif + +bin_PROGRAMS = libgtop_daemon2 @server_programs@ + +EXTRA_PROGRAMS = libgtop_server2 + +libgtop_daemon2_SOURCES = gnuserv.c slave.c main.c io.c version.c \ + daemon.h server_config.h +libgtop_daemon2_LDADD = $(top_builddir)/lib/libgtop-2.0.la \ + $(top_builddir)/sysdeps/common/libgtop_common-2.0.la \ + $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps-2.0.la \ + @sysdeps_suid_lib@ \ + $(suid_sysdeps) $(suid_common) \ + $(LIBGTOP_LIBS) \ + @libs_xauth@ + +libgtop_server2_SOURCES = server.c slave.c io.c version.c daemon.h +libgtop_server2_LDADD = $(top_builddir)/lib/libgtop-2.0.la \ + $(top_builddir)/sysdeps/common/libgtop_common-2.0.la \ + $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps-2.0.la \ + @sysdeps_suid_lib@ \ + $(suid_sysdeps) $(suid_common) \ + $(LIBGTOP_LIBS) \ + @libs_xauth@ + +EXTRA_DIST = server_config.h.in server_config.pl + +install-exec-hook: + -@libgtop_postinstall@ + diff --git a/src/daemon/Makefile.in b/src/daemon/Makefile.in new file mode 100644 index 0000000..1049fa9 --- /dev/null +++ b/src/daemon/Makefile.in @@ -0,0 +1,763 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = libgtop_daemon2$(EXEEXT) @server_programs@ +EXTRA_PROGRAMS = libgtop_server2$(EXEEXT) +subdir = src/daemon +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_libgtop_daemon2_OBJECTS = gnuserv.$(OBJEXT) slave.$(OBJEXT) \ + main.$(OBJEXT) io.$(OBJEXT) version.$(OBJEXT) +libgtop_daemon2_OBJECTS = $(am_libgtop_daemon2_OBJECTS) +@LIBGTOP_NEED_SERVER_TRUE@am__DEPENDENCIES_1 = $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps_suid-2.0.la +@LIBGTOP_NEED_SERVER_TRUE@am__DEPENDENCIES_2 = $(top_builddir)/sysdeps/common/libgtop_suid_common-2.0.la +am__DEPENDENCIES_3 = +libgtop_daemon2_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la \ + $(top_builddir)/sysdeps/common/libgtop_common-2.0.la \ + $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps-2.0.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am_libgtop_server2_OBJECTS = server.$(OBJEXT) slave.$(OBJEXT) \ + io.$(OBJEXT) version.$(OBJEXT) +libgtop_server2_OBJECTS = $(am_libgtop_server2_OBJECTS) +libgtop_server2_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la \ + $(top_builddir)/sysdeps/common/libgtop_common-2.0.la \ + $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps-2.0.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_daemon2_SOURCES) $(libgtop_server2_SOURCES) +DIST_SOURCES = $(libgtop_daemon2_SOURCES) $(libgtop_server2_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + ChangeLog +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = $(LIBGTOP_CFLAGS) @AM_CPPFLAGS@ -D_BSD \ + -DLIBGTOP_COMPILE_SYSTEM="\"`uname -s`\"" \ + -DLIBGTOP_COMPILE_RELEASE="\"`uname -r`\"" \ + -DLIBGTOP_COMPILE_VERSION="\"`uname -v`\"" \ + -DLIBGTOP_COMPILE_MACHINE="\"`uname -m`\"" + +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +@LIBGTOP_NEED_SERVER_FALSE@suid_sysdeps = +@LIBGTOP_NEED_SERVER_TRUE@suid_sysdeps = $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps_suid-2.0.la +@LIBGTOP_NEED_SERVER_FALSE@suid_common = +@LIBGTOP_NEED_SERVER_TRUE@suid_common = $(top_builddir)/sysdeps/common/libgtop_suid_common-2.0.la +libgtop_daemon2_SOURCES = gnuserv.c slave.c main.c io.c version.c \ + daemon.h server_config.h + +libgtop_daemon2_LDADD = $(top_builddir)/lib/libgtop-2.0.la \ + $(top_builddir)/sysdeps/common/libgtop_common-2.0.la \ + $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps-2.0.la \ + @sysdeps_suid_lib@ \ + $(suid_sysdeps) $(suid_common) \ + $(LIBGTOP_LIBS) \ + @libs_xauth@ + +libgtop_server2_SOURCES = server.c slave.c io.c version.c daemon.h +libgtop_server2_LDADD = $(top_builddir)/lib/libgtop-2.0.la \ + $(top_builddir)/sysdeps/common/libgtop_common-2.0.la \ + $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps-2.0.la \ + @sysdeps_suid_lib@ \ + $(suid_sysdeps) $(suid_common) \ + $(LIBGTOP_LIBS) \ + @libs_xauth@ + +EXTRA_DIST = server_config.h.in server_config.pl +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/daemon/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/daemon/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +libgtop_daemon2$(EXEEXT): $(libgtop_daemon2_OBJECTS) $(libgtop_daemon2_DEPENDENCIES) $(EXTRA_libgtop_daemon2_DEPENDENCIES) + @rm -f libgtop_daemon2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(libgtop_daemon2_OBJECTS) $(libgtop_daemon2_LDADD) $(LIBS) + +libgtop_server2$(EXEEXT): $(libgtop_server2_OBJECTS) $(libgtop_server2_DEPENDENCIES) $(EXTRA_libgtop_server2_DEPENDENCIES) + @rm -f libgtop_server2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(libgtop_server2_OBJECTS) $(libgtop_server2_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnuserv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slave.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-exec-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-exec-hook install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS + +.PRECIOUS: Makefile + + +install-exec-hook: + -@libgtop_postinstall@ + +# 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: diff --git a/src/daemon/daemon.h b/src/daemon/daemon.h new file mode 100644 index 0000000..aad2900 --- /dev/null +++ b/src/daemon/daemon.h @@ -0,0 +1,77 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_DAEMON_H__ +#define __GLIBTOP_DAEMON_H__ + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +G_BEGIN_DECLS + +/* Some don't have LOG_PERROR */ +#ifndef LOG_PERROR +#define LOG_PERROR 0 +#endif + +#if defined(HAVE_GETDTABLESIZE) +#define GET_MAX_FDS() getdtablesize() +#else +/* Fallthrough case - please add other #elif cases above + for different OS's as necessary */ +#define GET_MAX_FDS() 256 +#endif + +#define _offset_union(p) ((char *) &resp->u.p - (char *) resp) +#define _offset_data(p) _offset_union (data.p) + +#define MSG_BUFSZ sizeof (struct _glibtop_ipc_message) +#define MSG_MSGSZ (MSG_BUFSZ - sizeof (long)) + +void handle_parent_connection (int s); +void handle_slave_connection (int input, int output); +void handle_slave_command (glibtop_command *cmnd, glibtop_response *resp, + const void *parameter); + +void do_output (int s, glibtop_response *resp, off_t offset, + size_t data_size, const void *data); +int do_read (int s, void *ptr, size_t total_size); + +void syslog_message (int priority, const char *format, ...) G_GNUC_PRINTF(2, 3); +void syslog_io_message (int priority, const char *format, ...) G_GNUC_PRINTF(2, 3); + +extern gboolean enable_debug; +extern gboolean verbose_output; + +G_END_DECLS + +#endif diff --git a/src/daemon/gnuserv.c b/src/daemon/gnuserv.c new file mode 100644 index 0000000..78ebb64 --- /dev/null +++ b/src/daemon/gnuserv.c @@ -0,0 +1,645 @@ +/* -*-C-*- + * Server code for handling requests from clients and forwarding them + * on to the GNU Emacs process. + * + * This file is part of GNU Emacs. + * + * Copying is permitted under those conditions described by the GNU + * General Public License. + * + * Copyright (C) 1989 Free Software Foundation, Inc. + * + * Author: Andy Norman (ange@hplb.hpl.hp.com), based on 'etc/server.c' + * from the 18.52 GNU Emacs distribution. + * + * Please mail bugs and suggestions to the author at the above address. + */ + +/* HISTORY + * 11-Nov-1990 bristor@simba + * Added EOT stuff. + */ + +/* + * This file incorporates new features added by Bob Weiner , + * Darrell Kindred and Arup Mukherjee . + * Please see the note at the end of the README file for details. + * + * (If gnuserv came bundled with your emacs, the README file is probably + * ../etc/gnuserv.README relative to the directory containing this file) + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include "server_config.h" + +#include + +#include +#include + +#include "daemon.h" + +#ifdef AIX +#include +#endif + +#ifdef NEED_DECLARATION_PROGRAM_INVOCATION_NAME +extern char *program_invocation_name, *program_invocation_short_name; +#endif + +#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME +char *program_invocation_short_name; +#endif + +#ifndef HAVE_PROGRAM_INVOCATION_NAME +char *program_invocation_name; +#endif + + +#if !defined(INTERNET_DOMAIN_SOCKETS) +#error "Internet Domain sockets are required" +#endif + +#ifdef AUTH_MAGIC_COOKIE +#include +#include + +static Xauth *server_xauth = NULL; + +#endif /* AUTH_MAGIC_COOKIE */ + +gboolean enable_debug = FALSE; +gboolean verbose_output = FALSE; +static gboolean no_daemon = FALSE; +static gboolean invoked_from_inetd = FALSE; +static int changed_uid = 0; + +void +syslog_message (int priority, const char *format, ...) +{ + va_list ap; + char buffer [BUFSIZ]; + + va_start (ap, format); + vsnprintf (buffer, BUFSIZ-1, format, ap); + va_end (ap); + + syslog (priority, "%s", buffer); +} + +void +syslog_io_message (int priority, const char *format, ...) +{ + va_list ap; + char buffer [BUFSIZ]; + char buffer2 [BUFSIZ]; + + va_start (ap, format); + vsnprintf (buffer, BUFSIZ-1, format, ap); + va_end (ap); + + snprintf (buffer2, BUFSIZ-1, "%s: %s", buffer, g_strerror (errno)); + syslog (priority, "%s", buffer2); +} + +/* + * timed_read - Read with timeout. + */ + +static int +timed_read (int fd, char *buf, int max, int timeout, int one_line) +{ + fd_set rmask; + struct timeval tv; /* = {timeout, 0}; */ + char c = 0; + int nbytes = 0; + int r; + + tv.tv_sec = timeout; + tv.tv_usec = 0; + + FD_ZERO (&rmask); + FD_SET (fd, &rmask); + + do { + r = select (fd + 1, &rmask, NULL, NULL, &tv); + + if (r > 0) { + if (read (fd, &c, 1) == 1) { + *buf++ = c; + ++nbytes; + } else { + syslog_io_message (LOG_WARNING, "read error on socket"); + return -1; + } + } else if (r == 0) { + syslog_io_message (LOG_WARNING, "read timed out"); + return -1; + } else { + syslog_io_message (LOG_WARNING, "error in select"); + return -1; + } + } while ((nbytes < max) && !(one_line && (c == '\n'))); + + --buf; + if (one_line && *buf == '\n') { + *buf = 0; + } + return nbytes; +} + + +/* + * permitted -- return whether a given host is allowed to connect to the server. + */ + +static int +permitted (u_long host_addr, int fd) +{ + int i; + + char auth_protocol[128]; + char buf[1024]; + int auth_data_len; + + /* Read auth protocol name */ + + if (timed_read (fd, auth_protocol, AUTH_NAMESZ, AUTH_TIMEOUT, 1) <= 0) + return FALSE; + + if (enable_debug) + syslog_message (LOG_DEBUG, + "Client sent authenticatin protocol '%s'.", + auth_protocol); + + if (strcmp (auth_protocol, DEFAUTH_NAME) && + strcmp (auth_protocol, MCOOKIE_NAME)) { + syslog_message (LOG_WARNING, + "Invalid authentication protocol " + "'%s' from client", + auth_protocol); + return FALSE; + } + + if (!strcmp (auth_protocol, MCOOKIE_NAME)) { + /* + * doing magic cookie auth + */ + + if (timed_read (fd, buf, 10, AUTH_TIMEOUT, 1) <= 0) + return FALSE; + + auth_data_len = atoi (buf); + + if (auth_data_len < 1 || (size_t)auth_data_len > sizeof(buf)) { + syslog_message(LOG_WARNING, "Invalid data length supplied by client"); + return FALSE; + } + + if (timed_read (fd, buf, auth_data_len, AUTH_TIMEOUT, 0) != auth_data_len) + return FALSE; + +#ifdef AUTH_MAGIC_COOKIE + if (!invoked_from_inetd && server_xauth && server_xauth->data && + !memcmp (buf, server_xauth->data, auth_data_len)) { + return TRUE; + } +#else + syslog_message (LOG_WARNING, + "Client tried Xauth, but server is " + "not compiled with Xauth"); +#endif + + /* + * auth failed, but allow this to fall through to the + * GNU_SECURE protocol.... + */ + + if (verbose_output) { + if (changed_uid || invoked_from_inetd) + syslog_message (LOG_WARNING, + "Xauth authentication not allowed, " + "trying GNU_SECURE ..."); + else + syslog_message (LOG_WARNING, + "Xauth authentication failed, " + "trying GNU_SECURE auth..."); + } + } + + /* Other auth protocols go here, and should execute only if + * the * auth_protocol name matches. */ + + /* Now, try the old GNU_SECURE stuff... */ + + if (enable_debug) + syslog_message (LOG_DEBUG, "Doing GNU_SECURE auth ..."); + + /* Now check the chain for that hash key */ + for (i = 0; i < HOST_TABLE_ENTRIES; i++) { + if (enable_debug) + syslog_message (LOG_DEBUG, "Trying %lx - %lx", + host_addr, permitted_hosts [i]); + if (permitted_hosts [i] == 0L) + return (FALSE); + if (host_addr == permitted_hosts [i]) + return (TRUE); + } + + return (FALSE); +} + + +/* + * setup_table -- initialise the table of hosts allowed to contact the server, + * by reading from the file specified by the GNU_SECURE + * environment variable + * Put in the local machine, and, if a security file is specifed, + * add each host that is named in the file. + * Return the number of hosts added. + */ + +static int +setup_table (void) +{ + char hostname [HOSTNAMSZ]; + +#ifdef AUTH_MAGIC_COOKIE + char screen [BUFSIZ]; +#endif + + long host_addr; + int i, hosts = 0; + + /* Make sure every entry is null */ + for (i = 0; i < HOST_TABLE_ENTRIES; i++) + permitted_hosts [i] = 0; + + gethostname (hostname, HOSTNAMSZ); + + if ((host_addr = glibtop_internet_addr (hostname)) == -1) { + syslog_io_message (LOG_ERR, "Can't resolve '%s'", hostname); + exit (1); + } + +#ifdef AUTH_MAGIC_COOKIE + + sprintf (screen, "%d", SERVER_PORT); + + server_xauth = XauGetAuthByAddr + (FamilyInternet, + sizeof (host_addr), (char *) &host_addr, + strlen (screen), screen, + strlen (MCOOKIE_X_NAME), MCOOKIE_X_NAME); + hosts++; + +#endif /* AUTH_MAGIC_COOKIE */ + + /* Resolv host names from permitted_host_names []. */ + + for (i = 0; i < HOST_TABLE_ENTRIES; i++) { + if (!permitted_host_names [i]) + continue; + if (enable_debug) + syslog_message (LOG_DEBUG, "Resolving %s ...", + permitted_host_names [i]); + permitted_hosts [i] = + glibtop_internet_addr (permitted_host_names [i]); + if ((long) permitted_hosts [i] == -1) { + syslog_io_message (LOG_ERR, "Can't resolve '%s'", + permitted_host_names [i]); + exit (1); + } + } + + if (enable_debug) + for (i = 0; i < HOST_TABLE_ENTRIES; i++) + syslog_message (LOG_DEBUG, "Host %s - %lx", + permitted_host_names [i], + permitted_hosts [i]); + + hosts += HOST_TABLE_ENTRIES; + + return hosts; +} /* setup_table */ + +/* + * internet_init -- initialize server, returning an internet socket that can + * be listened on. + */ + +static int +internet_init (void) +{ + int ls; /* socket descriptor */ + struct sockaddr_in server; /* for local socket address */ + + if (setup_table () == 0) + return -1; + + /* clear out address structure */ + memset ((char *) &server, 0, sizeof (struct sockaddr_in)); + + /* Set up address structure for the listen socket. */ + server.sin_family = AF_INET; + server.sin_addr.s_addr = INADDR_ANY; + + /* We use a fixed port given in the config file. */ + server.sin_port = htons (SERVER_PORT); + + if (verbose_output) + syslog_message (LOG_INFO, "Using port %u.", SERVER_PORT); + + /* Create the listen socket. */ + if ((ls = socket (AF_INET, SOCK_STREAM, 0)) == -1) { + syslog_io_message (LOG_ERR, "unable to create socket"); + exit (1); + } + + /* Bind the listen address to the socket. */ + if (bind (ls, (struct sockaddr *) &server, + sizeof (struct sockaddr_in)) == -1) { + syslog_io_message (LOG_ERR, "bind"); + exit (1); + } + + /* Initiate the listen on the socket so remote users * can connect. */ + if (listen (ls, 20) == -1) { + syslog_io_message (LOG_ERR, "listen"); + exit (1); + } + + return (ls); +} /* internet_init */ + + +/* + * handle_internet_request -- accept a request from a client and send the + * information to stdout (the gnu process). + */ + +static void +handle_internet_request (int ls) +{ + int s; + size_t addrlen = sizeof (struct sockaddr_in); + struct sockaddr_in peer; /* for peer socket address */ + pid_t pid; + + memset ((char *) &peer, 0, sizeof (struct sockaddr_in)); + + if ((s = accept (ls, (struct sockaddr *) &peer, (void *) &addrlen)) == -1) { + syslog_io_message (LOG_ERR, "accept"); + exit (1); + } + + if (verbose_output) + syslog_message (LOG_INFO, "Connection was made from %s port %u.", + inet_ntoa (peer.sin_addr), ntohs (peer.sin_port)); + + /* Check that access is allowed - if not return crud to the client */ + if (!permitted (peer.sin_addr.s_addr, s)) { + close (s); + syslog_message (LOG_CRIT, "Refused connection from %s.", + inet_ntoa (peer.sin_addr)); + return; + } /* if */ + + if (verbose_output) + syslog_message (LOG_INFO, "Accepted connection from %s port %u.", + inet_ntoa (peer.sin_addr), ntohs (peer.sin_port)); + + pid = fork (); + + if (pid == -1) { + syslog_io_message (LOG_ERR, "fork failed"); + exit (1); + } + + if (pid) { + if (verbose_output) + syslog_message (LOG_INFO, "Child pid is %d.", pid); + return; + } + + handle_parent_connection (s); + + close (s); + + if (verbose_output) + syslog_message (LOG_INFO, "Closed connection to %s port %u.", + inet_ntoa (peer.sin_addr), ntohs (peer.sin_port)); + + _exit (0); +} /* handle_internet_request */ + +static void +handle_signal (int sig) +{ + if (sig == SIGCHLD) + return; + + syslog_message (LOG_ERR, "Catched signal %d.\n", sig); + exit (1); +} + +static const GOptionEntry options [] = { + { "debug", 'd', 0, G_OPTION_ARG_NONE, &enable_debug, + N_("Enable debugging"), NULL }, + { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose_output, + N_("Enable verbose output"), NULL }, + { "no-daemon", 'f', 0, G_OPTION_ARG_NONE, &no_daemon, + N_("Don’t fork into background"), NULL }, + { "inetd", 'i', 0, G_OPTION_ARG_NONE, &invoked_from_inetd, + N_("Invoked from inetd"), NULL }, + { NULL } +}; + +int +main (int argc, char **argv) +{ + const unsigned method = GLIBTOP_METHOD_PIPE; + const unsigned long features = GLIBTOP_SYSDEPS_ALL; + glibtop *server = glibtop_global_server; + GOptionContext *goption_context; + GError *error = NULL; + + int ils = -1; /* internet domain listen socket */ + + setlocale (LC_ALL, ""); + + /* On non-glibc systems, this is not set up for us. */ + if (!program_invocation_name) { + char *arg; + + program_invocation_name = (char *) argv[0]; + arg = strrchr (argv[0], '/'); + program_invocation_short_name = + arg ? (arg + 1) : program_invocation_name; + } + + g_set_prgname (program_invocation_short_name); + goption_context = g_option_context_new (NULL); + g_option_context_add_main_entries (goption_context, options, NULL); + g_option_context_parse (goption_context, &argc, &argv, &error); + g_option_context_free (goption_context); + + if (error != NULL) { + g_printerr ("%s\n", error->message); + g_error_free (error); + g_printerr (_("Run “%s --help” to see a full list of " + "available command line options.\n"), + program_invocation_name); + exit(1); + } + + if (enable_debug) + verbose_output = 1; + + if (no_daemon) { + openlog ("libgtop-daemon", LOG_PERROR | LOG_PID, LOG_LOCAL0); + } else { + openlog ("libgtop-daemon", LOG_PID, LOG_LOCAL0); + } + + if (!no_daemon && !invoked_from_inetd) { + pid_t pid = fork (); + + if (pid == -1) { + syslog_io_message (LOG_ERR, "fork failed"); + exit (1); + } else if (pid) + exit (0); + + close (0); + + setsid (); + } + + glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_INIT); + + signal (SIGCHLD, handle_signal); + + /* If we are root, completely switch to SERVER_UID and + * SERVER_GID. Otherwise we completely drop any priviledges. + */ + + if (enable_debug) + syslog_message (LOG_DEBUG, "Parent ID: (%d, %d) - (%d, %d)", + getuid (), geteuid (), getgid (), getegid ()); + + if (geteuid () == 0) { + changed_uid = 1; + if (setregid (SERVER_GID, SERVER_GID)) { + syslog_io_message (LOG_ERR, "setregid (SERVER_GID)"); + exit (1); + } + if (setreuid (SERVER_UID, SERVER_UID)) { + syslog_io_message (LOG_ERR, "setreuid (SERVER_UID)"); + exit (1); + } + } else { + if (setreuid (geteuid (), geteuid ())) { + syslog_io_message (LOG_ERR, "setreuid (euid)"); + exit (1); + } + } + + if (enable_debug) + syslog_message (LOG_DEBUG, "Parent ID: (%d, %d) - (%d, %d)", + getuid (), geteuid (), getgid (), getegid ()); + + if (invoked_from_inetd) { + size_t addrlen = sizeof (struct sockaddr_in); + struct sockaddr_in peer; + + memset ((char *) &peer, 0, sizeof (struct sockaddr_in)); + + if (getpeername (0, (struct sockaddr *) &peer, (void *) &addrlen)) { + syslog_io_message (LOG_ERR, "getpeername"); + exit (1); + } + + if (verbose_output) + syslog_message (LOG_INFO, "Connection was made from %s port %u.", + inet_ntoa (peer.sin_addr), ntohs (peer.sin_port)); + + /* Check that access is allowed - if not return crud to the client */ + if (!permitted (peer.sin_addr.s_addr, 0)) { + close (0); + syslog_message (LOG_CRIT, "Refused connection from %s.", + inet_ntoa (peer.sin_addr)); + exit (1); + } + + handle_parent_connection (0); + exit (0); + } + + /* get a internet domain socket to listen on. */ + ils = internet_init (); + + if (ils <= 0) { + syslog_message (LOG_ERR, "Unable to get internet domain socket."); + exit (1); + } + + glibtop_set_parameter_l (server, GLIBTOP_PARAM_METHOD, + &method, sizeof (method)); + + server->features = features; + + glibtop_init_r (&server, 0, 0); + + while (1) { + fd_set rmask; + int status, ret; + + while ((ret = wait3 (&status, WNOHANG, NULL)) != 0) { + if ((ret == -1) && (errno == ECHILD)) + break; + + if ((ret == -1) && ((errno == EAGAIN))) + continue; + if (ret == 0) { + syslog_io_message (LOG_WARNING, "wait3"); + continue; + } + + if (verbose_output) + syslog_message (LOG_INFO, "Child %d exited.", ret); + } + + FD_ZERO (&rmask); + + /* Only the child accepts connections from standard + * input made by its parent. */ + + FD_SET (ils, &rmask); + + if (enable_debug) + syslog_message (LOG_DEBUG, + "Server ready and waiting for connections."); + + if (select (ils+1, &rmask, (fd_set *) NULL, (fd_set *) NULL, + (struct timeval *) NULL) < 0) { + if (errno == EINTR) + continue; + syslog_io_message (LOG_ERR, "select"); + exit (1); + } + + if (FD_ISSET (ils, &rmask)) + handle_internet_request (ils); + } + + return 0; +} diff --git a/src/daemon/io.c b/src/daemon/io.c new file mode 100644 index 0000000..36c526f --- /dev/null +++ b/src/daemon/io.c @@ -0,0 +1,92 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include "daemon.h" +#include + +void +do_output (int s, glibtop_response *resp, off_t offset, + size_t data_size, const void *data) +{ + glibtop_debug ("Really writing %d bytes at offset %lu.", + sizeof (glibtop_response), offset); + + resp->offset = offset; + resp->data_size = data_size; + + if (s == 0) { + if (write (1, (const void *) resp, sizeof (glibtop_response)) < 0) + glibtop_warn_io ("write"); + } else { + if (send (s, (const void *) resp, sizeof (glibtop_response), 0) < 0) + glibtop_warn_io ("send"); + } + + if (resp->data_size) { + glibtop_debug ("Writing %d bytes of data.", resp->data_size); + + if (s == 0) { + if (write (1, data, resp->data_size) < 0) + glibtop_warn_io ("write"); + } else { + if (send (s, data, resp->data_size, 0) , 0) + glibtop_warn_io ("send"); + } + } +} + +int +do_read (int s, void *ptr, size_t total_size) +{ + int nread; + char *tmp_ptr; + size_t already_read = 0, remaining = total_size; + + while (already_read < total_size) { + if (s) + nread = recv (s, ptr, remaining, 0); + else + nread = read (0, ptr, remaining); + + if ((already_read == 0) && (nread == 0)) { + glibtop_warn ("pid %d received eof.", getpid ()); + return 0; + } + + if (nread <= 0) { + glibtop_warn_io ("recv"); + return 0; + } + + already_read += nread; + remaining -= nread; + /* (char *) ptr += nread; */ + tmp_ptr = ptr; + tmp_ptr += nread; + ptr = tmp_ptr; + + glibtop_debug ("READ (%d): %d - %d - %d", + nread, already_read, remaining, total_size); + } + + return already_read; +} diff --git a/src/daemon/main.c b/src/daemon/main.c new file mode 100644 index 0000000..b51addf --- /dev/null +++ b/src/daemon/main.c @@ -0,0 +1,248 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include "daemon.h" + +#ifdef LIBGTOP_ENABLE_DEBUG +#ifndef PARENT_DEBUG +#define PARENT_DEBUG 1 +#endif +#endif + +void +handle_parent_connection (int s) +{ + glibtop *server = glibtop_global_server; + glibtop_response _resp, *resp = &_resp; + glibtop_command _cmnd, *cmnd = &_cmnd; + glibtop_mountentry *mount_list; + char parameter [BUFSIZ]; + unsigned short device; + gint64 *param_ptr; + int all_fs; + pid_t pid; + void *ptr; + + glibtop_send_version (glibtop_global_server, s); + + if (verbose_output) + syslog_message (LOG_INFO, "Parent features = %lu", + glibtop_server_features); + + if (enable_debug) + syslog_message (LOG_DEBUG, "SIZEOF: %u - %u - %u - %u - %u - %u", + sizeof (glibtop_command), sizeof (glibtop_response), + sizeof (glibtop_mountentry), sizeof (glibtop_union), + sizeof (glibtop_sysdeps), + sizeof (glibtop_response_union)); + + while (do_read (s, cmnd, sizeof (glibtop_command))) { + if (enable_debug) + syslog_message (LOG_DEBUG, + "Parent (%d) received command %llu from client.", + getpid (), cmnd->command); + + if (cmnd->data_size >= BUFSIZ) { + syslog_message (LOG_WARNING, + "Client sent %llu bytes, but buffer is %lu", + cmnd->data_size, (unsigned long)BUFSIZ); + return; + } + + memset (resp, 0, sizeof (glibtop_response)); + + memset (parameter, 0, sizeof (parameter)); + + if (cmnd->data_size) { + if (enable_debug) + syslog_message (LOG_DEBUG, "Client has %llu bytes of data.", + cmnd->data_size); + + do_read (s, parameter, cmnd->data_size); + + } else if (cmnd->size) { + memcpy (parameter, cmnd->parameter, cmnd->size); + } + + switch (cmnd->command) { + case GLIBTOP_CMND_QUIT: + do_output (s, resp, 0, 0, NULL); + return; + case GLIBTOP_CMND_SYSDEPS: + memcpy (&resp->u.sysdeps, &server->sysdeps, + sizeof (glibtop_sysdeps)); + resp->u.sysdeps.features = GLIBTOP_SYSDEPS_ALL; + do_output (s, resp, _offset_union (sysdeps), 0, NULL); + break; + case GLIBTOP_CMND_CPU: + glibtop_get_cpu_l (server, &resp->u.data.cpu); + do_output (s, resp, _offset_data (cpu), 0, NULL); + break; + case GLIBTOP_CMND_MEM: + glibtop_get_mem_l (server, &resp->u.data.mem); + do_output (s, resp, _offset_data (mem), 0, NULL); + break; + case GLIBTOP_CMND_SWAP: + glibtop_get_swap_l (server, &resp->u.data.swap); + do_output (s, resp, _offset_data (swap), 0, NULL); + break; + case GLIBTOP_CMND_UPTIME: + glibtop_get_uptime_l (server, &resp->u.data.uptime); + do_output (s, resp, _offset_data (uptime), 0, NULL); + break; + case GLIBTOP_CMND_LOADAVG: + glibtop_get_loadavg_l (server, &resp->u.data.loadavg); + do_output (s, resp, _offset_data (loadavg), 0, NULL); + break; + case GLIBTOP_CMND_SHM_LIMITS: + glibtop_get_shm_limits_l + (server, &resp->u.data.shm_limits); + do_output (s, resp, _offset_data (shm_limits), 0, NULL); + break; + case GLIBTOP_CMND_MSG_LIMITS: + glibtop_get_msg_limits_l + (server, &resp->u.data.msg_limits); + do_output (s, resp, _offset_data (msg_limits), 0, NULL); + break; + case GLIBTOP_CMND_SEM_LIMITS: + glibtop_get_sem_limits_l + (server, &resp->u.data.sem_limits); + do_output (s, resp, _offset_data (sem_limits), 0, NULL); + break; + case GLIBTOP_CMND_PROCLIST: + param_ptr = (gint64 *) parameter; + ptr = glibtop_get_proclist_l (server, + &resp->u.data.proclist, + param_ptr [0], + param_ptr [1]); + do_output (s, resp, _offset_data (proclist), + resp->u.data.proclist.total, ptr); + g_free (ptr); + break; + case GLIBTOP_CMND_PROC_MAP: + memcpy (&pid, parameter, sizeof (pid_t)); + ptr = glibtop_get_proc_map_l (server, + &resp->u.data.proc_map, + pid); + do_output (s, resp, _offset_data (proc_map), + resp->u.data.proc_map.total, ptr); + g_free (ptr); + break; + + case GLIBTOP_CMND_PROC_WD: + /* FIXME */ + break; + + case GLIBTOP_CMND_NETLIST: + /* FIXME */ + break; + + case GLIBTOP_CMND_PROC_ARGS: + memcpy (&pid, parameter, sizeof (pid_t)); + ptr = glibtop_get_proc_args_l (server, + &resp->u.data.proc_args, + pid, 0); + do_output (s, resp, _offset_data (proc_args), + ptr ? resp->u.data.proc_args.size+1 : 0, ptr); + g_free (ptr); + break; + case GLIBTOP_CMND_PROC_STATE: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_state_l + (server, &resp->u.data.proc_state, pid); + do_output (s, resp, _offset_data (proc_state), 0, NULL); + break; + case GLIBTOP_CMND_PROC_UID: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_uid_l + (server, &resp->u.data.proc_uid, pid); + do_output (s, resp, _offset_data (proc_uid), 0, NULL); + break; + case GLIBTOP_CMND_PROC_MEM: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_mem_l + (server, &resp->u.data.proc_mem, pid); + do_output (s, resp, _offset_data (proc_mem), 0, NULL); + break; + case GLIBTOP_CMND_PROC_TIME: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_time_l + (server, &resp->u.data.proc_time, pid); + do_output (s, resp, _offset_data (proc_time), 0, NULL); + break; + case GLIBTOP_CMND_PROC_SIGNAL: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_signal_l + (server, &resp->u.data.proc_signal, pid); + do_output (s, resp, _offset_data (proc_signal), 0, NULL); + break; + case GLIBTOP_CMND_PROC_KERNEL: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_kernel_l + (server, &resp->u.data.proc_kernel, pid); + do_output (s, resp, _offset_data (proc_kernel), 0, NULL); + break; + case GLIBTOP_CMND_PROC_SEGMENT: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_segment_l + (server, &resp->u.data.proc_segment, pid); + do_output (s, resp, _offset_data (proc_segment), 0, NULL); + break; + case GLIBTOP_CMND_MOUNTLIST: + memcpy (&all_fs, parameter, sizeof (all_fs)); + mount_list = glibtop_get_mountlist_l + (server, &resp->u.data.mountlist, all_fs); + do_output (s, resp, _offset_data (mountlist), + resp->u.data.mountlist.total, mount_list); + g_free (mount_list); + break; + case GLIBTOP_CMND_FSUSAGE: + glibtop_get_fsusage_l + (server, &resp->u.data.fsusage, parameter); + do_output (s, resp, _offset_data (fsusage), + 0, NULL); + break; + case GLIBTOP_CMND_PROC_IO: + glibtop_get_proc_io_l + (server, &resp->u.data.proc_io, parameter); + do_output (s, resp, _offset_data (proc_io), + 0, NULL); + break; + case GLIBTOP_CMND_PPP: + memcpy (&device, parameter, sizeof (device)); + glibtop_get_ppp_l + (server, &resp->u.data.ppp, device); + do_output (s, resp, _offset_data (ppp), 0, NULL); + break; + case GLIBTOP_CMND_NETLOAD: + glibtop_get_netload_l + (server, &resp->u.data.netload, parameter); + do_output (s, resp, _offset_data (netload), + 0, NULL); + break; + default: + syslog_message (LOG_ERR, "Parent received unknown command %llu.", + cmnd->command); + break; + } + } +} diff --git a/src/daemon/server.c b/src/daemon/server.c new file mode 100644 index 0000000..60427e8 --- /dev/null +++ b/src/daemon/server.c @@ -0,0 +1,96 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include "daemon.h" + +#include +#include +#include +#include +#include + +#include + +#include +#include + +int +main(int argc, char *argv[]) +{ + struct utsname uts; + int uid, euid, gid, egid; + + /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ + + uid = getuid (); euid = geteuid (); + gid = getgid (); egid = getegid (); + + glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid()); + + if (uname (&uts) < 0) _exit (1); + +#ifdef _AIX + /* + * [FIXME]: should be in sysdeps part ? + */ + + if ((strcmp (uts.sysname, LIBGTOP_COMPILE_SYSTEM) != 0) || + ((atol(uts.version) < atol(LIBGTOP_COMPILE_VERSION)) && + (atol(uts.release) < atol(LIBGTOP_COMPILE_RELEASE))) ) { + fprintf (stderr, "Can only run on %s %s.%s and upper\n", + LIBGTOP_COMPILE_SYSTEM, + LIBGTOP_COMPILE_VERSION, + LIBGTOP_COMPILE_RELEASE); + _exit (1); + } +#else + if (strcmp (uts.sysname, LIBGTOP_COMPILE_SYSTEM) || + strcmp (uts.release, LIBGTOP_COMPILE_RELEASE) || + strcmp (uts.machine, LIBGTOP_COMPILE_MACHINE)) { + fprintf (stderr, "This libgtop was compiled on %s %s %s\n", + LIBGTOP_COMPILE_SYSTEM, + LIBGTOP_COMPILE_RELEASE, + LIBGTOP_COMPILE_MACHINE); + fprintf (stderr, "If you see strange problems caused by it,\n"); + fprintf (stderr, "you should recompile libgtop and dependent " + "applications.\n"); + } +#endif + + glibtop_machine_new (glibtop_global_server); + + glibtop_init_p (glibtop_global_server, 0, 0); + + glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid()); + + if (setreuid (euid, uid)) _exit (1); + + if (setregid (egid, gid)) _exit (1); + + glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid()); + + /* !!! END OF SUID ROOT PART !!! */ + + handle_slave_connection (0, 0); + + _exit (0); +} diff --git a/src/daemon/server_config.h b/src/daemon/server_config.h new file mode 100644 index 0000000..595c596 --- /dev/null +++ b/src/daemon/server_config.h @@ -0,0 +1,11 @@ +#define SERVER_PORT 42800 + +#define SERVER_UID 99 +#define SERVER_GID 99 + +#define HOST_TABLE_ENTRIES 1 + +const char *permitted_host_names [HOST_TABLE_ENTRIES] = +{ NULL }; + +unsigned long permitted_hosts [HOST_TABLE_ENTRIES]; diff --git a/src/daemon/server_config.h.in b/src/daemon/server_config.h.in new file mode 100644 index 0000000..f7884c8 --- /dev/null +++ b/src/daemon/server_config.h.in @@ -0,0 +1,44 @@ +/* -*-c-*- */ + +/* This is a sample config file. + * + * Copy this file to 'server_config.h' and edit it to fix your needs ! + * + * You can also use the 'server_config.pl' script to create 'server_config.h'. + * + */ + +#define SERVER_PORT 42800 /* Port the server should listen on. */ + +/* NOTE: On RedHat 5.1 nobody is UID 99 and GID 99. + * + * The 'server_config.pl' script will use the real UID and GID of 'nobody' + * on your system as default. + * + * NOTE: This only works if the server is started as root or SUID to root. + */ + +#define SERVER_UID 99 /* User ID the server should run as. */ +#define SERVER_GID 99 /* Group ID the server should run as. */ + +#define HOST_TABLE_ENTRIES 1 /* Number of entries in the host table. */ + +/* List of hosts that should be authorized to connect to the server. + * + * SECURITY WARNING: + * Enabling access for a particular hosts means the ALL USERS on this host + * will be allowed to connect to the server ! + * + * If you want security, let this table empty and use the 'xauth' method + * instead. + * + * Look at the manpage of gnuserv (1) as shipped with GNU Emacs for more + * details about security. The server uses the same security mechanisms + * like gnuserv from XEmacs 20.3. + */ + +const char *permitted_host_names [HOST_TABLE_ENTRIES] = +{ NULL }; + +unsigned long permitted_hosts [HOST_TABLE_ENTRIES]; + diff --git a/src/daemon/server_config.pl b/src/daemon/server_config.pl new file mode 100755 index 0000000..3e78ca8 --- /dev/null +++ b/src/daemon/server_config.pl @@ -0,0 +1,111 @@ +#!/usr/bin/perl -w + +require 5.004; +use strict; + +print "Enter port the server should listen on [42800]: "; + +my $port = ; chop $port; +$port = 42800 unless $port =~ /^\d+$/; + +print "\nUser name or UID to run as [nobody]: "; + +my $user = ; chop $user; $user = 'nobody' if $user eq ''; + +my ($login, $pass, $uid, $gid); + +unless ($user =~ /^\d+$/) { + ($login, $pass, $uid, $gid) = getpwnam ($user) or + die "User '$user' not in passwd file."; +} + +my $g_default = (defined $gid) ? $gid : 'nogroup'; + +print "Group name or GID to run as [$g_default]: "; + +my $group = ; chop $group; $group = $g_default if $group eq ''; + +unless ($group =~ /^\d+$/) { + $gid = getgrnam ($group) or + die "Group '$group' not in group file."; +} + +print "\nEnter list of hosts which should be authorized to"; +print "\nconnect to the server (terminate with a blank line):\n\n"; + +print "SECURITY WARNING:\n"; +print " Enabling access for a particular hosts means the ALL USERS on this host will\n"; +print " be allowed to connect to the server !\n\n"; + +print " If you want security, let this table empty and use the 'xauth' method instead.\n"; +print " Look at the manpage of gnuserv (1) as shipped with GNU Emacs for more details\n"; +print " about security. The server uses the same security mechanisms like gnuserv from\n"; +print " XEmacs 20.3\n\n"; + +my @hosts = (); +my @host_addrs = (); +my @host_names = (); + +while (1) { + print "Host: "; + + my $host = ; chop $host; + last if $host eq ''; + + my ($name,$aliases,$addrtype,$length,@addrs) = gethostbyname ($host) or + die "gethostbyname (): Can't resolve '$host'"; + + my ($a,$b,$c,$d) = unpack('C4',$addrs[0]); + + push @hosts, sprintf ("0x%02X%02X%02X%02X", $d, $c, $b, $a); + push @host_addrs, sprintf ("%d.%d.%d.%d", $a, $b, $c, $d); + push @host_names, $name; +}; + +print "\n"; +print "This is your config:\n"; +print "====================\n\n"; + +printf qq[%-30s: %d\n\n], 'Port', $port; +printf qq[%-30s: %d\n], 'UID', $uid; +printf qq[%-30s: %d\n\n], 'GID', $gid; + +foreach (0..$#hosts) { + printf qq[%-30s (%s - %s)\n], $host_names[$_], $hosts[$_], $host_addrs [$_]; +} + +print "\n"; + +print "Accept? (yes/no) "; + +my $accept = ; chop $accept; + +exit unless $accept eq 'yes'; + +print "\n"; + +open CONFIG, "> server_config.h" or + die "open (server_config.h): $!"; +select CONFIG; + +printf qq[\#define SERVER_PORT\t\t%d\n\n], $port; + +printf qq[\#define SERVER_UID\t\t%d\n], $uid; +printf qq[\#define SERVER_GID\t\t%d\n\n], $gid; + +printf qq[\#define HOST_TABLE_ENTRIES\t%d\n\n], $#hosts + 1; + +foreach (@host_names) { + $_ = qq["$_"]; +} + +printf qq[const char *permitted_host_names [HOST_TABLE_ENTRIES] = \n]; +printf qq[{ %s };\n\n], join (', ', @host_names); + +printf qq[unsigned long permitted_hosts [HOST_TABLE_ENTRIES];\n]; + +close CONFIG; + +select STDOUT; + +print "Your config has successfully been written to 'server_config.h'.\n"; diff --git a/src/daemon/slave.c b/src/daemon/slave.c new file mode 100644 index 0000000..e15f1ef --- /dev/null +++ b/src/daemon/slave.c @@ -0,0 +1,262 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include "daemon.h" +#include + +void +handle_slave_connection (int input, int output) +{ + glibtop *server G_GNUC_UNUSED = glibtop_global_server; + const void *ptr G_GNUC_UNUSED; + + unsigned short max_len G_GNUC_UNUSED; + pid_t pid G_GNUC_UNUSED; + gint64 proc_which G_GNUC_UNUSED; + gint64 proc_arg G_GNUC_UNUSED; + + glibtop_response _resp, *resp = &_resp; + glibtop_command _cmnd, *cmnd = &_cmnd; + char parameter [BUFSIZ]; + + glibtop_send_version (glibtop_global_server, output); + + while (do_read (input, cmnd, sizeof (glibtop_command))) { + glibtop_debug ("Slave %d received command " + "%llu from client.", getpid (), cmnd->command); + + if (cmnd->data_size >= BUFSIZ) + glibtop_error ("Client sent %llu bytes, " + "but buffer is %lu", + cmnd->size, (unsigned long)BUFSIZ); + + memset (resp, 0, sizeof (glibtop_response)); + + memset (parameter, 0, sizeof (parameter)); + + if (cmnd->data_size) { + glibtop_debug ("Client has %llu bytes of data.", + cmnd->data_size); + + do_read (input, parameter, cmnd->data_size); + + } else if (cmnd->size) { + memcpy (parameter, cmnd->parameter, cmnd->size); + } + + switch (cmnd->command) { + case GLIBTOP_CMND_QUIT: + do_output (output, resp, 0, 0, NULL); + return; +#if GLIBTOP_SUID_PROCLIST + case GLIBTOP_CMND_PROCLIST: + memcpy(&proc_which, parameter, sizeof proc_which); + memcpy(&proc_arg, parameter + sizeof proc_which, sizeof proc_arg); + ptr = glibtop_get_proclist_p + (server, &resp->u.data.proclist, + proc_which, proc_arg); + do_output (output, resp, _offset_data (proclist), + resp->u.data.proclist.total, ptr); + g_free (ptr); + break; +#endif +#if GLIBTOP_SUID_PROC_ARGS + case GLIBTOP_CMND_PROC_ARGS: + memcpy (&pid, parameter, sizeof (pid_t)); + memcpy (&max_len, parameter + sizeof (pid_t), + sizeof (max_len)); + ptr = glibtop_get_proc_args_p (server, + &resp->u.data.proc_args, + pid, max_len); + do_output (output, resp, _offset_data (proc_args), + ptr ? resp->u.data.proc_args.size+1 : 0, + ptr); + g_free (ptr); + break; +#endif +#if GLIBTOP_SUID_PROC_MAP + case GLIBTOP_CMND_PROC_MAP: + memcpy (&pid, parameter, sizeof (pid_t)); + ptr = glibtop_get_proc_map_p (server, + &resp->u.data.proc_map, + pid); + do_output (output, resp, _offset_data (proc_map), + resp->u.data.proc_map.total, ptr); + g_free (ptr); + break; +#endif + default: + handle_slave_command (cmnd, resp, parameter); + do_output (output, resp, resp->offset, 0, NULL); + break; + } + } +} + +void +handle_slave_command (glibtop_command *cmnd, glibtop_response *resp, + const void *parameter) +{ + glibtop *server = glibtop_global_server; + unsigned device G_GNUC_UNUSED; + pid_t pid G_GNUC_UNUSED; + + switch (cmnd->command) { + case GLIBTOP_CMND_SYSDEPS: + memcpy (&resp->u.sysdeps, &server->sysdeps, + sizeof (glibtop_sysdeps)); + resp->u.sysdeps.features = glibtop_server_features; + resp->u.sysdeps.flags = glibtop_server_features | + (1L << GLIBTOP_SYSDEPS_FEATURES); + resp->offset = _offset_union (sysdeps); + break; +#if GLIBTOP_SUID_CPU + case GLIBTOP_CMND_CPU: + glibtop_get_cpu_p (server, &resp->u.data.cpu); + resp->offset = _offset_data (cpu); + break; +#endif +#if GLIBTOP_SUID_MEM + case GLIBTOP_CMND_MEM: + glibtop_get_mem_p (server, &resp->u.data.mem); + resp->offset = _offset_data (mem); + break; +#endif +#if GLIBTOP_SUID_SWAP + case GLIBTOP_CMND_SWAP: + glibtop_get_swap_p (server, &resp->u.data.swap); + resp->offset = _offset_data (swap); + break; +#endif +#if GLIBTOP_SUID_UPTIME + case GLIBTOP_CMND_UPTIME: + glibtop_get_uptime_p (server, &resp->u.data.uptime); + resp->offset = _offset_data (uptime); + break; +#endif +#if GLIBTOP_SUID_LOADAVG + case GLIBTOP_CMND_LOADAVG: + glibtop_get_loadavg_p (server, &resp->u.data.loadavg); + resp->offset = _offset_data (loadavg); + break; +#endif +#if GLIBTOP_SUID_SHM_LIMITS + case GLIBTOP_CMND_SHM_LIMITS: + glibtop_get_shm_limits_p (server, &resp->u.data.shm_limits); + resp->offset = _offset_data (shm_limits); + break; +#endif +#if GLIBTOP_SUID_MSG_LIMITS + case GLIBTOP_CMND_MSG_LIMITS: + glibtop_get_msg_limits_p (server, &resp->u.data.msg_limits); + resp->offset = _offset_data (msg_limits); + break; +#endif +#if GLIBTOP_SUID_SEM_LIMITS + case GLIBTOP_CMND_SEM_LIMITS: + glibtop_get_sem_limits_p (server, &resp->u.data.sem_limits); + resp->offset = _offset_data (sem_limits); + break; +#endif +#if GLIBTOP_SUID_PROC_STATE + case GLIBTOP_CMND_PROC_STATE: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_state_p + (server, &resp->u.data.proc_state, pid); + resp->offset = _offset_data (proc_state); + break; +#endif +#if GLIBTOP_SUID_PROC_UID + case GLIBTOP_CMND_PROC_UID: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_uid_p + (server, &resp->u.data.proc_uid, pid); + resp->offset = _offset_data (proc_uid); + break; +#endif +#if GLIBTOP_SUID_PROC_MEM + case GLIBTOP_CMND_PROC_MEM: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_mem_p + (server, &resp->u.data.proc_mem, pid); + resp->offset = _offset_data (proc_mem); + break; +#endif +#if GLIBTOP_SUID_PROC_TIME + case GLIBTOP_CMND_PROC_TIME: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_time_p + (server, &resp->u.data.proc_time, pid); + resp->offset = _offset_data (proc_time); + break; +#endif +#if GLIBTOP_SUID_PROC_IO + case GLIBTOP_CMND_PROC_IO: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_io_p + (server, &resp->u.data.proc_io, pid); + resp->offset = _offset_data (proc_time); + break; +#endif +#if GLIBTOP_SUID_PROC_SIGNAL + case GLIBTOP_CMND_PROC_SIGNAL: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_signal_p + (server, &resp->u.data.proc_signal, pid); + resp->offset = _offset_data (proc_signal); + break; +#endif +#if GLIBTOP_SUID_PROC_KERNEL + case GLIBTOP_CMND_PROC_KERNEL: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_kernel_p + (server, &resp->u.data.proc_kernel, pid); + resp->offset = _offset_data (proc_kernel); + break; +#endif +#if GLIBTOP_SUID_PROC_SEGMENT + case GLIBTOP_CMND_PROC_SEGMENT: + memcpy (&pid, parameter, sizeof (pid_t)); + glibtop_get_proc_segment_p + (server, &resp->u.data.proc_segment, pid); + resp->offset = _offset_data (proc_segment); + break; +#endif +#if GLIBTOP_SUID_NETLOAD + case GLIBTOP_CMND_NETLOAD: + glibtop_get_netload_p (server, &resp->u.data.netload, parameter); + resp->offset = _offset_data (netload); + break; +#endif +#if GLIBTOP_SUID_PPP + case GLIBTOP_CMND_PPP: + memcpy (&device, parameter, sizeof (unsigned short)); + glibtop_get_ppp_p (server, &resp->u.data.ppp, device); + resp->offset = _offset_data (ppp); + break; +#endif + default: + glibtop_error ("Child received unknown command %llu", + cmnd->command); + break; + } +} diff --git a/src/daemon/version.c b/src/daemon/version.c new file mode 100644 index 0000000..ac11df3 --- /dev/null +++ b/src/daemon/version.c @@ -0,0 +1,62 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include + + +void +glibtop_send_version (glibtop *server, int fd) +{ + char buffer [BUFSIZ]; + size_t size; + + sprintf (buffer, LIBGTOP_VERSION_STRING, + LIBGTOP_VERSION, LIBGTOP_SERVER_VERSION, + (unsigned) sizeof (glibtop_command), + (unsigned) sizeof (glibtop_response), + (unsigned) sizeof (glibtop_union), + (unsigned) sizeof (glibtop_sysdeps)); + + size = strlen (buffer) + 1; + + glibtop_debug ("SERVER ID: |%s|", buffer); + + if (fd == 0) { + if (write (1, (const void *) &size, sizeof (size)) < 0) + glibtop_warn_io_r (server, "write"); + } else { + if (send (fd, (const void *) &size, sizeof (size), 0) < 0) + glibtop_warn_io_r (server, "send"); + } + + if (fd == 0) { + if (write (1, (const void *) buffer, size) < 0) + glibtop_warn_io_r (server, "write"); + } else { + if (send (fd, (const void *) buffer, size, 0) < 0) + glibtop_warn_io_r (server, "send"); + } +} diff --git a/sysdeps/Makefile.am b/sysdeps/Makefile.am new file mode 100644 index 0000000..163c008 --- /dev/null +++ b/sysdeps/Makefile.am @@ -0,0 +1,6 @@ + +SUBDIRS = common @sysdeps_dir@ + +DIST_SUBDIRS = bsd common linux osf1 \ + stub stub_suid sun4 freebsd solaris aix darwin \ + cygwin openbsd diff --git a/sysdeps/Makefile.in b/sysdeps/Makefile.in new file mode 100644 index 0000000..35b158d --- /dev/null +++ b/sysdeps/Makefile.in @@ -0,0 +1,696 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = sysdeps +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = common @sysdeps_dir@ +DIST_SUBDIRS = bsd common linux osf1 \ + stub stub_suid sun4 freebsd solaris aix darwin \ + cygwin openbsd + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sysdeps/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu sysdeps/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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: diff --git a/sysdeps/aix/ChangeLog b/sysdeps/aix/ChangeLog new file mode 100644 index 0000000..18c6e7d --- /dev/null +++ b/sysdeps/aix/ChangeLog @@ -0,0 +1,105 @@ +2004-12-23 Benoît Dejean + + * netlist.c: + * Makefile.am: Added dummy glibtop_get_netlist. + +2004-10-22 Benoît Dejean + + * procargs.c: (glibtop_get_proc_args_s): + * prockernel.c: (glibtop_get_proc_kernel_s): + * procmem.c: (glibtop_get_proc_mem_s): + * procsegment.c: (glibtop_get_proc_segment_s): + * procsignal.c: (glibtop_get_proc_signal_s): + * procstate.c: (glibtop_get_proc_state_s): + * proctime.c: (glibtop_get_proc_time_s): + * procuid.c: (glibtop_get_proc_uid_s): No longer abort() is no such pid. + buf.flags == 0ULL means that there no data could be retrieve at all. + Closes #154876. Thanks to Christophe Belle. + +2004-10-04 Benoît Dejean + + * procstate.c: (glibtop_get_proc_state_s): Fixed .state to follow + LibGTop2 specification. + +2004-10-04 Benoît Dejean + + * procmap.c: (glibtop_get_proc_map_s): Fixed glibtop_init_s call. + +2004-10-04 Benoît Dejean + + * Makefile.am: + * cpu.c: (glibtop_init_cpu_p), (glibtop_get_cpu_p): + * glibtop_machine.h: + * glibtop_server.h: + * mem.c: (glibtop_get_mem_s): + * netload.c: (glibtop_get_netload_p): + * procargs.c: (glibtop_get_proc_args_s): + * prockernel.c: (glibtop_get_proc_kernel_s): + * proclist.c: (glibtop_get_proclist_s): + * procmem.c: (glibtop_get_proc_mem_s): + * procsegment.c: (glibtop_get_proc_segment_s): + * procsignal.c: (glibtop_get_proc_signal_s): + * procstate.c: (glibtop_get_proc_state_s): + * proctime.c: (glibtop_get_proc_time_s): + * procuid.c: (glibtop_get_proc_uid_s): + * swap.c: (glibtop_get_swap_s): + * sysinfo.c: (add_info), (init_sysinfo): + * uptime.c: (glibtop_init_uptime_s), (glibtop_get_uptime_s): + + AIX support updated by Laurent Vivier . + + Fixed cpu/uptime/sysinfo. + Added missing calls to glibtop_init_s. + +2004-06-13 Benoît Dejean + + * sysinfo.c: Added missing const qualifier. + +2004-06-06 Benoît Dejean + + * procargs.c: (glibtop_get_proc_args_s): Removed never executed if statements. + * procstate.c: (glibtop_get_proc_state_s): Used g_strlcpy instead of + strncpy. + +2004-05-25 Benoît Dejean + + * uptime.c: (glibtop_get_uptime_p): Added boot_time. + +2004-03-09 Bastien Nocera + + * procargs.c: (glibtop_get_proc_args_s): fix g_malloc usage on non-Linux + platforms (patch by Benoît Dejean ) + +2003-10-21 Bastien Nocera + + * Makefile.am: install only one library, libgtop-2.0 + Fix build-time warnings due to the redefinition of guint64 + +2003-10-20 Bastien Nocera + + * procsignal.c: (glibtop_get_proc_signal_s): s/u_int64_t/guint64/ + +2003-10-20 Bastien Nocera + + * glibtop_machine.h: + * glibtop_server.h: + * glibtop_suid.h: + * procargs.c: + * proclist.c: + * procmap.c: + * utils.c: + * utils.h: fixed compilation + +2003-10-20 Bastien Nocera + + * procargs.c: (glibtop_get_proc_args_s): + * proclist.c: (glibtop_get_proclist_s): + replace all the xmalloc crap by glib memory management functions + +2003-10-20 Bastien Nocera + + * .cvsignore: added + +2002-09-24 Laurent Vivier + + * Create sysdeps/aix (from stub) diff --git a/sysdeps/aix/Makefile.am b/sysdeps/aix/Makefile.am new file mode 100644 index 0000000..2ab3801 --- /dev/null +++ b/sysdeps/aix/Makefile.am @@ -0,0 +1,24 @@ + +AM_CPPFLAGS = @AM_CPPFLAGS@ + +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la + +libgtop_sysdeps_2_0_la_SOURCES = siglist.c nosuid.c mem.c swap.c uptime.c \ + procargs.c prockernel.c proclist.c procmap.c \ + procmem.c procsegment.c procsignal.c \ + proctime.c procuid.c procmem.c utils.c \ + procstate.c sysinfo.c netlist.c + + +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + +libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c cpu.c loadavg.c \ + msg_limits.c shm_limits.c sem_limits.c \ + netload.c ppp.c utils.c + +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_suid_2_0_la_LIBADD = $(top_builddir)/sysdeps/common/libgtop_suid_common-2.0.la $(GLIB_LIBS) + +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h glibtop_suid.h + +libgtopincludedir = $(includedir)/libgtop-2.0 diff --git a/sysdeps/aix/Makefile.in b/sysdeps/aix/Makefile.in new file mode 100644 index 0000000..acbb37b --- /dev/null +++ b/sysdeps/aix/Makefile.in @@ -0,0 +1,783 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = sysdeps/aix +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libgtopinclude_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libgtop_sysdeps_2_0_la_LIBADD = +am_libgtop_sysdeps_2_0_la_OBJECTS = siglist.lo nosuid.lo mem.lo \ + swap.lo uptime.lo procargs.lo prockernel.lo proclist.lo \ + procmap.lo procmem.lo procsegment.lo procsignal.lo proctime.lo \ + procuid.lo procmem.lo utils.lo procstate.lo sysinfo.lo \ + netlist.lo +libgtop_sysdeps_2_0_la_OBJECTS = $(am_libgtop_sysdeps_2_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgtop_sysdeps_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__DEPENDENCIES_1 = +libgtop_sysdeps_suid_2_0_la_DEPENDENCIES = \ + $(top_builddir)/sysdeps/common/libgtop_suid_common-2.0.la \ + $(am__DEPENDENCIES_1) +am_libgtop_sysdeps_suid_2_0_la_OBJECTS = open.lo close.lo cpu.lo \ + loadavg.lo msg_limits.lo shm_limits.lo sem_limits.lo \ + netload.lo ppp.lo utils.lo +libgtop_sysdeps_suid_2_0_la_OBJECTS = \ + $(am_libgtop_sysdeps_suid_2_0_la_OBJECTS) +libgtop_sysdeps_suid_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_suid_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +DIST_SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libgtopincludedir)" +HEADERS = $(libgtopinclude_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + ChangeLog +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la +libgtop_sysdeps_2_0_la_SOURCES = siglist.c nosuid.c mem.c swap.c uptime.c \ + procargs.c prockernel.c proclist.c procmap.c \ + procmem.c procsegment.c procsignal.c \ + proctime.c procuid.c procmem.c utils.c \ + procstate.c sysinfo.c netlist.c + +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c cpu.c loadavg.c \ + msg_limits.c shm_limits.c sem_limits.c \ + netload.c ppp.c utils.c + +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_suid_2_0_la_LIBADD = $(top_builddir)/sysdeps/common/libgtop_suid_common-2.0.la $(GLIB_LIBS) +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h glibtop_suid.h +libgtopincludedir = $(includedir)/libgtop-2.0 +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sysdeps/aix/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu sysdeps/aix/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgtop_sysdeps-2.0.la: $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_2_0_la_LINK) $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_LIBADD) $(LIBS) + +libgtop_sysdeps_suid-2.0.la: $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_suid_2_0_la_LINK) $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netload.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nosuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prockernel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsegment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsignal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procstate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siglist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-libgtopincludeHEADERS: $(libgtopinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgtopincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgtopincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgtopincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgtopincludedir)" || exit $$?; \ + done + +uninstall-libgtopincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgtopincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libgtopincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libgtopincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libgtopincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libgtopincludeHEADERS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libgtopincludeHEADERS + +.PRECIOUS: Makefile + + +# 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: diff --git a/sysdeps/aix/close.c b/sysdeps/aix/close.c new file mode 100644 index 0000000..bee09f3 --- /dev/null +++ b/sysdeps/aix/close.c @@ -0,0 +1,29 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +/* Closes pipe to gtop server. */ + +void +glibtop_close_s (glibtop *server) +{ } diff --git a/sysdeps/aix/cpu.c b/sysdeps/aix/cpu.c new file mode 100644 index 0000000..5843496 --- /dev/null +++ b/sysdeps/aix/cpu.c @@ -0,0 +1,135 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_cpu = +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + +(1L << GLIBTOP_CPU_SYS) + (1L << GLIBTOP_CPU_IDLE) + +(1L << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_FREQUENCY) + +(1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) + +(1L << GLIBTOP_XCPU_SYS) + (1L << GLIBTOP_XCPU_IDLE) + +(1L << GLIBTOP_XCPU_NICE); + +/* Init function. */ + +void +_glibtop_init_cpu_p (glibtop *server) +{ + off_t result; + + server->ncpu = _system_configuration.ncpus; + if (server->ncpu == 1) + { + server->ncpu = 0; /* means single-processor, see glibtop.h */ + } + + result = _glibtop_get_kmem_offset(server, "sysinfo"); + if (result == -1) + { + return; + } + server->machine->sysinfo_offset = result; + + result = _glibtop_get_kmem_offset(server, "cpuinfo"); + if (result == -1) + { + server->sysdeps.cpu = 0; + + return; + } + server->machine->cpuinfo_offset = result; + + server->machine->cpuinfo = (struct cpuinfo*)calloc(_system_configuration.ncpus, sizeof(struct cpuinfo)); + + server->sysdeps.cpu = _glibtop_sysdeps_cpu; +} + +/* Provides information about cpu usage. */ + +void +glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf) +{ + int result; + int cpu; + struct sysinfo sysinfo; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_CPU), 0); + + memset (buf, 0, sizeof (glibtop_cpu)); + + result = _glibtop_get_kmem_info(server, server->machine->sysinfo_offset, + &sysinfo, sizeof(struct sysinfo)); + if (result <= 0) + { + glibtop_error_io_r (server, "Cannot read sysinfo"); + return; + } + + buf->idle = sysinfo.cpu[CPU_IDLE]; + buf->user = sysinfo.cpu[CPU_USER]; + buf->sys = sysinfo.cpu[CPU_KERNEL]; + buf->nice = sysinfo.cpu[CPU_WAIT]; + + buf->total = buf->idle + buf->user + buf->sys + buf->nice ; + + result = _glibtop_get_kmem_info(server, server->machine->cpuinfo_offset, + server->machine->cpuinfo, + _system_configuration.ncpus + * sizeof(struct cpuinfo)); + + if (result <= 0) + { + glibtop_error_io_r (server, "Cannot read cpuinfo"); + return; + } + + + for (cpu = 0; cpu < MIN(GLIBTOP_NCPU, _system_configuration.ncpus); cpu++) + { + buf->xcpu_idle[cpu] = + server->machine->cpuinfo[cpu].cpu[CPU_IDLE]; + buf->xcpu_user[cpu] = + server->machine->cpuinfo[cpu].cpu[CPU_USER]; + buf->xcpu_sys[cpu] = + server->machine->cpuinfo[cpu].cpu[CPU_KERNEL]; + buf->xcpu_nice[cpu] = + server->machine->cpuinfo[cpu].cpu[CPU_WAIT]; + + buf->xcpu_total[cpu] = buf->xcpu_idle[cpu] + + buf->xcpu_user[cpu] + + buf->xcpu_sys[cpu] + + buf->xcpu_nice[cpu]; + } + + + buf->frequency = sysconf(_SC_CLK_TCK); + buf->flags = _glibtop_sysdeps_cpu; +} diff --git a/sysdeps/aix/glibtop_machine.h b/sysdeps/aix/glibtop_machine.h new file mode 100644 index 0000000..727ae5f --- /dev/null +++ b/sysdeps/aix/glibtop_machine.h @@ -0,0 +1,50 @@ +/* + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , March 1999. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_MACHINE_H__ +#define __GLIBTOP_MACHINE_H__ + +#include + +G_BEGIN_DECLS + +struct _glibtop_machine +{ + uid_t uid, euid; + gid_t gid, egid; + + int kmem_fd; + + off_t cpuinfo_offset; + off_t sysinfo_offset; + off_t ifnet_offset; + off_t loadavg_offset; + off_t shminfo_offset; + off_t seminfo_offset; + off_t msginfo_offset; + + struct cpuinfo *cpuinfo; + struct procsinfo last_pinfo; +}; + +G_END_DECLS + +#endif /* __GLIBTOP_MACHINE_H__ */ diff --git a/sysdeps/aix/glibtop_server.h b/sysdeps/aix/glibtop_server.h new file mode 100644 index 0000000..c6eacc4 --- /dev/null +++ b/sysdeps/aix/glibtop_server.h @@ -0,0 +1,51 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SERVER_H__ +#define __GLIBTOP_SERVER_H__ + +G_BEGIN_DECLS + +#define GLIBTOP_SUID_CPU (1 << GLIBTOP_SYSDEPS_CPU) +#define GLIBTOP_SUID_MEM 0 +#define GLIBTOP_SUID_SWAP 0 +#define GLIBTOP_SUID_UPTIME 0 +#define GLIBTOP_SUID_LOADAVG (1 << GLIBTOP_SYSDEPS_LOADAVG) +#define GLIBTOP_SUID_SHM_LIMITS (1 << GLIBTOP_SYSDEPS_SHM_LIMITS) +#define GLIBTOP_SUID_MSG_LIMITS (1 << GLIBTOP_SYSDEPS_MSG_LIMITS) +#define GLIBTOP_SUID_SEM_LIMITS (1 << GLIBTOP_SYSDEPS_SEM_LIMITS) +#define GLIBTOP_SUID_PROCLIST 0 +#define GLIBTOP_SUID_PROC_STATE 0 +#define GLIBTOP_SUID_PROC_UID 0 +#define GLIBTOP_SUID_PROC_MEM 0 +#define GLIBTOP_SUID_PROC_TIME 0 +#define GLIBTOP_SUID_PROC_SIGNAL 0 +#define GLIBTOP_SUID_PROC_KERNEL 0 +#define GLIBTOP_SUID_PROC_SEGMENT 0 +#define GLIBTOP_SUID_PROC_ARGS 0 +#define GLIBTOP_SUID_PROC_MAP 0 +#define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) +#define GLIBTOP_SUID_NETLIST 0 +#define GLIBTOP_SUID_PPP 0 + +G_END_DECLS + +#endif diff --git a/sysdeps/aix/glibtop_suid.h b/sysdeps/aix/glibtop_suid.h new file mode 100644 index 0000000..580225f --- /dev/null +++ b/sysdeps/aix/glibtop_suid.h @@ -0,0 +1,50 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SUID_H__ +#define __GLIBTOP_SUID_H__ + +G_BEGIN_DECLS + +#if _IN_LIBGTOP +#include +#endif + +static inline void glibtop_suid_enter (glibtop *server) { + setegid (server->machine->egid); +} + +static inline void glibtop_suid_leave (glibtop *server) { + if (setegid (server->machine->gid)) + _exit (1); +} + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags); +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags); + +G_END_DECLS + +#endif diff --git a/sysdeps/aix/loadavg.c b/sysdeps/aix/loadavg.c new file mode 100644 index 0000000..2f2c2a5 --- /dev/null +++ b/sysdeps/aix/loadavg.c @@ -0,0 +1,77 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_loadavg = +(1 << GLIBTOP_LOADAVG_LOADAVG); + +/* Init function. */ + +void +_glibtop_init_loadavg_p (glibtop *server) +{ + int result; + + result = _glibtop_get_kmem_offset(server, "avenrun"); + if (result == -1) + { + server->sysdeps.loadavg = 0; + return; + } + + server->machine->loadavg_offset = result; + + server->sysdeps.loadavg = _glibtop_sysdeps_loadavg; +} + +/* Provides load averange. */ + +void +glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf) +{ + int result; + int loadavg[3]; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_LOADAVG), 0); + + memset (buf, 0, sizeof (glibtop_loadavg)); + + result = _glibtop_get_kmem_info(server, server->machine->loadavg_offset, + loadavg, sizeof(loadavg)); + if (result <= 0) + { + glibtop_error_io_r (server, "Cannot read loadavg"); + return; + } + + buf->loadavg[0] = loadavg[0] / 65536.0; + buf->loadavg[1] = loadavg[1] / 65536.0; + buf->loadavg[2] = loadavg[2] / 65536.0; + + buf->flags = _glibtop_sysdeps_loadavg; +} diff --git a/sysdeps/aix/mem.c b/sysdeps/aix/mem.c new file mode 100644 index 0000000..a80b4f0 --- /dev/null +++ b/sysdeps/aix/mem.c @@ -0,0 +1,77 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_mem = +(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) + +(1 << GLIBTOP_MEM_FREE) + (1 << GLIBTOP_MEM_LOCKED); + +/* Init function. */ + +void +_glibtop_init_mem_s (glibtop *server) +{ + server->sysdeps.mem = _glibtop_sysdeps_mem; +} + +/* Provides information about memory usage. */ + +void +glibtop_get_mem_s (glibtop *server, glibtop_mem *buf) +{ + struct vminfo vminfo; + int pagesize; + int result; + + glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_MEM), 0); + + memset (buf, 0, sizeof (glibtop_mem)); + + pagesize = sysconf(_SC_PAGESIZE); + +#ifdef HAVE_VMGETINFO + result = vmgetinfo((void*)&vminfo, VMINFO, sizeof(vminfo)); +#else + result = _glibtop_vmgetinfo((void*)&vminfo, VMINFO, sizeof(vminfo)); +#endif + if (result == -1) + { + glibtop_error_io_r (server, "Cannot read vminfo"); + return; + } + + + buf->total = vminfo.memsizepgs * pagesize; + buf->used = (vminfo.numwseguse + vminfo.numpseguse + + vminfo.numclseguse) * pagesize; + buf->free = vminfo.numfrb * pagesize; + buf->locked = (vminfo.numwsegpin + vminfo.numpsegpin + + vminfo.numclsegpin) * pagesize; + + buf->flags = _glibtop_sysdeps_mem; +} diff --git a/sysdeps/aix/msg_limits.c b/sysdeps/aix/msg_limits.c new file mode 100644 index 0000000..6eb4d56 --- /dev/null +++ b/sysdeps/aix/msg_limits.c @@ -0,0 +1,80 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_msg_limits = +(1 << GLIBTOP_IPC_MSGMAX) + (1 << GLIBTOP_IPC_MSGMNB) + +(1 << GLIBTOP_IPC_MSGMNI) + (1 << GLIBTOP_IPC_MSGTQL); + +/* Init function. */ + +void +_glibtop_init_msg_limits_p (glibtop *server) +{ + off_t result; + + result = _glibtop_get_kmem_offset(server, "msginfo"); + if (result <= 0) + { + server->sysdeps.sem_limits = 0; + return; + } + + server->machine->msginfo_offset = result; + + server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf) +{ + int result; + struct msginfo msginfo; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MSG_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_msg_limits)); + + result = _glibtop_get_kmem_info(server, server->machine->msginfo_offset, + &msginfo, sizeof(msginfo)); + + if (result <= 0) + { + glibtop_error_io_r (server, "Cannot read seminfo"); + + return; + } + + buf->msgmax = msginfo.msgmax; + buf->msgmnb = msginfo.msgmnb; + buf->msgmni = msginfo.msgmni; + buf->msgtql = msginfo.msgmnm; + + buf->flags = _glibtop_sysdeps_msg_limits; +} diff --git a/sysdeps/aix/netlist.c b/sysdeps/aix/netlist.c new file mode 100644 index 0000000..30fde7e --- /dev/null +++ b/sysdeps/aix/netlist.c @@ -0,0 +1,39 @@ +/* This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_netlist = 0; + +/* Init function. */ + +void +_glibtop_init_netlist_s (glibtop *server) +{ + server->sysdeps.netlist = _glibtop_sysdeps_netlist; +} + +char** +glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf) +{ + memset (buf, 0, sizeof (glibtop_netlist)); + + return NULL; +} diff --git a/sysdeps/aix/netload.c b/sysdeps/aix/netload.c new file mode 100644 index 0000000..e677e6c --- /dev/null +++ b/sysdeps/aix/netload.c @@ -0,0 +1,208 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include +#include + +#include "utils.h" + +static const unsigned long _glibtop_sysdeps_netload = +(1 << GLIBTOP_NETLOAD_IF_FLAGS) + (1 << GLIBTOP_NETLOAD_MTU) + +(1 << GLIBTOP_NETLOAD_SUBNET) + (1 << GLIBTOP_NETLOAD_ADDRESS) + +(1 << GLIBTOP_NETLOAD_PACKETS_IN) + (1 << GLIBTOP_NETLOAD_PACKETS_OUT) + +(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) + (1 << GLIBTOP_NETLOAD_BYTES_IN) + +(1 << GLIBTOP_NETLOAD_BYTES_OUT) + (1 << GLIBTOP_NETLOAD_BYTES_TOTAL) + +(1 << GLIBTOP_NETLOAD_ERRORS_IN) + (1 << GLIBTOP_NETLOAD_ERRORS_OUT) + +(1 << GLIBTOP_NETLOAD_ERRORS_TOTAL) + (1 << GLIBTOP_NETLOAD_COLLISIONS); + +static void get_ifaddr(glibtop* server, struct ifaddr* next, long* addr, long* mask) +{ + struct ifaddr ifaddr; + struct sockaddr_in sockaddr; + + *addr = 0; + *mask = 0; + + while (next) + { + /* get interface ifaddr structure */ + + _glibtop_get_kmem_info(server, (off_t)next, &ifaddr, sizeof(ifaddr)); + + /* get socket addr information */ + + _glibtop_get_kmem_info( server, (off_t)ifaddr.ifa_addr + , &sockaddr, sizeof(sockaddr)); + + /* if valid family : UDP, TCP, ...*/ + + if (sockaddr.sin_family == AF_INET) + { + *addr = sockaddr.sin_addr.s_addr; + + _glibtop_get_kmem_info( server, (off_t)ifaddr.ifa_netmask + , &sockaddr, sizeof(sockaddr)); + + *mask = sockaddr.sin_addr.s_addr; + + /* address found */ + + return; + } + + next = ifaddr.ifa_next; + } +} + +/* Init function. */ + +void +_glibtop_init_netload_p (glibtop *server) +{ + off_t result; + off_t addr; + + result = _glibtop_get_kmem_offset(server, "ifnet"); + if (result <= 0) + { + server->sysdeps.netload = 0; + return; + } + + result = _glibtop_get_kmem_info(server, result, &addr, sizeof(addr)); + if (result <= 0) + { + server->sysdeps.netload = 0; + return; + } + + server->machine->ifnet_offset = addr; + + server->sysdeps.netload = _glibtop_sysdeps_netload; +} + +/* Provides network statistics. */ + +void +glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, + const char *interface) +{ + int result; + off_t offset; + struct ifnet ifnet; + long addr; + long mask; + char name[16]; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_UPTIME), 0); + + memset (buf, 0, sizeof (glibtop_netload)); + + for ( offset = server->machine->ifnet_offset; + offset != 0; + offset = (off_t)ifnet.if_next + ) + { + result = _glibtop_get_kmem_info(server, offset, + &ifnet, sizeof(ifnet)); + if (result <= 0) + { + glibtop_error_io_r (server, "Cannot read ifnet"); + + return; + } + + result = _glibtop_get_kmem_info(server, (off_t)ifnet.if_name, + name, sizeof(name)); + if (result <= 0) + { + glibtop_error_io_r (server, "Cannot read if_name"); + + return; + } + + sprintf(name+strlen(name), "%d", ifnet.if_unit); + if (strcmp(name, interface) != 0) + { + continue; + } + + if (ifnet.if_flags & IFF_UP) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_UP); + if (ifnet.if_flags & IFF_BROADCAST) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_BROADCAST); + if (ifnet.if_flags & IFF_LOOPBACK) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_LOOPBACK); + if (ifnet.if_flags & IFF_POINTOPOINT) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_POINTOPOINT); + if (ifnet.if_flags & IFF_RUNNING) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_RUNNING); + if (ifnet.if_flags & IFF_NOARP) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_NOARP); + if (ifnet.if_flags & IFF_PROMISC) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_PROMISC); + if (ifnet.if_flags & IFF_ALLMULTI) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_ALLMULTI); + if (ifnet.if_flags & IFF_OACTIVE) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_OACTIVE); + if (ifnet.if_flags & IFF_SIMPLEX) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_SIMPLEX); + if (ifnet.if_flags & IFF_LINK0) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_LINK0); + if (ifnet.if_flags & IFF_LINK1) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_LINK1); + if (ifnet.if_flags & IFF_LINK2) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_LINK2); + if (ifnet.if_flags & IFF_LINK2) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_LINK2); + if (ifnet.if_flags & 0x80000) + buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_MULTICAST); + + buf->mtu = ifnet.if_mtu; + + get_ifaddr(server, ifnet.if_addrlist, &addr, &mask); + + buf->subnet = addr & mask; + buf->address = addr; + + buf->packets_in = ifnet.if_ipackets; + buf->packets_out = ifnet.if_opackets; + buf->packets_total = buf->packets_in + buf->packets_out; + + buf->bytes_in = ifnet.if_ibytes; + buf->bytes_out = ifnet.if_obytes; + buf->bytes_total = buf->bytes_in + buf->bytes_out; + + buf->errors_in = ifnet.if_ierrors; + buf->errors_out = ifnet.if_oerrors; + buf->errors_total = ifnet.if_ierrors + ifnet.if_oerrors; + + buf->collisions = ifnet.if_collisions; + } + + buf->flags = _glibtop_sysdeps_netload; +} diff --git a/sysdeps/aix/nosuid.c b/sysdeps/aix/nosuid.c new file mode 100644 index 0000000..8c70c69 --- /dev/null +++ b/sysdeps/aix/nosuid.c @@ -0,0 +1,45 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +void +glibtop_open_s (glibtop *server, + const char *program_name, + const unsigned long features, + const unsigned flags) +{ + server->ncpu = _system_configuration.ncpus; + + if (server->ncpu == 1) + { + server->ncpu = 0; /* means single-processor, see glibtop.h */ + } +} + +void +glibtop_close_s (glibtop *server) +{ } diff --git a/sysdeps/aix/open.c b/sysdeps/aix/open.c new file mode 100644 index 0000000..d0ecbe5 --- /dev/null +++ b/sysdeps/aix/open.c @@ -0,0 +1,81 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include "glibtop_suid.h" + +/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags) +{ + const _glibtop_init_func_t *init_fkt; + + if (server == NULL) + glibtop_error_r (NULL, "glibtop_init_p (server == NULL)"); + + if ((server->flags & _GLIBTOP_INIT_STATE_SYSDEPS) == 0) { + glibtop_open_p (server, "glibtop", features, flags); + + for (init_fkt = _glibtop_init_hook_p; *init_fkt; init_fkt++) + (*init_fkt) (server); + server->flags |= _GLIBTOP_INIT_STATE_SYSDEPS; + } +} + +/* Opens pipe to gtop server. Returns 0 on success and -1 on error. */ + +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags) +{ + /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ + + server->machine->uid = getuid (); + server->machine->euid = geteuid (); + server->machine->gid = getgid (); + server->machine->egid = getegid (); + + /* open kmem */ + + server->machine->kmem_fd = open("/dev/kmem", O_RDONLY); + if (server->machine->kmem_fd == -1) + glibtop_error_io_r (server, "Cannot open /dev/kmem"); + + /* Drop priviledges. */ + + if (seteuid (server->machine->uid)) + _exit (1); + + if (setegid (server->machine->gid)) + _exit (1); + + /* !!! END OF SUID ROOT PART !!! */ + + server->name = program_name; +} diff --git a/sysdeps/aix/ppp.c b/sysdeps/aix/ppp.c new file mode 100644 index 0000000..0801643 --- /dev/null +++ b/sysdeps/aix/ppp.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_ppp = 0; + +/* Init function. */ + +void +_glibtop_init_ppp_s (glibtop *server) +{ + server->sysdeps.ppp = _glibtop_sysdeps_ppp; +} + +/* Provides PPP/ISDN information. */ + +void +glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device) +{ + memset (buf, 0, sizeof (glibtop_ppp)); +} diff --git a/sysdeps/aix/procargs.c b/sysdeps/aix/procargs.c new file mode 100644 index 0000000..91f2f2e --- /dev/null +++ b/sysdeps/aix/procargs.c @@ -0,0 +1,113 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include "utils.h" + +static const unsigned long _glibtop_sysdeps_proc_args = + (1 << GLIBTOP_PROC_ARGS_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_args_s (glibtop *server) +{ + server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; +} + +/* Provides detailed information about a process. */ + +static void _glibtop_remove_non_ascii(char* string) +{ + for (;*string != 0;string++) + { + if (!isascii(*string)) + *string = '?'; + } +} + +char * +glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len) +{ + struct procsinfo *pinfo; + char *args_buffer; + char* args = NULL; + int size; + int result; + int len; + + glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_ARGS), 0); + + memset (buf, 0, sizeof (glibtop_proc_args)); + + pinfo = _glibtop_get_procinfo(server, pid); + if (pinfo == NULL) return NULL; + + size = max_len != 0 ? max_len : 4096; + args_buffer = g_malloc (size); + + result = getargs(pinfo, sizeof(struct procsinfo), args_buffer, size); + if (result == -1) + { + glibtop_error_io_r (server, "Cannot malloc getargs"); + + g_free(args_buffer); + + return NULL; + } + + /* look if empty string */ + + if (args_buffer[0] == 0) + { + g_free(args_buffer); + + return NULL; + } + + /* compute length of args and realloc */ + + len = 0; + while ((args_buffer[len] != 0) && (len < size)) + { + _glibtop_remove_non_ascii(args_buffer + len); + + len += strlen(args_buffer + len) + 1; + } + + args = g_malloc (len); + + memcpy(args, args_buffer, len); + g_free(args_buffer); + + buf->size = len - 1; + + buf->flags = _glibtop_sysdeps_proc_args; + + return args; +} diff --git a/sysdeps/aix/prockernel.c b/sysdeps/aix/prockernel.c new file mode 100644 index 0000000..23913e7 --- /dev/null +++ b/sysdeps/aix/prockernel.c @@ -0,0 +1,94 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include +#include +#include + +#include "utils.h" + +static const unsigned long _glibtop_sysdeps_proc_kernel = +(1 <sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, + pid_t pid) +{ + struct thrdsinfo thinfo; + struct procsinfo *pinfo; + tid_t thid; + int result; + + glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_KERNEL), 0); + + memset (buf, 0, sizeof (glibtop_proc_kernel)); + + pinfo = _glibtop_get_procinfo(server, pid); + if (pinfo == NULL) return; + + if (!(pinfo->pi_flags | SKPROC)) + { + /* not a kernel process */ + + return; + } + + buf->min_flt = pinfo->pi_ru.ru_minflt; + buf->maj_flt = pinfo->pi_ru.ru_majflt; + + buf->cmin_flt = pinfo->pi_cru.ru_minflt; + buf->cmaj_flt = pinfo->pi_cru.ru_majflt; + + thid = 0; + result = getthrds(pid, &thinfo, sizeof(thinfo), &thid, 1); + if (result != 1) + { + glibtop_error_io_r(server, "Cannot read thrdsinfo"); + + return; + } + + buf->kstk_esp = thinfo.ti_ustk; + buf->kstk_eip = thinfo.ti_code; + + buf->nwchan = thinfo.ti_wchan; + + buf->flags = _glibtop_sysdeps_proc_kernel; +} diff --git a/sysdeps/aix/proclist.c b/sysdeps/aix/proclist.c new file mode 100644 index 0000000..5420dfc --- /dev/null +++ b/sysdeps/aix/proclist.c @@ -0,0 +1,247 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include + +static const unsigned long _glibtop_sysdeps_proclist = +(1 << GLIBTOP_PROCLIST_NUMBER) + (1 << GLIBTOP_PROCLIST_TOTAL) + +(1 << GLIBTOP_PROCLIST_SIZE); + +#define BLOCK_COUNT 256 +#define BLOCK_SIZE (BLOCK_COUNT * sizeof (unsigned int)) + +/* Init function. */ + +void +_glibtop_init_proclist_s (glibtop *server) +{ + server->sysdeps.proclist = _glibtop_sysdeps_proclist; +} + +/* Fetch list of currently running processes. + * + * IMPORTANT NOTE: + * On error, this function MUST return NULL and set buf->flags to zero ! + * On success, it returnes a pointer to a list of buf->number elements + * each buf->size big. The total size is stored in buf->total. */ + +unsigned * +glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg) +{ + struct procsinfo pinfo; + int count, total; + unsigned pids [BLOCK_COUNT], *pids_chain = NULL; + int pids_size = 0, pids_offset = 0, new_size; + pid_t current; + int result; + + glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROCLIST), 0); + + memset (buf, 0, sizeof (glibtop_proclist)); + + for( count = total = 0, current = 0 + , result = getprocs(&pinfo, sizeof(pinfo), NULL, 0, ¤t, 1); + result == 1; + result = getprocs(&pinfo, sizeof(pinfo), NULL, 0, ¤t, 1)) + { + if (which & GLIBTOP_EXCLUDE_IDLE) + { + if (pinfo.pi_state & SIDL) + { + /* exclude idle processes */ + + continue; + } + } + + if (which & GLIBTOP_EXCLUDE_SYSTEM) + { + if (pinfo.pi_flags & SKPROC) + { + /* exclude Kernel processes */ + + continue; + } + } + + if (which & GLIBTOP_EXCLUDE_NOTTY) + { + if (!pinfo.pi_ttyp) + { + /* exclude processes without tty */ + + continue; + } + } + + switch(which & GLIBTOP_KERN_PROC_MASK) + { + case GLIBTOP_KERN_PROC_ALL: + + /* return information about all processes + * so, let's go ahead + */ + + break; + + case GLIBTOP_KERN_PROC_PID: + + /* return information about all processes with + * pid passed in arg + */ + + if (pinfo.pi_pid != arg) + { + continue; + } + + break; + + case GLIBTOP_KERN_PROC_PGRP: + + /* return information about all processes in + * process group passed in arg + */ + + if (pinfo.pi_pgrp != arg) + { + continue; + } + + break; + + case GLIBTOP_KERN_PROC_SESSION: + + /* return information about all processes in + * session passed in arg + */ + + if (pinfo.pi_sid != arg) + { + continue; + } + + break; + + case GLIBTOP_KERN_PROC_TTY: + + /* return information about all processes with + * tty device number passed in arg + */ + + if (pinfo.pi_ttyd != arg) + { + continue; + } + + break; + + case GLIBTOP_KERN_PROC_UID: + + /* return information about all processes with + * effective uid passed in arg + */ + + if (pinfo.pi_cred.cr_uid != arg) + { + continue; + } + + break; + + case GLIBTOP_KERN_PROC_RUID: + + /* return information about all processes with + * real uid passed in arg + */ + + if (pinfo.pi_cred.cr_ruid != arg) + { + continue; + } + + break; + } + + if (count >= BLOCK_COUNT) + { + /* The following call to g_realloc will be + * equivalent to g_malloc () if `pids_chain' is + * NULL. We just calculate the new size and copy `pids' + * to the beginning of the newly allocated block. */ + + new_size = pids_size + BLOCK_SIZE; + + pids_chain = g_realloc + (pids_chain, new_size); + memcpy (pids_chain + pids_offset, pids, BLOCK_SIZE); + + pids_size = new_size; + pids_offset += BLOCK_COUNT; + count = 0; + } + + /* pids is now big enough to hold at least one single pid. */ + + pids[count++] = pinfo.pi_pid; + + total++; + } + + if (result == -1) + { + glibtop_error_io_r(server, "Cannot read procsinfo"); + } + + /* count is only zero if an error occured (one a running Linux system, + * we have at least one single process). */ + + if (!count) return NULL; + + /* The following call to g_realloc will be equivalent to + * g_malloc if pids_chain is NULL. We just calculate the + * new size and copy pids to the beginning of the newly allocated + * block. */ + + new_size = pids_size + count * sizeof (unsigned); + + pids_chain = g_realloc (pids_chain, new_size); + + memcpy (pids_chain + pids_offset, pids, count * sizeof (unsigned)); + + pids_size = new_size; + + /* Since everything is ok now, we can set buf->flags, fill in the + * remaining fields and return the `pids_chain'. */ + + buf->size = sizeof(unsigned int); + buf->number = total; + buf->total = total * buf->size; + + buf->flags = _glibtop_sysdeps_proclist; + + return pids_chain; +} diff --git a/sysdeps/aix/procmap.c b/sysdeps/aix/procmap.c new file mode 100644 index 0000000..6470360 --- /dev/null +++ b/sysdeps/aix/procmap.c @@ -0,0 +1,48 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_map = 0; + +/* Init function. */ + +void +_glibtop_init_proc_map_s (glibtop *server) +{ + server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; +} + +/* Provides detailed information about a process. */ + +glibtop_map_entry * +glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid) +{ + glibtop_init_p (&server, (1L << GLIBTOP_SYSDEPS_PROC_MAP), 0); + + memset (buf, 0, sizeof (glibtop_proc_map)); + + return NULL; +} diff --git a/sysdeps/aix/procmem.c b/sysdeps/aix/procmem.c new file mode 100644 index 0000000..bdc22d6 --- /dev/null +++ b/sysdeps/aix/procmem.c @@ -0,0 +1,69 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include +#include + +#include "utils.h" + +static const unsigned long _glibtop_sysdeps_proc_mem = +(1 << GLIBTOP_PROC_MEM_SIZE) + (1 << GLIBTOP_PROC_MEM_VSIZE) + +(1 << GLIBTOP_PROC_MEM_RESIDENT) + (1 << GLIBTOP_PROC_MEM_RSS) + +(1 << GLIBTOP_PROC_MEM_RSS_RLIM); + +/* Init function. */ + +void +_glibtop_init_proc_mem_s (glibtop *server) +{ + server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, + pid_t pid) +{ + struct procsinfo *pinfo; + int pagesize; + + glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_MEM), 0); + + memset (buf, 0, sizeof (glibtop_proc_mem)); + + pinfo = _glibtop_get_procinfo(server, pid); + if (pinfo == NULL) return; + + pagesize = sysconf(_SC_PAGESIZE); + + buf->vsize = buf->size = pinfo->pi_size * pagesize; + buf->resident = buf->rss = (pinfo->pi_drss + pinfo->pi_trss) * pagesize; + buf->rss_rlim = pinfo->pi_rlimit[RLIMIT_RSS].rlim_cur; + + buf->flags = _glibtop_sysdeps_proc_mem; +} diff --git a/sysdeps/aix/procsegment.c b/sysdeps/aix/procsegment.c new file mode 100644 index 0000000..2c3adae --- /dev/null +++ b/sysdeps/aix/procsegment.c @@ -0,0 +1,70 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include +#include + +#include "utils.h" + +static const unsigned long _glibtop_sysdeps_proc_segment = +(1 << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + (1 << GLIBTOP_PROC_SEGMENT_SHLIB_RSS) + +(1 << GLIBTOP_PROC_SEGMENT_DATA_RSS) + (1 << GLIBTOP_PROC_SEGMENT_STACK_RSS); + + +/* Init function. */ + +void +_glibtop_init_proc_segment_s (glibtop *server) +{ + server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf, + pid_t pid) +{ + struct procsinfo *pinfo; + int pagesize; + + glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0); + + memset (buf, 0, sizeof (glibtop_proc_segment)); + + pinfo = _glibtop_get_procinfo(server, pid); + if (pinfo == NULL) return; + + pagesize = sysconf(_SC_PAGESIZE); + + buf->text_rss = pinfo->pi_trss * pagesize; + buf->data_rss = pinfo->pi_drss * pagesize; + buf->shlib_rss = pinfo->pi_ru.ru_ixrss * pagesize; + buf->stack_rss = pinfo->pi_ru.ru_isrss * pagesize; + + buf->flags = _glibtop_sysdeps_proc_segment; +} diff --git a/sysdeps/aix/procsignal.c b/sysdeps/aix/procsignal.c new file mode 100644 index 0000000..b27f383 --- /dev/null +++ b/sysdeps/aix/procsignal.c @@ -0,0 +1,85 @@ +/* Copyright (C)) +998-99 Martin Baulig + This file is part of LibGTop) +.0. + + Contributed by Martin Baulig , April) +998. + + LibGTop 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) + of the License, + or (at your option) any later version. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "utils.h" + +static const unsigned long _glibtop_sysdeps_proc_signal = +(1 <sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, + pid_t pid) +{ + struct procsinfo *pinfo; + int i; + long bit; + + glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0); + + memset (buf, 0, sizeof (glibtop_proc_signal)); + + pinfo = _glibtop_get_procinfo(server, pid); + if (pinfo == NULL) return; + + /* pending signals */ + +#define NB_BITS (8 * sizeof(guint64)) + + for (i = 0; (i < NSIG) && (i < 2 * NB_BITS); i++) + { + bit = 1 << (NB_BITS - 1 - (i % NB_BITS)); + + if (sigismember(&pinfo->pi_sig, i)) + buf->signal[i / NB_BITS] |= bit; + + if (pinfo->pi_signal[i] == (long)SIG_HOLD) + buf->blocked[i / NB_BITS] |= bit; + + if (pinfo->pi_signal[i] == (long)SIG_IGN) + buf->sigignore[i / NB_BITS] |= bit; + + if (pinfo->pi_signal[i] == (long)SIG_CATCH) + buf->sigcatch[i / NB_BITS] |= bit; + } + + buf->flags = _glibtop_sysdeps_proc_signal; +} diff --git a/sysdeps/aix/procstate.c b/sysdeps/aix/procstate.c new file mode 100644 index 0000000..9fcdad6 --- /dev/null +++ b/sysdeps/aix/procstate.c @@ -0,0 +1,124 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include +#include +#include + +#include "utils.h" + +static const unsigned long _glibtop_sysdeps_proc_state = +(1 << GLIBTOP_PROC_STATE_CMD) + (1 << GLIBTOP_PROC_STATE_STATE) + +(1 << GLIBTOP_PROC_STATE_UID) + (1 << GLIBTOP_PROC_STATE_GID); + +/* Init function. */ + +void +_glibtop_init_proc_state_s (glibtop *server) +{ + server->sysdeps.proc_state = _glibtop_sysdeps_proc_state; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, + pid_t pid) +{ + struct procsinfo *pinfo; + struct thrdsinfo thinfo; + tid_t thid; + int result; + + glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_STATE), 0); + + memset (buf, 0, sizeof (glibtop_proc_state)); + + pinfo = _glibtop_get_procinfo(server, pid); + if (pinfo == NULL) return; + + if (pinfo->pi_pid == 0) + { + strcpy(buf->cmd, "swapper"); + } + + if (pinfo->pi_comm[0] == 0) + { + strcpy(buf->cmd, ""); + } + else + { + g_strlcpy(buf->cmd, pinfo->pi_comm, sizeof buf->cmd); + } + + buf->uid = pinfo->pi_uid; + buf->gid = pinfo->pi_cred.cr_gid; + + if (pinfo->pi_state == SZOMB) + { + buf->state = GLIBTOP_PROCESS_ZOMBIE; + strcpy(buf->cmd, ""); + } + else + { + /* get state of first thread */ + + thid = 0; + result = getthrds(pid, &thinfo, sizeof(thinfo), &thid, 1); + if (result != 1) + { + glibtop_error_io_r(server, "Cannot read threadinfo"); + } + + switch (thinfo.ti_state) + { + case TSIDL: + /* FIXME */ + /* buf->state = GLIBTOP_PROCESS_UNINTERRUPTIBLE; */ + break; + case TSRUN: + buf->state = GLIBTOP_PROCESS_RUNNING; + break; + case TSSLEEP: + buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE; + break; + case TSZOMB: + buf->state = GLIBTOP_PROCESS_ZOMBIE; + strcpy(buf->cmd, ""); + break; + case TSSTOP: + buf->state = GLIBTOP_PROCESS_STOPPED; + break; + case TSSWAP: + buf->state = GLIBTOP_PROCESS_SWAPPING; + break; + default: + buf->state = 0; + break; + } + } + + buf->flags = _glibtop_sysdeps_proc_state; +} diff --git a/sysdeps/aix/proctime.c b/sysdeps/aix/proctime.c new file mode 100644 index 0000000..739c96c --- /dev/null +++ b/sysdeps/aix/proctime.c @@ -0,0 +1,69 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include "utils.h" + +static const unsigned long _glibtop_sysdeps_proc_time = +(1 << GLIBTOP_PROC_TIME_START_TIME) + (1 << GLIBTOP_PROC_TIME_RTIME) + +(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_STIME) + +(1 << GLIBTOP_PROC_TIME_CUTIME) + (1 << GLIBTOP_PROC_TIME_CSTIME) + +(1 << GLIBTOP_PROC_TIME_FREQUENCY); + +/* Init function. */ + +void +_glibtop_init_proc_time_s (glibtop *server) +{ + server->sysdeps.proc_time = _glibtop_sysdeps_proc_time; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, + pid_t pid) +{ + struct procsinfo *pinfo; + + glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_TIME), 0); + + memset (buf, 0, sizeof (glibtop_proc_time)); + + pinfo = _glibtop_get_procinfo(server, pid); + if (pinfo == NULL) return; + + buf->start_time = pinfo->pi_start; + buf->utime = pinfo->pi_ru.ru_utime.tv_sec + (double)pinfo->pi_ru.ru_utime.tv_usec/1000000.0; + buf->stime = pinfo->pi_ru.ru_stime.tv_sec + (double)pinfo->pi_ru.ru_stime.tv_usec/1000000.0; + buf->rtime = buf->utime + buf->stime; + buf->cutime = pinfo->pi_cru.ru_utime.tv_sec + (double)pinfo->pi_cru.ru_utime.tv_usec/1000000.0; + buf->cstime = pinfo->pi_cru.ru_stime.tv_sec + (double)pinfo->pi_cru.ru_stime.tv_usec/1000000.0; + buf->frequency = sysconf(_SC_CLK_TCK); + + buf->flags = _glibtop_sysdeps_proc_time; +} diff --git a/sysdeps/aix/procuid.c b/sysdeps/aix/procuid.c new file mode 100644 index 0000000..2aa936c --- /dev/null +++ b/sysdeps/aix/procuid.c @@ -0,0 +1,97 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include +#include + +#include "utils.h" + +static const unsigned long _glibtop_sysdeps_proc_uid = +(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) + +(1 << GLIBTOP_PROC_UID_GID) + (1 << GLIBTOP_PROC_UID_EGID) + +(1 << GLIBTOP_PROC_UID_PID) + (1 << GLIBTOP_PROC_UID_PPID) + +(1 << GLIBTOP_PROC_UID_PGRP) + (1 << GLIBTOP_PROC_UID_SESSION) + +(1 << GLIBTOP_PROC_UID_TTY) + (1 << GLIBTOP_PROC_UID_PRIORITY) + +(1 << GLIBTOP_PROC_UID_NICE); + + +/* Init function. */ + +void +_glibtop_init_proc_uid_s (glibtop *server) +{ + server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, + pid_t pid) +{ + struct procsinfo *pinfo; + struct thrdsinfo thinfo; + tid_t thid; + int result; + + glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_UID), 0); + + memset (buf, 0, sizeof (glibtop_proc_uid)); + + pinfo = _glibtop_get_procinfo(server, pid); + if (pinfo == NULL) return; + + buf->uid = pinfo->pi_cred.cr_ruid; + buf->euid = pinfo->pi_cred.cr_uid; + buf->gid = pinfo->pi_cred.cr_rgid; + buf->egid = pinfo->pi_cred.cr_gid; + + buf->pid = pinfo->pi_pid; + buf->ppid = pinfo->pi_ppid; + + buf->pgrp = pinfo->pi_pgrp; + buf->session = pinfo->pi_sid; + + buf->tty = pinfo->pi_ttyd; + + buf->nice = pinfo->pi_nice; + + buf->flags = _glibtop_sysdeps_proc_uid; + + thid = 0; + result = getthrds(pid, &thinfo, sizeof(thinfo), &thid, 1); + if (result != 1) + { + buf->flags &= ~(1 << GLIBTOP_PROC_UID_PRIORITY); + + glibtop_error_io_r(server, "Cannot read thrdsinfo"); + } + + /* priority of first thread */ + + buf->priority = thinfo.ti_pri; +} diff --git a/sysdeps/aix/sem_limits.c b/sysdeps/aix/sem_limits.c new file mode 100644 index 0000000..0cc8e6a --- /dev/null +++ b/sysdeps/aix/sem_limits.c @@ -0,0 +1,85 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "utils.h" + +static const unsigned long _glibtop_sysdeps_sem_limits = +(1 << GLIBTOP_IPC_SEMMNI) + (1 << GLIBTOP_IPC_SEMMSL) + +(1 << GLIBTOP_IPC_SEMOPM) + (1 << GLIBTOP_IPC_SEMUME) + +(1 << GLIBTOP_IPC_SEMUSZ) + (1 << GLIBTOP_IPC_SEMVMX) + +(1 << GLIBTOP_IPC_SEMAEM); + +/* Init function. */ + +void +_glibtop_init_sem_limits_p (glibtop *server) +{ + off_t result; + + result = _glibtop_get_kmem_offset(server, "seminfo"); + if (result <= 0) + { + server->sysdeps.sem_limits = 0; + return; + } + + server->machine->seminfo_offset = result; + + server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; +} + +/* Provides information about sysv sem limits. */ + +void +glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) +{ + int result; + struct seminfo seminfo; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SEM_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_sem_limits)); + + result = _glibtop_get_kmem_info(server, server->machine->seminfo_offset, + &seminfo, sizeof(seminfo)); + + if (result <= 0) + { + glibtop_error_io_r (server, "Cannot read seminfo"); + + return; + } + + buf->semmni = seminfo.semmni; + buf->semmsl = seminfo.semmsl; + buf->semopm = seminfo.semopm; + buf->semume = seminfo.semume; + buf->semusz = seminfo.semusz; + buf->semvmx = seminfo.semvmx; + buf->semaem = seminfo.semaem; + + buf->flags = _glibtop_sysdeps_sem_limits; +} diff --git a/sysdeps/aix/shm_limits.c b/sysdeps/aix/shm_limits.c new file mode 100644 index 0000000..860819e --- /dev/null +++ b/sysdeps/aix/shm_limits.c @@ -0,0 +1,78 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_shm_limits = +(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) + +(1L << GLIBTOP_IPC_SHMMNI); + +/* Init function. */ + +void +_glibtop_init_shm_limits_p (glibtop *server) +{ + int result; + + result = _glibtop_get_kmem_offset(server, "shminfo"); + if (result == -1) + { + server->sysdeps.shm_limits = 0; + return; + } + + server->machine->shminfo_offset = result; + + server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) +{ + int result; + struct shminfo shminfo; + int s; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SHM_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_shm_limits)); + + result = _glibtop_get_kmem_info(server, server->machine->shminfo_offset, + &shminfo, sizeof(struct shminfo)); + if (result <= 0) + { + glibtop_error_io_r (server, "Cannot read shminfo"); + return; + } + + buf->shmmax = shminfo.shmmax; + buf->shmmin = shminfo.shmmin; + buf->shmmni = shminfo.shmmni; + + buf->flags = _glibtop_sysdeps_shm_limits; +} diff --git a/sysdeps/aix/siglist.c b/sysdeps/aix/siglist.c new file mode 100644 index 0000000..87e6d81 --- /dev/null +++ b/sysdeps/aix/siglist.c @@ -0,0 +1,71 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 1, "SIGHUP", "Hangup" }, + { 2, "SIGINT", "Interrupt" }, + { 3, "SIGQUIT", "Quit" }, + { 4, "SIGILL", "Illegal Instruction" }, + { 5, "SIGTRAP", "Trace/Breakpoint Trap" }, + { 6, "SIGABRT", "Abort" }, + { 7, "SIGEMT", "Emulation Trap" }, + { 8, "SIGFPE", "Arithmetic Exception" }, + { 9, "SIGKILL", "Killed" }, + { 10, "SIGBUS", "Bus Error" }, + { 11, "SIGSEGV", "Segmentation Fault" }, + { 12, "SIGSYS", "Bad System Call" }, + { 13, "SIGPIPE", "Broken Pipe" }, + { 14, "SIGALRM", "Alarm Clock" }, + { 15, "SIGTERM", "Terminated" }, + { 16, "SIGURG", "Urgent Socket Condition" }, + { 17, "SIGSTOP", "Stop (signal)" }, + { 18, "SIGSTP", "Stop (user)" }, + { 19, "SIGCONT", "Continue" }, + { 20, "SIGCHLD", "Child Status Changed" }, + { 21, "SIGTTIN", "Stopped (tty input)" }, + { 22, "SIGTTOU", "Stopped (tty output)" }, + { 23, "SIGIO", "I/O completed" }, + { 24, "SIGXCPU", "Cpu Limit Exceeded" }, + { 25, "SIGXFSZ", "File Size Limit Exceeded" }, + { 27, "SIGMSG", "Message" }, + { 28, "SIGWINCH","Window Size Change" }, + { 29, "SIGPWR", "Power-Fail/Restart" }, + { 30, "SIGUSR1", "User Signal 1" }, + { 31, "SIGUSR2", "User Signal 2" }, + { 32, "SIGPROF", "Profiling Timer Expired" }, + { 33, "SIGDANGER","System Crash Imminent" }, + { 34, "SIGVTALRM","Virtual Timer Expired" }, + { 35, "SIGMIGRATE","Migrate Process" }, + { 36, "SIGPRE", "Programming Exception" }, + { 37, "SIGVIRT", "AIX Virtual Time Alarm" }, + { 38, "SIGALRM1", "m:n Condition Variables" }, + { 39, "SIGWAITING","Scheduling" }, + { 59, "SIGCPUFAIL","Predictive De-configuration of Processors" }, + { 60, "SIGKAP", "Keep Alive" }, + { 61, "SIGRETRACT","Monitor Mode Relinguish" }, + { 62, "SIGSOUND", "Sound Control Completed" }, + { 63, "SIGSAK", "Secure Attention Key" }, + { 0, NULL, NULL } +}; diff --git a/sysdeps/aix/swap.c b/sysdeps/aix/swap.c new file mode 100644 index 0000000..d20b0d1 --- /dev/null +++ b/sysdeps/aix/swap.c @@ -0,0 +1,129 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_swap = +(1 << GLIBTOP_SWAP_TOTAL) + (1 << GLIBTOP_SWAP_USED) + +(1 << GLIBTOP_SWAP_FREE) + (1 << GLIBTOP_SWAP_PAGEIN) + +(1 << GLIBTOP_SWAP_PAGEOUT); + +#define FILENAME "/etc/swapspaces" + +/* Init function. */ + +void +_glibtop_init_swap_s (glibtop *server) +{ + server->sysdeps.swap = _glibtop_sysdeps_swap; +} + +/* Provides information about swap usage. */ + +void +glibtop_get_swap_s (glibtop *server, glibtop_swap *buf) +{ + struct vminfo vminfo; + struct pginfo pginfo; + int pagesize; + int result; + FILE* fd; + char device_name[128]; + int c; + int comment = 0; + int pos = 0; + + glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_SWAP), 0); + + memset (buf, 0, sizeof (glibtop_swap)); + + pagesize = sysconf(_SC_PAGESIZE); + + fd = fopen(FILENAME, "r"); + if (fd == NULL) + { + glibtop_error_io_r (server, "open (%s)", FILENAME); + } + + buf->total = 0; + buf->free = 0; + while((c = getc(fd)) != EOF) + { + if (comment) + { + /* skip comments */ + if (c == '\n') comment = 0; + continue; + } + switch(c) + { + case '*': + comment = 1; + break; + case '\n': + device_name[pos] = 0; + pos = 0; + + if (strncmp("dev=", device_name, 4) == 0) + { + result = swapqry(device_name+4, &pginfo); + if (result == -1) + { + glibtop_error_io_r (server, "Cannot read pginfo"); + break; + } + + buf->total += pginfo.size * pagesize; + buf->free += pginfo.free * pagesize;; + } + break; + case ' ': + case '\t': + break; + default: + device_name[pos++] = c; + break; + } + } + + buf->used = buf->total - buf->free; + fclose(fd); +#ifdef HAVE_VMGETINFO + result = vmgetinfo((void*)&vminfo, VMINFO, sizeof(vminfo)); +#else + result = _glibtop_vmgetinfo((void*)&vminfo, VMINFO, sizeof(vminfo)); +#endif + if (result == -1) + { + glibtop_error_io_r (server, "Cannot read vminfo"); + return; + } + + buf->pagein = vminfo.pageins; + buf->pageout = vminfo.pageouts; + + buf->flags = _glibtop_sysdeps_swap; +} diff --git a/sysdeps/aix/sysinfo.c b/sysdeps/aix/sysinfo.c new file mode 100644 index 0000000..7bdb4e4 --- /dev/null +++ b/sysdeps/aix/sysinfo.c @@ -0,0 +1,198 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include +#include + +static const unsigned long _glibtop_sysdeps_sysinfo = +(1L << GLIBTOP_SYSINFO_CPUINFO); + +static glibtop_sysinfo sysinfo; + +static void add_info(glibtop_entry* entry, char* label, char* attribute) +{ + char* key; + char* value; + + key = g_strdup(label); + value = g_strdup(attribute); + + g_ptr_array_add(entry->labels, key); + g_hash_table_insert(entry->values, key, value); +} + +static void init_sysinfo(void) +{ + int cpu; + char buf[64]; + + memset (&sysinfo, 0, sizeof (glibtop_sysinfo)); + + sysinfo.ncpu = MIN(_system_configuration.ncpus, GLIBTOP_NCPU); + + for (cpu = 0; cpu < sysinfo.ncpu ; cpu++) + { + /* init cpu data structure */ + + sysinfo.cpuinfo[cpu].labels = g_ptr_array_new(); + sysinfo.cpuinfo[cpu].values = g_hash_table_new (NULL, NULL); + + /* add properties */ + + switch(_system_configuration.architecture) + { + case POWER_RS: + add_info( &sysinfo.cpuinfo[cpu] + , "architecture" + , "Power Classic"); + break; + case POWER_PC: + add_info( &sysinfo.cpuinfo[cpu] + , "architecture" + , "Power PC"); + break; + case IA64: + add_info( &sysinfo.cpuinfo[cpu] + , "architecture" + , "Intel IA64"); + break; + default: + add_info( &sysinfo.cpuinfo[cpu] + , "architecture" + , "Unknown"); + break; + } + + if ( (_system_configuration.architecture == POWER_RS) || + (_system_configuration.architecture == POWER_PC) ) + { + switch(_system_configuration.implementation) + { + case POWER_RS1: + add_info( &sysinfo.cpuinfo[cpu] + , "implementation" + , "RS1"); + break; + case POWER_RSC: + add_info( &sysinfo.cpuinfo[cpu] + , "implementation" + , "RSC"); + break; + case POWER_RS2: + add_info( &sysinfo.cpuinfo[cpu] + , "implementation" + , "RS2"); + break; + case POWER_601: + add_info( &sysinfo.cpuinfo[cpu] + , "implementation" + , "601"); + break; + case POWER_603: + add_info( &sysinfo.cpuinfo[cpu] + , "implementation" + , "603"); + break; + case POWER_604: + add_info( &sysinfo.cpuinfo[cpu] + , "implementation" + , "604"); + break; + case POWER_620: + add_info( &sysinfo.cpuinfo[cpu] + , "implementation" + , "620"); + break; + case POWER_630: + add_info( &sysinfo.cpuinfo[cpu] + , "implementation" + , "630"); + break; + case POWER_A35: + add_info( &sysinfo.cpuinfo[cpu] + , "implementation" + , "A35"); + break; + case POWER_RS64II: + add_info( &sysinfo.cpuinfo[cpu] + , "implementation" + , "RS64II"); + break; + case POWER_RS64III: + add_info( &sysinfo.cpuinfo[cpu] + , "implementation" + , "RS64III"); + break; + } + } + else if (_system_configuration.architecture == IA64) + { + switch(_system_configuration.implementation) + { + case IA64_M1: + add_info( &sysinfo.cpuinfo[cpu] + , "implementation" + , "IA64 M1"); + break; + case IA64_M2: + add_info( &sysinfo.cpuinfo[cpu] + , "implementation" + , "IA64 M2"); + break; + } + } + + sprintf(buf,"%d", _system_configuration.width); + add_info( &sysinfo.cpuinfo[cpu], "width", buf); + + if (_system_configuration.cache_attrib & 1 ) + { + /* L1 cache is present */ + + sprintf(buf,"%d", _system_configuration.icache_size); + add_info( &sysinfo.cpuinfo[cpu], "L1 instruction cache size", buf); + + sprintf(buf,"%d", _system_configuration.dcache_size); + add_info( &sysinfo.cpuinfo[cpu], "L1 data cache size", buf); + } + + sprintf(buf,"%d", _system_configuration.L2_cache_size); + add_info( &sysinfo.cpuinfo[cpu], "L2 cache size", buf); + } + + sysinfo.flags = _glibtop_sysdeps_sysinfo; +} + +const glibtop_sysinfo * +glibtop_get_sysinfo_s (glibtop *server) +{ + static int first_time = 1; + + if (first_time) + { + init_sysinfo(); + first_time = 0; + } + + return &sysinfo; +} diff --git a/sysdeps/aix/uptime.c b/sysdeps/aix/uptime.c new file mode 100644 index 0000000..cb36d70 --- /dev/null +++ b/sysdeps/aix/uptime.c @@ -0,0 +1,63 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include + +#include + +static const unsigned long _glibtop_sysdeps_uptime = +(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_BOOT_TIME); + + +/* Init function. */ + +void +_glibtop_init_uptime_s (glibtop *server) +{ + server->sysdeps.uptime = _glibtop_sysdeps_uptime; +} + +/* Provides uptime and idle time. */ + +void +glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf) +{ + time_t uptime; + struct tms tbuf; + + glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_UPTIME), 0); + + memset (buf, 0, sizeof (glibtop_uptime)); + + buf->uptime = (double)times(&tbuf) / (double)sysconf(_SC_CLK_TCK); + buf->boot_time = (guint64) time(NULL) - (guint64) buf->uptime; + buf->flags = _glibtop_sysdeps_uptime; +} + diff --git a/sysdeps/aix/utils.c b/sysdeps/aix/utils.c new file mode 100644 index 0000000..10ca7e3 --- /dev/null +++ b/sysdeps/aix/utils.c @@ -0,0 +1,139 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include +#include +#include "glibtop_suid.h" +#include "utils.h" + +#ifndef HAVE_VMGETINFO +#include +typedef int (*vmgetinfo_proto)(void *out, int command, int arg); +#endif + +off_t +_glibtop_get_kmem_offset(glibtop* server, char* kname) +{ + int result; + struct nlist kernelnames[] = + { {NULL, 0, 0, 0, 0, 0}, + {NULL, 0, 0, 0, 0, 0}, + }; + + kernelnames[0]._n._n_name = kname; + + glibtop_suid_enter(server); + + result = knlist(kernelnames, 1, sizeof(struct nlist)); + + glibtop_suid_leave(server); + + if (result == -1) + { + return -1; + } + + return kernelnames[0].n_value; +} + +int +_glibtop_get_kmem_info(glibtop* server, off_t offset, void* buf, size_t len) +{ + int result; + + glibtop_suid_enter(server); + + lseek(server->machine->kmem_fd, offset, SEEK_SET); + + result = read(server->machine->kmem_fd, buf, len); + + glibtop_suid_leave(server); + + return result; +} + +struct procsinfo* +_glibtop_get_procinfo (glibtop *server, pid_t pid) +{ + int result; + pid_t current; + static int first_time = 1; + + /* test if procsinfo already found */ + + if ((server->machine->last_pinfo.pi_pid == pid) && (!first_time)) + { + return &server->machine->last_pinfo; + } + + /* seek procsinfo if given pid */ + + first_time = 0; + current = 0; + while ((result = getprocs( &server->machine->last_pinfo + , sizeof(struct procsinfo) + , NULL, 0, ¤t, 1)) == 1) + { + + if (pid == server->machine->last_pinfo.pi_pid) + { + return &server->machine->last_pinfo; + } + } + return NULL; +} + +#ifndef HAVE_VMGETINFO +int +_glibtop_vmgetinfo (void *out, int command, int arg) +{ + void* handle; + + static vmgetinfo_proto kern_vmgetinfo = NULL; + + if (kern_vmgetinfo == NULL) + { + handle = dlopen("/unix", RTLD_NOW | RTLD_GLOBAL); + if (handle == NULL) + { + return -1; + } + + kern_vmgetinfo = dlsym( handle, "vmgetinfo"); + + dlclose(handle); + + if (kern_vmgetinfo == NULL) + { + return -1; + } + } + + return kern_vmgetinfo(out, command, arg); +} +#endif diff --git a/sysdeps/bsd/AUTHORS b/sysdeps/bsd/AUTHORS new file mode 100644 index 0000000..9da8ace --- /dev/null +++ b/sysdeps/bsd/AUTHORS @@ -0,0 +1,2 @@ +Martin Baulig (martin@home-of-linux.org) +Josh Sled (jsled@scam.XCF.Berkeley.EDU) diff --git a/sysdeps/bsd/ChangeLog b/sysdeps/bsd/ChangeLog new file mode 100644 index 0000000..abac6db --- /dev/null +++ b/sysdeps/bsd/ChangeLog @@ -0,0 +1,485 @@ +2007-05-08 Benoît Dejean + + * fsusage.c: (_glibtop_bsd_get_fsusage_read_write): + * netload.c: (glibtop_get_netload_p): + + Fixed build on OpenBSD. + Patch by Jasper Lievisse Adriaanse . + +2007-02-18 Benoît Dejean + + * AUTHORS: + * Makefile.am: + * NOTES: + * close.c: (glibtop_close_p): + * cpu.c: (glibtop_init_cpu_p), (glibtop_get_cpu_p): + * fsusage.c: (_glibtop_bsd_get_fsusage_read_write): + * glibtop_machine.h: + * glibtop_server.h: + * glibtop_suid.h: + * init.c: (glibtop_init_r): + * loadavg.c: (glibtop_init_loadavg_p), (glibtop_get_loadavg_p): + * mem.c: (glibtop_init_mem_p), (glibtop_get_mem_p): + * msg_limits.c: (glibtop_init_msg_limits_p), + (glibtop_get_msg_limits_p): + * netlist.c: (glibtop_init_netlist_s), (glibtop_get_netlist_s): + * netload.c: (glibtop_init_netload_p), (glibtop_get_netload_p): + * nosuid.c: (glibtop_open_s), (glibtop_close_s): + * open.c: (glibtop_init_p), (glibtop_open_p): + * ppp.c: (glibtop_init_ppp_p), (glibtop_get_ppp_p): + * procargs.c: (glibtop_init_proc_args_p), + (glibtop_get_proc_args_p): + * procdata.c: (glibtop_get_procdata_s): + * prockernel.c: (glibtop_init_proc_kernel_p), + (glibtop_get_proc_kernel_p): + * proclist.c: (glibtop_init_proclist_p), (glibtop_get_proclist_p): + * procmap.c: (glibtop_init_proc_map_p), (glibtop_get_proc_map_p): + * procmem.c: (glibtop_init_proc_mem_p), (glibtop_get_proc_mem_p): + * procopenfiles.c: (glibtop_init_proc_open_files_s), + (glibtop_get_proc_open_files_s): + * procsegment.c: (glibtop_init_proc_segment_p), + (glibtop_get_proc_segment_p): + * procsignal.c: (glibtop_init_proc_signal_p), + (glibtop_get_proc_signal_p): + * procstate.c: (glibtop_init_proc_state_p), + (glibtop_get_proc_state_p): + * proctime.c: (glibtop_init_proc_time_p): + * procuid.c: (glibtop_init_proc_uid_p), (glibtop_get_proc_uid_p): + * sem_limits.c: (glibtop_init_sem_limits_p), + (glibtop_get_sem_limits_p): + * shm_limits.c: (glibtop_init_shm_limits_p), + (glibtop_get_shm_limits_p): + * siglist.c: + * swap.c: (glibtop_init_swap_p), (glibtop_get_swap_p): + * sysinfo.c: (init_sysinfo), (glibtop_get_sysinfo_s): + * uptime.c: (glibtop_init_uptime_p), (glibtop_get_uptime_p): + + Huge (k)FreeBSD update. + (k)FreeBSD support is freebsd/ + Other BSD are in bsd/ + + Patch by Joe Marcus Clarke + Alexander Nedotsukov + + Closes #407693. + +2007-01-31 Benoît Dejean + + * fsusage.c: (_glibtop_freebsd_get_fsusage_read_write): + * netload.c: (glibtop_get_netload_p): + * prockernel.c: (glibtop_get_proc_kernel_p): + * procmap.c: (glibtop_get_proc_map_p): + * proctime.c: + * siglist.c: + * /libgtop-sysdeps.m4: + + Various FreeBSD and kFreeBSD updates. + Patch by Roy Marples . + Reviewed by Petr Salinger . + Closes #387200. + +2006-11-27 Benoît Dejean + + * fsusage.c: (_glibtop_freebsd_get_fsusage_read_write): + * mem.c: (glibtop_get_mem_p): + * prockernel.c: (glibtop_get_proc_kernel_p): + * proclist.c: (glibtop_get_proclist_p): + * procmap.c: (glibtop_get_proc_map_p): + * procmem.c: (glibtop_get_proc_mem_p): + * procsignal.c: (glibtop_get_proc_signal_p): + * procstate.c: (glibtop_get_proc_state_p): + * proctime.c: + * procuid.c: (glibtop_get_proc_uid_p): + * swap.c: (glibtop_init_swap_p), (glibtop_get_swap_p): + + Added kfreebsd support. + Patch by Petr Salinger . + +2006-04-09 Benoît Dejean + + * fsusage.c: (_glibtop_freebsd_get_fsusage_read_write): + + Fixed typo. + +2006-04-04 Julio M. Merino Vidal + + * sysdeps/freebsd/fsusage.c: + + Use statvfs(2) if available instead of statfs(2). The latter was + replaced by the former and is no longer available under, e.g. NetBSD. + + Fixes bug #337235. + +2006-04-04 Benoît Dejean + + * sysinfo.c: (init_sysinfo): + + Store only strings in values' values. g_strdup these strings. + Even if values is never destroyed, set key_destroy_func to NULL. + + Leave description to NULL. + +2006-04-04 Julio M. Merino Vidal + + * sysdeps/freebsd/Makefile.am: + * sysdeps/freebsd/sysinfo.c: + + Bring back to life (from the 1.x versions) the sysinfo.c file for + the freebsd sysdeps. The new file comes from the FreeBSD ports + repository and has some minor style changes by me. This is required + to get the glibtop_get_sysinfo_s function used by the sysdeps common + code. + + Fixes bug #337251. + +2006-04-04 Julio M. Merino Vidal + + * sysdeps/freebsd/proctime.c: + + Remove obsolete and non-functional code that breaks the build under + NetBSD. It was guarded by a conditional but could not compile + anyway because it referred to an undefined variable. + + Fixes bug #337234. + +2005-02-28 Benoît Dejean + + * fsusage.c: (_glibtop_freebsd_get_fsusage_read_write): Forgot to add + this file :) + +2005-02-28 Benoît Dejean + + * Makefile.am: + * cpu.c: (glibtop_get_cpu_p): + * netlist.c: (glibtop_get_netlist_s): + * netload.c: (glibtop_get_netload_p): + * procmem.c: (glibtop_get_proc_mem_p): + + Fix a bug in netlist where glibtop_netlist.number was never initialized to 0 + (this resulted in a NULL pointer dereference in the network load feature + of the multiload applet) + + * Add support for getting interface flags and packet counts even on interfaces + without IP addresses (needed for the network load feature of the multiload applet) + + * Restore per-process limits in the !FreeBSD or __FreeBSD_version < 500013 + case + + * Add CPU interrupt time as IOWAIT to get support for the cpu load feature of + the multiload applet. + + Patch from marcus@freebsd.org (Joe Marcus Clarke). + Closes #168704. + +2005-02-23 Benoît Dejean + + * Makefile.am: + * netlist.c: (glibtop_get_netlist_s): + * procmap.c: (glibtop_get_proc_map_p): + * procmem.c: (glibtop_get_proc_mem_p): + * procopenfiles.c: (glibtop_init_proc_open_files_s), + (glibtop_get_proc_open_files_s): + * proctime.c: + + Add support for FreeBSD 6-CURRENT. + Use the more portable getrlimit to obtain process memory limits. + Correctly determine process time. + Stub out the procopenfiles() function (this is not yet implemented, however). + Fix a nasty infinite loop and memory leak due to a forgot pointer increment. + + Patch from marcus@freebsd.org (Joe Marcus Clarke). + Closes #168232. + +2004-12-05 Benoît Dejean + + * Makefile.am: + * netlist.c: (glibtop_init_netlist_s), (glibtop_get_netlist_s): + Added glibtop_get_netlist. Patch from marcus@freebsd.org (Joe Marcus Clarke). + +2004-08-28 Benoît Dejean + + * mem.c: (glibtop_get_mem_p): + * ppp.c: + * swap.c: (glibtop_init_swap_p), (glibtop_get_swap_p): + * uptime.c: (glibtop_get_uptime_p): Merge a bunch of trivial OpenBSD + patchs. To *BSD maintainers : please report bugs ! don't be selfish, share + your patchs. + +2004-08-22 Benoît Dejean + + * procstate.c: + * uptime.c: (glibtop_get_uptime_p): Merged Marcus' patches. + +2004-07-15 Benoît Dejean + + * procstate.c: (glibtop_get_proc_state_p): Fixed copy/paste error + while setting buf->state. + +2004-06-07 Benoît Dejean + + * netload.c: (glibtop_get_netload_p): + * procstate.c: (glibtop_get_proc_state_p): + * prockernel.c: (glibtop_get_proc_kernel_p): s/strncpy/g_strlcpy/. + + * procargs.c: (glibtop_get_proc_args_p): + * procmap.c: (glibtop_get_proc_map_p): Cleaned. + + +2004-05-26 Benoît Dejean + + * procdata.c: (glibtop_get_procdata_s): Removed Linux related code. + +2004-04-07 Bastien Nocera + + * prockernel.c: (glibtop_get_proc_kernel_p): patch for NetBSD/AMD64 + support (Julio M. Merino Vidal ) + +2004-03-09 Bastien Nocera + + * Makefile.am: + * cpu.c: (glibtop_init_cpu_p), (glibtop_get_cpu_p): + * glibtop_machine.h: + * mem.c: + * netload.c: (glibtop_get_netload_p): + * prockernel.c: (glibtop_get_proc_kernel_p): + * proclist.c: (glibtop_get_proclist_p): + * procmap.c: (glibtop_get_proc_map_p): + * procmem.c: (glibtop_get_proc_mem_p): + * procsignal.c: (glibtop_get_proc_signal_p): + * procstate.c: (glibtop_get_proc_state_p): + * proctime.c: + * procuid.c: (glibtop_get_proc_uid_p): + * uptime.c: (glibtop_get_uptime_p): implement NetBSD support, and + some build problems on FreeBSD (Closes: #135674) + +2004-03-09 Bastien Nocera + + * procargs.c: (glibtop_get_proc_args_p): + * procmap.c: (glibtop_get_proc_map_p): + * swap.c: (glibtop_get_swap_p): fix g_malloc usage on non-Linux + platforms (patch by Benoît Dejean ) + +2003-10-21 Bastien Nocera + + * Makefile.am: install only one library, libgtop-2.0 + Fix build-time warnings due to the redefinition of guint64 + +2003-10-20 Bastien Nocera + + * mem.c: (glibtop_get_mem_p): + * prockernel.c: (glibtop_get_proc_kernel_p): + * procmem.c: (glibtop_get_proc_mem_p): + * proctime.c: (glibtop_get_proc_time_p): s/u_int64_t/guint64/ + +2003-10-20 Bastien Nocera + + * swap.c: (glibtop_get_swap_p): fix swap sizes in FreeBSD, + patch by edwin@mavetju.org + +2003-10-20 Bastien Nocera + + * glibtop_machine.h: + * glibtop_server.h: + * glibtop_suid.h: + * open.c: + * procargs.c: + * proclist.c: + * procmap.c: + * swap.c: fixed compilation + +2003-10-20 Bastien Nocera + + * procargs.c: (glibtop_get_proc_args_p): + * proclist.c: (glibtop_get_proclist_p): + * procmap.c: (glibtop_get_proc_map_p): + * swap.c: (glibtop_get_swap_p): replace all the xmalloc crap by glib + memory management functions + +2001-10-17 Abel Cheung + + * Makefile.am: move header to $(includedir)/libgtop-1.0/glibtop. + +2001-02-27 Martin Baulig + + * netload.c: Comment out the `subnet' field on BSDI; this should + make it compile. Bug #13345. + + * shm_limits.c, msg_limits.c, sem_limits.c: Applied a patch + from Rolf Grossmann (grossman@securitas.net) for FreeBSD 4.2. + Fixes #51334. + +2001-02-14 Martin Baulig + + * proctime.c (glibtop_get_proc_time_p): Make things work on + OpenBSD 2.6; this is basically the same than on NetBSD. + +2000-02-13 Martin Baulig + + * *.c: kvm_nlist () returns -1 on error, but a positive return value + does not necessarily mean failure. Fixes #3302 which was reported by + Matthias Scheler some time ago. + +1999-10-16 Martin Baulig + + Applied all patches from the FreeBSD 3.3 ports collection. + + * swap.c: Only #include for __FreeBSD_version < 400005. + + * prockernel.c: Make it compile on FreeBSD / alpha. + + * procsignal.c: Some fixes for FreeBSD-current. + +1999-10-16 Martin Baulig + + * procstate.c (glibtop_get_proc_state_p): Don't use the + `GLIBTOP_PROCESS_*' constants for process states for + LibGTop 1.0.x. + +1999-07-29 Martin Baulig + + * proctime.c (glibtop_get_proc_time_p): Fix bug reported by + Takis Psarogiannakopoulos: `start_time' are seconds since the + epoch as it is stated in the manual. + +Tue Jun 15 16:04:10 1999 Timur Bakeyev + + * procuid.c: A fix to a ommitted case, when nor NetBSD, nor + LibGTop >= 1.1.0. This should be investigated closely to cover + more cases.... + +1999-05-26 Martin Baulig + + More NetBSD 1.4 fixes. + + * mem.c, procmap.c, procmem.c: Make this work with the new UVM code. + + [FIXME: This following most likely works on all BSD systems, but + this needs to be tested; I made it conditional to NetBSD 1.4 at + the moment. Please extend the conditionals to any other systems + where this works ...] + + * procstate.c: Added `ruid' and `rgid' for LibGTop >= 1.1.0. + * procuid.c: Added `ngroups' and `groups' for LibGTop >= 1.1.0. + +1999-05-25 Martin Baulig + + * ppp.c: Make this work on NetBSD. + +Thu Apr 8 23:47:29 1999 Timur Bakeyev + + * cpu.c, mem.c, netload.c, procargs.c, procstate.c, proctime.c, + sem_limits.c, shm_limits.c, swap.c: Added initial port for BSD/OS + (aka BSDI) 2.x and 3.x. 4.x should also(?) work. + + Still, this port require more close look and extended check. + +1999-03-19 Martin Baulig + + Added basic support for BSDI. It compiles without problems on + BSDI 2.1 and 3.1, but it is *untested* - I'm neither root on + the machine nor have I access to /dev/kmem, so I don't know + whether it will work. + + You need to give configure the `--enable-hacker-mode' parameter + to use the code. + + If someone can verify whether it actually works, please let me + know. + +1999-03-18 Martin Baulig + + * ppp.c: Don't use `sppp.pp_phase' if we don't HAVE_I4B_ACCT. + This is an ugly hack until someone tells me which versions have + this field and which not. + +1999-02-25 Martin Baulig + + * prockernel.c, proctime.c: Applied patch Stanislav Grozev for + OpenBSD: only include for FreeBSD. + +1999-02-24 Martin Baulig + + * swap.c: Applied another patch from Jeremy Lea to + make it work with FreeBSD-current. + +1999-02-21 Martin Baulig + + * procmap.c, procmem.c: Applied patch from Jeremy Lea. + + * prockernel.c, proctime.c: Applied patch from the FreeBSD 2.2.8 + ports collection. + + * procsignal.c: Applied patch from the NetBSD-current ports + collection. + +1998-12-06 Martin Baulig + + * Make it work with OpenBSD 2.4. + +1998-12-05 Martin Baulig + + * Make it work with NetBSD 1.3.2. + +1998-11-17 Martin Baulig + + * Make it work with FreeBSD 3.0. + +1998-11-11 Martin Baulig + + * *.c: It does not work to get information about the swapper task + on FreeBSD 2.2.6, so we simple return if pid == 0. + +1998-10-31 Martin Baulig + + * *.c: Use glibtop_warn_io_r () instead of glibtop_error_io_r (). + + * proctime.c, prockernel.c, procargs.c: Don't call kvm_uread () if + the /proc filesystem is not mounted. + +1998-10-26 Martin Baulig + + * netload.c: New file to get network load. + +1998-10-26 Martin Baulig + + * procargs.c: New file to get command line arguments. + +1998-10-25 Martin Baulig + + * ppp.c: New file to get PPP/ISDN statistics. Currently this only + get ISDN statistics if you have the I4B package. + + To get the number of bytes transferred in/out you need to read the + file `misc/i4b_acct.txt' in the LibGTop source directory to see + how to enable this. + +1998-10-03 Martin Baulig + + * procstate.c (glibtop_get_procstate_s): Use correct values for + the `state' field. + + * proclist.c (glibtop_get_proclist_p): Honor the GLIBTOP_EXCLUDE_IDLE + and GLIBTOP_EXCLUDE_SYSTEM flags of the `which' parameter. + +1998-08-24 Martin Baulig + + * *.c (glibtop_init_p): Using correct `(1 << GLIBTOP_SYSDPES_*)'. + * cpu.c, mem.c: Removed `const' from sysctl () constants to keep + compiler happy. + + * procmem.c: Added missing call to `glibtop_init_p'. + + * prockernel.c: Casting `nwchan' to `unsigned long' since this + normally has the same size than a pointer. Well, is there a + FreeBSD for 64bit architectures ? + +1998-08-08 Martin Baulig + + * swap.c: Added swap usage based upton the source code + of `pinfo'. + +1998-08-07 Martin Baulig + + * *: Imported FreeBSD port of libgtop from Josh Sled. + + * ChangeLog: New file. diff --git a/sysdeps/bsd/Makefile.am b/sysdeps/bsd/Makefile.am new file mode 100644 index 0000000..a669237 --- /dev/null +++ b/sysdeps/bsd/Makefile.am @@ -0,0 +1,24 @@ + +AM_CPPFLAGS = @AM_CPPFLAGS@ + +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la + +libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c sysinfo.c + +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + +libgtop_sysdeps_suid_2_0_la_LIBADD = $(KVM_LIBS) +libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ + uptime.c loadavg.c shm_limits.c msg_limits.c \ + sem_limits.c procaffinity.c \ + proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c prockernel.c \ + procsegment.c procargs.c procmap.c netlist.c \ + netload.c ppp.c procopenfiles.c fsusage.c + +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h \ + glibtop_suid.h + +libgtopincludedir = $(includedir)/libgtop-2.0 diff --git a/sysdeps/bsd/Makefile.in b/sysdeps/bsd/Makefile.in new file mode 100644 index 0000000..655979f --- /dev/null +++ b/sysdeps/bsd/Makefile.in @@ -0,0 +1,783 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = sysdeps/bsd +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libgtopinclude_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libgtop_sysdeps_2_0_la_LIBADD = +am_libgtop_sysdeps_2_0_la_OBJECTS = nosuid.lo siglist.lo sysinfo.lo +libgtop_sysdeps_2_0_la_OBJECTS = $(am_libgtop_sysdeps_2_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgtop_sysdeps_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__DEPENDENCIES_1 = +libgtop_sysdeps_suid_2_0_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_libgtop_sysdeps_suid_2_0_la_OBJECTS = open.lo close.lo cpu.lo \ + mem.lo swap.lo uptime.lo loadavg.lo shm_limits.lo \ + msg_limits.lo sem_limits.lo procaffinity.lo proclist.lo \ + procstate.lo procuid.lo proctime.lo procmem.lo procsignal.lo \ + prockernel.lo procsegment.lo procargs.lo procmap.lo netlist.lo \ + netload.lo ppp.lo procopenfiles.lo fsusage.lo +libgtop_sysdeps_suid_2_0_la_OBJECTS = \ + $(am_libgtop_sysdeps_suid_2_0_la_OBJECTS) +libgtop_sysdeps_suid_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_suid_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +DIST_SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libgtopincludedir)" +HEADERS = $(libgtopinclude_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp AUTHORS \ + ChangeLog +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la +libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c sysinfo.c +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_suid_2_0_la_LIBADD = $(KVM_LIBS) +libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ + uptime.c loadavg.c shm_limits.c msg_limits.c \ + sem_limits.c procaffinity.c \ + proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c prockernel.c \ + procsegment.c procargs.c procmap.c netlist.c \ + netload.c ppp.c procopenfiles.c fsusage.c + +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h \ + glibtop_suid.h + +libgtopincludedir = $(includedir)/libgtop-2.0 +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sysdeps/bsd/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu sysdeps/bsd/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgtop_sysdeps-2.0.la: $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_2_0_la_LINK) $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_LIBADD) $(LIBS) + +libgtop_sysdeps_suid-2.0.la: $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_suid_2_0_la_LINK) $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsusage.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netload.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nosuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procaffinity.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prockernel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procopenfiles.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsegment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsignal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procstate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siglist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-libgtopincludeHEADERS: $(libgtopinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgtopincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgtopincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgtopincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgtopincludedir)" || exit $$?; \ + done + +uninstall-libgtopincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgtopincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libgtopincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libgtopincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libgtopincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libgtopincludeHEADERS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libgtopincludeHEADERS + +.PRECIOUS: Makefile + + +# 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: diff --git a/sysdeps/bsd/close.c b/sysdeps/bsd/close.c new file mode 100644 index 0000000..72ce14d --- /dev/null +++ b/sysdeps/bsd/close.c @@ -0,0 +1,30 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +/* Closes pipe to gtop server. */ + +void +glibtop_close_p (glibtop *server) +{ } diff --git a/sysdeps/bsd/cpu.c b/sysdeps/bsd/cpu.c new file mode 100644 index 0000000..cf5e721 --- /dev/null +++ b/sysdeps/bsd/cpu.c @@ -0,0 +1,142 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#ifdef __NetBSD__ +#include +#endif + +static const unsigned long _glibtop_sysdeps_cpu = +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + +(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) + +(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY) + +(1L << GLIBTOP_CPU_IOWAIT); + +#ifndef KERN_CP_TIME +/* nlist structure for kernel access */ +static struct nlist nlst [] = { +#ifdef __bsdi__ + { "_cpustats" }, +#else + { "_cp_time" }, +#endif + { 0 } +}; +#endif + +/* MIB array for sysctl */ +static int mib_length=2; +static int mib [] = { CTL_KERN, KERN_CLOCKRATE }; +#ifdef KERN_CP_TIME +static int mib2 [] = { CTL_KERN, KERN_CP_TIME }; +#endif + +/* Init function. */ + +void +_glibtop_init_cpu_p (glibtop *server) +{ +#ifndef KERN_CP_TIME + if (kvm_nlist (server->machine->kd, nlst) < 0) { + glibtop_warn_io_r (server, "kvm_nlist (cpu)"); + return; + } +#endif + + /* Set this only if kvm_nlist () succeeded. */ + server->sysdeps.cpu = _glibtop_sysdeps_cpu; +} + +/* Provides information about cpu usage. */ + +void +glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf) +{ +#ifdef KERN_CP_TIME + guint64 cpts [CPUSTATES]; +#else + long cpts [CPUSTATES]; +#endif + /* sysctl vars*/ + struct clockinfo ci; + size_t length; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_CPU), 0); + + memset (buf, 0, sizeof (glibtop_cpu)); + + /* If this fails, the nlist may not be valid. */ + if (server->sysdeps.cpu == 0) + return; + +#ifdef KERN_CP_TIME + length = sizeof (cpts); + if (sysctl (mib2, mib_length, cpts, &length, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl"); + return; + } +#else + if (kvm_read (server->machine->kd, nlst [0].n_value, + &cpts, sizeof (cpts)) != sizeof (cpts)) { + glibtop_warn_io_r (server, "kvm_read (cp_time)"); + return; + } +#endif + + /* Get the clockrate data */ + length = sizeof (struct clockinfo); + if (sysctl (mib, mib_length, &ci, &length, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl"); + return; + } + + /* set user time */ + buf->user = cpts [CP_USER]; + /* set nice time */ + buf->nice = cpts [CP_NICE]; + /* set sys time */ + buf->sys = cpts [CP_SYS]; + /* set idle time */ + buf->idle = cpts [CP_IDLE]; + /* set iowait (really just interrupt) time */ + buf->iowait = cpts [CP_INTR]; + + /* set frequency */ + /* + FIXME -- is hz, tick, profhz or stathz wanted? + buf->frequency = sysctl("kern.clockrate", ...); + + struct clockinfo + */ + buf->frequency = ci.hz; + /* set total */ + buf->total = cpts [CP_USER] + cpts [CP_NICE] + + cpts [CP_SYS] + cpts [CP_IDLE]; + + /* Set the flags last. */ + buf->flags = _glibtop_sysdeps_cpu; +} diff --git a/sysdeps/bsd/fsusage.c b/sysdeps/bsd/fsusage.c new file mode 100644 index 0000000..78f6b43 --- /dev/null +++ b/sysdeps/bsd/fsusage.c @@ -0,0 +1,61 @@ +#include + +/* Although FreeBSD ships with statvfs it seems incomplete, so prefer statfs */ +#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) +#undef HAVE_SYS_STATVFS_H +#undef STAT_STATVFS +#endif + +#include +#include +#include + +#include + +#include + +#include +#include +#if defined (HAVE_SYS_STATVFS_H) +#include +#else +#include +#endif + +#include +#include +#include + +void +_glibtop_bsd_get_fsusage_read_write(glibtop *server, + glibtop_fsusage *buf, + const char *path); + +void +_glibtop_bsd_get_fsusage_read_write(glibtop *server, + glibtop_fsusage *buf, + const char *path) +{ + int result; +#if defined (STAT_STATVFS) + struct statvfs sfs; +#else + struct statfs sfs; +#endif + +#if defined (STAT_STATVFS) + result = statvfs (path, &sfs); +#else + result = statfs (path, &sfs); +#endif + + if (result == -1) { + return; + } + +#if !defined(__OpenBSD__) + buf->read = sfs.f_syncreads + sfs.f_asyncreads; +#endif + buf->write = sfs.f_syncwrites + sfs.f_asyncwrites; + buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE); +} diff --git a/sysdeps/bsd/glibtop_machine.h b/sysdeps/bsd/glibtop_machine.h new file mode 100644 index 0000000..173aed6 --- /dev/null +++ b/sysdeps/bsd/glibtop_machine.h @@ -0,0 +1,63 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_MACHINE_H__ +#define __GLIBTOP_MACHINE_H__ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef __FreeBSD__ +#include +#endif + +#ifdef __NetBSD__ +#include + +#ifndef SRUN +#define SRUN SACTIVE +#endif +#endif + +G_BEGIN_DECLS + +struct _glibtop_machine +{ + uid_t uid, euid; + gid_t gid, egid; + + /* The kernel descriptor, used by kvm_* calls. We keep and re-use + * it rather than re-getting it for almost all function + * invocations. */ + kvm_t *kd; +}; + +G_END_DECLS + +#endif /* __GLIBTOP_MACHINE_H__ */ diff --git a/sysdeps/bsd/glibtop_server.h b/sysdeps/bsd/glibtop_server.h new file mode 100644 index 0000000..ca4dde0 --- /dev/null +++ b/sysdeps/bsd/glibtop_server.h @@ -0,0 +1,53 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SERVER_H__ +#define __GLIBTOP_SERVER_H__ + +G_BEGIN_DECLS + +#define GLIBTOP_SUID_CPU (1 << GLIBTOP_SYSDEPS_CPU) +#define GLIBTOP_SUID_MEM (1 << GLIBTOP_SYSDEPS_MEM) +#define GLIBTOP_SUID_SWAP (1 << GLIBTOP_SYSDEPS_SWAP) +#define GLIBTOP_SUID_UPTIME (1 << GLIBTOP_SYSDEPS_UPTIME) +#define GLIBTOP_SUID_LOADAVG (1 << GLIBTOP_SYSDEPS_LOADAVG) +#define GLIBTOP_SUID_SHM_LIMITS (1 << GLIBTOP_SYSDEPS_SHM_LIMITS) +#define GLIBTOP_SUID_MSG_LIMITS (1 << GLIBTOP_SYSDEPS_MSG_LIMITS) +#define GLIBTOP_SUID_SEM_LIMITS (1 << GLIBTOP_SYSDEPS_SEM_LIMITS) +#define GLIBTOP_SUID_PROCLIST (1 << GLIBTOP_SYSDEPS_PROCLIST) +#define GLIBTOP_SUID_PROC_STATE (1 << GLIBTOP_SYSDEPS_PROC_STATE) +#define GLIBTOP_SUID_PROC_UID (1 << GLIBTOP_SYSDEPS_PROC_UID) +#define GLIBTOP_SUID_PROC_MEM (1 << GLIBTOP_SYSDEPS_PROC_MEM) +#define GLIBTOP_SUID_PROC_TIME (1 << GLIBTOP_SYSDEPS_PROC_TIME) +#define GLIBTOP_SUID_PROC_SIGNAL (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL) +#define GLIBTOP_SUID_PROC_KERNEL (1 << GLIBTOP_SYSDEPS_PROC_KERNEL) +#define GLIBTOP_SUID_PROC_SEGMENT (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT) +#define GLIBTOP_SUID_PROC_ARGS (1 << GLIBTOP_SYSDEPS_PROC_ARGS) +#define GLIBTOP_SUID_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP) +#define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) +#define GLIBTOP_SUID_NETLIST 0 +#define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) +#define GLIBTOP_SUID_PROC_WD 0 +#define GLIBTOP_SUID_PROC_AFFINITY 0 + +G_END_DECLS + +#endif diff --git a/sysdeps/bsd/glibtop_suid.h b/sysdeps/bsd/glibtop_suid.h new file mode 100644 index 0000000..253c1d5 --- /dev/null +++ b/sysdeps/bsd/glibtop_suid.h @@ -0,0 +1,56 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SUID_H__ +#define __GLIBTOP_SUID_H__ + +G_BEGIN_DECLS + +#if _IN_LIBGTOP +#include +#endif + +#define KI_PROC(ki) (&(ki))->kp_proc) +#define KI_EPROC(ki) (&(ki))->kp_eproc) + +#define FORCEUREAD 1 +#define UREADOK(ki) (FORCEUREAD || (KI_PROC(ki)->p_flag & P_INMEM)) + +static inline void glibtop_suid_enter (glibtop *server) { + setregid (server->machine->gid, server->machine->egid); +}; + +static inline void glibtop_suid_leave (glibtop *server) { + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); +}; + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags); +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags); + +G_END_DECLS + +#endif diff --git a/sysdeps/bsd/loadavg.c b/sysdeps/bsd/loadavg.c new file mode 100644 index 0000000..d3a48e8 --- /dev/null +++ b/sysdeps/bsd/loadavg.c @@ -0,0 +1,59 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_loadavg = +(1L << GLIBTOP_LOADAVG_LOADAVG); + +/* Init function. */ + +void +_glibtop_init_loadavg_p (glibtop *server) +{ + server->sysdeps.loadavg = _glibtop_sysdeps_loadavg; +} + +/* Provides load averange. */ + +void +glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf) +{ + double ldavg[3]; + int i; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_LOADAVG), 0); + + memset (buf, 0, sizeof (glibtop_loadavg)); + + getloadavg (ldavg, 3); + + /* fill in the struct */ + buf->flags = _glibtop_sysdeps_loadavg; + for (i = 0; i < 3; i++) { + buf->loadavg [i] = ldavg [i]; + } /* end for */ +} diff --git a/sysdeps/bsd/mem.c b/sysdeps/bsd/mem.c new file mode 100644 index 0000000..df5912e --- /dev/null +++ b/sysdeps/bsd/mem.c @@ -0,0 +1,222 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#if defined(__NetBSD__) && (__NetBSD_Version__ < 105020000) +#include +#endif + +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) +#include +#endif + +static const unsigned long _glibtop_sysdeps_mem = +(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) + +(1L << GLIBTOP_MEM_FREE) + +(1L << GLIBTOP_MEM_SHARED) + +(1L << GLIBTOP_MEM_BUFFER) + +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +(1L << GLIBTOP_MEM_CACHED) + +#endif +(1L << GLIBTOP_MEM_USER) + (1L << GLIBTOP_MEM_LOCKED); + +#ifndef LOG1024 +#define LOG1024 10 +#endif + +/* these are for getting the memory statistics */ +static int pageshift; /* log base 2 of the pagesize */ + +/* define pagetok in terms of pageshift */ +#define pagetok(size) ((size) << pageshift) + +/* nlist structure for kernel access */ +static struct nlist nlst [] = { +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) + { "_bufpages" }, + { 0 } +#else +#if defined(__bsdi__) + { "_bufcachemem" }, +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + { "_bufspace" }, +#else + { "_bufpages" }, +#endif + { "_cnt" }, + { 0 } +#endif +}; + +/* MIB array for sysctl */ +#ifdef __bsdi__ +static int mib [] = { CTL_VM, VM_TOTAL }; +#else +static int mib [] = { CTL_VM, VM_METER }; +#endif + +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) +static int mib_uvmexp [] = { CTL_VM, VM_UVMEXP }; +#endif + +/* Init function. */ + +void +_glibtop_init_mem_p (glibtop *server) +{ + register int pagesize; + + if (kvm_nlist (server->machine->kd, nlst) < 0) { + glibtop_warn_io_r (server, "kvm_nlist (mem)"); + return; + } + + /* get the page size with "getpagesize" and calculate pageshift + * from it */ + pagesize = getpagesize (); + pageshift = 0; + while (pagesize > 1) { + pageshift++; + pagesize >>= 1; + } + + /* we only need the amount of log(2)1024 for our conversion */ + pageshift -= LOG1024; + + server->sysdeps.mem = _glibtop_sysdeps_mem; +} + +void +glibtop_get_mem_p (glibtop *server, glibtop_mem *buf) +{ + struct vmtotal vmt; + size_t length_vmt; +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) + struct uvmexp uvmexp; + size_t length_uvmexp; +#else + struct vmmeter vmm; +#endif + u_int v_used_count; + u_int v_total_count; + u_int v_free_count; + int bufspace; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MEM), 0); + + memset (buf, 0, sizeof (glibtop_mem)); + + if (server->sysdeps.mem == 0) + return; + + /* [FIXME: On FreeBSD 2.2.6, sysctl () returns an incorrect + * value for `vmt.vm'. We use some code from Unix top + * here.] */ + + /* Get the data from sysctl */ + length_vmt = sizeof (vmt); + if (sysctl (mib, 2, &vmt, &length_vmt, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (vmt)"); + return; + } + +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) + length_uvmexp = sizeof (uvmexp); + if (sysctl (mib_uvmexp, 2, &uvmexp, &length_uvmexp, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (uvmexp)"); + return; + } +#else + /* Get the data from kvm_* */ + if (kvm_read (server->machine->kd, nlst[1].n_value, + &vmm, sizeof (vmm)) != sizeof (vmm)) { + glibtop_warn_io_r (server, "kvm_read (cnt)"); + return; + } +#endif + + if (kvm_read (server->machine->kd, nlst[0].n_value, + &bufspace, sizeof (bufspace)) != sizeof (bufspace)) { + glibtop_warn_io_r (server, "kvm_read (bufspace)"); + return; + } + + /* convert memory stats to Kbytes */ + +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + v_total_count = vmm.v_page_count; +#else +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) + v_total_count = uvmexp.reserve_kernel + + uvmexp.reserve_pagedaemon + + uvmexp.free + uvmexp.wired + uvmexp.active + + uvmexp.inactive; +#else + v_total_count = vmm.v_kernel_pages + + vmm.v_free_count + vmm.v_wire_count + + vmm.v_active_count + vmm.v_inactive_count; +#endif +#endif + +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) + v_used_count = uvmexp.active + uvmexp.inactive; + v_free_count = uvmexp.free; +#else + v_used_count = vmm.v_active_count + vmm.v_inactive_count; + v_free_count = vmm.v_free_count; +#endif + + buf->total = (guint64) pagetok (v_total_count) << LOG1024; + buf->used = (guint64) pagetok (v_used_count) << LOG1024; + buf->free = (guint64) pagetok (v_free_count) << LOG1024; + +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + buf->cached = (guint64) pagetok (vmm.v_cache_count) << LOG1024; +#endif + +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) + buf->locked = (guint64) pagetok (uvmexp.wired) << LOG1024; +#else + buf->locked = (guint64) pagetok (vmm.v_wire_count) << LOG1024; +#endif + + buf->shared = (guint64) pagetok (vmt.t_rmshr) << LOG1024; + +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + buf->buffer = (guint64) bufspace; +#else + buf->buffer = (guint64) pagetok (bufspace) << LOG1024; +#endif + + /* user */ + buf->user = buf->total - buf->free - buf->shared - buf->buffer; + + /* Set the values to return */ + buf->flags = _glibtop_sysdeps_mem; +} diff --git a/sysdeps/bsd/msg_limits.c b/sysdeps/bsd/msg_limits.c new file mode 100644 index 0000000..44aed99 --- /dev/null +++ b/sysdeps/bsd/msg_limits.c @@ -0,0 +1,114 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , August 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#if (defined __bsdi__) && (_BSDI_VERSION < 199700) +/* Older versions of BSDI don't seem to have this. */ + +void +_glibtop_init_msg_limits_p (glibtop *server) +{ } + +void +glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf) +{ + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MSG_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_msg_limits)); +} + +#else + +/* Define the appropriate macro (if any) to get declaration of `struct + * msginfo'. Needed on, at least, FreeBSD. */ +#if defined (STRUCT_MSGINFO_NEEDS_KERNEL) +#define KERNEL 1 +#elif defined (STRUCT_MSGINFO_NEEDS__KERNEL) +#define _KERNEL 1 +#endif + +#include +#include + +static const unsigned long _glibtop_sysdeps_msg_limits = +(1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNI) + +(1L << GLIBTOP_IPC_MSGMNB) + (1L << GLIBTOP_IPC_MSGTQL) + +(1L << GLIBTOP_IPC_MSGSSZ); + +/* The values in this structure never change at runtime, so we only + * read it once during initialization. We have to use the name `_msginfo' + * since `msginfo' is already declared external in . */ +static struct msginfo _msginfo; + +/* nlist structure for kernel access */ +static struct nlist nlst [] = { + { "_msginfo" }, + { 0 } +}; + +/* Init function. */ + +void +_glibtop_init_msg_limits_p (glibtop *server) +{ + if (kvm_nlist (server->machine->kd, nlst) < 0) { + glibtop_warn_io_r (server, "kvm_nlist (msg_limits)"); + return; + } + + if (kvm_read (server->machine->kd, nlst [0].n_value, + &_msginfo, sizeof (_msginfo)) != sizeof (_msginfo)) { + glibtop_warn_io_r (server, "kvm_read (msginfo)"); + return; + } + + server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf) +{ + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MSG_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_msg_limits)); + + if (server->sysdeps.msg_limits == 0) + return; + + buf->msgmax = _msginfo.msgmax; + buf->msgmni = _msginfo.msgmni; + buf->msgmnb = _msginfo.msgmnb; + buf->msgtql = _msginfo.msgtql; + buf->msgssz = _msginfo.msgtql; + + buf->flags = _glibtop_sysdeps_msg_limits; +} + +#endif /* either a newer BSDI or no BSDI at all. */ + diff --git a/sysdeps/bsd/netlist.c b/sysdeps/bsd/netlist.c new file mode 100644 index 0000000..59550e0 --- /dev/null +++ b/sysdeps/bsd/netlist.c @@ -0,0 +1,66 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + + +static const unsigned long _glibtop_sysdeps_netlist = (1 << GLIBTOP_NETLIST_NUMBER); + +/* Init function. */ + +void +_glibtop_init_netlist_s (glibtop *server) +{ + server->sysdeps.netlist = _glibtop_sysdeps_netlist; +} + + +char** +glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf) +{ + struct if_nameindex *ifstart, *ifs; + GPtrArray *devices; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_NETLIST, 0); + + memset (buf, 0, sizeof (glibtop_netlist)); + + ifs = ifstart = if_nameindex(); + + devices = g_ptr_array_new(); + + while(ifs && ifs->if_name) { + g_ptr_array_add(devices, g_strdup(ifs->if_name)); + buf->number++; + ifs++; + } + + if_freenameindex(ifstart); + + buf->flags = _glibtop_sysdeps_netlist; + + g_ptr_array_add(devices, NULL); + + return (char **) g_ptr_array_free(devices, FALSE); +} + diff --git a/sysdeps/bsd/netload.c b/sysdeps/bsd/netload.c new file mode 100644 index 0000000..2195e19 --- /dev/null +++ b/sysdeps/bsd/netload.c @@ -0,0 +1,244 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +#ifdef HAVE_NET_IF_VAR_H +#include +#endif + +#include +#include + +static const unsigned long _glibtop_sysdeps_netload = +(1L << GLIBTOP_NETLOAD_IF_FLAGS) + +(1L << GLIBTOP_NETLOAD_PACKETS_IN) + +(1L << GLIBTOP_NETLOAD_PACKETS_OUT) + +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_BYTES_IN) + +(1L << GLIBTOP_NETLOAD_BYTES_OUT) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) + +(1L << GLIBTOP_NETLOAD_ERRORS_IN) + +(1L << GLIBTOP_NETLOAD_ERRORS_OUT) + +(1L << GLIBTOP_NETLOAD_ERRORS_TOTAL) + +(1L << GLIBTOP_NETLOAD_COLLISIONS); + +static const unsigned _glibtop_sysdeps_netload_data = +(1L << GLIBTOP_NETLOAD_ADDRESS) + +#if !defined(__bsdi__) +(1L << GLIBTOP_NETLOAD_SUBNET) + +#endif +(1L << GLIBTOP_NETLOAD_MTU); + +/* nlist structure for kernel access */ +static struct nlist nlst [] = { + { "_ifnet" }, + { 0 } +}; + +/* Init function. */ + +void +_glibtop_init_netload_p (glibtop *server) +{ + server->sysdeps.netload = _glibtop_sysdeps_netload; + + if (kvm_nlist (server->machine->kd, nlst) < 0) + glibtop_error_io_r (server, "kvm_nlist"); +} + +/* Provides Network statistics. */ + +void +glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, + const char *interface) +{ + struct ifnet ifnet; + u_long ifnetaddr, ifnetfound; + struct sockaddr *sa = NULL; +#if (defined(__FreeBSD__) && (__FreeBSD_version < 501113)) || defined(__bsdi__) + char tname [16]; +#endif + char name [32]; + + union { + struct ifaddr ifa; + struct in_ifaddr in; + } ifaddr; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_NETLOAD), 0); + + memset (buf, 0, sizeof (glibtop_netload)); + + if (kvm_read (server->machine->kd, nlst [0].n_value, + &ifnetaddr, sizeof (ifnetaddr)) != sizeof (ifnetaddr)) + glibtop_error_io_r (server, "kvm_read (ifnet)"); + + while (ifnetaddr) { + struct sockaddr_in *sin; + register char *cp; + u_long ifaddraddr; + + { + ifnetfound = ifnetaddr; + + if (kvm_read (server->machine->kd, ifnetaddr, &ifnet, + sizeof (ifnet)) != sizeof (ifnet)) + glibtop_error_io_r (server, "kvm_read (ifnetaddr)"); + +#if (defined(__FreeBSD__) && (__FreeBSD_version < 501113)) || defined(__bsdi__) + if (kvm_read (server->machine->kd, (u_long) ifnet.if_name, + tname, 16) != 16) + glibtop_error_io_r (server, "kvm_read (if_name)"); + tname[15] = '\0'; + snprintf (name, 32, "%s%d", tname, ifnet.if_unit); +#else + g_strlcpy (name, ifnet.if_xname, sizeof(name)); +#endif +#if defined(__FreeBSD__) && (__FreeBSD_version >= 300000) + ifnetaddr = (u_long) ifnet.if_link.tqe_next; +#elif defined(__FreeBSD__) || defined(__bsdi__) + ifnetaddr = (u_long) ifnet.if_next; +#else + ifnetaddr = (u_long) ifnet.if_list.tqe_next; +#endif + + if (strcmp (name, interface) != 0) + continue; + +#if defined(__FreeBSD__) && (__FreeBSD_version >= 300000) + ifaddraddr = (u_long) ifnet.if_addrhead.tqh_first; +#elif defined(__FreeBSD__) || defined(__bsdi__) + ifaddraddr = (u_long) ifnet.if_addrlist; +#else + ifaddraddr = (u_long) ifnet.if_addrlist.tqh_first; +#endif + } + if (ifnet.if_flags & IFF_UP) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP); + if (ifnet.if_flags & IFF_BROADCAST) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST); + if (ifnet.if_flags & IFF_DEBUG) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG); + if (ifnet.if_flags & IFF_LOOPBACK) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK); + if (ifnet.if_flags & IFF_POINTOPOINT) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT); +#ifdef IFF_DRV_RUNNING + if (ifnet.if_drv_flags & IFF_DRV_RUNNING) +#else + if (ifnet.if_flags & IFF_RUNNING) +#endif + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING); + if (ifnet.if_flags & IFF_NOARP) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP); + if (ifnet.if_flags & IFF_PROMISC) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC); + if (ifnet.if_flags & IFF_ALLMULTI) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI); +#ifdef IFF_DRV_OACTIVE + if (ifnet.if_drv_flags & IFF_DRV_OACTIVE) +#else + if (ifnet.if_flags & IFF_OACTIVE) +#endif + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_OACTIVE); + if (ifnet.if_flags & IFF_SIMPLEX) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_SIMPLEX); + if (ifnet.if_flags & IFF_LINK0) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LINK0); + if (ifnet.if_flags & IFF_LINK1) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LINK1); + if (ifnet.if_flags & IFF_LINK2) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LINK2); +#ifdef __FreeBSD__ + if (ifnet.if_flags & IFF_ALTPHYS) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALTPHYS); +#endif + if (ifnet.if_flags & IFF_MULTICAST) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST); + + buf->packets_in = ifnet.if_ipackets; + buf->packets_out = ifnet.if_opackets; + buf->packets_total = buf->packets_in + buf->packets_out; + + buf->bytes_in = ifnet.if_ibytes; + buf->bytes_out = ifnet.if_obytes; + buf->bytes_total = buf->bytes_in + buf->bytes_out; + + buf->errors_in = ifnet.if_ierrors; + buf->errors_out = ifnet.if_oerrors; + buf->errors_total = buf->errors_in + buf->errors_out; + + buf->collisions = ifnet.if_collisions; + buf->flags = _glibtop_sysdeps_netload; + + while (ifaddraddr) { + if ((kvm_read (server->machine->kd, ifaddraddr, &ifaddr, + sizeof (ifaddr)) != sizeof (ifaddr))) + glibtop_error_io_r (server, "kvm_read (ifaddraddr)"); + +#define CP(x) ((char *)(x)) + cp = (CP(ifaddr.ifa.ifa_addr) - CP(ifaddraddr)) + + CP(&ifaddr); + sa = (struct sockaddr *)cp; + + if (sa->sa_family == AF_LINK) { + struct sockaddr_dl *dl = (struct sockaddr_dl *) sa; + + memcpy (buf->hwaddress, LLADDR (dl), sizeof (buf->hwaddress)); + buf->flags |= GLIBTOP_NETLOAD_HWADDRESS; + } else if (sa->sa_family == AF_INET) { + sin = (struct sockaddr_in *)sa; +#if !defined(__bsdi__) + /* Commenting out to "fix" #13345. */ + buf->subnet = htonl (ifaddr.in.ia_subnet); +#endif + buf->address = sin->sin_addr.s_addr; + buf->mtu = ifnet.if_mtu; + + buf->flags |= _glibtop_sysdeps_netload_data; + } else if (sa->sa_family == AF_INET6) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa; + + memcpy (buf->address6, &sin6->sin6_addr, sizeof (buf->address6)); + buf->flags |= GLIBTOP_NETLOAD_ADDRESS6; + } + /* FIXME prefix6, scope6 */ +#if defined (__OpenBSD__) + ifaddraddr = (u_long) ifaddr.ifa.ifa_list.tqe_next; +#else + ifaddraddr = (u_long) ifaddr.ifa.ifa_link.tqe_next; +#endif + } + return; + } +} diff --git a/sysdeps/bsd/nosuid.c b/sysdeps/bsd/nosuid.c new file mode 100644 index 0000000..2c879c9 --- /dev/null +++ b/sysdeps/bsd/nosuid.c @@ -0,0 +1,36 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +void +glibtop_open_s (glibtop *server, + const char *program_name, + const unsigned long features, + const unsigned flags) +{ } + +void +glibtop_close_s (glibtop *server) +{ } diff --git a/sysdeps/bsd/open.c b/sysdeps/bsd/open.c new file mode 100644 index 0000000..e5cbb6c --- /dev/null +++ b/sysdeps/bsd/open.c @@ -0,0 +1,94 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags) +{ + const _glibtop_init_func_t *init_fkt; + + if (server == NULL) + glibtop_error_r (NULL, "glibtop_init_p (server == NULL)"); + + /* Do the initialization, but only if not already initialized. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SYSDEPS) == 0) { + glibtop_open_p (server, "glibtop", features, flags); + + for (init_fkt = _glibtop_init_hook_p; *init_fkt; init_fkt++) + (*init_fkt) (server); + + server->flags |= _GLIBTOP_INIT_STATE_SYSDEPS; + } +} + +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags) +{ +#ifdef LIBGTOP_ENABLE_DEBUG + fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ()); +#endif + + /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ + + server->machine->uid = getuid (); + server->machine->euid = geteuid (); + server->machine->gid = getgid (); + server->machine->egid = getegid (); + +#ifdef __FreeBSD__ + server->os_version_code = __FreeBSD_version; +#endif + + /* Setup machine-specific data */ + server->machine->kd = kvm_open (NULL, NULL, NULL, O_RDONLY, "kvm_open"); + + if (server->machine->kd == NULL) + glibtop_error_io_r (server, "kvm_open"); + + /* Drop priviledges. */ + + if (setreuid (server->machine->euid, server->machine->uid)) + _exit (1); + + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); + + /* !!! END OF SUID ROOT PART !!! */ + + /* Our effective uid is now those of the user invoking the server, + * so we do no longer have any priviledges. */ + + /* NOTE: On FreeBSD, we do not need to be suid root, we just need to + * be sgid kmem. + * + * The server will only use setegid() to get back it's priviledges, + * so it will fail if it is suid root and not sgid kmem. */ +} diff --git a/sysdeps/bsd/ppp.c b/sysdeps/bsd/ppp.c new file mode 100644 index 0000000..ae9307a --- /dev/null +++ b/sysdeps/bsd/ppp.c @@ -0,0 +1,143 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#ifdef HAVE_I4B + +#include +#include + +#ifdef HAVE_NET_IF_VAR_H +#include +#endif + +#include +#include + +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#include +#else +#include +#endif + +/* Read `misc/i4b_acct.txt' for details ... */ +#ifdef HAVE_I4B_ACCT +#include +#endif + +static const unsigned long _glibtop_sysdeps_ppp = +(1L << GLIBTOP_PPP_STATE); + +#ifdef HAVE_I4B_ACCT +static const unsigned long _glibtop_sysdeps_ppp_acct = +(1L << GLIBTOP_PPP_BYTES_IN) + (1L << GLIBTOP_PPP_BYTES_OUT); +#endif + +#endif /* HAVE_I4B */ + +/* nlist structure for kernel access */ +static struct nlist nlst [] = { +#ifdef HAVE_I4B + { "_i4bisppp_softc" }, +#endif + { 0 } +}; + +/* Init function. */ + +void +_glibtop_init_ppp_p (glibtop *server) +{ +#ifdef HAVE_I4B +#ifdef HAVE_I4B_ACCT + server->sysdeps.ppp = _glibtop_sysdeps_ppp | + _glibtop_sysdeps_ppp_acct; +#else + server->sysdeps.ppp = _glibtop_sysdeps_ppp; +#endif +#endif /* HAVE_I4B */ + + if (kvm_nlist (server->machine->kd, nlst) < 0) + glibtop_error_io_r (server, "kvm_nlist"); +} + +/* Provides information about ppp usage. */ + +void +glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device) +{ +#ifdef HAVE_I4B +#ifdef HAVE_I4B_ACCT + struct i4bisppp_softc data; +#else + struct sppp data; +#endif + int phase; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PPP), 0); + + memset (buf, 0, sizeof (glibtop_ppp)); + + if (kvm_read (server->machine->kd, nlst [0].n_value, + &data, sizeof (data)) != sizeof (data)) + glibtop_error_io_r (server, "kvm_read (i4bisppp_softc)"); + +#ifdef HAVE_I4B_ACCT + phase = data.sc_if_un.scu_sp.pp_phase; +#else + /* FIXME: Which FreeBSD version have this field and + * which not. */ +#if 0 + phase = data.pp_phase; +#endif +#endif + + switch (phase) { +#ifdef HAVE_I4B_ACCT + case PHASE_DEAD: + case PHASE_TERMINATE: + buf->state = GLIBTOP_PPP_STATE_HANGUP; + break; + case PHASE_ESTABLISH: + case PHASE_NETWORK: + buf->state = GLIBTOP_PPP_STATE_ONLINE; + break; +#endif + default: + buf->state = GLIBTOP_PPP_STATE_UNKNOWN; + break; + } + + buf->flags = _glibtop_sysdeps_ppp; + +#ifdef HAVE_I4B_ACCT + buf->bytes_in = data.sc_inb; + buf->bytes_out = data.sc_outb; + buf->flags |= _glibtop_sysdeps_ppp_acct; +#endif +#endif /* HAVE_I4B */ +} diff --git a/sysdeps/bsd/procaffinity.c b/sysdeps/bsd/procaffinity.c new file mode 100644 index 0000000..141341d --- /dev/null +++ b/sysdeps/bsd/procaffinity.c @@ -0,0 +1,87 @@ +/* Copyright (C) 2008 Juan Romero Pardines + + This file is part of LibGTop 2. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include + +#include +#if __NetBSD_Version__ >= 499007200 /* 4.99.72 to play safe */ +#include +#endif + +void +_glibtop_init_proc_affinity_s(glibtop *server) +{ + server->sysdeps.proc_affinity = + (1 << GLIBTOP_PROC_AFFINITY_NUMBER) | + (1 << GLIBTOP_PROC_AFFINITY_ALL); + +} + + +guint16 * +glibtop_get_proc_affinity_s(glibtop *server, glibtop_proc_affinity *buf, pid_t pid) +{ +#if __NetBSD_Version__ >= 499007200 + cpuset_t *cpuset; + size_t i; + GArray* cpus; + + memset(buf, 0, sizeof *buf); + + /* create the cpuset(3) */ + cpuset = cpuset_create(); + if (cpuset == NULL) { + glibtop_error_r(server, "cpuset_getaffinity (cpuset_create) failed"); + return NULL; + } + + /* get the affinity for _this_ pid, I assume that we always want lid 0 */ + if ((_sched_getaffinity(pid, 0, cpuset_size(cpuset), cpuset)) != 0) { + cpuset_destroy(cpuset); + glibtop_error_r(server, "cpuset_getaffinity (_sched_getaffinity) failed"); + return NULL; + } + + cpus = g_array_new(FALSE, FALSE, sizeof(guint16)); + + for (i = 0; i < MIN(cpuset_size(cpuset), (size_t)(server->ncpu + 1)); i++) { + if (cpuset_isset(i, cpuset)) { + guint16 n = i; + g_array_append_val(cpus, n); + } + } + + buf->number = cpus->len; + buf->all = (cpus->len == (size_t)(server->ncpu + 1)); + buf->flags = (1 << GLIBTOP_PROC_AFFINITY_NUMBER) + | (1 << GLIBTOP_PROC_AFFINITY_ALL); + + /* we are done */ + cpuset_destroy(cpuset); + + return (guint16*) g_array_free(cpus, FALSE); +#else + memset(buf, 0, sizeof *buf); + + return NULL; +#endif +} diff --git a/sysdeps/bsd/procargs.c b/sysdeps/bsd/procargs.c new file mode 100644 index 0000000..b2ea761 --- /dev/null +++ b/sysdeps/bsd/procargs.c @@ -0,0 +1,108 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_args = +(1L << GLIBTOP_PROC_ARGS_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_args_p (glibtop *server) +{ + server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; +} + +/* Provides detailed information about a process. */ + +char * +glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len) +{ + struct kinfo_proc *pinfo; + char *retval, **args, **ptr; + size_t size = 0, pos = 0; + int count; + +#ifndef __bsdi__ + char filename [BUFSIZ]; + struct stat statb; +#endif + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_ARGS), 0); + + memset (buf, 0, sizeof (glibtop_proc_args)); + + /* swapper, init, pagedaemon, vmdaemon, update - this doen't work. */ + if (pid < 5) return NULL; + +#ifndef __bsdi__ + sprintf (filename, "/proc/%d/mem", pid); + if (stat (filename, &statb)) return NULL; +#endif + + glibtop_suid_enter (server); + + /* Get the process data */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count < 1)) { + glibtop_suid_leave (server); + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return NULL; + } + + args = kvm_getargv (server->machine->kd, pinfo, max_len); + if (args == NULL) { + glibtop_suid_leave (server); + glibtop_warn_io_r (server, "kvm_getargv (%d)", pid); + return NULL; + } + + glibtop_suid_leave (server); + + for (ptr = args; *ptr; ptr++) + size += strlen (*ptr)+1; + + size += 2; + retval = g_malloc0 (size); + + for (ptr = args; *ptr; ptr++) { + const size_t len = strlen (*ptr)+1; + memcpy (retval+pos, *ptr, len); + pos += len; + } + + buf->size = pos ? pos-1 : 0; + + buf->flags = _glibtop_sysdeps_proc_args; + + return retval; +} diff --git a/sysdeps/bsd/prockernel.c b/sysdeps/bsd/prockernel.c new file mode 100644 index 0000000..0927c4b --- /dev/null +++ b/sysdeps/bsd/prockernel.c @@ -0,0 +1,270 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#if (!defined __OpenBSD__) && (!defined __bsdi__) +#include +#endif +#if !defined(__bsdi__) && !(defined(__FreeBSD__) && defined(__alpha__)) && \ + !defined(__NetBSD__) +#include +#endif + +#include +#include + +#ifdef __FreeBSD__ +#include +#endif + +#ifdef __NetBSD__ +#include +#include +#ifdef __arm32__ +#define KERNBASE KERNEL_BASE +#endif +#endif + +#ifdef __NetBSD__ +#include +#include +#ifdef __arm32__ +#define KERNBASE KERNEL_BASE +#endif +#endif + + +static const unsigned long _glibtop_sysdeps_proc_kernel_pstats = +(1L << GLIBTOP_PROC_KERNEL_MIN_FLT) + +(1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) + +(1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) + +(1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT); + +static const unsigned long _glibtop_sysdeps_proc_kernel_pcb = +(1L << GLIBTOP_PROC_KERNEL_KSTK_EIP) + +(1L << GLIBTOP_PROC_KERNEL_KSTK_ESP); + +static const unsigned long _glibtop_sysdeps_proc_kernel_wchan = +(1L << GLIBTOP_PROC_KERNEL_NWCHAN) + +(1L << GLIBTOP_PROC_KERNEL_WCHAN); + +/* Init function. */ + +void +_glibtop_init_proc_kernel_p (glibtop *server) +{ + server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel_pstats | + _glibtop_sysdeps_proc_kernel_pcb | + _glibtop_sysdeps_proc_kernel_wchan; +} + +void +glibtop_get_proc_kernel_p (glibtop *server, + glibtop_proc_kernel *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; +#if !(defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) + struct user *u_addr = (struct user *)USRSTACK; + struct pstats pstats; + struct pcb pcb; +#endif + int count; + + char filename [BUFSIZ]; + struct stat statb; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_KERNEL), 0); + + memset (buf, 0, sizeof (glibtop_proc_kernel)); + + if (server->sysdeps.proc_time == 0) + return; + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count != 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + +#if (defined(__FreeBSD__) && (__FreeBSD_version >= 500013)) || defined(__FreeBSD_kernel__) + +#define PROC_WCHAN ki_wchan +#define PROC_WMESG ki_wmesg +#define PROC_WMESG ki_wmesg + +#else + +#define PROC_WCHAN kp_proc.p_wchan +#define PROC_WMESG kp_proc.p_wmesg +#define PROC_WMESG kp_eproc.e_wmesg + +#endif + +#if !defined(__NetBSD__) || !defined(SACTIVE) + buf->nwchan = (unsigned long) pinfo [0].PROC_WCHAN &~ KERNBASE; + + buf->flags |= (1L << GLIBTOP_PROC_KERNEL_NWCHAN); + + if (pinfo [0].PROC_WCHAN && pinfo [0].PROC_WMESG) { + g_strlcpy (buf->wchan, pinfo [0].PROC_WMESG, + sizeof buf->wchan); + buf->flags |= (1L << GLIBTOP_PROC_KERNEL_WCHAN); + } else { + buf->wchan [0] = 0; + } +#endif + +#if !(defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) + + /* Taken from `saveuser ()' in `/usr/src/bin/ps/ps.c'. */ + + /* [FIXME]: /usr/include/sys/user.h tells me that the user area + * may or may not be at the same kernel address in all + * processes, but I don't see any way to get that address. + * Since `ps' simply uses its own address, I think it's + * safe to do this here, too. */ + + /* NOTE: You need to mount the /proc filesystem to make + * `kvm_uread' work. */ + + sprintf (filename, "/proc/%d/mem", (int) pid); + if (stat (filename, &statb)) return; + + glibtop_suid_enter (server); + +#if !defined(__NetBSD__) || !defined(SACTIVE) +#ifdef __NetBSD__ + /* On NetBSD, there is no kvm_uread(), and kvm_read() always reads + * from kernel memory. */ + + if (kvm_read (server->machine->kd, +#else + + if ((pinfo [0].kp_proc.p_flag & P_INMEM) && + kvm_uread (server->machine->kd, &(pinfo [0]).kp_proc, +#endif + (unsigned long) &u_addr->u_stats, + (char *) &pstats, sizeof (pstats)) == sizeof (pstats)) + { + /* + * The u-area might be swapped out, and we can't get + * at it because we have a crashdump and no swap. + * If it's here fill in these fields, otherwise, just + * leave them 0. + */ + + buf->min_flt = (guint64) pstats.p_ru.ru_minflt; + buf->maj_flt = (guint64) pstats.p_ru.ru_majflt; + buf->cmin_flt = (guint64) pstats.p_cru.ru_minflt; + buf->cmaj_flt = (guint64) pstats.p_cru.ru_majflt; + + buf->flags |= _glibtop_sysdeps_proc_kernel_pstats; + } + +#ifdef __NetBSD__ + if (kvm_read (server->machine->kd, +#else + if ((pinfo [0].kp_proc.p_flag & P_INMEM) && + kvm_uread (server->machine->kd, &(pinfo [0]).kp_proc, +#endif + (unsigned long) &u_addr->u_pcb, + (char *) &pcb, sizeof (pcb)) == sizeof (pcb)) + { +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#ifndef __alpha__ +#if (__FreeBSD_version >= 300003) || defined(__FreeBSD_kernel__) + buf->kstk_esp = (guint64) pcb.pcb_esp; + buf->kstk_eip = (guint64) pcb.pcb_eip; +#else + buf->kstk_esp = (guint64) pcb.pcb_ksp; + buf->kstk_eip = (guint64) pcb.pcb_pc; +#endif +#else + /*xxx FreeBSD/Alpha? */ +#endif +#else +#ifdef __i386__ + buf->kstk_esp = (guint64) pcb.pcb_tss.tss_esp0; +#ifdef __bsdi__ + buf->kstk_eip = (guint64) pcb.pcb_tss.tss_eip; +#else + buf->kstk_eip = (guint64) pcb.pcb_tss.__tss_eip; +#endif +#else +#if defined(__NetBSD__) +#if defined(__m68k__) + buf->kstk_esp = (guint64) pcb.pcb_usp; + buf->kstk_eip = (guint64) 0; +#elif defined(__x86_64__) + buf->kstk_esp = (guint64) pcb.pcb_usersp; + buf->kstk_eip = (guint64) 0; +#elif (defined(__arm32__) || defined(__powerpc__)) + buf->kstk_esp = (guint64) pcb.pcb_sp; + buf->kstk_eip = (guint64) 0; +#elif defined(__mipsel__) + buf->kstk_esp = (guint64) pcb.pcb_context[8]; + buf->kstk_eip = (guint64) 0; +#elif defined(__sparc__) + buf->kstk_esp = (guint64) pcb.pcb_sp; + buf->kstk_eip = (guint64) pcb.pcb_pc; +#elif defined(__alpha__) + buf->kstk_esp = (guint64) pcb.pcb_context[9]; + buf->kstk_eip = (guint64) pcb.pcb_context[8]; +#else + /* provide some defaults for other platforms */ + buf->kstk_esp = (guint64) 0; + buf->kstk_eip = (guint64) 0; +#endif /* ${MACHINE_ARCH} */ +#endif /* __NetBSD__ */ + buf->flags |= _glibtop_sysdeps_proc_kernel_pcb; +#endif +#endif + } +#endif + + /* Taken from `wchan ()' in `/usr/src/bin/ps/print.c'. */ + + glibtop_suid_leave (server); + +#else + /* XXX: the code here was, quite frankly, junk, and almost + * certainly wrong - remove it all, leave these fields + * unpopulated, and give up until such time as the right + * code is produced for both FreeBSD 4.x and 5.x + */ + return; +#endif /* __FreeBSD__ */ +} diff --git a/sysdeps/bsd/proclist.c b/sysdeps/bsd/proclist.c new file mode 100644 index 0000000..8331001 --- /dev/null +++ b/sysdeps/bsd/proclist.c @@ -0,0 +1,113 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proclist = +(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) + +(1L << GLIBTOP_PROCLIST_SIZE); + +/* Fetch list of currently running processes. + * The interface of this function is a little bit different from the others: + * buf->flags is only set if the call succeeded, in this case pids_chain, + * a list of the pids of all currently running processes is returned, + * buf->number is the number of elements of this list and buf->size is + * the size of one single element (sizeof (unsigned)). The total size is + * stored in buf->total. + * + * The calling function has to free the memory to which a pointer is returned. + * + * IMPORTANT NOTE: + * On error, this function MUST return NULL and set buf->flags to zero ! + * On success, it returnes a pointer to a list of buf->number elements + * each buf->size big. The total size is stored in buf->total. + * The calling function has to free the memory to which a pointer is returned. + * + * On error, NULL is returned and buf->flags is zero. */ + +/* Init function. */ + +void +_glibtop_init_proclist_p (glibtop *server) +{ + server->sysdeps.proclist = _glibtop_sysdeps_proclist; +} + +unsigned * +glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf, + gint64 real_which, gint64 arg) +{ + struct kinfo_proc *pinfo; + unsigned *pids = NULL; + int which, count; + int i,j; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROCLIST), 0); + + memset (buf, 0, sizeof (glibtop_proclist)); + + which = (int)(real_which & GLIBTOP_KERN_PROC_MASK); + + /* Get the process data */ + pinfo = kvm_getprocs (server->machine->kd, which, arg, &count); + if ((pinfo == NULL) || (count < 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (proclist)"); + return NULL; + } + count--; + + /* Allocate count objects in the pids_chain array + * Same as malloc is pids is NULL, which it is. */ + pids = g_realloc (pids, count * sizeof (unsigned)); + /* Copy the pids over to this chain */ + for (i=j=0; i < count; i++) { +#if (defined(__FreeBSD__) && (__FreeBSD_version >= 500013)) || defined(__FreeBSD_kernel__) +#define PROC_STAT ki_stat +#define PROC_RUID ki_ruid +#define PROC_PID ki_pid + +#else +#define PROC_STAT kp_proc.p_stat +#define PROC_RUID kp_eproc.e_pcred.p_ruid +#define PROC_PID kp_proc.p_pid + +#endif + + if ((real_which & GLIBTOP_EXCLUDE_IDLE) && + (pinfo[i].PROC_STAT != SRUN)) + continue; + else if ((real_which & GLIBTOP_EXCLUDE_SYSTEM) && + (pinfo[i].PROC_RUID == 0)) + continue; + pids [j++] = (unsigned) pinfo[i].PROC_PID; + } /* end for */ + /* Set the fields in buf */ + buf->number = j; + buf->size = sizeof (unsigned); + buf->total = j * sizeof (unsigned); + buf->flags = _glibtop_sysdeps_proclist; + return pids; +} diff --git a/sysdeps/bsd/procmap.c b/sysdeps/bsd/procmap.c new file mode 100644 index 0000000..bcc0116 --- /dev/null +++ b/sysdeps/bsd/procmap.c @@ -0,0 +1,311 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#if defined(__NetBSD__) && (__NetBSD_Version__ < 105020000) +#include +#include +#include +#elif defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000) +#include +#else +#include +#include +#if (__FreeBSD_version >= 400011) || defined(__FreeBSD_kernel__) +#include +#else +#include +#endif +#endif + +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#define _KVM_VNODE +#endif +#include +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#undef _KVM_VNODE +#endif +#include +#include +#include + +#include +#if (!defined __OpenBSD__) && (!defined __bsdi__) +#include +#endif +#include +#if !defined(__NetBSD__) || (__NetBSD_Version__ < 105020000) +#include +#endif + +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) +/* Fixme ... */ +#undef _KERNEL +#define _UVM_UVM_AMAP_I_H_ 1 +#define _UVM_UVM_MAP_I_H_ 1 +#include +#endif + +static const unsigned long _glibtop_sysdeps_proc_map = +(1L << GLIBTOP_PROC_MAP_TOTAL) + (1L << GLIBTOP_PROC_MAP_NUMBER) + +(1L << GLIBTOP_PROC_MAP_SIZE); + +static const unsigned long _glibtop_sysdeps_map_entry = +(1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) + +(1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) + +(1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE); + +/* Init function. */ + +void +_glibtop_init_proc_map_p (glibtop *server) +{ + server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; +} + +/* Provides detailed information about a process. */ + +glibtop_map_entry * +glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + struct vm_map_entry entry, *first; + struct vmspace vmspace; +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) + struct vnode vnode; + struct inode inode; +#else + struct vm_object object; +#endif + GArray *maps = g_array_sized_new(FALSE, FALSE, + sizeof(glibtop_map_entry), + 100); +#if (defined __FreeBSD__) || defined(__FreeBSD_kernel__) + struct vnode vnode; +#if (__FreeBSD_version < 500039) && !defined(__FreeBSD_kernel__) + struct inode inode; +#endif +#endif + int count, i = 0; + int update = 0; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MAP), 0); + + memset (buf, 0, sizeof (glibtop_proc_map)); + + /* It does not work for the swapper task. */ + if (pid == 0) return (glibtop_map_entry*) g_array_free(maps, TRUE); + + glibtop_suid_enter (server); + + /* Get the process data */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count < 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return (glibtop_map_entry*) g_array_free(maps, TRUE); + } + + /* Now we get the memory maps. */ + + if (kvm_read (server->machine->kd, +#if (defined(__FreeBSD__) && (__FreeBSD_version >= 500013)) || defined(__FreeBSD_kernel__) + (unsigned long) pinfo [0].ki_vmspace, +#else + (unsigned long) pinfo [0].kp_proc.p_vmspace, +#endif + (char *) &vmspace, sizeof (vmspace)) != sizeof (vmspace)) + glibtop_error_io_r (server, "kvm_read (vmspace)"); + + first = vmspace.vm_map.header.next; + + if (kvm_read (server->machine->kd, + (unsigned long) vmspace.vm_map.header.next, + (char *) &entry, sizeof (entry)) != sizeof (entry)) + glibtop_error_io_r (server, "kvm_read (entry)"); + + /* Allocate space. */ + + buf->number = vmspace.vm_map.nentries; + buf->size = sizeof (glibtop_map_entry); + + buf->total = buf->number * buf->size; + + buf->flags = _glibtop_sysdeps_proc_map; + + /* Walk through the `vm_map_entry' list ... */ + + /* I tested this a few times with `mmap'; as soon as you write + * to the mmap'ed area, the object type changes from OBJT_VNODE + * to OBJT_DEFAULT so if seems this really works. */ + + do { + glibtop_map_entry *mentry; + unsigned long inum, dev; + guint len; + + if (update) { + if (kvm_read (server->machine->kd, + (unsigned long) entry.next, + &entry, sizeof (entry)) != sizeof (entry)) + glibtop_error_io_r (server, "kvm_read (entry)"); + } else { + update = 1; + } + +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#if (__FreeBSD__ >= 4) || defined(__FreeBSD_kernel__) + if (entry.eflags & (MAP_ENTRY_IS_SUB_MAP)) + continue; +#else + if (entry.eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) + continue; +#endif +#else +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) + if (UVM_ET_ISSUBMAP (&entry)) + continue; +#else + if (entry.is_a_map || entry.is_sub_map) + continue; +#endif +#endif + + +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) + if (!entry.object.uvm_obj) + continue; + + /* We're only interested in vnodes */ + + if (kvm_read (server->machine->kd, + (unsigned long) entry.object.uvm_obj, + &vnode, sizeof (vnode)) != sizeof (vnode)) { + glibtop_warn_io_r (server, "kvm_read (vnode)"); + return (glibtop_map_entry*) g_array_free(maps, TRUE); + } +#else + if (!entry.object.vm_object) + continue; + + /* We're only interested in `vm_object's */ + + if (kvm_read (server->machine->kd, + (unsigned long) entry.object.vm_object, + &object, sizeof (object)) != sizeof (object)) + glibtop_error_io_r (server, "kvm_read (object)"); +#endif + +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) +#if defined(UVM_VNODE_VALID) + if (!vnode.v_uvm.u_flags & UVM_VNODE_VALID) + continue; +#endif + if ((vnode.v_type != VREG) || (vnode.v_tag != VT_UFS) || + !vnode.v_data) continue; + + if (kvm_read (server->machine->kd, + (unsigned long) vnode.v_data, + &inode, sizeof (inode)) != sizeof (inode)) + glibtop_error_io_r (server, "kvm_read (inode)"); + + inum = inode.i_number; + dev = inode.i_dev; +#endif + + +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + /* If the object is of type vnode, add its size */ + + if (object.type != OBJT_VNODE) + continue; + + if (!object.handle) + continue; + + if (kvm_read (server->machine->kd, + (unsigned long) object.handle, + &vnode, sizeof (vnode)) != sizeof (vnode)) + glibtop_error_io_r (server, "kvm_read (vnode)"); + +#if (defined(__FreeBSD__) && (__FreeBSD_version >= 500039)) || defined(__FreeBSD_kernel__) + switch (vnode.v_type) { + case VREG: +#if (__FreeBSD_version < 600006) && !defined(__FreeBSD_kernel__) + inum = vnode.v_cachedid; + dev = vnode.v_cachedfs; +#endif + default: + continue; + } +#else + if ((vnode.v_type != VREG) || (vnode.v_tag != VT_UFS) || + !vnode.v_data) continue; + + if (kvm_read (server->machine->kd, + (unsigned long) vnode.v_data, + &inode, sizeof (inode)) != sizeof (inode)) + glibtop_error_io_r (server, "kvm_read (inode)"); + + inum = inode.i_number; + dev = inode.i_dev; +#endif +#endif + len = maps->len; + g_array_set_size(maps, len + 1); + mentry = &g_array_index(maps, glibtop_map_entry, len); + + mentry->flags = _glibtop_sysdeps_map_entry; + + mentry->start = (guint64) entry.start; + mentry->end = (guint64) entry.end; + mentry->offset = (guint64) entry.offset; + mentry->device = (guint64) dev; + mentry->inode = (guint64) inum; + + mentry->perm = (guint64) 0; + + if (entry.protection & VM_PROT_READ) + mentry->perm |= GLIBTOP_MAP_PERM_READ; + if (entry.protection & VM_PROT_WRITE) + mentry->perm |= GLIBTOP_MAP_PERM_WRITE; + if (entry.protection & VM_PROT_EXECUTE) + mentry->perm |= GLIBTOP_MAP_PERM_EXECUTE; + } while (entry.next != first); + + buf->flags = _glibtop_sysdeps_proc_map; + + buf->number = maps->len; + buf->size = sizeof (glibtop_map_entry); + buf->total = buf->number * buf->size; + + return (glibtop_map_entry*) g_array_free(maps, FALSE); +} diff --git a/sysdeps/bsd/procmem.c b/sysdeps/bsd/procmem.c new file mode 100644 index 0000000..b20ab80 --- /dev/null +++ b/sysdeps/bsd/procmem.c @@ -0,0 +1,293 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000) +#include +#else +#include +#include +#endif + +#include +#include +#include + +#include +#if (!defined __OpenBSD__) && (!defined __bsdi__) +#include +#endif +#include +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000) +#include +#else +#include +#endif + +#if defined(__NetBSD__) && \ + (__NetBSD_Version__ >= 104000000) && (__NetBSD_Version__ < 105020000) +/* Fixme ... */ +#undef _KERNEL +#define _UVM_UVM_AMAP_I_H_ 1 +#define _UVM_UVM_MAP_I_H_ 1 +#include +#endif + +static const unsigned long _glibtop_sysdeps_proc_mem = +(1L << GLIBTOP_PROC_MEM_SIZE) + +(1L << GLIBTOP_PROC_MEM_VSIZE) + +(1L << GLIBTOP_PROC_MEM_RESIDENT) + +(1L << GLIBTOP_PROC_MEM_RSS) + +(1L << GLIBTOP_PROC_MEM_RSS_RLIM); + +static const unsigned long _glibtop_sysdeps_proc_mem_share = +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) +(1L << GLIBTOP_PROC_MEM_SHARE); +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +(1L << GLIBTOP_PROC_MEM_SHARE); +#else +0; +#endif + +#ifndef LOG1024 +#define LOG1024 10 +#endif + +/* these are for getting the memory statistics */ +static int pageshift; /* log base 2 of the pagesize */ + +/* define pagetok in terms of pageshift */ +#define pagetok(size) ((size) << pageshift) + +/* Init function. */ + +void +_glibtop_init_proc_mem_p (glibtop *server) +{ + register int pagesize; + + /* get the page size with "getpagesize" and calculate pageshift + * from it */ + pagesize = getpagesize (); + pageshift = 0; + while (pagesize > 1) { + pageshift++; + pagesize >>= 1; + } + + /* we only need the amount of log(2)1024 for our conversion */ + pageshift -= LOG1024; + + server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem | + _glibtop_sysdeps_proc_mem_share; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + struct vm_map_entry entry, *first; + struct vmspace *vms, vmspace; +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) + struct vnode vnode; +#else + struct vm_object object; +#endif +#if (!defined(__FreeBSD__) || (__FreeBSD_version < 500013)) && !defined(__FreeBSD_kernel__) + struct plimit plimit; +#endif + int count; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MEM), 0); + + memset (buf, 0, sizeof (glibtop_proc_mem)); + + if (server->sysdeps.proc_mem == 0) + return; + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + /* Get the process data */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count < 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } +#if (defined(__FreeBSD__) && (__FreeBSD_version >= 500013)) || defined(__FreeBSD_kernel__) + +#define PROC_VMSPACE ki_vmspace + + buf->rss_rlim = pinfo [0].ki_rssize; + + buf->vsize = buf->size = (guint64) pagetok + (pinfo [0].ki_tsize + pinfo [0].ki_dsize + pinfo[0].ki_ssize) + << LOG1024; + buf->resident = buf->rss = (guint64) pagetok + (pinfo [0].ki_rssize) << LOG1024; + +#else + +#define PROC_VMSPACE kp_proc.p_vmspace + + if (kvm_read (server->machine->kd, + (unsigned long) pinfo [0].PROC_VMSPACE, + (char *) &plimit, sizeof (plimit)) != sizeof (plimit)) { + glibtop_warn_io_r (server, "kvm_read (plimit)"); + return; + } + + buf->rss_rlim = (guint64) + (plimit.pl_rlimit [RLIMIT_RSS].rlim_cur); + + vms = &pinfo [0].kp_eproc.e_vm; + + buf->vsize = buf->size = (guint64) pagetok + (vms->vm_tsize + vms->vm_dsize + vms->vm_ssize) << LOG1024; + + buf->resident = buf->rss = (guint64) pagetok + (vms->vm_rssize) << LOG1024; +#endif + + /* Now we get the shared memory. */ + + if (kvm_read (server->machine->kd, + (unsigned long) pinfo [0].PROC_VMSPACE, + (char *) &vmspace, sizeof (vmspace)) != sizeof (vmspace)) { + glibtop_warn_io_r (server, "kvm_read (vmspace)"); + return; + } + + first = vmspace.vm_map.header.next; + + if (kvm_read (server->machine->kd, + (unsigned long) vmspace.vm_map.header.next, + (char *) &entry, sizeof (entry)) != sizeof (entry)) { + glibtop_warn_io_r (server, "kvm_read (entry)"); + return; + } + + /* Walk through the `vm_map_entry' list ... */ + + /* I tested this a few times with `mmap'; as soon as you write + * to the mmap'ed area, the object type changes from OBJT_VNODE + * to OBJT_DEFAULT so if seems this really works. */ + + while (entry.next != first) { + if (kvm_read (server->machine->kd, + (unsigned long) entry.next, + &entry, sizeof (entry)) != sizeof (entry)) { + glibtop_warn_io_r (server, "kvm_read (entry)"); + return; + } + +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#if (__FreeBSD__ >= 4) || defined(__FreeBSD_kernel__) + if (entry.eflags & (MAP_ENTRY_IS_SUB_MAP)) + continue; +#else + if (entry.eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) + continue; +#endif +#else +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) + if (UVM_ET_ISSUBMAP (&entry)) + continue; +#else + if (entry.is_a_map || entry.is_sub_map) + continue; +#endif +#endif + +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) + if (!entry.object.uvm_obj) + continue; + + /* We're only interested in vnodes */ + + if (kvm_read (server->machine->kd, + (unsigned long) entry.object.uvm_obj, + &vnode, sizeof (vnode)) != sizeof (vnode)) { + glibtop_warn_io_r (server, "kvm_read (vnode)"); + return; + } +#else + if (!entry.object.vm_object) + continue; + + /* We're only interested in `vm_object's */ + + if (kvm_read (server->machine->kd, + (unsigned long) entry.object.vm_object, + &object, sizeof (object)) != sizeof (object)) { + glibtop_warn_io_r (server, "kvm_read (object)"); + return; + } +#endif + /* If the object is of type vnode, add its size */ + +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) +#if defined(UVM_VNODE_VALID) + if (!vnode.v_uvm.u_flags & UVM_VNODE_VALID) + continue; +#endif + if ((vnode.v_type != VREG) || (vnode.v_tag != VT_UFS) || + !vnode.v_data) continue; +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105250000) + /* Reference count must be at least two. */ + if (vnode.v_usecount <= 1) + continue; + + buf->share += pagetok (vnode.v_uobj.uo_npages) << LOG1024; +#else + + /* Reference count must be at least two. */ + if (vnode.v_uvm.u_obj.uo_refs <= 1) + continue; + + buf->share += pagetok (vnode.v_uvm.u_obj.uo_npages) << LOG1024; +#endif /* __NetBSD_Version__ >= 105250000 */ +#endif + +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + if (object.type != OBJT_VNODE) + continue; + + buf->share += object.un_pager.vnp.vnp_size; +#endif + } + + buf->flags = _glibtop_sysdeps_proc_mem | + _glibtop_sysdeps_proc_mem_share; +} diff --git a/sysdeps/bsd/procopenfiles.c b/sysdeps/bsd/procopenfiles.c new file mode 100644 index 0000000..78858f0 --- /dev/null +++ b/sysdeps/bsd/procopenfiles.c @@ -0,0 +1,51 @@ +/* Copyright (C) 1998-99 Martin Baulig + Copyright (C) 2004 Nicol�s Lichtmaier + This file is part of LibGTop 1.0. + + Modified by Nicol�s Lichtmaier to give a process open files. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_open_files = +(1L << GLIBTOP_PROC_OPEN_FILES_NUMBER)| +(1L << GLIBTOP_PROC_OPEN_FILES_TOTAL)| +(1L << GLIBTOP_PROC_OPEN_FILES_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_open_files_s (glibtop *server) +{ + server->sysdeps.proc_open_files = _glibtop_sysdeps_proc_open_files; +} + + +/* XXX Unimplemented on FreeBSD */ +glibtop_open_files_entry * +glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pid_t pid) +{ + return NULL; +} diff --git a/sysdeps/bsd/procsegment.c b/sysdeps/bsd/procsegment.c new file mode 100644 index 0000000..282c86f --- /dev/null +++ b/sysdeps/bsd/procsegment.c @@ -0,0 +1,81 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_segment = 0; + +/* Init function. */ + +void +_glibtop_init_proc_segment_p (glibtop *server) +{ + server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_segment_p (glibtop *server, + glibtop_proc_segment *buf, + pid_t pid) +{ + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0); + + memset (buf, 0, sizeof (glibtop_proc_segment)); + +#if 0 + /* Get the process info from the kernel */ + kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, count); + if (*count != 1) { + return; /* the zeroed-out buffer indicating no data */ + } + + /* trs: text resident set size + pinfo[0]->kp_eproc.e_xrssize; + */ + /* buf->trs = pinfo[0]->kp_eproc.e_xrssize; */ + /* lrs: shared-lib resident set size + ? */ + /* drs: data resident set size + pinfo[0]->kp_eproc.e_vm.vm_map.vm_dsize; + */ + /* dt: dirty pages + */ + /* start_code: address of beginning of code segment + + */ + /* end_code: address of end of code segment + */ + /* start_stack: address of the bottom of stack segment + */ +#endif +} + diff --git a/sysdeps/bsd/procsignal.c b/sysdeps/bsd/procsignal.c new file mode 100644 index 0000000..9771f7d --- /dev/null +++ b/sysdeps/bsd/procsignal.c @@ -0,0 +1,136 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include + +#ifdef __FreeBSD__ +#include +#endif + +static const unsigned long _glibtop_sysdeps_proc_signal = +(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + +(1L << GLIBTOP_PROC_SIGNAL_BLOCKED) + +(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + +(1L << GLIBTOP_PROC_SIGNAL_SIGCATCH); + +/* Init function. */ + +void +_glibtop_init_proc_signal_p (glibtop *server) +{ + server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; +} + +void +glibtop_get_proc_signal_p (glibtop *server, + glibtop_proc_signal *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + int count = 0; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0); + + memset (buf, 0, sizeof (glibtop_proc_signal)); + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count != 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + +#if (defined(__FreeBSD__) && (__FreeBSD_version >= 500013)) || defined(__FreeBSD_kernel__) + +#define PROC_SIGLIST ki_siglist +#define PROC_SIGMASK ki_sigmask +#define PROC_SIGIGNORE ki_sigignore +#define PROC_SIGCATCH ki_sigcatch + +#else + +#define PROC_SIGLIST kp_proc.p_siglist +#define PROC_SIGMASK kp_proc.p_sigmask +#define PROC_SIGIGNORE kp_proc.p_sigignore +#define PROC_SIGCATCH kp_proc.p_sigcatch + +#endif + + /* signal: mask of pending signals. + * pinfo [0].kp_proc.p_siglist + */ +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) + buf->signal [0] = pinfo [0].kp_proc.p_sigctx.ps_siglist.__bits[0]; +#elif (defined(__NetBSD__) && (NSIG > 32)) || \ + (defined(__FreeBSD__) && (__FreeBSD_version >= 400011) || defined(__FreeBSD_kernel__)) + buf->signal [0] = pinfo [0].PROC_SIGLIST.__bits[0]; +#else + buf->signal [0] = pinfo [0].kp_proc.p_siglist; +#endif + + /* blocked: mask of blocked signals. + * pinfo [0].kp_proc.p_sigmask + */ +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) + buf->blocked [0] = pinfo [0].kp_proc.p_sigctx.ps_sigmask.__bits[0]; +#elif (defined(__NetBSD__) && (NSIG > 32)) || \ + (defined(__FreeBSD__) && (__FreeBSD_version >= 400011) || defined(__FreeBSD_kernel__)) + buf->blocked [0] = pinfo [0].PROC_SIGMASK.__bits[0]; +#else + buf->blocked [0] = pinfo [0].kp_proc.p_sigmask; +#endif + + /* sigignore: mask of ignored signals. + * pinfo [0].kp_proc.p_sigignore + */ +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) + buf->sigignore [0] = pinfo [0].kp_proc.p_sigctx.ps_sigignore.__bits[0]; +#elif (defined(__NetBSD__) && (NSIG > 32)) || \ + (defined(__FreeBSD__) && (__FreeBSD_version >= 400011) || defined(__FreeBSD_kernel__)) + buf->sigignore [0] = pinfo [0].PROC_SIGIGNORE.__bits[0]; +#else + buf->sigignore [0] = pinfo [0].kp_proc.p_sigignore; +#endif + + /* sigcatch: mask of caught signals. + * pinfo [0].kp_proc.p_sigcatch + */ +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) + buf->sigcatch [0] = pinfo [0].kp_proc.p_sigctx.ps_sigcatch.__bits[0]; +#elif (defined(__NetBSD__) && (NSIG > 32)) || \ + (defined(__FreeBSD__) && (__FreeBSD_version >= 400011) || defined(__FreeBSD_kernel__)) + buf->sigcatch [0] = pinfo [0].PROC_SIGCATCH.__bits[0]; +#else + buf->sigcatch [0] = pinfo [0].kp_proc.p_sigcatch; +#endif + + buf->flags = _glibtop_sysdeps_proc_signal; +} diff --git a/sysdeps/bsd/procstate.c b/sysdeps/bsd/procstate.c new file mode 100644 index 0000000..6fcec52 --- /dev/null +++ b/sysdeps/bsd/procstate.c @@ -0,0 +1,148 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#if !defined(__OpenBSD__) +/* && (!defined __bsdi__) */ +#include +#endif + +static const unsigned long _glibtop_sysdeps_proc_state = +(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_UID) + +(1L << GLIBTOP_PROC_STATE_GID); + +static const unsigned long _glibtop_sysdeps_proc_state_new = +0; + +/* Init function. */ + +void +_glibtop_init_proc_state_p (glibtop *server) +{ + server->sysdeps.proc_state = _glibtop_sysdeps_proc_state | + _glibtop_sysdeps_proc_state_new; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_state_p (glibtop *server, + glibtop_proc_state *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + int count = 0; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_STATE), 0); + + memset (buf, 0, sizeof (glibtop_proc_state)); + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count != 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + +#if (defined(__FreeBSD__) && (__FreeBSD_version >= 500013)) || defined(__FreeBSD_kernel__) +#define PROC_COMM ki_comm +#define PROC_SVUID ki_svuid +#define PROC_SVGID ki_svgid +#define PROC_RUID ki_ruid +#define PROC_RGID ki_rgid +#define PROC_STAT ki_stat + +#else +#define PROC_COMM kp_proc.p_comm +#define PROC_SVUID kp_eproc.e_pcred.p_svuid +#define PROC_SVGID kp_eproc.e_pcred.p_svgid +#define PROC_RUID kp_eproc.e_pcred.p_ruid +#define PROC_RGID kp_eproc.e_pcred.p_rgid +#define PROC_STAT kp_proc.p_stat + +#endif + + g_strlcpy (buf->cmd, pinfo [0].PROC_COMM, sizeof buf->cmd); + + buf->uid = pinfo [0].PROC_SVUID; + buf->gid = pinfo [0].PROC_SVGID; + + /* Set the flags for the data we're about to return*/ + buf->flags = _glibtop_sysdeps_proc_state | + _glibtop_sysdeps_proc_state_new; + +#if LIBGTOP_VERSION_CODE >= 1001000 + switch (pinfo [0].PROC_STAT) { + case SIDL: + buf->state = 0; + break; + case SRUN: + buf->state = GLIBTOP_PROCESS_RUNNING; + break; +#ifdef SSLEEP + case SSLEEP: + buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE; + break; +#endif + case SSTOP: + buf->state = GLIBTOP_PROCESS_STOPPED; + break; + case SZOMB: + buf->state = GLIBTOP_PROCESS_ZOMBIE; + break; + default: + return; + } +#else + switch (pinfo [0].PROC_STAT) { + case SIDL: + buf->state = 'D'; + break; + case SRUN: + buf->state = 'R'; + break; +#ifdef SSLEEP + case SSLEEP: + buf->state = 'S'; + break; +#endif + case SSTOP: + buf->state = 'T'; + break; + case SZOMB: + buf->state = 'Z'; + break; + default: + return; + } +#endif + + buf->flags |= (1L << GLIBTOP_PROC_STATE_STATE); +} diff --git a/sysdeps/bsd/proctime.c b/sysdeps/bsd/proctime.c new file mode 100644 index 0000000..ff29adc --- /dev/null +++ b/sysdeps/bsd/proctime.c @@ -0,0 +1,252 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#ifdef __FreeBSD__ +#include +#endif + +static const unsigned long _glibtop_sysdeps_proc_time = +(1L << GLIBTOP_PROC_TIME_RTIME) + (1L << GLIBTOP_PROC_TIME_FREQUENCY); + +static const unsigned long _glibtop_sysdeps_proc_time_user = +(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_STIME) + +(1L << GLIBTOP_PROC_TIME_CUTIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) + +(1L << GLIBTOP_PROC_TIME_START_TIME); + +#define tv2sec(tv) (((guint64) tv.tv_sec * 1000000) + (guint64) tv.tv_usec) + +/* Init function. */ + +void +_glibtop_init_proc_time_p (glibtop *server) +{ + server->sysdeps.proc_time = _glibtop_sysdeps_proc_time | + _glibtop_sysdeps_proc_time_user; +} + +/* Taken from /usr/src/sys/kern/kern_resource.c */ + +/* + * Transform the running time and tick information in proc p into user, + * system, and interrupt time usage. + */ + +#if !(defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) + +static void +calcru(p, up, sp, ip) + struct proc *p; + struct timeval *up; + struct timeval *sp; + struct timeval *ip; +{ + quad_t totusec; + u_quad_t u, st, ut, it, tot; + long sec, usec; + struct timeval tv; + + st = p->p_sticks; + ut = p->p_uticks; + it = p->p_iticks; + + tot = st + ut + it; + if (tot == 0) { + st = 1; + tot = 1; + } + + sec = p->p_rtime.tv_sec; + usec = p->p_rtime.tv_usec; + + totusec = (quad_t)sec * 1000000 + usec; + + if (totusec < 0) { + /* XXX no %qd in kernel. Truncate. */ + fprintf (stderr, "calcru: negative time: %ld usec\n", + (long)totusec); + totusec = 0; + } + + + u = totusec; + st = (u * st) / tot; + sp->tv_sec = st / 1000000; + sp->tv_usec = st % 1000000; + ut = (u * ut) / tot; + up->tv_sec = ut / 1000000; + up->tv_usec = ut % 1000000; + if (ip != NULL) { + it = (u * it) / tot; + ip->tv_sec = it / 1000000; + ip->tv_usec = it % 1000000; + } +} +#endif /* !__FreeBSD__ */ + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; +#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) || (defined(OpenBSD) && (OpenBSD >= 199912)) + register struct rusage *rup; +#else + struct user *u_addr = (struct user *)USRSTACK; +#endif + struct pstats pstats; + int count; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_TIME), 0); + + memset (buf, 0, sizeof (glibtop_proc_time)); + + /* It does not work for the swapper task. */ + if (pid == 0) return; + +#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) + if (server->sysdeps.proc_time == 0) + return; +#endif + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count != 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + +#if (defined(__FreeBSD__) && (__FreeBSD_version >= 500013)) || defined(__FreeBSD_kernel__) + buf->rtime = pinfo [0].ki_runtime; +#elif (defined __FreeBSD__) && (__FreeBSD_version <= 500013) + buf->rtime = pinfo [0].kp_proc.p_runtime; +#else + buf->rtime = tv2sec (pinfo [0].kp_proc.p_rtime); +#endif + + buf->frequency = 1000000; + buf->flags = _glibtop_sysdeps_proc_time; + +#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) || (defined(OpenBSD) && (OpenBSD >= 199912)) + glibtop_suid_enter (server); + + if (kvm_read (server->machine->kd, + (unsigned long) pinfo [0].kp_proc.p_stats, + &pstats, sizeof (pstats)) != sizeof (pstats)) { + glibtop_warn_io_r (server, "kvm_read (pstats)"); + return; + } + + glibtop_suid_leave (server); + + rup = &pstats.p_ru; + calcru(&(pinfo [0]).kp_proc, + &rup->ru_utime, &rup->ru_stime, NULL); + + buf->utime = tv2sec (pstats.p_ru.ru_utime); + buf->stime = tv2sec (pstats.p_ru.ru_stime); + + buf->cutime = tv2sec (pstats.p_cru.ru_utime); + buf->cstime = tv2sec (pstats.p_cru.ru_stime); + + buf->start_time = (guint64) pstats.p_start.tv_sec; + + buf->flags |= _glibtop_sysdeps_proc_time_user; +#else +#if (defined(__FreeBSD__) && (__FreeBSD_version >= 500013)) || defined(__FreeBSD_kernel__) +#if (__FreeBSD_version >= 500016) || defined(__FreeBSD_kernel__) + if ((pinfo [0].ki_flag & PS_INMEM)) { +#else + if ((pinfo [0].ki_flag & P_INMEM)) { +#endif + buf->utime = pinfo [0].ki_runtime; + buf->stime = tv2sec (pinfo [0].ki_rusage.ru_stime); + buf->cutime = tv2sec (pinfo [0].ki_childtime); +#if (__FreeBSD_version >= 600000) || (__FreeBSD_kernel_version >= 600000) + buf->cstime = tv2sec (pinfo [0].ki_rusage_ch.ru_stime); +#else + buf->cstime = 0; +#endif + buf->start_time = tv2sec (pinfo [0].ki_start); + buf->flags = _glibtop_sysdeps_proc_time_user; + } + + glibtop_suid_enter (server); + +#elif (__FreeBSD_version <= 500013) + + if ((pinfo [0].kp_proc.p_flag & P_INMEM) && + kvm_uread (server->machine->kd, &(pinfo [0]).kp_proc, + (unsigned long) &u_addr->u_stats, + (char *) &pstats, sizeof (pstats)) == sizeof (pstats)) + { + + buf->utime = tv2sec (pinfo[0].kp_eproc.e_stats.p_ru.ru_utime); + buf->stime = tv2sec (pinfo[0].kp_eproc.e_stats.p_ru.ru_stime); + buf->cutime = tv2sec (pinfo[0].kp_eproc.e_stats.p_cru.ru_utime); + buf->cstime = tv2sec (pinfo[0].kp_eproc.e_stats.p_cru.ru_stime); + buf->start_time = tv2sec (pinfo[0].kp_eproc.e_stats.p_start); + buf->flags = _glibtop_sysdeps_proc_time_user; + glibtop_suid_leave (server); + } +#else + + if ((pinfo [0].kp_proc.p_flag & P_INMEM) && + kvm_uread (server->machine->kd, &(pinfo [0]).kp_proc, + (unsigned long) &u_addr->u_stats, + (char *) &pstats, sizeof (pstats)) == sizeof (pstats)) + { + /* This is taken form the kernel source code of + * FreeBSD 2.2.6. */ + + /* Well, we just do the same getrusage () does ... */ + + register struct rusage *rup; + + glibtop_suid_leave (server); + + rup = &pstats.p_ru; + calcru(&(pinfo [0]).kp_proc, + &rup->ru_utime, &rup->ru_stime, NULL); + + buf->utime = tv2sec (pstats.p_ru.ru_utime); + buf->stime = tv2sec (pstats.p_ru.ru_stime); + + buf->cutime = tv2sec (pstats.p_cru.ru_utime); + buf->cstime = tv2sec (pstats.p_cru.ru_stime); + + buf->start_time = tv2sec (pstats.p_start); + + buf->flags = _glibtop_sysdeps_proc_time_user; + } +#endif + glibtop_suid_leave (server); +#endif +} + diff --git a/sysdeps/bsd/procuid.c b/sysdeps/bsd/procuid.c new file mode 100644 index 0000000..cee39e0 --- /dev/null +++ b/sysdeps/bsd/procuid.c @@ -0,0 +1,148 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_uid = +(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) + +(1L << GLIBTOP_PROC_UID_EGID) + (1L << GLIBTOP_PROC_UID_PID) + +(1L << GLIBTOP_PROC_UID_PPID) + (1L << GLIBTOP_PROC_UID_PGRP) + +(1L << GLIBTOP_PROC_UID_TPGID) + (1L << GLIBTOP_PROC_UID_PRIORITY) + +(1L << GLIBTOP_PROC_UID_NICE); + +static const unsigned long _glibtop_sysdeps_proc_uid_groups = +0L; + +/* Init function. */ + +void +_glibtop_init_proc_uid_p (glibtop *server) +{ + server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid | + _glibtop_sysdeps_proc_uid_groups; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + int count = 0; + +#if LIBGTOP_VERSION_CODE >= 1001000 +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) + struct ucred ucred; + void *ucred_ptr; +#endif +#endif + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_UID), 0); + + memset (buf, 0, sizeof (glibtop_proc_uid)); + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count != 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + +#if (defined(__FreeBSD__) && (__FreeBSD_version >= 500013)) || defined(__FreeBSD_kernel__) + +#define PROC_RUID ki_ruid +#define PROC_SVUID ki_svuid +#define PROC_RGID ki_rgid +#define PROC_SVGID ki_svgid +#define PROC_PPID ki_ppid +#define PROC_PGID ki_pgid +#define PROC_TPGID ki_tpgid +#define PROC_NICE ki_nice +#define PROC_PRIORITY ki_pri.pri_user +#else + +#define PROC_RUID kp_eproc.e_pcred.p_ruid +#define PROC_SVUID kp_eproc.e_pcred.p_svuid +#define PROC_RGID kp_eproc.e_pcred.p_rgid +#define PROC_SVGID kp_eproc.e_pcred.p_svgid +#define PROC_PPID kp_eproc.e_ppid +#define PROC_PGID kp_eproc.e_pgid +#define PROC_TPGID kp_eproc.e_tpgid +#define PROC_NICE kp_proc.p_nice +#define PROC_PRIORITY kp_proc.p_priority + +#endif + + buf->uid = pinfo [0].PROC_RUID; + buf->euid = pinfo [0].PROC_SVUID; + buf->gid = pinfo [0].PROC_RGID; + buf->egid = pinfo [0].PROC_SVGID; + + buf->ppid = pinfo [0].PROC_PPID; + buf->pgrp = pinfo [0].PROC_PGID; + buf->tpgid = pinfo [0].PROC_TPGID; + + buf->nice = pinfo [0].PROC_NICE; +#if defined(__NetBSD__) && defined(SACTIVE) + buf->priority = 0; +#else + buf->priority = pinfo [0].PROC_PRIORITY; +#endif + + /* Set the flags for the data we're about to return*/ + buf->flags = _glibtop_sysdeps_proc_uid; + + /* Use LibGTop conditionals here so we can more easily merge this + * code into the LIBGTOP_STABLE_1_0 branch. */ +#if 0 + /* This probably also works with other versions, but not yet + * tested. Please remove the conditional if this is true. */ +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) + ucred_ptr = (void *) pinfo [0].kp_eproc.e_pcred.pc_ucred; + + if (ucred_ptr) { + if (kvm_read (server->machine->kd, (unsigned long) ucred_ptr, + &ucred, sizeof (ucred)) != sizeof (ucred)) { + glibtop_warn_io_r (server, "kvm_read (ucred)"); + } else { + int count = (ucred.cr_ngroups < GLIBTOP_MAX_GROUPS) ? + ucred.cr_ngroups : GLIBTOP_MAX_GROUPS; + int i; + + for (i = 0; i < count; i++) + buf->groups [i] = ucred.cr_groups [i]; + buf->ngroups = count; + + buf->flags |= _glibtop_sysdeps_proc_uid_groups; + } + } +#endif +#endif +} diff --git a/sysdeps/bsd/sem_limits.c b/sysdeps/bsd/sem_limits.c new file mode 100644 index 0000000..758b775 --- /dev/null +++ b/sysdeps/bsd/sem_limits.c @@ -0,0 +1,119 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , August 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#if defined(__bsdi__) && (_BSDI_VERSION < 199700) +/* Older versions of BSDI don't seem to have this. */ + +void +_glibtop_init_sem_limits_p (glibtop *server) +{ } + +void +glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) +{ + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SEM_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_sem_limits)); +} + +#else + +/* #define KERNEL to get declaration of `struct seminfo'. */ + +#if (defined(__FreeBSD__) && (__FreeBSD_version < 410000)) || defined(__bsdi__) +#define KERNEL 1 +#else +#define _KERNEL 1 +#endif + +#include +#include + +static unsigned long _glibtop_sysdeps_sem_limits = +(1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) + +(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) + +(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) + +(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) + +(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM); + +/* The values in this structure never change at runtime, so we only + * read it once during initialization. We have to use the name `_seminfo' + * since `seminfo' is already declared external in . */ +static struct seminfo _seminfo; + +/* nlist structure for kernel access */ +static struct nlist nlst [] = { + { "_seminfo" }, + { 0 } +}; + +/* Init function. */ + +void +_glibtop_init_sem_limits_p (glibtop *server) +{ + if (kvm_nlist (server->machine->kd, nlst) < 0) { + glibtop_warn_io_r (server, "kvm_nlist (sem_limits)"); + return; + } + + if (kvm_read (server->machine->kd, nlst [0].n_value, + &_seminfo, sizeof (_seminfo)) != sizeof (_seminfo)) { + glibtop_warn_io_r (server, "kvm_read (seminfo)"); + return; + } + + server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; +} + +/* Provides information about sysv sem limits. */ + +void +glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) +{ + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SEM_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_sem_limits)); + + if (server->sysdeps.sem_limits == 0) + return; + + buf->semmap = _seminfo.semmap; + buf->semmni = _seminfo.semmni; + buf->semmns = _seminfo.semmns; + buf->semmnu = _seminfo.semmnu; + buf->semmsl = _seminfo.semmsl; + buf->semopm = _seminfo.semopm; + buf->semvmx = _seminfo.semvmx; + buf->semaem = _seminfo.semaem; + + buf->flags = _glibtop_sysdeps_sem_limits; +} + +#endif /* either a newer BSDI or no BSDI at all. */ + diff --git a/sysdeps/bsd/shm_limits.c b/sysdeps/bsd/shm_limits.c new file mode 100644 index 0000000..219b532 --- /dev/null +++ b/sysdeps/bsd/shm_limits.c @@ -0,0 +1,114 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , August 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#if defined(__bsdi__) && (_BSDI_VERSION < 199700) +/* Older versions of BSDI don't seem to have this. */ + +void +_glibtop_init_shm_limits_p (glibtop *server) +{ } + +void +glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) +{ + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SHM_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_shm_limits)); +} + +#else + +/* #define KERNEL to get declaration of `struct shminfo'. */ + +#if (defined(__FreeBSD__) && (__FreeBSD_version < 410000)) || defined(__bsdi__) +#define KERNEL 1 +#else +#define _KERNEL 1 +#endif + +#include +#include + +static unsigned long _glibtop_sysdeps_shm_limits = +(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) + +(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) + +(1L << GLIBTOP_IPC_SHMALL); + +/* The values in this structure never change at runtime, so we only + * read it once during initialization. We have to use the name `_shminfo' + * since `shminfo' is already declared external in . */ +static struct shminfo _shminfo; + +/* nlist structure for kernel access */ +static struct nlist nlst [] = { + { "_shminfo" }, + { 0 } +}; + +/* Init function. */ + +void +_glibtop_init_shm_limits_p (glibtop *server) +{ + if (kvm_nlist (server->machine->kd, nlst) < 0) { + glibtop_warn_io_r (server, "kvm_nlist (shm_limits)"); + return; + } + + if (kvm_read (server->machine->kd, nlst [0].n_value, + &_shminfo, sizeof (_shminfo)) != sizeof (_shminfo)) { + glibtop_warn_io_r (server, "kvm_read (shminfo)"); + return; + } + + server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) +{ + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SHM_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_shm_limits)); + + if (server->sysdeps.shm_limits == 0) + return; + + buf->shmmax = _shminfo.shmmax; + buf->shmmin = _shminfo.shmmin; + buf->shmmni = _shminfo.shmmni; + buf->shmseg = _shminfo.shmseg; + buf->shmall = _shminfo.shmall; + + buf->flags = _glibtop_sysdeps_shm_limits; +} + +#endif /* either a newer BSDI or no BSDI at all. */ + diff --git a/sysdeps/bsd/siglist.c b/sysdeps/bsd/siglist.c new file mode 100644 index 0000000..48ccad7 --- /dev/null +++ b/sysdeps/bsd/siglist.c @@ -0,0 +1,60 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 1, "SIGHUP", "Hangup" }, + { 2, "SIGINT", "Interrupt" }, + { 3, "SIGQUIT", "Quit" }, + { 4, "SIGILL", "Illegal Instruction" }, + { 5, "SIGTRAP", "Trace/Breakpoint Trap" }, + { 6, "SIGABRT", "Abort" }, + { 7, "SIGEMT", "Emulation Trap" }, + { 8, "SIGFPE", "Arithmetic Exception" }, + { 9, "SIGKILL", "Killed" }, + { 10, "SIGBUS", "Bus Error" }, + { 11, "SIGSEGV", "Segmentation Fault" }, + { 12, "SIGSYS", "Bad System Call" }, + { 13, "SIGPIPE", "Broken Pipe" }, + { 14, "SIGALRM", "Alarm Clock" }, + { 15, "SIGTERM", "Terminated" }, + { 16, "SIGURG", "Urgent Condition Present On Socket" }, + { 17, "SIGSTOP", "Stop (cannot be caught or ignored)" }, + { 18, "SIGTSTP", "Stop Signal Generated From Keyboard" }, + { 19, "SIGCONT", "Continue After Stop" }, + { 20, "SIGCHLD", "Child Status Has Changed" }, + { 21, "SIGTTIN", "Background Read Attempted From Control Terminal" }, + { 22, "SIGTTOU", "Background Write Attempted To Control Terminal" }, + { 23, "SIGIO", "I/O Is Possible On A Descriptor" }, + { 24, "SIGXCPU", "CPU Time Limit Exceeded" }, + { 25, "SIGXFSZ", "File Size Limit Exceeded" }, + { 26, "SIGVTALRM","Virtual Time Alarm" }, + { 27, "SIGPROF", "Profiling Timer Alarm" }, + { 28, "SIGWINCH","Window Size Change" }, + { 29, "SIGINFO", "Status Request From Keyboard" }, + { 30, "SIGUSR1", "User Defined Signal 1" }, + { 31, "SIGUSR2", "User Defined Signal 2" }, + { 32, "SIGTHR", "Thread Interrupt" }, + { 0, NULL, NULL } +}; diff --git a/sysdeps/bsd/swap.c b/sysdeps/bsd/swap.c new file mode 100644 index 0000000..81979a8 --- /dev/null +++ b/sysdeps/bsd/swap.c @@ -0,0 +1,426 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_swap = +(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) + +(1L << GLIBTOP_SWAP_FREE) + (1L << GLIBTOP_SWAP_PAGEIN) + +(1L << GLIBTOP_SWAP_PAGEOUT); + +#if defined(__FreeBSD__) || defined(__bsdi__) || defined(__FreeBSD_kernel__) + +#include +#ifdef __bsdi__ +#include +#else +#if (__FreeBSD_version < 400005) && !defined(__FreeBSD_kernel__) +#include +#endif +#endif +#include + +/* nlist structure for kernel access */ + +#if defined(__bsdi__) +static struct nlist nlst [] = { + { "_swapstats" }, /* general swap info */ + { 0 } +}; +#elif __FreeBSD__ < 4 +static struct nlist nlst [] = { +#define VM_SWAPLIST 0 + { "_swaplist" },/* list of free swap areas */ +#define VM_SWDEVT 1 + { "_swdevt" }, /* list of swap devices and sizes */ +#define VM_NSWAP 2 + { "_nswap" }, /* size of largest swap device */ +#define VM_NSWDEV 3 + { "_nswdev" }, /* number of swap devices */ +#define VM_DMMAX 4 + { "_dmmax" }, /* maximum size of a swap block */ + { 0 } +}; +#endif + +#elif defined(__NetBSD__) || defined(__OpenBSD__) + +#if (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) +#include +#include +#else +#include +#endif + +#endif + +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) +static int mib_uvmexp [] = { CTL_VM, VM_UVMEXP }; +#else +/* nlist structure for kernel access */ +static struct nlist nlst2 [] = { + { "_cnt" }, + { 0 } +}; +#endif + +/* Init function. */ + +void +_glibtop_init_swap_p (glibtop *server) +{ +#if defined(__FreeBSD__) || defined(__bsdi__) || defined(__FreeBSD_kernel__) +#if __FreeBSD__ < 4 || defined(__bsdi__) + if (kvm_nlist (server->machine->kd, nlst) < 0) { + glibtop_warn_io_r (server, "kvm_nlist (swap)"); + return; + } +#else + struct kvm_swap dummy; + + if (kvm_getswapinfo (server->machine->kd, &dummy, 1, 0) != 0) { + glibtop_warn_io_r (server, "kvm_swap (swap)"); + return; + } +#endif +#endif + +#if !(defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) && !defined(__OpenBSD__) + if (kvm_nlist (server->machine->kd, nlst2) < 0) { + glibtop_warn_io_r (server, "kvm_nlist (cnt)"); + return; + } +#endif + + server->sysdeps.swap = _glibtop_sysdeps_swap; +} + +/* Provides information about swap usage. */ + +/* + * This function is based on a program called swapinfo written + * by Kevin Lahey . + */ + +void +glibtop_get_swap_p (glibtop *server, glibtop_swap *buf) +{ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + +# if (__FreeBSD__ < 4) && !defined(__FreeBSD_kernel__) + char *header; + int hlen, nswdev, dmmax; + int div, nfree, npfree; + struct swdevt *sw; + long blocksize, *perdev; + struct rlist head; + struct rlisthdr swaplist; + struct rlist *swapptr; + size_t sw_size; + u_long ptr; +# else + int nswdev; + struct kvm_swap kvmsw[16]; +# endif + +#elif defined(__bsdi__) + struct swapstats swap; +#elif defined(__NetBSD__) || defined(__OpenBSD__) + struct swapent *swaplist; +#endif + + int nswap, i; + guint64 avail = 0, inuse = 0; + +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) + struct uvmexp uvmexp; + size_t length_uvmexp; +#else + /* To get `pagein' and `pageout'. */ + struct vmmeter vmm; +#endif + static int swappgsin = -1; + static int swappgsout = -1; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SWAP), 0); + + memset (buf, 0, sizeof (glibtop_swap)); + + if (server->sysdeps.swap == 0) + return; + +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) + length_uvmexp = sizeof (uvmexp); + if (sysctl (mib_uvmexp, 2, &uvmexp, &length_uvmexp, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (uvmexp)"); + return; + } +#else + /* This is used to get the `pagein' and `pageout' members. */ + + if (kvm_read (server->machine->kd, nlst2[0].n_value, + &vmm, sizeof (vmm)) != sizeof (vmm)) { + glibtop_warn_io_r (server, "kvm_read (cnt)"); + return; + } +#endif + + if (swappgsin < 0) { + buf->pagein = 0; + buf->pageout = 0; + } else { +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + buf->pagein = vmm.v_swappgsin - swappgsin; + buf->pageout = vmm.v_swappgsout - swappgsout; +#elif defined(__NetBSD__) && (__NetBSD_Version__ >= 599002100) + /* no uvmexp.swap{ins,outs} */ + buf->pagein = 0; + buf->pageout = 0; +#elif defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) + buf->pagein = uvmexp.swapins - swappgsin; + buf->pageout = uvmexp.swapouts - swappgsout; +#else + buf->pagein = vmm.v_swpin - swappgsin; + buf->pageout = vmm.v_swpout - swappgsout; +#endif + } + +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + swappgsin = vmm.v_swappgsin; + swappgsout = vmm.v_swappgsout; +#elif defined(__NetBSD__) && (__NetBSD_Version__ >= 599002100) + swappgsin = 0; + swappgsout = 0; +#elif defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) + swappgsin = uvmexp.swapins; + swappgsout = uvmexp.swapouts; +#else + swappgsin = vmm.v_swpin; + swappgsout = vmm.v_swpout; +#endif + +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + +#if (__FreeBSD__ < 4) && !defined(__FreeBSD_kernel__) + + /* Size of largest swap device. */ + + if (kvm_read (server->machine->kd, nlst[VM_NSWAP].n_value, + &nswap, sizeof (nswap)) != sizeof (nswap)) { + glibtop_warn_io_r (server, "kvm_read (nswap)"); + return; + } + + /* Number of swap devices. */ + + if (kvm_read (server->machine->kd, nlst[VM_NSWDEV].n_value, + &nswdev, sizeof (nswdev)) != sizeof (nswdev)) { + glibtop_warn_io_r (server, "kvm_read (nswdev)"); + return; + } + + /* Maximum size of a swap block. */ + + if (kvm_read (server->machine->kd, nlst[VM_DMMAX].n_value, + &dmmax, sizeof (dmmax)) != sizeof (dmmax)) { + glibtop_warn_io_r (server, "kvm_read (dmmax)"); + return; + } + + /* List of free swap areas. */ + + if (kvm_read (server->machine->kd, nlst[VM_SWAPLIST].n_value, + &swaplist, sizeof (swaplist)) != sizeof (swaplist)) { + glibtop_warn_io_r (server, "kvm_read (swaplist)"); + return; + } + + /* Kernel offset of list of swap devices and sizes. */ + + if (kvm_read (server->machine->kd, nlst[VM_SWDEVT].n_value, + &ptr, sizeof (ptr)) != sizeof (ptr)) { + glibtop_warn_io_r (server, "kvm_read (swdevt)"); + return; + } + + /* List of swap devices and sizes. */ + + sw_size = nswdev * sizeof (*sw); + sw = g_malloc (sw_size); + + if (kvm_read (server->machine->kd, ptr, sw, sw_size) != (ssize_t)sw_size) { + glibtop_warn_io_r (server, "kvm_read (*swdevt)"); + return; + } + + perdev = g_malloc (nswdev * sizeof (*perdev)); + + /* Count up swap space. */ + + nfree = 0; + memset (perdev, 0, nswdev * sizeof(*perdev)); + + swapptr = swaplist.rlh_list; + + while (swapptr) { + int top, bottom, next_block; + + if (kvm_read (server->machine->kd, (int) swapptr, &head, + sizeof (struct rlist)) != sizeof (struct rlist)) { + glibtop_warn_io_r (server, "kvm_read (swapptr)"); + return; + } + + top = head.rl_end; + bottom = head.rl_start; + + nfree += top - bottom + 1; + + /* + * Swap space is split up among the configured disks. + * + * For interleaved swap devices, the first dmmax blocks + * of swap space some from the first disk, the next dmmax + * blocks from the next, and so on up to nswap blocks. + * + * The list of free space joins adjacent free blocks, + * ignoring device boundries. If we want to keep track + * of this information per device, we'll just have to + * extract it ourselves. + */ + while (top / dmmax != bottom / dmmax) { + next_block = ((bottom + dmmax) / dmmax); + perdev[(bottom / dmmax) % nswdev] += + next_block * dmmax - bottom; + bottom = next_block * dmmax; + } + perdev[(bottom / dmmax) % nswdev] += + top - bottom + 1; + + swapptr = head.rl_next; + } + + header = getbsize (&hlen, &blocksize); + + div = blocksize / 512; + avail = npfree = 0; + for (i = 0; i < nswdev; i++) { + int xsize, xfree; + + /* + * Don't report statistics for partitions which have not + * yet been activated via swapon(8). + */ + if (!(sw[i].sw_flags & SW_FREED)) + continue; + + /* The first dmmax is never allocated to avoid trashing of + * disklabels + */ + xsize = sw[i].sw_nblks - dmmax; + xfree = perdev[i]; + inuse = xsize - xfree; + npfree++; + avail += xsize; + } + + /* + * If only one partition has been set up via swapon(8), we don't + * need to bother with totals. + */ + inuse = avail - nfree; + + g_free (sw); + g_free (perdev); + + buf->flags = _glibtop_sysdeps_swap; + + buf->used = inuse; + buf->free = avail; + + buf->total = inuse + avail; + +#else + + nswdev = kvm_getswapinfo(server->machine->kd, kvmsw, 16, 0); + + buf->flags = _glibtop_sysdeps_swap; + + buf->used = kvmsw[nswdev].ksw_used * getpagesize(); + buf->total = kvmsw[nswdev].ksw_total * getpagesize(); + + buf->free = buf->total - buf->used; + +#endif + +#elif defined(__bsdi__) + + /* General info about swap devices. */ + + if (kvm_read (server->machine->kd, nlst[0].n_value, + &swap, sizeof (swap)) != sizeof (swap)) { + glibtop_warn_io_r (server, "kvm_read (swap)"); + return; + } + + buf->flags = _glibtop_sysdeps_swap; + + buf->used = swap.swap_total - swap.swap_free; + buf->free = swap.swap_free; + + buf->total = swap.swap_total; + +#elif defined(__NetBSD__) || defined(__OpenBSD__) + + nswap = swapctl (SWAP_NSWAP, NULL, 0); + if (nswap < 0) { + glibtop_warn_io_r (server, "swapctl (SWAP_NSWAP)"); + return; + } + + swaplist = g_malloc (nswap * sizeof (struct swapent)); + + if (swapctl (SWAP_STATS, swaplist, nswap) != nswap) { + glibtop_warn_io_r (server, "swapctl (SWAP_STATS)"); + g_free (swaplist); + return; + } + + for (i = 0; i < nswap; i++) { + avail += swaplist[i].se_nblks; + inuse += swaplist[i].se_inuse; + } + + g_free (swaplist); + + buf->flags = _glibtop_sysdeps_swap; + + buf->used = inuse; + buf->free = avail; + + buf->total = inuse + avail; +#endif +} diff --git a/sysdeps/bsd/sysinfo.c b/sysdeps/bsd/sysinfo.c new file mode 100644 index 0000000..9d9da38 --- /dev/null +++ b/sysdeps/bsd/sysinfo.c @@ -0,0 +1,91 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_sysinfo = +(1L << GLIBTOP_SYSINFO_CPUINFO); + +static glibtop_sysinfo sysinfo = { .flags = 0 }; + +static void +init_sysinfo (glibtop *server) +{ + char *model; + guint64 ncpus = 1; + int mhz = 0; + size_t len; + + if (G_LIKELY (sysinfo.flags)) + return; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0); + + len = sizeof (ncpus); + sysctlbyname ("hw.ncpu", &ncpus, &len, NULL, 0); + len = 0; + sysctlbyname ("hw.model", NULL, &len, NULL, 0); + model = g_malloc (len); + sysctlbyname ("hw.model", model, &len, NULL, 0); + len = sizeof (mhz); + sysctlbyname ("hw.clockrate", &mhz, &len, NULL, 0); + + for (sysinfo.ncpu = 0; + sysinfo.ncpu < GLIBTOP_NCPU && sysinfo.ncpu < ncpus; + sysinfo.ncpu++) { + glibtop_entry * const cpuinfo = &sysinfo.cpuinfo[sysinfo.ncpu]; + + cpuinfo->labels = g_ptr_array_new (); + + cpuinfo->values = g_hash_table_new_full(g_str_hash, + g_str_equal, + NULL, g_free); + + g_ptr_array_add (cpuinfo->labels, "processor"); + g_hash_table_insert (cpuinfo->values, "processor", + g_strdup_printf("%u", (guint)sysinfo.ncpu)); + + g_ptr_array_add (cpuinfo->labels, "vendor_id"); + g_hash_table_insert (cpuinfo->values, "vendor_id", + g_strdup(model)); + + g_ptr_array_add (cpuinfo->labels, "cpu MHz"); + g_hash_table_insert (cpuinfo->values, "cpu MHz", + g_strdup_printf("%d", mhz)); + } + + g_free (model); + + sysinfo.flags = _glibtop_sysdeps_sysinfo; +} + +const glibtop_sysinfo * +glibtop_get_sysinfo_s (glibtop *server) +{ + init_sysinfo (server); + return &sysinfo; +} diff --git a/sysdeps/bsd/uptime.c b/sysdeps/bsd/uptime.c new file mode 100644 index 0000000..f9e8b17 --- /dev/null +++ b/sysdeps/bsd/uptime.c @@ -0,0 +1,92 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include + +static const unsigned long _glibtop_sysdeps_uptime = +(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME); + +static const unsigned long _required_cpu_flags = +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_IDLE) + +(1L << GLIBTOP_CPU_FREQUENCY); + +/* Init function. */ + +void +_glibtop_init_uptime_p (glibtop *server) +{ + server->sysdeps.uptime = _glibtop_sysdeps_uptime; +} + +/* Provides uptime and idle time. */ + +void +glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf) +{ +#if defined(__NetBSD__) || defined(__OpenBSD__) + time_t now; + time_t uptime; + int mib[2]; + struct timeval boottime; + size_t size; + + mib[0] = CTL_KERN; + mib[1] = KERN_BOOTTIME; + size = sizeof(boottime); + if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && + boottime.tv_sec != 0) { + time(&now); + buf->uptime = now - boottime.tv_sec; + /* XXX: don't know a useful value to put here. */ + buf->idletime = 0; + buf->flags = _glibtop_sysdeps_uptime; + } +#else + glibtop_cpu cpu; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_UPTIME), 0); + + memset (buf, 0, sizeof (glibtop_uptime)); + + /* We simply calculate it from the CPU usage. */ + + glibtop_get_cpu_p (server, &cpu); + + /* Make sure all required fields are present. */ + + if ((cpu.flags & _required_cpu_flags) != _required_cpu_flags) + return; + + /* Calculate values. */ + + buf->uptime = (double) cpu.total / (double) cpu.frequency; + buf->idletime = (double) cpu.idle / (double) cpu.frequency; + + buf->flags = _glibtop_sysdeps_uptime; +#endif +} diff --git a/sysdeps/common/ChangeLog b/sysdeps/common/ChangeLog new file mode 100644 index 0000000..f22d9b6 --- /dev/null +++ b/sysdeps/common/ChangeLog @@ -0,0 +1,253 @@ +2007-05-19 Benoît Dejean + + * default.c: + + Fixed returned type. + +2007-03-16 Benoît Dejean + + * mountlist.c: (ignore_mount_entry): + + Ignore securityfs and fusectl. + Patch by Fryderyk Dziarmagowski + Closes #418718. + +2007-02-10 Benoît Dejean + + * fsusage.c: (glibtop_get_fsusage_s): + + Make sure avail <= free. + Closes #406280. + +2007-01-31 Benoît Dejean + + * mountlist.c: (ignore_mount_entry): + + Fixed order. + Added objfs and ctfs. + Closes #400557. + +2006-09-21 Benoît Dejean + + * mountlist.c: (ignore_mount_entry): + + Added nfsd to the exclude list. + +2006-06-24 Benoît Dejean + + * mountlist.c: (read_filesystem_list): + + Ensure file is closed. + + (glibtop_get_mountlist_s): + + Fixed .flags. + + Patch by hua.zhang@sun.com. + Closes #345812. + +2006-04-09 Benoît Dejean + + * Makefile.am: Fixed trivial warning. + +2006-02-21 Benoît Dejean + + * mountlist.c: (ignore_mount_entry): Also ignores linprocfs, mfs + and devfs. + Closes #331856. + Patch by Andreas Kohn + +2005-04-26 Jörgen Scheibengruber + + * mountlist.c: (ignore_mount_entry): Added tmpfs to ignore list. + +2005-03-25 Benoît Dejean + + * error.c: (glibtop_error_io_vr), (glibtop_warn_io_vr): + * error_suid.c: (glibtop_error_io_vr), (glibtop_warn_io_vr): + s/strerror/g_strerror/g. + +2005-03-11 Benoît Dejean + + * mountlist.c: (ignore_mount_entry): Added mqueue to ignore list. + +2005-02-28 Benoît Dejean + + * fsusage.c: * Add support for file system read and write counting + (needed for the disk load feature of the multiload applet). + +2005-02-23 Benoît Dejean + + * fsusage.c: (glibtop_get_fsusage_s): Correct file system size calculations. + Patch from marcus@freebsd.org (Joe Marcus Clarke). + Closes #168232. + +2005-02-15 Benoît Dejean + + * fsusage.c: (_glibtop_get_fsusage_read_write): Fixed G_GNUC attribute usage. + Replaced macro by inline function. + +2005-01-18 Benoît Dejean + + * mountlist.c: (ignore_mount_entry): Re-worked with bsearch. + +2004-12-09 Benoît Dejean + + * mountlist.c: (ignore_mount_entry): Ignores "unkown" file system type. + +2004-09-24 Benoît Dejean + + * fsusage.c: (glibtop_get_fsusage_s): Fixed .block_size on Solaris. + +2004-09-24 Benoît Dejean + + * Makefile.am: + * mountlist.c: + * mountlist.h: Removed mountlist.h. + +2004-09-23 Benoît Dejean + + * mountlist.c: (ignore_mount_entry): Added openpromfs. + +2004-09-22 Benoît Dejean + + * fsusage.c: (glibtop_get_fsusage_s): Linux: Sanitize. Removed calls + to obfuscated PROPAGATE_ALL_ONES(x) which seems to return unpredictable + values on some arch (e.g sparc). + Closes #153141. + +2004-09-22 Benoît Dejean + + * mountlist.c: (ignore_mount_entry): Added mntfs to ignore list. + +2004-09-21 Benoît Dejean + + * fsusage.c: (_glibtop_get_fsusage_read_write), + (glibtop_get_fsusage_s): + * mountlist.c: (glibtop_get_mountlist_s): Back to previous version. + +2004-09-19 Benoît Dejean + + * fsusage.c: (_glibtop_get_fsusage_read_write) : Added new flag. + (_glibtop_get_fsusage_read_write): Changed prototype. Returns TRUE on + success, then _glibtop_get_fsusage_read_write is set. + + Added comment to locate Linux code. + + * mountlist.c: (read_filesystem_list): Dropped unused need_fs_type parameter. + This is now default. + Fixed possible leak. + + (ignore_mount_entry): Added "usbfs" to ignored FS. + + (glibtop_get_mountlist_s): Updated. + +2004-08-22 Benoît Dejean + + * mountlist.c: (read_filesystem_list): Merged FreeBSD Marcus' patch. + +2004-07-17 Benoît Dejean + + * fsusage.c: (glibtop_get_fsusage_s): Started implementation of read, write. + Code should be splitted into arch specific files. + + * mountlist.c: (glibtop_get_mountlist_s): glibify. Used GArray. + +2004-07-07 Benoît Dejean + + * Makefile.am: + * procargs.c: (split_args0), (glibtop_get_proc_argv_l), + (glibtop_get_proc_argv_p), (glibtop_get_proc_argv_s): Added file to + repository. Provides glibtop_get_proc_argv*() for system dependant + glibtop_get_proc_args*(). + +2004-06-18 Benoît Dejean + + * error.c: (print_server_name), (glibtop_error_r), + (glibtop_warn_r), (glibtop_error_io_r), (glibtop_warn_io_r), + (glibtop_error), (glibtop_warn), (glibtop_error_io), + (glibtop_warn_io): These functions are now globally defined. + +2004-06-12 Benoît Dejean + + * Makefile.am: + * fsusage-frontend.c: + * fsusage.h: Removed files. + + * fsusage.c: (glibtop_get_fsusage_s), (statfs): Merged and cleaned. + +2004-06-12 Benoît Dejean + + * mountlist.c: (xatoi) Removed, replaced by ISO strtoull. + (fstype_to_string): Cleaned. + (read_filesystem_list) : Changed prototype. Cleaned and secured. + Replaced broken free by g_free. + (ignore_mount_entry): Added. + (glibtop_get_mountlist_s): Cleaned. Better allocation algorithm. + @all_fs has now a real meaning, see the documentation. + +2004-06-06 Benoît Dejean + + * gnuslib.c: (connect_to_internet_server): Cleaned. + * mountlist.c: (glibtop_get_mountlist_s): Replaced multiple strcpy/cat by + g_strdup_printf. Replaced strncpy by g_strlcpy. + +2004-03-15 Bastien Nocera + + * fsusage.c: + * fsusage.h: remove use of uintmax_t + +2004-03-09 Bastien Nocera + + * fsusage.c: fix build (we don't have "full-read.h" here) + +2003-12-27 Ole Laursen + + * README.fsusage: Added a few words about the code from GNU + Coreutils. + + * fsusage.c, fsusage.h: Resynced from GNU Coreutils 5.0. + + * fsusage-frontend.c: Moved the frontend from fsusage.c to here. + +2003-10-21 Bastien Nocera + + * Makefile.am: + * fsusage.h: install only one library, libgtop-2.0 + Fix build-time warnings due to the redefinition of guint64 + Include glib.h for the definition of guint64 + +2003-10-20 Bastien Nocera + + * inodedb.c: (glibtop_inodedb_close_s): fix compilation, thanks Jeff + +2003-10-20 Bastien Nocera + + * ChangeLog: + * backend.c: (_open_common): + * fsusage.c: + * fsusage.h: + * inodedb.c: (glibtop_inodedb_lookup_s): s/u_int64_t/guint64/ + +2003-10-20 Bastien Nocera + + * inodedb.c: + * mountlist.c: (glibtop_get_mountlist_s): fixed compilation + +2003-10-20 Bastien Nocera + + * Makefile.am: + * inodedb.c: (glibtop_inodedb_open_s), (glibtop_inodedb_close_s): + * mountlist.c: (glibtop_get_mountlist_s): + * xmalloc.c: + * xmalloc_suid.c: replace all the xmalloc crap by glib memory + management functions + +2000-01-20 Martin Baulig + + * fsusage.c (adjust_blocks): Use `guint64' arguments and + return value to avoid long int overflows on machines with large + disks. + + * fsusage.h (struct fs_usage): Use `guint64' here as well. + diff --git a/sysdeps/common/Makefile.am b/sysdeps/common/Makefile.am new file mode 100644 index 0000000..373b389 --- /dev/null +++ b/sysdeps/common/Makefile.am @@ -0,0 +1,25 @@ + +AM_CPPFLAGS = @AM_CPPFLAGS@ + +noinst_LTLIBRARIES = libgtop_common-2.0.la libgtop_suid_common-2.0.la + +if !LIBGTOP_SYSDEPS_PRIVATE_MOUNTLIST +mountlist_src = mountlist.c +endif + +if !LIBGTOP_SYSDEPS_PRIVATE_FSUSAGE +fsusage_src = fsusage.c +endif + +libgtop_common_2_0_la_SOURCES = error.c gnuslib.c \ + procargs.c \ + default.c \ + $(mountlist_src) $(fsusage_src) + +# libgtop_common_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_common_2_0_la_LIBADD = $(LIBGTOP_EXTRA_LIBS) + +libgtop_suid_common_2_0_la_SOURCES = error.c sysdeps_suid.c + +# libgtop_suid_common_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + diff --git a/sysdeps/common/Makefile.in b/sysdeps/common/Makefile.in new file mode 100644 index 0000000..51614bc --- /dev/null +++ b/sysdeps/common/Makefile.in @@ -0,0 +1,694 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = sysdeps/common +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libgtop_common_2_0_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am__libgtop_common_2_0_la_SOURCES_DIST = error.c gnuslib.c procargs.c \ + default.c mountlist.c fsusage.c +@LIBGTOP_SYSDEPS_PRIVATE_MOUNTLIST_FALSE@am__objects_1 = mountlist.lo +@LIBGTOP_SYSDEPS_PRIVATE_FSUSAGE_FALSE@am__objects_2 = fsusage.lo +am_libgtop_common_2_0_la_OBJECTS = error.lo gnuslib.lo procargs.lo \ + default.lo $(am__objects_1) $(am__objects_2) +libgtop_common_2_0_la_OBJECTS = $(am_libgtop_common_2_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgtop_suid_common_2_0_la_LIBADD = +am_libgtop_suid_common_2_0_la_OBJECTS = error.lo sysdeps_suid.lo +libgtop_suid_common_2_0_la_OBJECTS = \ + $(am_libgtop_suid_common_2_0_la_OBJECTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_common_2_0_la_SOURCES) \ + $(libgtop_suid_common_2_0_la_SOURCES) +DIST_SOURCES = $(am__libgtop_common_2_0_la_SOURCES_DIST) \ + $(libgtop_suid_common_2_0_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + ChangeLog +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libgtop_common-2.0.la libgtop_suid_common-2.0.la +@LIBGTOP_SYSDEPS_PRIVATE_MOUNTLIST_FALSE@mountlist_src = mountlist.c +@LIBGTOP_SYSDEPS_PRIVATE_FSUSAGE_FALSE@fsusage_src = fsusage.c +libgtop_common_2_0_la_SOURCES = error.c gnuslib.c \ + procargs.c \ + default.c \ + $(mountlist_src) $(fsusage_src) + + +# libgtop_common_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_common_2_0_la_LIBADD = $(LIBGTOP_EXTRA_LIBS) +libgtop_suid_common_2_0_la_SOURCES = error.c sysdeps_suid.c +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sysdeps/common/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu sysdeps/common/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgtop_common-2.0.la: $(libgtop_common_2_0_la_OBJECTS) $(libgtop_common_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_common_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libgtop_common_2_0_la_OBJECTS) $(libgtop_common_2_0_la_LIBADD) $(LIBS) + +libgtop_suid_common-2.0.la: $(libgtop_suid_common_2_0_la_OBJECTS) $(libgtop_suid_common_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_suid_common_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libgtop_suid_common_2_0_la_OBJECTS) $(libgtop_suid_common_2_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/default.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsusage.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnuslib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mountlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysdeps_suid.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# libgtop_suid_common_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + +# 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: diff --git a/sysdeps/common/default.c b/sysdeps/common/default.c new file mode 100644 index 0000000..e3b096f --- /dev/null +++ b/sysdeps/common/default.c @@ -0,0 +1,448 @@ +#include + +#include +#include +#include + + +/** + * glibtop_close: + * + * Close the connection to the server. + */ +void +glibtop_close(void) +{ + glibtop_close_r(glibtop_global_server); +} + +/** + * SECTION:glibtop + * @short_description: Server initilization + * @stability: Stable + * + * You do not need to worry about the #glibtop * server structure if + * you don't need - the library exports a #glibtop_global_server + * which you can use everywhere a #glibtop * is expected. + * + * Most of the library and all of the sysdeps function also have an alias + * (which is the function name without the _l, + * _s or _r suffix) which don't + * take a #glibtop * as argument but uses the #glibtop_global_server + * instead. + */ + +/** + * glibtop_init: + * + * Server initialization. + * + * Returns: A #glibtop reference. + */ +glibtop* +glibtop_init(void) +{ + return glibtop_init_r(&glibtop_global_server, 0, 0); +} + + +/** + * glibtop_get_cpu: + * @buf: A location to return the CPU usage. + * + * Get the CPU usage. + * + * All CPU units are measured in jiffies which are normally + * 1/100th of a second (in which case frequency equals 100), + * but can also be in any other unit. To get seconds, divide them by + * frequency. + */ +void +glibtop_get_cpu(glibtop_cpu *buf) +{ + glibtop_get_cpu_l(glibtop_global_server, buf); +} + + +/** + * glibtop_get_fsusage: + * @buf: A location to return the file system usage. + * @mount_dir: mount dir where to get the information of usage. + * + * Get the file system usage for an specific @mount_dir. + */ +void +glibtop_get_fsusage(glibtop_fsusage *buf, const char *mount_dir) +{ + glibtop_get_fsusage_l(glibtop_global_server, buf, mount_dir); +} + + +/** + * glibtop_get_uptime: + * @buf: A location to return the system uptime + * + * When porting LibGTop to a new system, you only need to implement + * #uptime and #idletime if there's a faster or better way to obtain them + * as using function(glibtop_cpu) for it. Look at + * sysdeps/freebsd/uptime.c for an + * example on how to obtain them using function(glibtop_cpu). + */ +void +glibtop_get_uptime(glibtop_uptime *buf) +{ + glibtop_get_uptime_l(glibtop_global_server, buf); +} + + +/** + * glibtop_sysinfo: + * + * Returns: The system information through a #glibtop_sysinfo structure. + */ +const glibtop_sysinfo * +glibtop_get_sysinfo(void) +{ + return glibtop_get_sysinfo_s(glibtop_global_server); +} + + +/** + * glibtop_get_swap: + * @buf: A location to return a #glibtop_swap. + * + * Get the swap usage. + */ +void +glibtop_get_swap(glibtop_swap *buf) +{ + glibtop_get_swap_l(glibtop_global_server, buf); +} + + +/** + * glibtop_get_proc_uid: + * @buf: A location to return a #glibtop_proc_uid + * @pid: Process id to get the user and tty information + * + * Get the process user id and tty information. + */ +void +glibtop_get_proc_uid(glibtop_proc_uid *buf, pid_t pid) +{ + glibtop_get_proc_uid_l(glibtop_global_server, buf, pid); +} + + +/** + * SECTION:proctime + * @title: Process Time + * @short_description: Get process time information + * @stability: Stable + */ + +/** + * glibtop_get_proc_time: + * @buf: Returned process time information - see #glibtop_proc_time. + * @pid: Process id + * + * Get process time information. + */ +void +glibtop_get_proc_time(glibtop_proc_time *buf, pid_t pid) +{ + glibtop_get_proc_time_l(glibtop_global_server, buf, pid); +} + + +void +glibtop_get_proc_state(glibtop_proc_state *buf, pid_t pid) +{ + glibtop_get_proc_state_l(glibtop_global_server, buf, pid); +} + + +void +glibtop_get_proc_signal(glibtop_proc_signal *buf, pid_t pid) +{ + glibtop_get_proc_signal_l(glibtop_global_server, buf, pid); +} + + +void +glibtop_get_proc_segment(glibtop_proc_segment *buf, pid_t pid) +{ + glibtop_get_proc_segment_l(glibtop_global_server, buf, pid); +} + + +glibtop_open_files_entry * +glibtop_get_proc_open_files(glibtop_proc_open_files *buf, pid_t pid) +{ + return glibtop_get_proc_open_files_l(glibtop_global_server, buf, pid); +} + + +void +glibtop_get_proc_mem(glibtop_proc_mem *buf, pid_t pid) +{ + glibtop_get_proc_mem_l(glibtop_global_server, buf, pid); +} + + +glibtop_map_entry * +glibtop_get_proc_map(glibtop_proc_map *buf, pid_t pid) +{ + return glibtop_get_proc_map_l(glibtop_global_server, buf, pid); +} + + +/** + * SECTION:procargs + * @title: Process Arguments + * @short_description: Get process command line arguments + * @see_also: #libgtop-Process-List + * @stability: Stable + */ + +/** + * glibtop_get_proc_args: + * @buf: Struct with @size of returned string. + * @pid: Process id + * @max_len: Maximum length of string to return (use zero to get all arguments). + * + * Get process command line arguments. + * + * Returns: @pid's command line arguments separated by null bytes; the length of + * this string is returned in the @buf size field. You are required to free + * the string when done. + */ +char * +glibtop_get_proc_args(glibtop_proc_args *buf, pid_t pid, unsigned max_len) +{ + return glibtop_get_proc_args_l(glibtop_global_server, buf, pid, max_len); +} + + +/** + * glibtop_get_proc_argv + * @buf: Struct with @size of combined returned arguments. + * @pid: Process id + * @max_len: Maximum length of all arguments combined (use zero to get all arguments). + * + * Get process command line arguments. + * + * Returns: A NULL-terminated array of strings with all arguments of process pid + * (up to @max_len characters). Remember to g_strfreev + * the returned array to avoid a memory leak. + */ +char ** +glibtop_get_proc_argv(glibtop_proc_args *buf, pid_t pid, unsigned max_len) +{ + return glibtop_get_proc_argv_l(glibtop_global_server, buf, pid, max_len); +} + + +/** + * SECTION:proclist + * @title: Process List + * @short_description: List running processes + * @stability: Stable + */ + +/** + * glibtop_get_proclist + * @buf: Extra return information, see #glibtop_proclist. + * @which: Criteria for processes in returned list. See the GLIBTOP_KERN_PROC_* and GLIBTOP_EXCLUDE_* constants. + * @arg: Extra arguments applied to @which. Only GLIBTOP_KERN_PROC_* constants take arguments, see each constant definition for particular @arg description. + * + * Returns: A list of running processes or NULL on error. The + * returned list is allocated using g_malloc and must be + * freed using g_free to avoid a memory leak. + */ +pid_t* +glibtop_get_proclist(glibtop_proclist *buf, gint64 which, gint64 arg) +{ + return glibtop_get_proclist_l(glibtop_global_server, buf, which, arg); +} + + +void +glibtop_get_proc_kernel(glibtop_proc_kernel *buf, pid_t pid) +{ + glibtop_get_proc_kernel_l(glibtop_global_server, buf, pid); +} + + +/** + * SECTION:ppp + * @short_description: PPP Usage. + * @see_also: #libgtop-netload, #libgtop-netlist + * @stability: Stable + * + * Management of a PPP device. + */ + +/** + * glibtop_get_ppp: + * @buf: A location to return the PPP usage + * @short device: The device to ask information + * + * Get the PPP usage. + */ +void +glibtop_get_ppp(glibtop_ppp *buf, unsigned short device) +{ + glibtop_get_ppp_l(glibtop_global_server, buf, device); +} + +/** + * SECTION:netlist + * @short_description: Network Devices List. + * @see_also: #libgtop-netload + * @stability: Stable + * + * The application class handles ... + */ + +/** + * glibtop_get_nelist: + * @buf: + * + * Get the list of network devices. + * + * Returns: A list of network devices. + */ +char** +glibtop_get_netlist(glibtop_netlist *buf) +{ + return glibtop_get_netlist_l(glibtop_global_server, buf); +} + +/** + * SECTION:netload + * @short_description: Network Load. + * @see_also: #libtop-netlist + * @stability: Stable + * + * The application class handles ... + */ + + +/** + * glibtop_get_netload: + * @buf: The variable where the results will be assigned. + * @interface: The name of the network interface. + * + * Recolects network statistics for @interface + * (which is the same than in ifconfig). + * The values are returned into @buf. + */ +void +glibtop_get_netload(glibtop_netload *buf, const char *interface) +{ + glibtop_get_netload_l(glibtop_global_server, buf, interface); +} + + +glibtop_mountentry * +glibtop_get_mountlist(glibtop_mountlist *buf, int all_fs) +{ + return glibtop_get_mountlist_l(glibtop_global_server, buf, all_fs); +} + + +/** + * glibtop_get_mem: + * @buf: Buffer where the output will be given. + * + * Get the memory usage. Unless explicitly stated otherwise, all memory + * units are in bytes. + */ +void +glibtop_get_mem(glibtop_mem *buf) +{ + glibtop_get_mem_l(glibtop_global_server, buf); +} + + +void +glibtop_get_loadavg(glibtop_loadavg *buf) +{ + glibtop_get_loadavg_l(glibtop_global_server, buf); +} + + +void +glibtop_get_msg_limits(glibtop_msg_limits *buf) +{ + glibtop_get_msg_limits_l(glibtop_global_server, buf); +} + + +void +glibtop_get_sem_limits(glibtop_sem_limits *buf) +{ + glibtop_get_sem_limits_l(glibtop_global_server, buf); +} + + +void +glibtop_get_shm_limits(glibtop_shm_limits *buf) +{ + glibtop_get_shm_limits_l(glibtop_global_server, buf); +} + + +void +glibtop_get_sysdeps(glibtop_sysdeps *buf) +{ + glibtop_get_sysdeps_r(glibtop_global_server, buf); +} + + +/** + * glibtop_get_proc_wd: + * @buf: + * @pid: Process id to get the user and tty information + * + * Get the root directory and the working directories + * + * Returns: A NULL-terminated list of working directories. + */ +char** +glibtop_get_proc_wd(glibtop_proc_wd *buf, pid_t pid) +{ + return glibtop_get_proc_wd_l(glibtop_global_server, buf, pid); +} + + +/** + * glibtop_get_proc_affinity: + * @buf: + * @pid: Process id to get the affinity + * + * Get the processor affinity list for a process + * + * Returns: A list of processor ID of 'buf.number' elements. + */ +guint16 * +glibtop_get_proc_affinity(glibtop_proc_affinity *buf, pid_t pid) +{ + return glibtop_get_proc_affinity_l(glibtop_global_server, buf, pid); +} + +/** + * glibtop_get_proc_io: Get the io stats for the given pid + * @buf: Buffer where the result will be given + * @pid: Process id to get the io stats for + * + * Get the io stats for a process + * + * Returns: A list of processor ID of 'buf.number' elements. + */ +void +glibtop_get_proc_io(glibtop_proc_io *buf, pid_t pid) +{ + return glibtop_get_proc_io_l(glibtop_global_server, buf, pid); +} diff --git a/sysdeps/common/error.c b/sysdeps/common/error.c new file mode 100644 index 0000000..6ca947b --- /dev/null +++ b/sysdeps/common/error.c @@ -0,0 +1,223 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include +#include + +#include + +enum MESSAGE_LEVEL { + MESSAGE_DEBUG, + MESSAGE_WARNING, + MESSAGE_ERROR +}; + +#define DEFAULT_NAME "LibGTop-Server" + +/* Prints error message and exits. */ + +static void +print_message (const glibtop *server, int message_level, const char *format, int error, va_list args) +{ + const char *level; + GString* message; + + message = g_string_new(NULL); + + g_string_printf(message, "%s", (server && server->name ? server->name : DEFAULT_NAME)); + + if (server && server->pid) { + g_string_append_printf(message, "(c=%u/s=%u)", getpid(), server->pid); + } + else { + g_string_append_printf(message, "(c=%u)", getpid()); + } + + switch (message_level) { + case MESSAGE_DEBUG: + level = "DEBUG"; + break; + case MESSAGE_WARNING: + level = "WARNING"; + break; + case MESSAGE_ERROR: + level = "ERROR"; + break; + default: + level = "UNKNOWN"; + } + + g_string_append_printf(message, ": [%s] ", level); + + g_string_append_vprintf(message, format, args); + + if (error) { + g_string_append_printf(message, ": %s", g_strerror(error)); + } + + g_string_append_c(message, '\n'); + + fputs(message->str, stderr); + + g_string_free(message, TRUE); +} + +void +glibtop_error_vr (glibtop *server, const char *format, va_list args) +{ + print_message (server, MESSAGE_ERROR, format, 0, args); + +#ifdef LIBGTOP_ENABLE_DEBUG + abort (); +#else + exit (1); +#endif +} + +void +glibtop_error_io_vr (glibtop *server, const char *format, int error, va_list args) +{ + print_message (server, MESSAGE_ERROR, format, error, args); + +#ifdef LIBGTOP_ENABLE_DEBUG + abort (); +#else + exit (1); +#endif +} + +void +glibtop_warn_vr (glibtop *server, const char *format, va_list args) +{ + print_message (server, MESSAGE_WARNING, format, 0, args); + +#ifdef LIBGTOP_FATAL_WARNINGS + abort (); +#endif +} + +void +glibtop_warn_io_vr (glibtop *server, const char *format, int error, va_list args) +{ + print_message (server, MESSAGE_WARNING, format, error, args); + +#ifdef LIBGTOP_FATAL_WARNINGS + abort (); +#endif +} + + +void +glibtop_error_r (glibtop *server, const char *format, ...) +{ + va_list args; + + va_start (args, format); + glibtop_error_vr (server, format, args); + va_end (args); +} + + +void +glibtop_warn_r (glibtop *server, const char *format, ...) +{ + va_list args; + + va_start (args, format); + glibtop_warn_vr (server, format, args); + va_end (args); +} + +void +glibtop_error_io_r (glibtop *server, const char *format, ...) +{ + va_list args; + + va_start (args, format); + glibtop_error_io_vr (server, format, errno, args); + va_end (args); +} + +void +glibtop_warn_io_r (glibtop *server, const char *format, ...) +{ + va_list args; + + va_start (args, format); + glibtop_warn_io_vr (server, format, errno, args); + va_end (args); +} + + +void +glibtop_debug_vr (glibtop *server, const char *format, va_list args) +{ + print_message (server, MESSAGE_DEBUG, format, 0, args); +} + +void +glibtop_debug_r_real (glibtop *server, const char *format, ...) +{ + va_list args; + + va_start (args, format); + glibtop_debug_vr (server, format, args); + va_end (args); +} + + +void +glibtop_error (const char *format, ...) +{ + va_list args; + va_start (args, format); + glibtop_error_vr (glibtop_global_server, format, args); + va_end (args); +} + +void +glibtop_warn (const char *format, ...) +{ + va_list args; + va_start (args, format); + glibtop_warn_vr (glibtop_global_server, format, args); + va_end (args); +} + +void +glibtop_error_io (const char *format, ...) +{ + va_list args; + va_start (args, format); + glibtop_error_io_vr (glibtop_global_server, format, errno, args); + va_end (args); +} + +void +glibtop_warn_io (const char *format, ...) +{ + va_list args; + va_start (args, format); + glibtop_warn_io_vr (glibtop_global_server, format, errno, args); + va_end (args); +} diff --git a/sysdeps/common/fsusage.c b/sysdeps/common/fsusage.c new file mode 100644 index 0000000..21e83f5 --- /dev/null +++ b/sysdeps/common/fsusage.c @@ -0,0 +1,335 @@ +/* fsusage.c -- return space usage of mounted filesystems + Copyright (C) 1991, 1992, 1996, 1998, 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 General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#include +#include + +#ifdef HAVE_LIMITS_H +# include +#endif +#ifndef CHAR_BIT +# define CHAR_BIT 8 +#endif + +#ifdef HAVE_SYS_PARAM_H +# include +#endif + +#ifdef HAVE_SYS_MOUNT_H +# include +#endif + +#ifdef HAVE_SYS_VFS_H +# include +#endif + +#ifdef HAVE_SYS_FS_S5PARAM_H /* Fujitsu UXP/V */ +# include +#endif + +#if defined HAVE_SYS_FILSYS_H && !defined _CRAY +# include /* SVR2 */ +#endif + +#ifdef HAVE_FCNTL_H +# include +#endif + +#ifdef HAVE_SYS_STATFS_H +# include +#endif + +#ifdef HAVE_DUSTAT_H /* AIX PS/2 */ +# include +#endif + +#ifdef HAVE_SYS_STATVFS_H /* SVR4 */ +# include +int statvfs (const char *path, struct statvfs *buf); +#endif + +/* Many space usage primitives use all 1 bits to denote a value that is + not applicable or unknown. Propagate this information by returning + a guint64 value that is all 1 bits if X is all 1 bits, even if X + is unsigned and narrower than guint64. */ +#define PROPAGATE_ALL_ONES(x) \ + ((sizeof (x) < sizeof (guint64) \ + && (~ (x) == (sizeof (x) < sizeof (int) \ + ? - (1 << (sizeof (x) * CHAR_BIT)) \ + : 0))) \ + ? G_MAXUINT64 : (x)) + +/* Extract the top bit of X as an guint64 value. */ +#define EXTRACT_TOP_BIT(x) ((x) \ + & ((guint64) 1 << (sizeof (x) * CHAR_BIT - 1))) + +/* If a value is negative, many space usage primitives store it into an + integer variable by assignment, even if the variable's type is unsigned. + So, if a space usage variable X's top bit is set, convert X to the + guint64 value V such that (- (guint64) V) is the negative of + the original value. If X's top bit is clear, just yield X. + Use PROPAGATE_TOP_BIT if the original value might be negative; + otherwise, use PROPAGATE_ALL_ONES. */ +#define PROPAGATE_TOP_BIT(x) ((x) | ~ (EXTRACT_TOP_BIT (x) - 1)) + +/* Fill in the fields of FSP with information about space usage for + the filesystem on which PATH resides. + DISK is the device on which PATH is mounted, for space-getting + methods that need to know it. + Return 0 if successful, -1 if not. When returning -1, ensure that + ERRNO is either a system error value, or zero if DISK is NULL + on a system that requires a non-NULL value. */ + + +static const unsigned long _glibtop_sysdeps_fsusage = +(1L << GLIBTOP_FSUSAGE_BLOCKS) + (1L << GLIBTOP_FSUSAGE_BFREE) ++ (1L << GLIBTOP_FSUSAGE_BAVAIL) + (1L << GLIBTOP_FSUSAGE_FILES) ++ (1L << GLIBTOP_FSUSAGE_FFREE) + (1L << GLIBTOP_FSUSAGE_BLOCK_SIZE); + + +/* + * _glibtop_get_fsusage_read_write + * New function to retrieve total read and write + * + * Each arch should have its own function() + * and the proper #define. This is more readable than one single + * function full of #something where everything is mixed. + * These functions are private. + * + * void _glibtop__get_fsusage_read_write(glibtop*server, + * glibtop_fsusage *buf, + * const char *path); + * + * TODO: split this file properly, is possible + */ + +#ifdef linux +void +_glibtop_linux_get_fsusage_read_write(glibtop *server, + glibtop_fsusage *buf, + const char *path); + +static inline void +_glibtop_get_fsusage_read_write(glibtop *server, + glibtop_fsusage *buf, + const char *path) +{ + _glibtop_linux_get_fsusage_read_write(server, buf, path); +} + + +#elif defined(__FreeBSD__) +void +_glibtop_freebsd_get_fsusage_read_write(glibtop *server, + glibtop_fsusage *buf, + const char *path); + +#define _glibtop_get_fsusage_read_write(S, B, P) \ + _glibtop_freebsd_get_fsusage_read_write(S, B, P) + +#elif defined(__OpenBSD__) +void +_glibtop_openbsd_get_fsusage_read_write(glibtop *server, + glibtop_fsusage *buf, + const char *path); + +#define _glibtop_get_fsusage_read_write(S, B, P) \ + _glibtop_openbsd_get_fsusage_read_write(S, B, P) + +#else /* default fallback */ +#warning glibtop_get_fsusage .read .write are not implemented. +static inline void +_glibtop_get_fsusage_read_write(glibtop *server, + glibtop_fsusage *buf, + const char *path) +{ + /* NOOP */ +} +#endif /* default fallback */ + +/* end _glibtop_get_fsusage_read_write */ + + + +void +glibtop_get_fsusage_s (glibtop *server, glibtop_fsusage *buf, + const char *path) +{ +#if defined STAT_STATFS3_OSF1 + struct statfs fsd; +#elif defined STAT_STATFS2_FS_DATA /* Ultrix */ + struct fs_data fsd; +#elif defined STAT_STATFS2_BSIZE /* 4.3BSD, SunOS 4, HP-UX, AIX */ + struct statfs fsd; +#elif defined STAT_STATVFS /* SVR4 */ + struct statvfs fsd; +#elif defined STAT_STATFS2_FSIZE /* 4.4BSD */ + struct statfs fsd; +#elif defined STAT_STATFS4 /* SVR3, Dynix, Irix, AIX */ + struct stafs fsd; +#endif + + glibtop_init_r (&server, 0, 0); + + memset (buf, 0, sizeof (glibtop_fsusage)); + +#ifdef STAT_STATFS3_OSF1 + + if (statfs (path, &fsd, sizeof (struct statfs)) != 0) + return; + + buf->block_size = PROPAGATE_ALL_ONES (fsd.f_fsize); + +#endif /* STAT_STATFS3_OSF1 */ + +#ifdef STAT_STATFS2_FS_DATA /* Ultrix */ + + if (statfs (path, &fsd) != 1) + return; + + buf->block_size = 1024; + buf->blocks = PROPAGATE_ALL_ONES (fsd.fd_req.btot); + buf->bfree = PROPAGATE_ALL_ONES (fsd.fd_req.bfree); + buf->bavail = PROPAGATE_TOP_BIT (fsd.fd_req.bfreen); + /* buf->bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.fd_req.bfreen) != 0; */ + buf->files = PROPAGATE_ALL_ONES (fsd.fd_req.gtot); + buf->ffree = PROPAGATE_ALL_ONES (fsd.fd_req.gfree); + +#endif /* STAT_STATFS2_FS_DATA */ + +#ifdef STAT_STATFS2_BSIZE /* 4.3BSD, SunOS 4, HP-UX, AIX */ + + if (statfs (path, &fsd) < 0) + return; + + buf->block_size = PROPAGATE_ALL_ONES (fsd.f_bsize); + +# ifdef STATFS_TRUNCATES_BLOCK_COUNTS + + /* In SunOS 4.1.2, 4.1.3, and 4.1.3_U1, the block counts in the + struct statfs are truncated to 2GB. These conditions detect that + truncation, presumably without botching the 4.1.1 case, in which + the values are not truncated. The correct counts are stored in + undocumented spare fields. */ + if (fsd.f_blocks == 0x7fffffff / fsd.f_bsize && fsd.f_spare[0] > 0) + { + fsd.f_blocks = fsd.f_spare[0]; + fsd.f_bfree = fsd.f_spare[1]; + fsd.f_bavail = fsd.f_spare[2]; + } +# endif /* STATFS_TRUNCATES_BLOCK_COUNTS */ + +#endif /* STAT_STATFS2_BSIZE */ + +#ifdef STAT_STATFS2_FSIZE /* 4.4BSD */ + + if (statfs (path, &fsd) < 0) + return; + + buf->block_size = PROPAGATE_ALL_ONES (fsd.f_fsize); + +#endif /* STAT_STATFS2_FSIZE */ + +#ifdef STAT_STATFS4 /* SVR3, Dynix, Irix, AIX */ + +# if !_AIX && !defined _SEQUENT_ && !defined DOLPHIN +# define f_bavail f_bfree +# endif + + if (statfs (path, &fsd, sizeof fsd, 0) < 0) + return; + + /* Empirically, the block counts on most SVR3 and SVR3-derived + systems seem to always be in terms of 512-byte blocks, + no matter what value f_bsize has. */ +# if _AIX || defined _CRAY + buf->block_size = PROPAGATE_ALL_ONES (fsd.f_bsize); +# else + buf->block_size = 512; +# endif + +#endif /* STAT_STATFS4 */ + +#ifdef STAT_STATVFS /* SVR4 */ + /* Linux, Solaris */ + + if (statvfs (path, &fsd) < 0) + return; + +#if (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)) \ + || defined(__FreeBSD__) || defined(__OpenBSD__) + /* Solaris but not SunOS and FreeBSD */ + buf->block_size = fsd.f_frsize; +#else + /* else, including Linux */ + buf->block_size = fsd.f_bsize; +#endif + +#endif /* STAT_STATVFS */ + +#if !defined STAT_STATFS2_FS_DATA && !defined STAT_READ_FILSYS + /* !Ultrix && !SVR2 */ + /* Linux */ + + buf->blocks = fsd.f_blocks; + buf->bfree = fsd.f_bfree; + buf->bavail = (fsd.f_bavail > fsd.f_bfree) ? 0 : fsd.f_bavail; + buf->files = fsd.f_files; + buf->ffree = fsd.f_ffree; + +#endif /* not STAT_STATFS2_FS_DATA && not STAT_READ_FILSYS */ + + buf->flags = _glibtop_sysdeps_fsusage; + + /* setting additional flags is delegated */ + _glibtop_get_fsusage_read_write(server, buf, path); +} + +#if defined _AIX && defined _I386 +/* AIX PS/2 does not supply statfs. */ + +static int +statfs (const char *path, struct statfs *fsb) +{ + struct stat stats; + struct dustat fsd; + + if (stat (path, &stats)) + return -1; + if (dustat (stats.st_dev, 0, &fsd, sizeof (fsd))) + return -1; + fsb->f_type = 0; + fsb->f_bsize = fsd.du_bsize; + fsb->f_blocks = fsd.du_fsize - fsd.du_isize; + fsb->f_bfree = fsd.du_tfree; + fsb->f_bavail = fsd.du_tfree; + fsb->f_files = (fsd.du_isize - 2) * fsd.du_inopb; + fsb->f_ffree = fsd.du_tinode; + fsb->f_fsid.val[0] = fsd.du_site; + fsb->f_fsid.val[1] = fsd.du_pckno; + return 0; +} + +#endif /* _AIX && _I386 */ diff --git a/sysdeps/common/gnuslib.c b/sysdeps/common/gnuslib.c new file mode 100644 index 0000000..7929548 --- /dev/null +++ b/sysdeps/common/gnuslib.c @@ -0,0 +1,373 @@ +/* -*-C-*- + * Common library code for the GNU Emacs server and client. + * + * This file is part of GNU Emacs. + * + * Copying is permitted under those conditions described by the GNU + * General Public License. + * + * Copyright (C) 1989 Free Software Foundation, Inc. + * + * Author: Andy Norman (ange@hplb.hpl.hp.com), based on + * 'etc/server.c' and 'etc/emacsclient.c' from the 18.52 GNU + * Emacs distribution. + * + * Please mail bugs and suggestions to the author at the above address. + */ + +/* HISTORY + * 11-Nov-1990 bristor@simba + * Added EOT stuff. + */ + +/* + * This file incorporates new features added by Bob Weiner , + * Darrell Kindred and Arup Mukherjee . + * Please see the note at the end of the README file for details. + * + * (If gnuserv came bundled with your emacs, the README file is probably + * ../etc/gnuserv.README relative to the directory containing this file) + */ + +#include +#include +#include +#include + +#include + +#ifdef UNIX_DOMAIN_SOCKETS +static int connect_to_unix_server (void); +#endif + +#ifdef INTERNET_DOMAIN_SOCKETS +static int connect_to_internet_server (const char *serverhost, u_short port); +#endif + +/* On some systems, e.g. DGUX, inet_addr returns a 'struct in_addr'. */ +#ifdef HAVE_BROKEN_INET_ADDR +#define IN_ADDR struct in_addr +#define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == 0xffffffff) +#else +#if (LONGBITS > 32) +#define IN_ADDR unsigned int +#else +#define IN_ADDR unsigned long +#endif +#define NUMERIC_ADDR_ERROR (numeric_addr == (IN_ADDR) 0xffffffff) +#endif + +#include + +int +glibtop_make_connection (const char *hostarg, int portarg, int *s) +{ +#ifdef INTERNET_DOMAIN_SOCKETS + char *ptr; + + if (hostarg == NULL) + hostarg = getenv ("LIBGTOP_HOST"); + if (portarg == 0 && (ptr = getenv ("LIBGTOP_PORT")) != NULL) + portarg = atoi (ptr); +#endif + + if (hostarg != NULL) { + /* hostname was given explicitly, via cmd line arg or + * LIBGTOP_HOST, * so obey it. */ +#ifdef UNIX_DOMAIN_SOCKETS + if (!strcmp (hostarg, "unix")) { + *s = connect_to_unix_server (); + return (int) CONN_UNIX; + } +#endif /* UNIX_DOMAIN_SOCKETS */ +#ifdef INTERNET_DOMAIN_SOCKETS + *s = connect_to_internet_server (hostarg, portarg); + return (int) CONN_INTERNET; +#endif + } else { + /* no hostname given. Use unix-domain/sysv-ipc, or * + * internet-domain connection to local host if they're not + * available. */ +#if defined(UNIX_DOMAIN_SOCKETS) + *s = connect_to_unix_server (); + return (int) CONN_UNIX; +#elif defined(INTERNET_DOMAIN_SOCKETS) + { + char localhost[HOSTNAMSZ]; + + gethostname (localhost, HOSTNAMSZ); /* use this + * host by + * default */ + *s = connect_to_internet_server (localhost, portarg); + return (int) CONN_INTERNET; + } +#endif /* IPC type */ + } +} + +#if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS) +/* + * send_string -- send string to socket. + */ +#if 0 +static void +send_string (s, msg) + int s; + const char *msg; +{ +#if 0 + if (send (s, msg, strlen (msg), 0) < 0) { + perror (progname); + fprintf (stderr, "%s: unable to send\n", progname); + exit (1); + }; /* if */ +#else + int len, left = strlen (msg); + + while (left > 0) { + if ((len = write (s, msg, min2 (left, GSERV_BUFSZ))) < 0) { + /* XEmacs addition: robertl@arnet.com */ + if (errno == EPIPE) { + return; + } + perror (progname); + fprintf (stderr, "%s: unable to send\n", progname); + exit (1); + }; /* if */ + left -= len; + msg += len; + }; /* while */ +#endif +} /* send_string */ + +/* + * read_line -- read a \n terminated line from a socket + */ +static int +read_line (int s, char *dest) +{ + int length; + int offset = 0; + char buffer[GSERV_BUFSZ + 1]; + + while ((length = read (s, buffer + offset, 1) > 0) && buffer[offset] != '\n' + && buffer[offset] != EOT_CHR) { + offset += length; + if (offset >= GSERV_BUFSZ) + break; + } + buffer[offset] = '\0'; + strcpy (dest, buffer); + return 1; +} /* read_line */ +#endif +#endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */ + + +#ifdef UNIX_DOMAIN_SOCKETS +/* + * connect_to_unix_server -- establish connection with server process via a unix- + * domain socket. Returns socket descriptor for server + * if successful. + */ +static int +connect_to_unix_server (void) +{ + int s; /* connected socket descriptor */ + struct sockaddr_un server; /* for unix connections */ + + if ((s = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) + glibtop_error_io ("unable to create socket"); + + server.sun_family = AF_UNIX; +#ifdef HIDE_UNIX_SOCKET + sprintf (server.sun_path, "/tmp/lgtddir%d/lgtd", (int) geteuid ()); +#else /* HIDE_UNIX_SOCKET */ + sprintf (server.sun_path, "/tmp/lgtd%d", (int) geteuid ()); +#endif /* HIDE_UNIX_SOCKET */ + if (connect (s, (struct sockaddr *)&server, strlen (server.sun_path) + 2) < 0) + glibtop_error_io ("unable to connect to local"); + + return (s); + +} /* connect_to_unix_server */ +#endif /* UNIX_DOMAIN_SOCKETS */ + + +#ifdef INTERNET_DOMAIN_SOCKETS +/* + * internet_addr -- return the internet addr of the hostname or + * internet address passed. Return -1 on error. + */ +long +glibtop_internet_addr (const char *host) +{ + struct hostent *hp; /* pointer to host info for remote host */ + IN_ADDR numeric_addr; /* host address */ + + numeric_addr = inet_addr (host); + if (!NUMERIC_ADDR_ERROR) + return numeric_addr; + else if ((hp = gethostbyname (host)) != NULL) + return ((struct in_addr *) (hp->h_addr))->s_addr; + else { + glibtop_warn_io ("gethostbyname (%s)", host); + return -1; + } + +} /* glibtop_internet_addr */ + +#ifdef AUTH_MAGIC_COOKIE +#include +#include + +static Xauth *server_xauth = NULL; + +#endif + +/* + * connect_to_internet_server -- establish connection with server process via + * an internet domain socket. Returns socket + * descriptor for server if successful. + */ +static int +connect_to_internet_server (const char *serverhost, u_short port) +{ + int s; /* connected socket descriptor */ + struct servent *sp; /* pointer to service information */ + struct sockaddr_in peeraddr_in; /* for peer socket address */ + char buf[512]; /* temporary buffer */ + + /* clear out address structures */ + memset (&peeraddr_in, 0, sizeof (struct sockaddr_in)); + + /* Set up the peer address to which we will connect. */ + peeraddr_in.sin_family = AF_INET; + + /* look up the server host's internet address */ + peeraddr_in.sin_addr.s_addr = glibtop_internet_addr (serverhost); + if ((long) peeraddr_in.sin_addr.s_addr == -1) + glibtop_error ("unable to find %s in /etc/hosts or from YP", serverhost); + + if (port == 0) { + if ((sp = getservbyname ("gtopd", "tcp")) == NULL) + peeraddr_in.sin_port = htons (DEFAULT_PORT + getuid ()); + else + peeraddr_in.sin_port = sp->s_port; + } + /* if */ + else + peeraddr_in.sin_port = htons (port); + + /* Create the socket. */ + if ((s = socket (AF_INET, SOCK_STREAM, 0)) == -1) + glibtop_error_io ("unable to create socket"); + + /* Try to connect to the remote server at the address * which was + * just built into peeraddr. */ + if (connect (s, (struct sockaddr *) &peeraddr_in, + sizeof (struct sockaddr_in)) == -1) + glibtop_error_io ("unable to connect to remote"); + +#ifdef AUTH_MAGIC_COOKIE + + /* send credentials using MIT-MAGIC-COOKIE-1 protocol */ + + sprintf (buf, "%d", port); + + server_xauth = + XauGetAuthByAddr (FamilyInternet, + sizeof (peeraddr_in.sin_addr.s_addr), + (char *) &peeraddr_in.sin_addr.s_addr, + strlen (buf), buf, + strlen (MCOOKIE_X_NAME), MCOOKIE_X_NAME); + + if (server_xauth && server_xauth->data) { + sprintf (buf, "%s\n%d\n", MCOOKIE_NAME, server_xauth->data_length); + write (s, buf, strlen (buf)); + write (s, server_xauth->data, server_xauth->data_length); + + return (s); + } +#endif /* AUTH_MAGIC_COOKIE */ + + sprintf (buf, "%s\n", DEFAUTH_NAME); + write (s, buf, strlen (buf)); + + return (s); + +} /* connect_to_internet_server */ +#endif /* INTERNET_DOMAIN_SOCKETS */ + + +#if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS) +/* + * disconnect_from_server -- inform the server that sending has finished, and wait for + * its reply. + */ +#if 0 +static void +disconnect_from_server (s, echo) + int s; + int echo; +{ +#if 0 + char buffer[REPLYSIZ + 1]; + +#else + char buffer[GSERV_BUFSZ + 1]; + +#endif + int add_newline = 1; + int length; + + send_string (s, EOT_STR); /* make sure server gets string */ + +#if !defined (linux) && !defined (_SCO_DS) + /* + * shutdown is completely hozed under linux. If s is a unix domain socket, + * you'll get EOPNOTSUPP back from it. If s is an internet socket, you get + * a broken pipe when you try to read a bit later. The latter + * problem is fixed for linux versions >= 1.1.46, but the problem + * with unix sockets persists. Sigh. + */ + + if (shutdown (s, 1) == -1) { + perror (progname); + fprintf (stderr, "%s: unable to shutdown socket\n", progname); + exit (1); + }; /* if */ +#endif + +#if 0 + while ((length = recv (s, buffer, REPLYSIZ, 0)) > 0) { + buffer[length] = '\0'; + if (echo) + fputs (buffer, stdout); + add_newline = (buffer[length - 1] != '\n'); + }; /* while */ +#else + while ((length = read (s, buffer, GSERV_BUFSZ)) > 0 || + (length == -1 && errno == EINTR)) { + if (length) { + buffer[length] = '\0'; + if (echo) { + fputs (buffer, stdout); + add_newline = (buffer[length - 1] != '\n'); + }; /* if */ + }; /* if */ + }; /* while */ +#endif + + if (echo && add_newline) + putchar ('\n'); + + if (length < 0) { + perror (progname); + fprintf (stderr, "%s: unable to read the reply from the server\n", progname); + exit (1); + }; /* if */ + +} /* disconnect_from_server */ +#endif +#endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */ diff --git a/sysdeps/common/mountlist.c b/sysdeps/common/mountlist.c new file mode 100644 index 0000000..54c1606 --- /dev/null +++ b/sysdeps/common/mountlist.c @@ -0,0 +1,623 @@ +/* mountlist.c -- return a list of mounted filesystems + Copyright (C) 1991, 1992 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) +#include +#else +#include +#endif + +#include +#include + +/* A mount table entry. */ +struct mount_entry +{ + char *me_devname; /* Device node pathname, including "/dev/". */ + char *me_mountdir; /* Mount point directory pathname. */ + char *me_type; /* "nfs", "4.2", etc. */ + dev_t me_dev; /* Device number of me_mountdir. */ + struct mount_entry *me_next; +}; + + +static struct mount_entry *read_filesystem_list (void); + +#ifdef HAVE_SYS_PARAM_H +#include +#endif + +#if defined (MOUNTED_GETFSSTAT) /* __alpha running OSF_1 */ +# include +# include +#endif /* MOUNTED_GETFSSTAT */ + +#ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */ +#include +#if !defined(MOUNTED) +# if defined(MNT_MNTTAB) /* HP-UX. */ +# define MOUNTED MNT_MNTTAB +# endif +# if defined(MNTTABNAME) /* Dynix. */ +# define MOUNTED MNTTABNAME +# endif +#endif +#endif + +#ifdef MOUNTED_GETMNTINFO /* 4.4BSD. */ +#include +#endif + +#ifdef MOUNTED_GETMNT /* Ultrix. */ +#include +#include +#endif + +#ifdef MOUNTED_FREAD /* SVR2. */ +#include +#endif + +#ifdef MOUNTED_FREAD_FSTYP /* SVR3. */ +#include +#include +#include +#endif + +#ifdef MOUNTED_LISTMNTENT +#include +#endif + +#ifdef MOUNTED_GETMNTENT2 /* SVR4. */ +#include +#endif + +#ifdef MOUNTED_VMOUNT /* AIX. */ +#include +#include +#endif + +#ifdef DOLPHIN +/* So special that it's not worth putting this in autoconf. */ +#undef MOUNTED_FREAD_FSTYP +#define MOUNTED_GETMNTTBL +#endif + + +#if defined (MOUNTED_GETMNTINFO) && !defined (__NetBSD__) && !defined (__OpenBSD__) && !defined(__FreeBSD__) +static const char * +fstype_to_string (short t) +{ + switch (t) + { +#ifdef MOUNT_PC + case MOUNT_PC: + return "pc"; +#endif +#ifdef MOUNT_MFS + case MOUNT_MFS: + return "mfs"; +#endif +#ifdef MOUNT_LO + case MOUNT_LO: + return "lo"; +#endif +#ifdef MOUNT_TFS + case MOUNT_TFS: + return "tfs"; +#endif +#ifdef MOUNT_TMP + case MOUNT_TMP: + return "tmp"; +#endif +#ifdef MOUNT_UFS + case MOUNT_UFS: + return "ufs" ; +#endif +#ifdef MOUNT_NFS + case MOUNT_NFS: + return "nfs" ; +#endif +#ifdef MOUNT_MSDOS + case MOUNT_MSDOS: + return "msdos" ; +#endif +#ifdef MOUNT_LFS + case MOUNT_LFS: + return "lfs" ; +#endif +#ifdef MOUNT_LOFS + case MOUNT_LOFS: + return "lofs" ; +#endif +#ifdef MOUNT_FDESC + case MOUNT_FDESC: + return "fdesc" ; +#endif +#ifdef MOUNT_PORTAL + case MOUNT_PORTAL: + return "portal" ; +#endif +#ifdef MOUNT_NULL + case MOUNT_NULL: + return "null" ; +#endif +#ifdef MOUNT_UMAP + case MOUNT_UMAP: + return "umap" ; +#endif +#ifdef MOUNT_KERNFS + case MOUNT_KERNFS: + return "kernfs" ; +#endif +#ifdef MOUNT_PROCFS + case MOUNT_PROCFS: + return "procfs" ; +#endif +#ifdef MOUNT_AFS + case MOUNT_AFS: + return "afs" ; +#endif +#ifdef MOUNT_CD9660 + case MOUNT_CD9660: + return "cd9660" ; +#endif +#ifdef MOUNT_UNION + case MOUNT_UNION: + return "union" ; +#endif +#ifdef MOUNT_DEVFS + case MOUNT_DEVFS: + return "devfs" ; +#endif +#ifdef MOUNT_EXT2FS + case MOUNT_EXT2FS: + return "ext2fs" ; +#endif + default: + return "?"; + } +} +#endif /* MOUNTED_GETMNTINFO */ + +#ifdef MOUNTED_VMOUNT /* AIX. */ +static const char * +fstype_to_string (int t) +{ + struct vfs_ent *e; + + e = getvfsbytype (t); + if (!e || !e->vfsent_name) + return "none"; + else + return e->vfsent_name; +} +#endif /* MOUNTED_VMOUNT */ + +/* Return a list of the currently mounted filesystems, or NULL on error. + Add each entry to the tail of the list so that they stay in order. +*/ + +static struct mount_entry * +read_filesystem_list (void) +{ + struct mount_entry *mount_list; + struct mount_entry *me; + struct mount_entry *mtail; + + /* Start the list off with a dummy entry. */ + me = g_new (struct mount_entry, 1); + me->me_next = NULL; + mount_list = mtail = me; + +#ifdef MOUNTED_LISTMNTENT + { + struct tabmntent *mntlist, *p; + struct mntent *mnt; + struct mount_entry *me; + + /* the third and fourth arguments could be used to filter mounts, + but Crays doesn't seem to have any mounts that we want to + remove. Specifically, automount create normal NFS mounts. + */ + + if(listmntent(&mntlist, KMTAB, NULL, NULL) < 0) + return NULL; + p = mntlist; + while(p){ + mnt = p->ment; + me = (struct mount_entry*) g_malloc(sizeof (struct mount_entry)); + me->me_devname = g_strdup(mnt->mnt_fsname); + me->me_mountdir = g_strdup(mnt->mnt_dir); + me->me_type = g_strdup(mnt->mnt_type); + me->me_dev = -1; + me->me_next = NULL; + mtail->me_next = me; + mtail = me; + p = p->next; + } + freemntlist(mntlist); + } +#endif + +#ifdef MOUNTED_GETMNTENT1 /* Linux, 4.3BSD, SunOS, HP-UX, Dynix, Irix. */ + { + const struct mntent *mnt; + FILE *fp; + const char *devopt; + + fp = setmntent (MOUNTED, "r"); + if (fp == NULL) + return NULL; + + while ((mnt = getmntent (fp))) + { + me = g_new(struct mount_entry, 1); + me->me_devname = g_strdup (mnt->mnt_fsname); + me->me_mountdir = g_strdup (mnt->mnt_dir); + me->me_type = g_strdup (mnt->mnt_type); + devopt = strstr (mnt->mnt_opts, "dev="); + if (devopt) + me->me_dev = (dev_t) strtoull( devopt + 4, NULL, 0); + else + me->me_dev = (dev_t) -1; /* Magic; means not known yet. */ + + me->me_next = NULL; + + /* Add to the linked list. */ + mtail->me_next = me; + mtail = me; + } + + if (endmntent (fp) == 0) + return NULL; + } +#endif /* MOUNTED_GETMNTENT1. */ + +#ifdef MOUNTED_GETMNTINFO /* 4.4BSD. */ + { + struct statfs *fsp; + int entries; + + entries = getmntinfo (&fsp, MNT_NOWAIT); + if (entries < 0) + return NULL; + while (entries-- > 0) + { + me = (struct mount_entry *) g_malloc (sizeof (struct mount_entry)); + me->me_devname = g_strdup (fsp->f_mntfromname); + me->me_mountdir = g_strdup (fsp->f_mntonname); +#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) + me->me_type = g_strdup (fsp->f_fstypename); +#else + me->me_type = g_strdup (fstype_to_string (fsp->f_type)); +#endif + me->me_dev = (dev_t) -1; /* Magic; means not known yet. */ + me->me_next = NULL; + + /* Add to the linked list. */ + mtail->me_next = me; + mtail = me; + fsp++; + } + } +#endif /* MOUNTED_GETMNTINFO */ + +#ifdef MOUNTED_GETMNT /* Ultrix. */ + { + int offset = 0; + int val; + struct fs_data fsd; + + while ((val = getmnt (&offset, &fsd, sizeof (fsd), NOSTAT_MANY, + (char *) 0)) > 0) + { + me = (struct mount_entry *) g_malloc (sizeof (struct mount_entry)); + me->me_devname = g_strdup (fsd.fd_req.devname); + me->me_mountdir = g_strdup (fsd.fd_req.path); + me->me_type = g_strdup (gt_names[fsd.fd_req.fstype]); + me->me_dev = fsd.fd_req.dev; + me->me_next = NULL; + + /* Add to the linked list. */ + mtail->me_next = me; + mtail = me; + } + if (val < 0) + return NULL; + } +#endif /* MOUNTED_GETMNT. */ + +#if defined (MOUNTED_GETFSSTAT) /* __alpha running OSF_1 */ + { + int numsys, counter, bufsize; + struct statfs *stats; + + numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); + if (numsys < 0) + return (NULL); + + bufsize = (1 + numsys) * sizeof (struct statfs); + stats = (struct statfs *) g_malloc (bufsize); + numsys = getfsstat (stats, bufsize, MNT_WAIT); + + if (numsys < 0) + { + g_free (stats); + return (NULL); + } + + for (counter = 0; counter < numsys; counter++) + { + me = (struct mount_entry *) g_malloc (sizeof (struct mount_entry)); + me->me_devname = g_strdup (stats[counter].f_mntfromname); + me->me_mountdir = g_strdup (stats[counter].f_mntonname); + me->me_type = g_strdup (mnt_names[stats[counter].f_type]); + me->me_dev = (dev_t) -1; /* Magic; means not known yet. */ + me->me_next = NULL; + + /* Add to the linked list. */ + mtail->me_next = me; + mtail = me; + } + + g_free (stats); + } +#endif /* MOUNTED_GETFSSTAT */ + +#if defined (MOUNTED_FREAD) || defined (MOUNTED_FREAD_FSTYP) /* SVR[23]. */ + { + struct mnttab mnt; + FILE *fp; + fp = fopen ("/etc/mnttab", "r"); + if (fp == NULL) + return NULL; + + while (fread (&mnt, sizeof mnt, 1, fp) > 0) + { + me = (struct mount_entry *) g_malloc (sizeof (struct mount_entry)); +#ifdef GETFSTYP /* SVR3. */ + me->me_devname = g_strdup (mnt.mt_dev); +#else + me->me_devname = g_strdup_printf("/dev/%s", mnt.mt_dev); +#endif + me->me_mountdir = g_strdup (mnt.mt_filsys); + me->me_dev = (dev_t) -1; /* Magic; means not known yet. */ + +#ifdef GETFSTYP /* SVR3. */ + { + struct statfs fsd; + char typebuf[FSTYPSZ]; + + if (statfs (me->me_mountdir, &fsd, sizeof fsd, 0) != -1 + && sysfs (GETFSTYP, fsd.f_fstyp, typebuf) != -1) + me->me_type = g_strdup (typebuf); + } +#else + me->me_type = g_strdup (""); +#endif + + me->me_next = NULL; + + /* Add to the linked list. */ + mtail->me_next = me; + mtail = me; + } + + if (fclose (fp) == EOF) + return NULL; + } +#endif /* MOUNTED_FREAD || MOUNTED_FREAD_FSTYP. */ + +#ifdef MOUNTED_GETMNTTBL /* DolphinOS goes it's own way */ + { + struct mntent **mnttbl=getmnttbl(),**ent; + for (ent=mnttbl;*ent;ent++) + { + me = (struct mount_entry *) g_malloc (sizeof (struct mount_entry)); + me->me_devname = g_strdup ( (*ent)->mt_resource); + me->me_mountdir = g_strdup( (*ent)->mt_directory); + me->me_type = g_strdup ((*ent)->mt_fstype); + me->me_dev = (dev_t) -1; /* Magic; means not known yet. */ + me->me_next = NULL; + + /* Add to the linked list. */ + mtail->me_next = me; + mtail = me; + } + endmnttbl(); + } +#endif + +#ifdef MOUNTED_GETMNTENT2 /* SVR4. */ + { + struct mnttab mnt; + FILE *fp; + int ret; + + fp = fopen (MNTTAB, "r"); + if (fp == NULL) + return NULL; + + while ((ret = getmntent (fp, &mnt)) == 0) + { + me = (struct mount_entry *) g_malloc (sizeof (struct mount_entry)); + me->me_devname = g_strdup (mnt.mnt_special); + me->me_mountdir = g_strdup (mnt.mnt_mountp); + me->me_type = g_strdup (mnt.mnt_fstype); + me->me_dev = (dev_t) -1; /* Magic; means not known yet. */ + me->me_next = NULL; + + /* Add to the linked list. */ + mtail->me_next = me; + mtail = me; + } + + if (fclose (fp) == EOF) + return NULL; + if (ret > 0) + return NULL; + } +#endif /* MOUNTED_GETMNTENT2. */ + +#ifdef MOUNTED_VMOUNT /* AIX. */ + { + int bufsize; + char *entries, *thisent; + struct vmount *vmp; + + /* Ask how many bytes to allocate for the mounted filesystem info. */ + mntctl (MCTL_QUERY, sizeof bufsize, (struct vmount *) &bufsize); + entries = g_malloc (bufsize); + + /* Get the list of mounted filesystems. */ + mntctl (MCTL_QUERY, bufsize, (struct vmount *) entries); + + for (thisent = entries; thisent < entries + bufsize; + thisent += vmp->vmt_length) + { + vmp = (struct vmount *) thisent; + me = (struct mount_entry *) g_malloc (sizeof (struct mount_entry)); + if (vmp->vmt_flags & MNT_REMOTE) + { + /* Prepend the remote pathname. */ + me->me_devname = \ + g_strdup_printf("%s:%s", + thisent + vmp->vmt_data[VMT_HOSTNAME].vmt_off + thisent + vmp->vmt_data[VMT_OBJECT ].vmt_off); + } + else + { + me->me_devname = g_strdup (thisent + + vmp->vmt_data[VMT_OBJECT].vmt_off); + } + me->me_mountdir = g_strdup (thisent + vmp->vmt_data[VMT_STUB].vmt_off); + me->me_type = g_strdup (fstype_to_string (vmp->vmt_gfstype)); + me->me_dev = (dev_t) -1; /* vmt_fsid might be the info we want. */ + me->me_next = NULL; + + /* Add to the linked list. */ + mtail->me_next = me; + mtail = me; + } + g_free (entries); + } +#endif /* MOUNTED_VMOUNT. */ + + /* Free the dummy head. */ + me = mount_list; + mount_list = mount_list->me_next; + g_free (me); + return mount_list; +} + + +static gboolean ignore_mount_entry(const struct mount_entry *me) +{ + /* keep sorted */ + static const char ignored[][12] = { + "autofs", + "binfmt_misc", + "ctfs", + "devfs", + "devpts", + "fusectl", + "linprocfs", + "mfs", + "mntfs", + "mqueue", + "none", + "nsfd", + "objfs", + "openpromfs", + "proc", + "procfs", + "rpc_pipefs", + "securityfs", + "supermount", + "sysfs", + "tmpfs", + "unknown", + "usbdevfs", + "usbfs" + }; + + typedef int (*Comparator)(const void*, const void*); + + return bsearch(me->me_type, + ignored, G_N_ELEMENTS(ignored), sizeof ignored[0], + (Comparator) strcmp) != NULL; +} + + +glibtop_mountentry * +glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf, int all_fs) +{ + struct mount_entry *entries, *cur, *next; + + GArray *mount_array = g_array_new(FALSE, FALSE, + sizeof(glibtop_mountentry)); + + glibtop_init_r (&server, 0, 0); + + memset (buf, 0, sizeof (glibtop_mountlist)); + + /* Read filesystem list. */ + + if((entries = read_filesystem_list ()) == NULL) + return NULL; + + for (cur = &entries[0]; cur != NULL; cur = next) { + + if(all_fs || !ignore_mount_entry(cur)) { + /* add a new glibtop_mountentry */ + glibtop_mountentry e; + + g_strlcpy(e.devname, cur->me_devname, sizeof e.devname); + g_strlcpy(e.mountdir, cur->me_mountdir, sizeof e.mountdir); + g_strlcpy(e.type, cur->me_type, sizeof e.type); + e.dev = cur->me_dev; + + g_array_append_val(mount_array, e); + } + + /* free current mount_entry and move to the next */ + next = cur->me_next; + g_free(cur->me_devname); + g_free(cur->me_mountdir); + g_free(cur->me_type); + g_free(cur); + } + + buf->size = sizeof (glibtop_mountentry); + buf->number = mount_array->len; + buf->total = buf->number * buf->size; + + buf->flags = (1 << GLIBTOP_MOUNTLIST_SIZE) + | (1 << GLIBTOP_MOUNTLIST_NUMBER) + | (1 << GLIBTOP_MOUNTLIST_TOTAL); + + return (glibtop_mountentry*) g_array_free(mount_array, FALSE); +} diff --git a/sysdeps/common/procargs.c b/sysdeps/common/procargs.c new file mode 100644 index 0000000..cefdb58 --- /dev/null +++ b/sysdeps/common/procargs.c @@ -0,0 +1,44 @@ +#include +#include + +#include +#include + +/* + Splitting args0 + * args0 [......0.. ....0.........0] + * Returned value must be free with g_strfreev + * args0 is g_free()d + */ +static char ** +split_args0(const char * const args0, size_t size) +{ + GPtrArray *argv = g_ptr_array_new(); + const char *arg; + + /* remember that if there were no args, args0 == NULL and size == 0 */ + for (arg = args0; arg < (args0 + size); arg += strlen(arg) + 1) { + g_ptr_array_add(argv, g_strdup(arg)); + } + + g_ptr_array_add(argv, NULL); + + g_free((void* /* remove constness */) args0); + + return (char**) g_ptr_array_free(argv, FALSE); +} + + + + +/* + * public functions + */ + +char ** +glibtop_get_proc_argv_l (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len) +{ + const char * const args0 = glibtop_get_proc_args_l(server, buf, pid, max_len); + return split_args0(args0, buf->size); +} diff --git a/sysdeps/common/sysdeps_suid.c b/sysdeps/common/sysdeps_suid.c new file mode 100644 index 0000000..2495317 --- /dev/null +++ b/sysdeps/common/sysdeps_suid.c @@ -0,0 +1,98 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include + +const _glibtop_init_func_t _glibtop_init_hook_p [] = { +#if GLIBTOP_SUID_CPU + _glibtop_init_cpu_p, +#endif +#if GLIBTOP_SUID_MEM + _glibtop_init_mem_p, +#endif +#if GLIBTOP_SUID_SWAP + _glibtop_init_swap_p, +#endif +#if GLIBTOP_SUID_UPTIME + _glibtop_init_uptime_p, +#endif +#if GLIBTOP_SUID_LOADAVG + _glibtop_init_loadavg_p, +#endif +#if GLIBTOP_SUID_SHM_LIMITS + _glibtop_init_shm_limits_p, +#endif +#if GLIBTOP_SUID_MSG_LIMITS + _glibtop_init_msg_limits_p, +#endif +#if GLIBTOP_SUID_SEM_LIMITS + _glibtop_init_sem_limits_p, +#endif +#if GLIBTOP_SUID_PROCLIST + _glibtop_init_proclist_p, +#endif +#if GLIBTOP_SUID_PROC_STATE + _glibtop_init_proc_state_p, +#endif +#if GLIBTOP_SUID_PROC_UID + _glibtop_init_proc_uid_p, +#endif +#if GLIBTOP_SUID_PROC_MEM + _glibtop_init_proc_mem_p, +#endif +#if GLIBTOP_SUID_PROC_TIME + _glibtop_init_proc_time_p, +#endif +#if GLIBTOP_SUID_PROC_SIGNAL + _glibtop_init_proc_signal_p, +#endif +#if GLIBTOP_SUID_PROC_KERNEL + _glibtop_init_proc_kernel_p, +#endif +#if GLIBTOP_SUID_PROC_SEGMENT + _glibtop_init_proc_segment_p, +#endif +#if GLIBTOP_SUID_PROC_ARGS + _glibtop_init_proc_args_p, +#endif +#if GLIBTOP_SUID_PROC_MAP + _glibtop_init_proc_map_p, +#endif +#if GLIBTOP_SUID_NETLOAD + _glibtop_init_netload_p, +#endif +#if GLIBTOP_SUID_NETLIST + _glibtop_init_netlist_p, +#endif +#if GLIBTOP_SUID_PPP + _glibtop_init_ppp_p, +#endif +#if GLIBTOP_SUID_PROC_IO + _glibtop_init_proc_io_p, +#endif + NULL +}; + diff --git a/sysdeps/cygwin/Makefile.am b/sysdeps/cygwin/Makefile.am new file mode 100644 index 0000000..e3c9f78 --- /dev/null +++ b/sysdeps/cygwin/Makefile.am @@ -0,0 +1,18 @@ +AM_CPPFLAGS = @AM_CPPFLAGS@ + +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la + +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ + uptime.c loadavg.c mountlist.c shm_limits.c msg_limits.c \ + sem_limits.c proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c prockernel.c \ + procsegment.c procargs.c procmap.c siglist.c \ + sysinfo.c netload.c ppp.c glibtop_private.c \ + netlist.c procaffinity.c procopenfiles.c procwd.c + +libgtop_sysdeps_2_0_la_LIBADD = @GLIB_LIBS@ + +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h +libgtopincludedir = $(includedir)/libgtop-2.0 + +noinst_HEADERS = glibtop_private.h diff --git a/sysdeps/cygwin/Makefile.in b/sysdeps/cygwin/Makefile.in new file mode 100644 index 0000000..3305730 --- /dev/null +++ b/sysdeps/cygwin/Makefile.in @@ -0,0 +1,762 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = sysdeps/cygwin +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libgtopinclude_HEADERS) \ + $(noinst_HEADERS) $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libgtop_sysdeps_2_0_la_DEPENDENCIES = +am_libgtop_sysdeps_2_0_la_OBJECTS = open.lo close.lo cpu.lo mem.lo \ + swap.lo uptime.lo loadavg.lo mountlist.lo shm_limits.lo \ + msg_limits.lo sem_limits.lo proclist.lo procstate.lo \ + procuid.lo proctime.lo procmem.lo procsignal.lo prockernel.lo \ + procsegment.lo procargs.lo procmap.lo siglist.lo sysinfo.lo \ + netload.lo ppp.lo glibtop_private.lo netlist.lo \ + procaffinity.lo procopenfiles.lo procwd.lo +libgtop_sysdeps_2_0_la_OBJECTS = $(am_libgtop_sysdeps_2_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) +DIST_SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libgtopincludedir)" +HEADERS = $(libgtopinclude_HEADERS) $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ + uptime.c loadavg.c mountlist.c shm_limits.c msg_limits.c \ + sem_limits.c proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c prockernel.c \ + procsegment.c procargs.c procmap.c siglist.c \ + sysinfo.c netload.c ppp.c glibtop_private.c \ + netlist.c procaffinity.c procopenfiles.c procwd.c + +libgtop_sysdeps_2_0_la_LIBADD = @GLIB_LIBS@ +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h +libgtopincludedir = $(includedir)/libgtop-2.0 +noinst_HEADERS = glibtop_private.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sysdeps/cygwin/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu sysdeps/cygwin/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgtop_sysdeps-2.0.la: $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glibtop_private.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mountlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netload.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procaffinity.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prockernel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procopenfiles.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsegment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsignal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procstate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procwd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siglist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-libgtopincludeHEADERS: $(libgtopinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgtopincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgtopincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgtopincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgtopincludedir)" || exit $$?; \ + done + +uninstall-libgtopincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgtopincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libgtopincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libgtopincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libgtopincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libgtopincludeHEADERS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libgtopincludeHEADERS + +.PRECIOUS: Makefile + + +# 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: diff --git a/sysdeps/cygwin/close.c b/sysdeps/cygwin/close.c new file mode 100644 index 0000000..bee09f3 --- /dev/null +++ b/sysdeps/cygwin/close.c @@ -0,0 +1,29 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +/* Closes pipe to gtop server. */ + +void +glibtop_close_s (glibtop *server) +{ } diff --git a/sysdeps/cygwin/cpu.c b/sysdeps/cygwin/cpu.c new file mode 100644 index 0000000..cbdcc55 --- /dev/null +++ b/sysdeps/cygwin/cpu.c @@ -0,0 +1,103 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_cpu = +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + +(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) + +(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY); + +static const unsigned long _glibtop_sysdeps_cpu_smp = +(1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) + +(1L << GLIBTOP_XCPU_NICE) + (1L << GLIBTOP_XCPU_SYS) + +(1L << GLIBTOP_XCPU_IDLE); + +/* Init function. */ + +void +_glibtop_init_cpu_s (glibtop *server) +{ + server->sysdeps.cpu = _glibtop_sysdeps_cpu; + + if (server->ncpu) + server->sysdeps.cpu |= _glibtop_sysdeps_cpu_smp; +} + +/* Provides information about cpu usage. */ + +#define FILENAME "/proc/stat" + +void +glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf) +{ + char buffer [BUFSIZ], *p; + int i; + + memset (buf, 0, sizeof (glibtop_cpu)); + + file_to_buffer(server, buffer, sizeof buffer, FILENAME); + + /* + * GLOBAL + */ + + p = skip_token (buffer); /* "cpu" */ + + buf->user = strtoull (p, &p, 0); + buf->nice = strtoull (p, &p, 0); + buf->sys = strtoull (p, &p, 0); + buf->idle = strtoull (p, &p, 0); + buf->total = buf->user + buf->nice + buf->sys + buf->idle; + + buf->frequency = 100; + buf->flags = _glibtop_sysdeps_cpu; + + /* + * PER CPU + */ + + for (i = 0; i <= server->ncpu; i++) { + + p = skip_line(p); /* move to ^ */ + + if (!check_cpu_line_warn(server, p, i)) + break; + + p = skip_token(p); /* "cpuN" */ + + buf->xcpu_user [i] = strtoull (p, &p, 0); + buf->xcpu_nice [i] = strtoull (p, &p, 0); + buf->xcpu_sys [i] = strtoull (p, &p, 0); + buf->xcpu_idle [i] = strtoull (p, &p, 0); + buf->xcpu_total[i] = buf->xcpu_user [i] \ + + buf->xcpu_nice [i] \ + + buf->xcpu_sys [i] \ + + buf->xcpu_idle [i]; + } + + if(server->ncpu) /* ok, that's a real SMP */ + buf->flags |= _glibtop_sysdeps_cpu_smp; +} diff --git a/sysdeps/cygwin/glibtop_machine.h b/sysdeps/cygwin/glibtop_machine.h new file mode 100644 index 0000000..5f2ca00 --- /dev/null +++ b/sysdeps/cygwin/glibtop_machine.h @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_MACHINE_H__ +#define __GLIBTOP_MACHINE_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +struct _glibtop_machine +{ + pid_t last_pid; + int no_update; + int fd_stat, fd_meminfo, fd_loadavg; + char proc_stat [BUFSIZ], proc_statm [BUFSIZ]; + char proc_status [BUFSIZ]; +}; + +G_END_DECLS + +#endif diff --git a/sysdeps/cygwin/glibtop_private.c b/sysdeps/cygwin/glibtop_private.c new file mode 100644 index 0000000..c7112c3 --- /dev/null +++ b/sysdeps/cygwin/glibtop_private.c @@ -0,0 +1,221 @@ +#include +#include +#include + +#include "glibtop_private.h" + +#include + +#include +#include +#include + +#include +#include + + +unsigned long long +get_scaled(const char *buffer, const char *key) +{ + const char *ptr = buffer; + char *next; + unsigned long long value; + + if (key) { + if (G_LIKELY((ptr = strstr(buffer, key)))) + ptr += strlen(key); + else { + g_warning("Could not read key '%s' in buffer '%s'", + key, buffer); + return 0; + } + } + + value = strtoull(ptr, &next, 0); + + for ( ; *next; ++next) { + if (*next == 'k') { + value *= 1024; + break; + } else if (*next == 'M') { + value *= 1024 * 1024; + break; + } + } + + return value; +} + + +char * +skip_token (const char *p) +{ + p = next_token(p); + while (*p && !isspace(*p)) p++; + p = next_token(p); + return (char *)p; +} + + +/* + * Read functions + */ +enum TRY_FILE_TO_BUFFER +{ + TRY_FILE_TO_BUFFER_OK = 0, + TRY_FILE_TO_BUFFER_OPEN = -1, + TRY_FILE_TO_BUFFER_READ = -2 +}; + +/* + * Doesn't handle bufsiz == 0 + */ +int try_file_to_buffer(char *buffer, size_t bufsiz, const char *format, ...) +{ + char path[4096]; + int fd; + size_t len = 0; + ssize_t nread = 0; + va_list pa; + + if (G_UNLIKELY(bufsiz <= sizeof(char*))) + g_warning("Huhu, bufsiz of %lu looks bad", (gulong)bufsiz); + + va_start(pa, format); + + /* C99 also provides vsnprintf */ + g_vsnprintf(path, sizeof path, format, pa); + + va_end(pa); + + bufsiz--; /* reserve 1 for trailing NUL */ + buffer [0] = '\0'; + + if((fd = open (path, O_RDONLY)) < 0) + return TRY_FILE_TO_BUFFER_OPEN; + + while (len < bufsiz) { + nread = read (fd, buffer + len, bufsiz - len); + + if (G_UNLIKELY(nread < 0)) { + if (errno == EINTR) + continue; + else + break; + } + + len += nread; + + if (nread == 0) + break; + } + + close (fd); + + if (nread < 0) + return TRY_FILE_TO_BUFFER_READ; + + buffer [len] = '\0'; + + return TRY_FILE_TO_BUFFER_OK; +} + + +void +file_to_buffer(glibtop *server, char *buffer, size_t bufsiz, const char *filename) +{ + switch(try_file_to_buffer(buffer, bufsiz, "%s", filename)) + { + case TRY_FILE_TO_BUFFER_OPEN: + glibtop_error_io_r (server, "open (%s)", filename); + case TRY_FILE_TO_BUFFER_READ: + glibtop_error_io_r (server, "read (%s)", filename); + } +} + + + + +static unsigned long +read_boot_time(glibtop *server) +{ + char* line = NULL; + size_t size = 0; + FILE* stat; + unsigned long btime = 0; + + if (!(stat = fopen("/proc/stat", "r"))) { + glibtop_error_io_r(server, "fopen(\"/proc/stat\")"); + goto out; + } + + while (getline(&line, &size, stat) != -1) { + if (!strncmp(line, "btime", 5)) { + btime = strtoul(skip_token(line), NULL, 10); + break; + } + } + + free(line); + fclose(stat); +out: + return btime; +} + + + +unsigned long +get_boot_time(glibtop *server) +{ + static unsigned long boot_time = 0UL; + + if(G_UNLIKELY(!boot_time)) + { + boot_time = read_boot_time(server); + } + + return boot_time; +} + + +size_t +get_page_size(void) +{ + static size_t pagesize = 0; + + if(G_UNLIKELY(!pagesize)) + { + pagesize = getpagesize(); + } + + return pagesize; +} + + + +gboolean +check_cpu_line(glibtop *server, const char *line, unsigned i) +{ + char start[10]; + + g_snprintf(start, sizeof start, "cpu%u", i); + + return g_str_has_prefix(line, start); +} + + + +gboolean safe_readlink(const char *path, char *buf, size_t bufsiz) +{ + ssize_t ret; + + ret = readlink(path, buf, bufsiz - 1); + + if (ret == -1) { + g_warning("Could not read link %s : %s", path, strerror(errno)); + return FALSE; + } + + buf[ret] = '\0'; + return TRUE; +} diff --git a/sysdeps/cygwin/glibtop_private.h b/sysdeps/cygwin/glibtop_private.h new file mode 100644 index 0000000..78218f9 --- /dev/null +++ b/sysdeps/cygwin/glibtop_private.h @@ -0,0 +1,152 @@ +/* Copyright (C) 2004 Benoît Dejean + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __CYGWIN__GLIBTOP_PRIVATE_H__ +#define __CYGWIN__GLIBTOP_PRIVATE_H__ + +#include +#include + +#include + +#include +#include +#include + +G_BEGIN_DECLS + + +static inline char* +next_token(const char *p) +{ + while (isspace(*p)) p++; + return (char*) p; +} + +char * +skip_token (const char *p); + +static inline char * +skip_multiple_token (const char *p, size_t count) +{ + while(count--) + p = skip_token (p); + + return (char *)p; +} + + +static inline char * +skip_line (const char *p) +{ + while (*p && *p != '\n') p++; + return (char *) (*p ? p+1 : p); +} + +/* + * Smart strtoul which handles binary suffixes + * e.g: get_scaled("Size: 32 kB", "Size:") == 32768 + * key can be NULL if there's not prefix to strip (or prefix size is known + */ +unsigned long long +get_scaled(const char *buffer, const char *key); + + +/* aborts on error */ +void +file_to_buffer(glibtop *server, char *buffer, size_t bufsiz, const char *filename); + +/* return < 0 on error, otherwise 0 on success */ +int +try_file_to_buffer(char *buffer, size_t bufsiz, const char *format, ...) G_GNUC_PRINTF(3, 4); + + +/* some inline functions that wrap proc path + * as fast as macros :) + */ + +static inline int +proc_file_to_buffer (char *buffer, size_t bufsiz, const char *fmt, pid_t pid) +{ + return try_file_to_buffer(buffer, bufsiz, fmt, pid); +} + +static inline int +proc_stat_to_buffer (char *buffer, size_t bufsiz, pid_t pid) +{ + return proc_file_to_buffer(buffer, bufsiz, "/proc/%d/stat", pid); +} + +static inline int +proc_status_to_buffer (char *buffer, size_t bufsiz, pid_t pid) +{ + return proc_file_to_buffer(buffer, bufsiz, "/proc/%d/status", pid); +} + +static inline int +proc_statm_to_buffer (char *buffer, size_t bufsiz, pid_t pid) +{ + return proc_file_to_buffer(buffer, bufsiz, "/proc/%d/statm", pid); +} + + +static inline char * +proc_stat_after_cmd (char *p) +{ + p = strrchr (p, ')'); + if (G_LIKELY(p)) + *p++ = '\0'; + return p; +} + + +unsigned long +get_boot_time(glibtop *server); + + +size_t +get_page_size(void); + + +gboolean +check_cpu_line(glibtop *server, const char *line, unsigned n); + + +static inline gboolean +check_cpu_line_warn(glibtop *server, const char *line, unsigned i) +{ + gboolean ret; + + ret = check_cpu_line(server, line, i); + + if (G_UNLIKELY(!ret)) + glibtop_warn_io_r(server, + "'%s' does not start with 'cpu%u'", + line, i); + + return ret; +} + + +gboolean safe_readlink(const char *path, char *buf, size_t bufsiz); + + +G_END_DECLS + +#endif /* __CYGWIN__GLIBTOP_PRIVATE_H__ */ diff --git a/sysdeps/cygwin/glibtop_server.h b/sysdeps/cygwin/glibtop_server.h new file mode 100644 index 0000000..b1f20f9 --- /dev/null +++ b/sysdeps/cygwin/glibtop_server.h @@ -0,0 +1,50 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __CYGWIN__GLIBTOP_SERVER_H__ +#define __CYGWIN__GLIBTOP_SERVER_H__ + +#define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_MEM 0 +#define GLIBTOP_SUID_SWAP 0 +#define GLIBTOP_SUID_UPTIME 0 +#define GLIBTOP_SUID_LOADAVG 0 +#define GLIBTOP_SUID_SHM_LIMITS 0 +#define GLIBTOP_SUID_MSG_LIMITS 0 +#define GLIBTOP_SUID_SEM_LIMITS 0 +#define GLIBTOP_SUID_PROCLIST 0 +#define GLIBTOP_SUID_PROC_STATE 0 +#define GLIBTOP_SUID_PROC_UID 0 +#define GLIBTOP_SUID_PROC_MEM 0 +#define GLIBTOP_SUID_PROC_TIME 0 +#define GLIBTOP_SUID_PROC_SIGNAL 0 +#define GLIBTOP_SUID_PROC_KERNEL 0 +#define GLIBTOP_SUID_PROC_SEGMENT 0 +#define GLIBTOP_SUID_PROC_ARGS 0 +#define GLIBTOP_SUID_PROC_MAP 0 +#define GLIBTOP_SUID_NETLOAD 0 +#define GLIBTOP_SUID_NETLIST 0 +#define GLIBTOP_SUID_PROC_AFFINITY 0 +#define GLIBTOP_SUID_PROC_WD 0 +#define GLIBTOP_SUID_PPP 0 +#define GLIBTOP_SUID_PROC_FILE 0 + +#endif /* __CYGWIN__GLIBTOP_SERVER_H__ */ diff --git a/sysdeps/cygwin/loadavg.c b/sysdeps/cygwin/loadavg.c new file mode 100644 index 0000000..be0d5fc --- /dev/null +++ b/sysdeps/cygwin/loadavg.c @@ -0,0 +1,81 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_loadavg = +(1L << GLIBTOP_LOADAVG_LOADAVG); + +static const unsigned long _glibtop_sysdeps_loadavg_tasks = +(1L << GLIBTOP_LOADAVG_NR_RUNNING) + +(1L << GLIBTOP_LOADAVG_NR_TASKS) + +(1L << GLIBTOP_LOADAVG_LAST_PID); + +/* Init function. */ + +void +_glibtop_init_loadavg_s (glibtop *server) +{ + server->sysdeps.loadavg = _glibtop_sysdeps_loadavg; +} + +/* Provides load load averange. */ + +#define FILENAME "/proc/loadavg" + +void +glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf) +{ + char buffer [BUFSIZ], *p, *old; + + memset (buf, 0, sizeof (glibtop_loadavg)); + + file_to_buffer(server, buffer, sizeof buffer, FILENAME); + + buf->loadavg [0] = g_ascii_strtod (buffer, &p); + buf->loadavg [1] = g_ascii_strtod (p, &p); + buf->loadavg [2] = g_ascii_strtod (p, &p); + + buf->flags = _glibtop_sysdeps_loadavg; + + p = next_token(p); + + /* Older Linux versions don't have the nr_running/nr_tasks fields. */ + + old = p; + while (*p) { + if (*p == '/') + break; + if (!isdigit (*p)) + return; + p++; + } + + buf->nr_running = strtoull (old, &p, 0); p++; + buf->nr_tasks = strtoull (p, &p, 0); + buf->last_pid = strtoull (p, &p, 0); + + buf->flags |= _glibtop_sysdeps_loadavg_tasks; +} diff --git a/sysdeps/cygwin/mem.c b/sysdeps/cygwin/mem.c new file mode 100644 index 0000000..108f98a --- /dev/null +++ b/sysdeps/cygwin/mem.c @@ -0,0 +1,61 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_mem = +(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) + +(1L << GLIBTOP_MEM_FREE) + (1L << GLIBTOP_MEM_SHARED) + +(1L << GLIBTOP_MEM_USER); + +/* Init function. */ + +void +_glibtop_init_mem_s (glibtop *server) +{ + server->sysdeps.mem = _glibtop_sysdeps_mem; +} + +/* Provides information about memory usage. */ + +#define FILENAME "/proc/meminfo" + +void +glibtop_get_mem_s (glibtop *server, glibtop_mem *buf) +{ + char buffer [BUFSIZ]; + + memset(buf, 0, sizeof *buf); + + file_to_buffer(server, buffer, sizeof buffer, FILENAME); + + buf->total = get_scaled(buffer, "MemTotal:"); + buf->free = get_scaled(buffer, "MemFree:"); + buf->used = buf->total - buf->free; + buf->shared = 0; + + buf->user = buf->total - buf->free; + buf->flags = _glibtop_sysdeps_mem; +} diff --git a/sysdeps/cygwin/mountlist.c b/sysdeps/cygwin/mountlist.c new file mode 100644 index 0000000..fbbfbef --- /dev/null +++ b/sysdeps/cygwin/mountlist.c @@ -0,0 +1,164 @@ +/* mountlist.c -- return a list of mounted filesystems + Copyright (C) 1991, 1992 Free Software Foundation, Inc. + + This file is a fork of sysdeps/common/mountlist.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, 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. */ + + +/* +Local Variables: +mode: C +c-file-style: "gnu" +End: +*/ + +#include + +#include +#include + +#include +#include +#include + + +/* IgnoreList */ + + +typedef struct +{ + GHashTable *table; +} IgnoreList; + + +static IgnoreList* +ignore_list_new(void) +{ + IgnoreList* ig; + ig = g_new(IgnoreList, 1); + ig->table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); + return ig; +} + + +static void +ignore_list_delete(IgnoreList* ig) +{ + if (ig) { + g_hash_table_destroy(ig->table); + g_free(ig); + } +} + + +static void +ignore_list_add(IgnoreList* ig, const char* fs) +{ + g_hash_table_insert(ig->table, g_strdup(fs), GINT_TO_POINTER(1)); +} + + +static gboolean +ignore_list_has(IgnoreList* ig, const char* fs) +{ + gpointer data; + data = g_hash_table_lookup(ig->table, fs); + return data != NULL; +} + + +/* ~IgnoreList */ + + +static gboolean +ignore_fs(const char *fstype, IgnoreList** ig) +{ + if (!*ig) { + FILE* fs; + char line[128]; + + *ig = ignore_list_new(); + + ignore_list_add(*ig, "none"); + + if ((fs = fopen("/proc/filesystems", "r")) != NULL) { + while (fgets(line, sizeof line, fs)) { + if (!strncmp(line, "nodev", 5)) { + char *type; + type = g_strstrip(line + 5); + ignore_list_add(*ig, type); + } + } + fclose(fs); + } + } + + return ignore_list_has(*ig, fstype); +} + + +glibtop_mountentry * +glibtop_get_mountlist_s(glibtop *server, glibtop_mountlist *buf, int all_fs) +{ + const struct mntent *mnt; + FILE *fp; + GArray* entries; + IgnoreList* ig = NULL; + + memset(buf, 0, sizeof(glibtop_mountlist)); + + /* wild guess, preallocate 8 entries + on a desktop, almost everyone has / and a tmpfs for udev + if all_fs, there are also proc, sys, fuse, binfmt, etc */ + entries = g_array_sized_new(FALSE, FALSE, sizeof(glibtop_mountentry), 8); + + if (!(fp = setmntent(MOUNTED, "r"))) { + glibtop_warn_io_r(server, "Could not open %s", MOUNTED); + goto out; + } + + while ((mnt = getmntent(fp))) + { + glibtop_mountentry *me; + gsize len; + + if (!all_fs && ignore_fs(mnt->mnt_type, &ig)) + continue; + + len = entries->len; + g_array_set_size(entries, len + 1); + me = &g_array_index(entries, glibtop_mountentry, len); + + g_strlcpy(me->devname, mnt->mnt_fsname, sizeof me->devname); + g_strlcpy(me->mountdir, mnt->mnt_dir, sizeof me->mountdir); + g_strlcpy(me->type, mnt->mnt_type, sizeof me->type); + } + + endmntent(fp); + + + out: + ignore_list_delete(ig); + + buf->size = sizeof(glibtop_mountentry); + buf->number = entries->len; + buf->total = buf->number * buf->size; + buf->flags = (1 << GLIBTOP_MOUNTLIST_SIZE) + | (1 << GLIBTOP_MOUNTLIST_NUMBER) + | (1 << GLIBTOP_MOUNTLIST_TOTAL); + + return (glibtop_mountentry*) g_array_free(entries, FALSE); +} diff --git a/sysdeps/cygwin/msg_limits.c b/sysdeps/cygwin/msg_limits.c new file mode 100644 index 0000000..6a66242 --- /dev/null +++ b/sysdeps/cygwin/msg_limits.c @@ -0,0 +1,59 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#define _KERNEL +#include +#include + +static const unsigned long _glibtop_sysdeps_msg_limits = +(1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNB) + +(1L << GLIBTOP_IPC_MSGMNI) + (1L << GLIBTOP_IPC_MSGSSZ) + +(1L << GLIBTOP_IPC_MSGTQL); + +/* Init function. */ + +void +_glibtop_init_msg_limits_s (glibtop *server) +{ + server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf) +{ + struct msginfo msginfo; + + memset (buf, 0, sizeof (glibtop_msg_limits)); + + msgctl (0, IPC_INFO, (void*) &msginfo); + + buf->msgmax = msginfo.msgmax; + buf->msgmnb = msginfo.msgmnb; + buf->msgmni = msginfo.msgmni; + buf->msgssz = msginfo.msgssz; + buf->msgtql = msginfo.msgtql; + buf->flags = _glibtop_sysdeps_msg_limits; +} diff --git a/sysdeps/cygwin/netlist.c b/sysdeps/cygwin/netlist.c new file mode 100644 index 0000000..30fde7e --- /dev/null +++ b/sysdeps/cygwin/netlist.c @@ -0,0 +1,39 @@ +/* This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_netlist = 0; + +/* Init function. */ + +void +_glibtop_init_netlist_s (glibtop *server) +{ + server->sysdeps.netlist = _glibtop_sysdeps_netlist; +} + +char** +glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf) +{ + memset (buf, 0, sizeof (glibtop_netlist)); + + return NULL; +} diff --git a/sysdeps/cygwin/netload.c b/sysdeps/cygwin/netload.c new file mode 100644 index 0000000..5b3d3cf --- /dev/null +++ b/sysdeps/cygwin/netload.c @@ -0,0 +1,44 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_netload = 0; + +/* Init function. */ + +void +_glibtop_init_netload_s (glibtop *server) +{ + server->sysdeps.netload = _glibtop_sysdeps_netload; +} + +/* Provides network statistics. */ + +void +glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, + const char *interface) +{ + memset (buf, 0, sizeof (glibtop_netload)); +} diff --git a/sysdeps/cygwin/open.c b/sysdeps/cygwin/open.c new file mode 100644 index 0000000..7f3f240 --- /dev/null +++ b/sysdeps/cygwin/open.c @@ -0,0 +1,68 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +#include "glibtop_private.h" + +/* ======================================================= */ + +/* Opens pipe to gtop server. Returns 0 on success and -1 on error. */ + +#define FILENAME "/proc/stat" + +void +glibtop_open_s (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags) +{ + char buffer [BUFSIZ], *p = buffer; + + server->name = program_name; + + file_to_buffer(server, buffer, sizeof buffer, FILENAME); + + p = skip_line(p); /* cpu */ + + for (server->real_ncpu = 0; /* nop */; server->real_ncpu++) { + + if (!check_cpu_line(server, p, server->real_ncpu)) { + server->real_ncpu--; + break; + } + + p = skip_line(p); + } + + server->ncpu = MIN(GLIBTOP_NCPU - 1, server->real_ncpu); + + if (server->real_ncpu != server->ncpu) { + glibtop_warn_r(server, + "This machine has %d CPUs, " + "%d are being monitored.", + server->real_ncpu + 1, + server->ncpu + 1); + } +} diff --git a/sysdeps/cygwin/ppp.c b/sysdeps/cygwin/ppp.c new file mode 100644 index 0000000..0801643 --- /dev/null +++ b/sysdeps/cygwin/ppp.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_ppp = 0; + +/* Init function. */ + +void +_glibtop_init_ppp_s (glibtop *server) +{ + server->sysdeps.ppp = _glibtop_sysdeps_ppp; +} + +/* Provides PPP/ISDN information. */ + +void +glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device) +{ + memset (buf, 0, sizeof (glibtop_ppp)); +} diff --git a/sysdeps/cygwin/procaffinity.c b/sysdeps/cygwin/procaffinity.c new file mode 100644 index 0000000..8e5a2b4 --- /dev/null +++ b/sysdeps/cygwin/procaffinity.c @@ -0,0 +1,39 @@ +/* This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_affinity = 0; + +/* Init function. */ + +void +_glibtop_init_proc_affinity_s (glibtop *server) +{ + server->sysdeps.proc_affinity = _glibtop_sysdeps_proc_affinity; +} + +guint16* +glibtop_get_proc_affinity_s (glibtop *server, glibtop_proc_affinity *buf, pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_affinity)); + + return NULL; +} diff --git a/sysdeps/cygwin/procargs.c b/sysdeps/cygwin/procargs.c new file mode 100644 index 0000000..74d9057 --- /dev/null +++ b/sysdeps/cygwin/procargs.c @@ -0,0 +1,70 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_args = +(1L << GLIBTOP_PROC_ARGS_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_args_s (glibtop *server) +{ + server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; +} + +/* Provides detailed information about a process. */ + +char * +glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len) +{ + char filename[48]; /* magiv */ + + char *args; + gsize length; + GError *error = NULL; + + memset (buf, 0, sizeof (glibtop_proc_args)); + + sprintf (filename, "/proc/%d/cmdline", pid); + + if(!g_file_get_contents(filename, &args, &length, &error)) { + g_error_free(error); + buf->size = 0; + return NULL; + } + + if(max_len && max_len < length) { + args = g_realloc(args, max_len); + args[max_len - 1] = '\0'; + length = max_len; + } + + buf->size = length; + buf->flags = _glibtop_sysdeps_proc_args; + + return args; +} diff --git a/sysdeps/cygwin/prockernel.c b/sysdeps/cygwin/prockernel.c new file mode 100644 index 0000000..8c1e548 --- /dev/null +++ b/sysdeps/cygwin/prockernel.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_kernel = 0; + +/* Init function. */ + +void +_glibtop_init_proc_kernel_s (glibtop *server) +{ + server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_kernel)); +} diff --git a/sysdeps/cygwin/proclist.c b/sysdeps/cygwin/proclist.c new file mode 100644 index 0000000..de1ce87 --- /dev/null +++ b/sysdeps/cygwin/proclist.c @@ -0,0 +1,169 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proclist = +(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) + +(1L << GLIBTOP_PROCLIST_SIZE); + +/* Init function. */ + +void +_glibtop_init_proclist_s (glibtop *server) +{ + server->sysdeps.proclist = _glibtop_sysdeps_proclist; +} + +/* Fetch list of currently running processes. + * + * The interface of this function is a little bit different from the others: + * buf->flags is only set if the call succeeded, in this case pids_chain, + * a list of the pids of all currently running processes is returned, + * buf->number is the number of elements of this list and buf->size is + * the size of one single element (sizeof (unsigned)). The total size is + * stored in buf->total. + * + * The calling function has to free the memory to which a pointer is returned. + * + * On error, NULL is returned and buf->flags is zero. */ + +pid_t* +glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg) +{ + DIR *proc; + struct dirent *entry; + GArray *pids; + glibtop_proc_uid procuid; + glibtop_proc_state procstate; + struct stat statb; + + memset (buf, 0, sizeof (glibtop_proclist)); + + proc = opendir ("/proc"); + if (!proc) return NULL; + + if(fstat(dirfd(proc), &statb) != 0) return NULL; + + pids = g_array_sized_new(FALSE, FALSE, sizeof(pid_t), statb.st_nlink); + + /* read every every entry in /proc */ + + while((entry = readdir (proc))) { + pid_t pid; + + if (entry->d_type != DT_DIR) + continue; + + if (!(pid = strtoul(entry->d_name, NULL, 10))) + continue; + + switch (which & GLIBTOP_KERN_PROC_MASK) { + case GLIBTOP_KERN_PROC_ALL: + break; + case GLIBTOP_KERN_PROC_PID: + if ((pid_t) arg != pid) + continue; + break; + case GLIBTOP_KERN_PROC_UID: + { + char path[32]; + struct stat path_stat; + + snprintf(path, sizeof path, "/proc/%u", (unsigned)pid); + + if (stat(path, &path_stat)) + continue; + + if ((uid_t) arg != path_stat.st_uid) + continue; + } + break; + case GLIBTOP_KERN_PROC_PGRP: + /* Do you really, really need this ? */ + glibtop_get_proc_uid_s (server, &procuid, pid); + if (procuid.flags & (1L << GLIBTOP_PROC_UID_PGRP)) + if ((int) arg != procuid.pgrp) + continue; + break; + case GLIBTOP_KERN_PROC_SESSION: + /* Do you really, really need this ? */ + glibtop_get_proc_uid_s (server, &procuid, pid); + if (procuid.flags & (1L << GLIBTOP_PROC_UID_SESSION)) + if ((int) arg != procuid.session) + continue; + break; + case GLIBTOP_KERN_PROC_TTY: + /* Do you really, really need this ? */ + glibtop_get_proc_uid_s (server, &procuid, pid); + if (procuid.flags & (1L << GLIBTOP_PROC_UID_TTY)) + if ((int) arg != procuid.tty) + continue; + break; + case GLIBTOP_KERN_PROC_RUID: + /* Do you really, really need this ? */ + glibtop_get_proc_uid_s (server, &procuid, pid); + if (procuid.flags & (1L << GLIBTOP_PROC_UID_EUID)) + if ((int) arg != procuid.euid) + continue; + break; + } + + if (which & GLIBTOP_EXCLUDE_NOTTY) { + glibtop_get_proc_uid_s (server, &procuid, pid); + if (procuid.flags & (1L << GLIBTOP_PROC_UID_TTY)) + if (procuid.tty == -1) continue; + } + + if (which & GLIBTOP_EXCLUDE_IDLE) { + glibtop_get_proc_state_s (server, &procstate, pid); + if (procstate.flags & (1L << GLIBTOP_PROC_STATE_STATE)) + if (procstate.state != GLIBTOP_PROCESS_RUNNING) continue; + } + + if (which & GLIBTOP_EXCLUDE_SYSTEM) { + glibtop_get_proc_uid_s (server, &procuid, pid); + if (procuid.flags & (1L << GLIBTOP_PROC_UID_UID)) + if (procuid.uid == 0) continue; + } + + g_array_append_val(pids, pid); + } + + closedir (proc); + + buf->flags = _glibtop_sysdeps_proclist; + buf->size = sizeof(pid_t); + buf->number = pids->len; + buf->total = buf->number * buf->size; + + return (pid_t*)g_array_free(pids, FALSE); +} diff --git a/sysdeps/cygwin/procmap.c b/sysdeps/cygwin/procmap.c new file mode 100644 index 0000000..2db1ff3 --- /dev/null +++ b/sysdeps/cygwin/procmap.c @@ -0,0 +1,162 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include "glibtop_private.h" + +#define MKDEV(ma,mi) (((ma) << 20) | (mi)) + +#define MAPS_FILE "/proc/%u/maps" + + +#define PROC_MAPS_FORMAT "%16" G_GINT64_MODIFIER "x-%16" G_GINT64_MODIFIER "x %4c %16" G_GINT64_MODIFIER "x %02hx:%02hx %" G_GINT64_MODIFIER "u%*[ ]%n" + + +static const unsigned long _glibtop_sysdeps_proc_map = +(1L << GLIBTOP_PROC_MAP_NUMBER) + (1L << GLIBTOP_PROC_MAP_TOTAL) + +(1L << GLIBTOP_PROC_MAP_SIZE); + +static const unsigned long _glibtop_sysdeps_map_entry = +(1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) + +(1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) + +(1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE) + +(1L << GLIBTOP_MAP_ENTRY_FILENAME); + + +/* Init function. */ + +void +_glibtop_init_proc_map_s (glibtop *server) +{ + server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; +} + + +glibtop_map_entry * +glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid) +{ + char procfilename[GLIBTOP_MAP_FILENAME_LEN+1]; + + /* + default size of 100 maybe inaccurate. + It's the average number of entry per process on my laptop + */ + + GArray *entry_list = g_array_sized_new(FALSE, FALSE, + sizeof(glibtop_map_entry), + 100); + FILE *maps; + const char *filename; + char *line = NULL; + size_t line_size = 0; + + memset (buf, 0, sizeof (glibtop_proc_map)); + + filename = MAPS_FILE; + + snprintf (procfilename, sizeof procfilename, filename, (unsigned)pid); + + if((maps = fopen (procfilename, "r")) == NULL) { + return (glibtop_map_entry*) g_array_free(entry_list, TRUE); + } + + while(TRUE) + { + unsigned long perm; + guint len; + int line_end; + + unsigned short dev_major, dev_minor; + guint64 start, end, offset, inode; + char flags[4]; + char *filename; + + glibtop_map_entry *entry; + + if (getline(&line, &line_size, maps) == -1) + break; + + new_entry_line: + + if (sscanf(line, PROC_MAPS_FORMAT, + &start, &end, flags, &offset, + &dev_major, &dev_minor, &inode, &line_end) != 7) + continue; + + filename = line + line_end; + g_strstrip(filename); + + /* Compute access permissions. */ + perm = 0; + + if (flags [0] == 'r') + perm |= GLIBTOP_MAP_PERM_READ; + + if (flags [1] == 'w') + perm |= GLIBTOP_MAP_PERM_WRITE; + + if (flags [2] == 'x') + perm |= GLIBTOP_MAP_PERM_EXECUTE; + + if (flags [3] == 's') + perm |= GLIBTOP_MAP_PERM_SHARED; + else if (flags [3] == 'p') + perm |= GLIBTOP_MAP_PERM_PRIVATE; + + /* + avoid copying the entry, grow by 1 and point to the last + element. + */ + len = entry_list->len; + g_array_set_size(entry_list, len + 1); + entry = &g_array_index(entry_list, glibtop_map_entry, len); + + entry->flags = _glibtop_sysdeps_map_entry; + entry->start = start; + entry->end = end; + entry->offset = offset; + entry->perm = perm; + entry->device = MKDEV(dev_major, dev_minor); + entry->inode = inode; + g_strlcpy(entry->filename, filename, sizeof entry->filename); + } + +eof: + + free(line); + fclose (maps); + + buf->flags = _glibtop_sysdeps_proc_map; + + buf->number = entry_list->len; + buf->size = sizeof (glibtop_map_entry); + buf->total = buf->number * buf->size; + + return (glibtop_map_entry*) g_array_free(entry_list, FALSE); +} diff --git a/sysdeps/cygwin/procmem.c b/sysdeps/cygwin/procmem.c new file mode 100644 index 0000000..aa8fddd --- /dev/null +++ b/sysdeps/cygwin/procmem.c @@ -0,0 +1,68 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_mem = +(1L << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_RESIDENT) + +(1L << GLIBTOP_PROC_MEM_SHARE); + +/* Init function. */ + +void +_glibtop_init_proc_mem_s (glibtop *server) +{ + server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid) +{ + char buffer [BUFSIZ], *p; + const size_t pagesize = get_page_size(); + + memset (buf, 0, sizeof (glibtop_proc_mem)); + + if (proc_statm_to_buffer(buffer, sizeof buffer, pid)) + return; + + buf->size = strtoull (buffer, &p, 0); + buf->resident = strtoull (p, &p, 0); + buf->share = strtoull (p, &p, 0); + + buf->size *= pagesize; + buf->resident *= pagesize; + buf->share *= pagesize; + + /* dummy values */ + buf->vsize = buf->size; + buf->rss_rlim = ~0; + + buf->flags |= _glibtop_sysdeps_proc_mem; + buf->rss = buf->resident; +} diff --git a/sysdeps/cygwin/procopenfiles.c b/sysdeps/cygwin/procopenfiles.c new file mode 100644 index 0000000..caed854 --- /dev/null +++ b/sysdeps/cygwin/procopenfiles.c @@ -0,0 +1,324 @@ +/* Copyright (C) 1998-99 Martin Baulig + Copyright (C) 2004 Nicolás Lichtmaier + This file is part of LibGTop 1.0. + + Modified by Nicolás Lichtmaier to give a process open files. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_open_files = +(1L << GLIBTOP_PROC_OPEN_FILES_NUMBER)| +(1L << GLIBTOP_PROC_OPEN_FILES_TOTAL)| +(1L << GLIBTOP_PROC_OPEN_FILES_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_open_files_s (glibtop *server) +{ + server->sysdeps.proc_open_files = _glibtop_sysdeps_proc_open_files; +} + + + +typedef void (*LineParser)(GHashTable *dict, const char *line); + + +static void +parse_file(const char *filename, LineParser parser, GHashTable *dict) +{ + FILE *f; + char *line = NULL; + size_t size = 0; + + f = fopen(filename, "r"); + + if(!f) { + g_warning("Cannot open '%s'", filename); + return; + } + + + /* skip the first line */ + if (getline(&line, &size, f) == -1) + goto eof; + + while (getline(&line, &size, f) != -1) + parser(dict, line); + + eof: + free(line); + fclose(f); +} + + +static GHashTable* +get_all(const char *filename, LineParser parser) +{ + GHashTable *dict; + + dict = g_hash_table_new_full(g_direct_hash, g_direct_equal, + NULL, g_free); + + parse_file(filename, parser, dict); + + return dict; +} + + + + + +struct Inet6SocketEntry +{ + char host[GLIBTOP_OPEN_DEST_HOST_LEN + 1]; + int port; +}; + + +static void +inet6_socket_parser(GHashTable *dict, const char* line) +{ + struct Inet6SocketEntry *se; + int sock; + struct in6_addr addr; + + se = g_malloc0(sizeof *se); + + if(sscanf(line, "%*d: %*s %8x%8x%8x%8x:%4x %*x %*x:%*x %*x:%*x %*d %*d %*d %d", + &addr.s6_addr32[0], &addr.s6_addr32[1], &addr.s6_addr32[2], + &addr.s6_addr32[3], &se->port, &sock) != 6) + goto error; + + if(!inet_ntop(AF_INET6, &addr, se->host, sizeof se->host)) + goto error; + + g_hash_table_insert(dict, GINT_TO_POINTER(sock), se); + return; + + error: + g_free(se); +} + + +static inline GHashTable * +get_all_inet6_sockets() +{ + return get_all("/proc/net/tcp6", inet6_socket_parser); +} + + + + + +struct InetSocketEntry +{ + char host[GLIBTOP_OPEN_DEST_HOST_LEN + 1]; + int port; +}; + + +static void +inet_socket_parser(GHashTable *dict, const char* line) +{ + struct InetSocketEntry *se; + int sock; + unsigned addr; + + se = g_malloc0(sizeof *se); + + if(sscanf(line, "%*d: %*x:%*x %8x:%4x %*x %*x:%*x %*x:%*x %*d %*d %*d %d", + &addr, &se->port, &sock) != 3) + goto error; + + if(!inet_ntop(AF_INET, &addr, se->host, sizeof se->host)) + goto error; + + g_hash_table_insert(dict, GINT_TO_POINTER(sock), se); + return; + + error: + g_free(se); +} + + +static inline GHashTable * +get_all_inet_sockets() +{ + return get_all("/proc/net/tcp", inet_socket_parser); +} + + + + + +struct LocalSocketEntry +{ + char name[GLIBTOP_OPEN_DEST_HOST_LEN + 1]; +}; + + +static void +local_socket_parser(GHashTable *dict, const char *line) +{ + int sock; + struct LocalSocketEntry *use; + char *p; + + use = g_malloc0(sizeof *use); + + /* dfaf1640: 00000003 00000000 00000000 0001 03 6457 /dev/log */ + p = skip_multiple_token(line, 6); + + sock = strtoul(p, &p, 10); + g_strlcpy(use->name, p, sizeof use->name); + g_strstrip(use->name); + g_hash_table_insert(dict, GINT_TO_POINTER(sock), use); +} + + +static inline GHashTable * +get_all_local_sockets() +{ + return get_all("/proc/net/unix", local_socket_parser); +} + + + +/* Provides detailed information about a process' open files */ + +glibtop_open_files_entry * +glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pid_t pid) +{ + char fn [BUFSIZ]; + GArray *entries; + GHashTable *inet6_sockets = NULL, *inet_sockets = NULL, *local_sockets = NULL; + struct dirent *direntry; + DIR *dir; + + memset (buf, 0, sizeof (glibtop_proc_open_files)); + + sprintf (fn, "/proc/%d/fd", pid); + + dir = opendir (fn); + if (!dir) return NULL; + + entries = g_array_new(FALSE, FALSE, sizeof(glibtop_open_files_entry)); + + while((direntry = readdir(dir))) { + char tgt [BUFSIZ]; + glibtop_open_files_entry entry = {0}; + + if(direntry->d_name[0] == '.') + continue; + + g_snprintf(fn, sizeof fn, "/proc/%d/fd/%s", + pid, direntry->d_name); + + if (!safe_readlink(fn, tgt, sizeof tgt)) + continue; + + entry.fd = atoi(direntry->d_name); + + if(g_str_has_prefix(tgt, "socket:[")) + { + int sockfd; + struct Inet6SocketEntry *i6se; + struct InetSocketEntry *ise; + struct LocalSocketEntry *lse; + + if(!inet6_sockets) inet6_sockets = get_all_inet6_sockets(); + if(!inet_sockets) inet_sockets = get_all_inet_sockets(); + if(!local_sockets) local_sockets = get_all_local_sockets(); + + sockfd = atoi(tgt + 8); + + i6se = g_hash_table_lookup(inet6_sockets, + GINT_TO_POINTER(sockfd)); + + if(i6se) { + entry.type = GLIBTOP_FILE_TYPE_INET6SOCKET; + entry.info.sock.dest_port = i6se->port; + g_strlcpy(entry.info.sock.dest_host, i6se->host, + sizeof entry.info.sock.dest_host); + goto found; + } + + ise = g_hash_table_lookup(inet_sockets, + GINT_TO_POINTER(sockfd)); + + if(ise) { + entry.type = GLIBTOP_FILE_TYPE_INETSOCKET; + entry.info.sock.dest_port = ise->port; + g_strlcpy(entry.info.sock.dest_host, ise->host, + sizeof entry.info.sock.dest_host); + goto found; + } + + lse = g_hash_table_lookup(local_sockets, + GINT_TO_POINTER(sockfd)); + + if(lse) { + entry.type = GLIBTOP_FILE_TYPE_LOCALSOCKET; + g_strlcpy(entry.info.localsock.name, lse->name, + sizeof entry.info.localsock.name); + goto found; + } + + found: + (void)0; /* kills warning */ + } + else if(g_str_has_prefix(tgt, "pipe:[")) + { + entry.type = GLIBTOP_FILE_TYPE_PIPE; + } + else + { + entry.type = GLIBTOP_FILE_TYPE_FILE; + g_strlcpy(entry.info.file.name, tgt, sizeof entry.info.file.name); + } + + g_array_append_val(entries, entry); + } + + closedir (dir); + + if(inet_sockets) g_hash_table_destroy(inet_sockets); + if(inet6_sockets) g_hash_table_destroy(inet6_sockets); + if(local_sockets) g_hash_table_destroy(local_sockets); + + buf->flags = _glibtop_sysdeps_proc_open_files; + buf->number = entries->len; + buf->size = sizeof(glibtop_open_files_entry); + buf->total = buf->number * buf->size; + + return (glibtop_open_files_entry*)g_array_free(entries, FALSE); +} diff --git a/sysdeps/cygwin/procsegment.c b/sysdeps/cygwin/procsegment.c new file mode 100644 index 0000000..7706f1a --- /dev/null +++ b/sysdeps/cygwin/procsegment.c @@ -0,0 +1,88 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_segment = +(1L << GLIBTOP_PROC_SEGMENT_START_CODE) + +(1L << GLIBTOP_PROC_SEGMENT_END_CODE) + +(1L << GLIBTOP_PROC_SEGMENT_START_STACK); + +static const unsigned long _glibtop_sysdeps_proc_segment_statm = +(1L << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_DATA_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_DIRTY_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_segment_s (glibtop *server) +{ + server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment | + _glibtop_sysdeps_proc_segment_statm; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf, + pid_t pid) +{ + char buffer [BUFSIZ], *p; + const size_t pagesize = get_page_size(); + + memset (buf, 0, sizeof (glibtop_proc_segment)); + + if (proc_stat_to_buffer(buffer, sizeof buffer, pid)) + return; + + p = proc_stat_after_cmd (buffer); + if (!p) return; + + p = skip_multiple_token (p, 23); + + buf->start_code = strtoull (p, &p, 0); + buf->end_code = strtoull (p, &p, 0); + buf->start_stack = strtoull (p, &p, 0); + + buf->flags = _glibtop_sysdeps_proc_segment; + + if (proc_statm_to_buffer(buffer, sizeof buffer, pid)) + return; + + p = skip_multiple_token (buffer, 3); + + buf->text_rss = strtoull (p, &p, 0); + buf->shlib_rss = strtoull (p, &p, 0); + buf->data_rss = strtoull (p, &p, 0); + buf->dirty_size = strtoull (p, &p, 0); + + buf->text_rss *= pagesize; + buf->shlib_rss *= pagesize; + buf->data_rss *= pagesize; + buf->dirty_size *= pagesize; + + buf->flags |= _glibtop_sysdeps_proc_segment_statm; +} diff --git a/sysdeps/cygwin/procsignal.c b/sysdeps/cygwin/procsignal.c new file mode 100644 index 0000000..0fc9dca --- /dev/null +++ b/sysdeps/cygwin/procsignal.c @@ -0,0 +1,64 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_signal = +(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1L << GLIBTOP_PROC_SIGNAL_BLOCKED) + +(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1L << GLIBTOP_PROC_SIGNAL_SIGCATCH); + +/* Init function. */ + +void +_glibtop_init_proc_signal_s (glibtop *server) +{ + server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, pid_t pid) +{ + char buffer [BUFSIZ], *p; + + memset (buf, 0, sizeof (glibtop_proc_signal)); + + if (proc_stat_to_buffer(buffer, sizeof buffer, pid)) + return; + + p = proc_stat_after_cmd (buffer); + if (!p) return; + + p = skip_multiple_token (p, 28); + + buf->signal [0] = strtoull (p, &p, 0); + buf->blocked [0] = strtoull (p, &p, 0); + buf->sigignore [0] = strtoull (p, &p, 0); + buf->sigcatch [0] = strtoull (p, &p, 0); + + buf->flags = _glibtop_sysdeps_proc_signal; +} diff --git a/sysdeps/cygwin/procstate.c b/sysdeps/cygwin/procstate.c new file mode 100644 index 0000000..024acf3 --- /dev/null +++ b/sysdeps/cygwin/procstate.c @@ -0,0 +1,120 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "glibtop_private.h" + +#include + +static const unsigned long _glibtop_sysdeps_proc_state = +(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_STATE); + +static const unsigned long _glibtop_sysdeps_proc_state_uid = +(1L << GLIBTOP_PROC_STATE_UID) + (1L << GLIBTOP_PROC_STATE_GID); + +/* Init function. */ + +void +_glibtop_init_proc_state_s (glibtop *server) +{ + server->sysdeps.proc_state = _glibtop_sysdeps_proc_state | + _glibtop_sysdeps_proc_state_uid; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid) +{ + char buffer [BUFSIZ], *p; + struct stat statb; + + memset (buf, 0, sizeof (glibtop_proc_state)); + + /* IMPORTANT NOTICE: For security reasons it is extremely important + * that the 'uid' and 'gid' fields have correct + * values; NEVER set their flags values if this + * is not the case !!! */ + + sprintf (buffer, "/proc/%d", pid); + + if (stat (buffer, &statb)) + return; + + /* For security reasons we use stat () since it is + * more failsafe than parsing the file. */ + + buf->uid = statb.st_uid; + buf->gid = statb.st_gid; + + buf->flags = _glibtop_sysdeps_proc_state_uid; + + /* Now we read the remaining fields. */ + + if (proc_stat_to_buffer(buffer, sizeof buffer, pid)) + return; + + p = proc_stat_after_cmd(buffer); + p = next_token(p); + + switch(*p) + { + case 'R': + buf->state = GLIBTOP_PROCESS_RUNNING; + break; + + case 'Z': + buf->state = GLIBTOP_PROCESS_ZOMBIE; + break; + + case 'S': + buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE; + break; + + case 'T': + buf->state = GLIBTOP_PROCESS_STOPPED; + break; + + case 'D': + buf->state = GLIBTOP_PROCESS_UNINTERRUPTIBLE; + break; + + case 'W': + buf->state = GLIBTOP_PROCESS_SWAPPING; + break; + + case 'X': + buf->state = GLIBTOP_PROCESS_DEAD; + break; + } + + p = skip_token (buffer); /* pid */ + if (G_UNLIKELY(*p++ != '(')) + glibtop_error_r (server, "Bad data in /proc/%d/stat", pid); + + g_strlcpy (buf->cmd, p, sizeof buf->cmd); + + buf->flags |= _glibtop_sysdeps_proc_state; +} diff --git a/sysdeps/cygwin/proctime.c b/sysdeps/cygwin/proctime.c new file mode 100644 index 0000000..026fbfa --- /dev/null +++ b/sysdeps/cygwin/proctime.c @@ -0,0 +1,109 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_time = +(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_CUTIME) + +(1L << GLIBTOP_PROC_TIME_RTIME) + +(1L << GLIBTOP_PROC_TIME_STIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) + +(1L << GLIBTOP_PROC_TIME_FREQUENCY) + (1L << GLIBTOP_PROC_TIME_TIMEOUT) + +(1L << GLIBTOP_PROC_TIME_IT_REAL_VALUE) + (1L << GLIBTOP_PROC_TIME_START_TIME); + +static const unsigned long _glibtop_sysdeps_proc_time_smp = +(1L << GLIBTOP_PROC_TIME_XCPU_UTIME) + (1L << GLIBTOP_PROC_TIME_XCPU_STIME); + +/* Init function. */ + +void +_glibtop_init_proc_time_s (glibtop *server) +{ + server->sysdeps.proc_time = _glibtop_sysdeps_proc_time; + + if (server->ncpu) + server->sysdeps.proc_time |= _glibtop_sysdeps_proc_time_smp; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid) +{ + char buffer [BUFSIZ], *p; + int i; + + memset (buf, 0, sizeof (glibtop_proc_time)); + + if (proc_stat_to_buffer(buffer, sizeof buffer, pid)) + return; + + p = proc_stat_after_cmd (buffer); + if (!p) return; + + p = skip_multiple_token (p, 11); + + /* clock_t (1/100 s) */ + buf->utime = strtoull (p, &p, 0); + buf->stime = strtoull (p, &p, 0); + buf->rtime = buf->utime + buf->stime; + + buf->cutime = strtoull (p, &p, 0); + buf->cstime = strtoull (p, &p, 0); + + p = skip_multiple_token (p, 3); + + buf->it_real_value = strtoull (p, &p, 0); + + /* seconds since epoch */ + { + buf->start_time = get_boot_time(server) + strtoull (p, &p, 0) / 100; + } + + buf->frequency = 100; + + buf->flags = _glibtop_sysdeps_proc_time; + + if (!server->ncpu) + return; + + if (proc_file_to_buffer(buffer, sizeof buffer, "/proc/%d/cpu", pid)) + return; + + p = skip_multiple_token (p, 3); + + for (i = 0; i <= server->ncpu; i++) { + + if (!check_cpu_line_warn(server, p + 1, i)) + break; + + p = skip_token(p); + buf->xcpu_utime [i] = strtoull (p, &p, 0); + buf->xcpu_stime [i] = strtoull (p, &p, 0); + } + + buf->flags |= _glibtop_sysdeps_proc_time_smp; +} diff --git a/sysdeps/cygwin/procuid.c b/sysdeps/cygwin/procuid.c new file mode 100644 index 0000000..82ef0fb --- /dev/null +++ b/sysdeps/cygwin/procuid.c @@ -0,0 +1,115 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_uid = +(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) + +(1L << GLIBTOP_PROC_UID_GID) + (1L << GLIBTOP_PROC_UID_EGID); + +static const unsigned long _glibtop_sysdeps_proc_uid_stat = +(1L << GLIBTOP_PROC_UID_PID) + (1L << GLIBTOP_PROC_UID_PPID) + +(1L << GLIBTOP_PROC_UID_PGRP) + (1L << GLIBTOP_PROC_UID_SESSION) + +(1L << GLIBTOP_PROC_UID_TTY) + (1L << GLIBTOP_PROC_UID_TPGID) + +(1L << GLIBTOP_PROC_UID_PRIORITY) + (1L << GLIBTOP_PROC_UID_NICE); + + +/* Init function. */ + +void +_glibtop_init_proc_uid_s (glibtop *server) +{ + server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid | + _glibtop_sysdeps_proc_uid_stat; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid) +{ + char buffer [BUFSIZ], *p; + + memset (buf, 0, sizeof (glibtop_proc_uid)); + + if (proc_status_to_buffer(buffer, sizeof buffer, pid)) + return; + + /* Search substring 'Pid:' */ + + p = strstr (buffer, "\nPid:"); + if (!p) return; + + p = skip_token (p); /* "Pid:" */ + buf->pid = strtol (p, &p, 0); + + p = skip_token (p); /* "PPid:" */ + buf->ppid = strtol (p, &p, 0); + + /* Maybe future Linux versions place something between + * "PPid" and "Uid", so we catch this here. */ + p = strstr (p, "\nUid:"); + if (!p) return; + + p = skip_token (p); /* "Uid:" */ + buf->uid = strtol (p, &p, 0); + buf->euid = strtol (p, &p, 0); + + /* We don't know how many entries on the "Uid:" line + * future Linux version will have, so we catch this here. */ + p = strstr (p, "\nGid:"); + if (!p) return; + + p = skip_token (p); /* "Gid:" */ + buf->gid = strtol (p, &p, 0); + buf->egid = strtol (p, &p, 0); + + buf->flags = _glibtop_sysdeps_proc_uid; + + if (proc_stat_to_buffer(buffer, sizeof buffer, pid)) + return; + + p = proc_stat_after_cmd (buffer); + if (!p) return; + + p = skip_multiple_token (p, 2); + + buf->pgrp = strtol (p, &p, 0); + buf->session = strtol (p, &p, 0); + buf->tty = strtol (p, &p, 0); + buf->tpgid = strtol (p, &p, 0); + + p = skip_multiple_token (p, 9); + + buf->priority = strtol (p, &p, 0); + buf->nice = strtol (p, &p, 0); + + if (buf->tty == 0) + /* the old notty val, update elsewhere bef. moving to 0 */ + buf->tty = -1; + + buf->flags |= _glibtop_sysdeps_proc_uid_stat; +} diff --git a/sysdeps/cygwin/procwd.c b/sysdeps/cygwin/procwd.c new file mode 100644 index 0000000..a5af41c --- /dev/null +++ b/sysdeps/cygwin/procwd.c @@ -0,0 +1,99 @@ +/* Copyright (C) 2007 Benoît Dejean + This file is part of LibGTop 2. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +#include +#include +#include + + +void +_glibtop_init_proc_wd_s(glibtop *server) +{ + server->sysdeps.proc_wd = + (1 << GLIBTOP_PROC_WD_EXE) + + (1 << GLIBTOP_PROC_WD_ROOT) + + (1 << GLIBTOP_PROC_WD_NUMBER); + +} + +static gboolean is_in(GPtrArray *array, const char *str) +{ + guint i; + + for (i = 0; i != array->len; ++i) { + if (strcmp(g_ptr_array_index(array, i), str) == 0) + return TRUE; + } + + return FALSE; +} + + +char** +glibtop_get_proc_wd_s(glibtop *server, glibtop_proc_wd *buf, pid_t pid) +{ + GPtrArray *dirs; + char path[80]; + char dir[256]; + DIR *task; + + memset(buf, 0, sizeof(glibtop_proc_wd)); + + g_snprintf(path, sizeof path, "/proc/%u/root", pid); + if (safe_readlink(path, buf->root, sizeof buf->root)) + buf->flags |= (1 << GLIBTOP_PROC_WD_ROOT); + + g_snprintf(path, sizeof path, "/proc/%u/exe", pid); + if (safe_readlink(path, buf->exe, sizeof buf->exe)) + buf->flags |= (1 << GLIBTOP_PROC_WD_EXE); + + dirs = g_ptr_array_sized_new(2); + + g_snprintf(path, sizeof path, "/proc/%u/cwd", pid); + if (safe_readlink(path, dir, sizeof dir)) + g_ptr_array_add(dirs, g_strdup(dir)); + + g_snprintf(path, sizeof path, "/proc/%u/task", pid); + if ((task = opendir(path)) != NULL) { + struct dirent *sub; + while ((sub = readdir(task)) != NULL) { + /* task dirs have numeric name */ + if (!isdigit(sub->d_name[0])) + continue; + g_snprintf(path, sizeof path, "/proc/%u/task/%s/cwd", pid, sub->d_name); + if (safe_readlink(path, dir, sizeof dir) && !is_in(dirs, dir)) + g_ptr_array_add(dirs, g_strdup(dir)); + } + closedir(task); + } + + buf->number = dirs->len; + buf->flags |= (1 << GLIBTOP_PROC_WD_NUMBER); + + g_ptr_array_add(dirs, NULL); + + return (char**) g_ptr_array_free(dirs, FALSE); +} + diff --git a/sysdeps/cygwin/sem_limits.c b/sysdeps/cygwin/sem_limits.c new file mode 100644 index 0000000..f14bfe2 --- /dev/null +++ b/sysdeps/cygwin/sem_limits.c @@ -0,0 +1,84 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#define _KERNEL +#include +#include + +#ifdef _SEM_SEMUN_UNDEFINED + +/* glibc 2.1 will no longer defines semun, instead it defines + * _SEM_SEMUN_UNDEFINED so users can define semun on their own. + * Thanks to Albert K T Hui . */ + +union semun +{ + int val; + struct semid_ds *buf; + unsigned short int *array; + struct seminfo *__buf; +}; +#endif + +static const unsigned long _glibtop_sysdeps_sem_limits = +(1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) + +(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) + +(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) + +(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) + +(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM); + +/* Init function. */ + +void +_glibtop_init_sem_limits_s (glibtop *server) +{ + server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf) +{ + struct seminfo seminfo; + union semun arg; + + memset (buf, 0, sizeof (glibtop_sem_limits)); + + buf->flags = _glibtop_sysdeps_sem_limits; + + arg.array = (void *) &seminfo; + semctl (0, 0, IPC_INFO, arg); + + buf->semmap = seminfo.semmap; + buf->semmni = seminfo.semmni; + buf->semmns = seminfo.semmns; + buf->semmnu = seminfo.semmnu; + buf->semmsl = seminfo.semmsl; + buf->semopm = seminfo.semopm; + buf->semume = seminfo.semume; + buf->semusz = seminfo.semusz; + buf->semvmx = seminfo.semvmx; + buf->semaem = seminfo.semaem; +} diff --git a/sysdeps/cygwin/shm_limits.c b/sysdeps/cygwin/shm_limits.c new file mode 100644 index 0000000..7e561b5 --- /dev/null +++ b/sysdeps/cygwin/shm_limits.c @@ -0,0 +1,59 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#define _KERNEL +#include +#include + +static const unsigned long _glibtop_sysdeps_shm_limits = +(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) + +(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) + +(1L << GLIBTOP_IPC_SHMALL); + +/* Init function. */ + +void +_glibtop_init_shm_limits_s (glibtop *server) +{ + server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf) +{ + struct shminfo shminfo; + + memset (buf, 0, sizeof (glibtop_shm_limits)); + + shmctl (0, IPC_INFO, (void *) &shminfo); + + buf->shmmax = shminfo.shmmax; + buf->shmmin = shminfo.shmmin; + buf->shmmni = shminfo.shmmni; + buf->shmseg = shminfo.shmseg; + buf->shmall = shminfo.shmall; + buf->flags = _glibtop_sysdeps_shm_limits; +} diff --git a/sysdeps/cygwin/siglist.c b/sysdeps/cygwin/siglist.c new file mode 100644 index 0000000..ddecf08 --- /dev/null +++ b/sysdeps/cygwin/siglist.c @@ -0,0 +1,143 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include +#include + +#include + + +#if 0 /* comment */ +perl -nle 'print "{$1,\t\"$1\",\t\"$2\"}," if m|^#define\s*(SIG[A-Z0-9]+).*?/\*\s*(.*?)\s*\*/|' + < /usr/include/bits/signum.h +#endif + + +const glibtop_signame glibtop_sys_siglist [] = +{ +#ifdef SIGHUP + {SIGHUP, "SIGHUP", "Hangup (POSIX)."}, +#endif +#ifdef SIGINT + {SIGINT, "SIGINT", "Interrupt (ANSI)."}, +#endif +#ifdef SIGQUIT + {SIGQUIT, "SIGQUIT", "Quit (POSIX)."}, +#endif +#ifdef SIGILL + {SIGILL, "SIGILL", "Illegal instruction (ANSI)."}, +#endif +#ifdef SIGTRAP + {SIGTRAP, "SIGTRAP", "Trace trap (POSIX)."}, +#endif +#ifdef SIGABRT + {SIGABRT, "SIGABRT", "Abort (ANSI)."}, +#endif +#ifdef SIGIOT + {SIGIOT, "SIGIOT", "IOT trap (4.2 BSD)."}, +#endif +#ifdef SIGBUS + {SIGBUS, "SIGBUS", "BUS error (4.2 BSD)."}, +#endif +#ifdef SIGFPE + {SIGFPE, "SIGFPE", "Floating-point exception (ANSI)."}, +#endif +#ifdef SIGKILL + {SIGKILL, "SIGKILL", "Kill, unblockable (POSIX)."}, +#endif +#ifdef SIGUSR1 + {SIGUSR1, "SIGUSR1", "User-defined signal 1 (POSIX)."}, +#endif +#ifdef SIGSEGV + {SIGSEGV, "SIGSEGV", "Segmentation violation (ANSI)."}, +#endif +#ifdef SIGUSR2 + {SIGUSR2, "SIGUSR2", "User-defined signal 2 (POSIX)."}, +#endif +#ifdef SIGPIPE + {SIGPIPE, "SIGPIPE", "Broken pipe (POSIX)."}, +#endif +#ifdef SIGALRM + {SIGALRM, "SIGALRM", "Alarm clock (POSIX)."}, +#endif +#ifdef SIGTERM + {SIGTERM, "SIGTERM", "Termination (ANSI)."}, +#endif +#ifdef SIGSTKFLT + {SIGSTKFLT, "SIGSTKFLT", "Stack fault."}, +#endif +#ifdef SIGCLD + {SIGCLD, "SIGCLD", "Same as SIGCHLD (System V)."}, +#endif +#ifdef SIGCHLD + {SIGCHLD, "SIGCHLD", "Child status has changed (POSIX)."}, +#endif +#ifdef SIGCONT + {SIGCONT, "SIGCONT", "Continue (POSIX)."}, +#endif +#ifdef SIGSTOP + {SIGSTOP, "SIGSTOP", "Stop, unblockable (POSIX)."}, +#endif +#ifdef SIGTSTP + {SIGTSTP, "SIGTSTP", "Keyboard stop (POSIX)."}, +#endif +#ifdef SIGTTIN + {SIGTTIN, "SIGTTIN", "Background read from tty (POSIX)."}, +#endif +#ifdef SIGTTOU + {SIGTTOU, "SIGTTOU", "Background write to tty (POSIX)."}, +#endif +#ifdef SIGURG + {SIGURG, "SIGURG", "Urgent condition on socket (4.2 BSD)."}, +#endif +#ifdef SIGXCPU + {SIGXCPU, "SIGXCPU", "CPU limit exceeded (4.2 BSD)."}, +#endif +#ifdef SIGXFSZ + {SIGXFSZ, "SIGXFSZ", "File size limit exceeded (4.2 BSD)."}, +#endif +#ifdef SIGVTALRM + {SIGVTALRM, "SIGVTALRM", "Virtual alarm clock (4.2 BSD)."}, +#endif +#ifdef SIGPROF + {SIGPROF, "SIGPROF", "Profiling alarm clock (4.2 BSD)."}, +#endif +#ifdef SIGWINCH + {SIGWINCH, "SIGWINCH", "Window size change (4.3 BSD, Sun)."}, +#endif +#ifdef SIGPOLL + {SIGPOLL, "SIGPOLL", "Pollable event occurred (System V)."}, +#endif +#ifdef SIGIO + {SIGIO, "SIGIO", "I/O now possible (4.2 BSD)."}, +#endif +#ifdef SIGPWR + {SIGPWR, "SIGPWR", "Power failure restart (System V)."}, +#endif +#ifdef SIGSYS + {SIGSYS, "SIGSYS", "Bad system call."}, +#endif +#ifdef SIGUNUSED + {SIGUNUSED, "SIGUNUSED", ""}, +#endif + {0, NULL, NULL} +}; diff --git a/sysdeps/cygwin/swap.c b/sysdeps/cygwin/swap.c new file mode 100644 index 0000000..0b18842 --- /dev/null +++ b/sysdeps/cygwin/swap.c @@ -0,0 +1,81 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +#include + +static const unsigned long _glibtop_sysdeps_swap = +(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) + +(1L << GLIBTOP_SWAP_FREE); + +static const unsigned long _glibtop_sysdeps_swap_paging = +(1L << GLIBTOP_SWAP_PAGEIN) + (1L << GLIBTOP_SWAP_PAGEOUT); + +/* Init function. */ + +void +_glibtop_init_swap_s (glibtop *server) +{ + server->sysdeps.swap = _glibtop_sysdeps_swap | + _glibtop_sysdeps_swap_paging; +} + +/* Provides information about swap usage. */ + +#define MEMINFO "/proc/meminfo" +#define PROC_STAT "/proc/stat" + +void +glibtop_get_swap_s (glibtop *server, glibtop_swap *buf) +{ + char buffer [BUFSIZ], *p; + + memset (buf, 0, sizeof (glibtop_swap)); + + file_to_buffer(server, buffer, sizeof buffer, MEMINFO); + + /* Kernel 2.6 with multiple lines */ + + buf->total = get_scaled(buffer, "SwapTotal:"); + buf->free = get_scaled(buffer, "SwapFree:"); + buf->used = buf->total - buf->free; + + buf->flags = _glibtop_sysdeps_swap; + + file_to_buffer (server, buffer, sizeof buffer, PROC_STAT); + + p = strstr (buffer, "\nswap"); + + if(p) + { + p = skip_token (p); + + buf->pagein = strtoull (p, &p, 0); + buf->pageout = strtoull (p, &p, 0); + + buf->flags |= _glibtop_sysdeps_swap_paging; + } +} diff --git a/sysdeps/cygwin/sysinfo.c b/sysdeps/cygwin/sysinfo.c new file mode 100644 index 0000000..b478281 --- /dev/null +++ b/sysdeps/cygwin/sysinfo.c @@ -0,0 +1,99 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "glibtop_private.h" + +#define FILENAME "/proc/cpuinfo" + +static const unsigned long _glibtop_sysdeps_sysinfo = +(1L << GLIBTOP_SYSINFO_CPUINFO); + +static glibtop_sysinfo sysinfo = { .flags = 0 }; + +static void +init_sysinfo (glibtop *server) +{ + char buffer [16384]; + gchar ** processors; + + if(G_LIKELY(sysinfo.flags)) return; + + file_to_buffer(server, buffer, sizeof buffer, FILENAME); + + /* cpuinfo records are seperated by a blank line */ + processors = g_strsplit(buffer, "\n\n", 0); + + for(sysinfo.ncpu = 0; + sysinfo.ncpu < GLIBTOP_NCPU && processors[sysinfo.ncpu] && *processors[sysinfo.ncpu]; + sysinfo.ncpu++) { + + gchar **parts, **p; + + glibtop_entry * const cpuinfo = &sysinfo.cpuinfo[sysinfo.ncpu]; + + cpuinfo->labels = g_ptr_array_new (); + + cpuinfo->values = g_hash_table_new_full(g_str_hash, g_str_equal, + g_free, g_free); + + cpuinfo->descriptions = g_hash_table_new_full(g_str_hash, g_str_equal, + g_free, g_free); + + /* " : " */ + parts = g_strsplit_set(processors[sysinfo.ncpu], ":\n", 0); + + for(p = parts; *p && *(p+1); p += 2) { + + /* stole the allocated memory */ + gchar * const key = g_strstrip( *p ); + gchar * const value = g_strstrip( *(p+1) ); + + g_ptr_array_add(cpuinfo->labels, key); + g_hash_table_insert(cpuinfo->values, key, value); + } + + + /* the last key has no value and has not been added */ + if(*p) g_free(*p); + + /* just g_free instead of g_strvfree because we stole + the memory*/ + + g_free(parts); + + } + + g_strfreev(processors); + + sysinfo.flags = _glibtop_sysdeps_sysinfo; +} + +const glibtop_sysinfo * +glibtop_get_sysinfo_s (glibtop *server) +{ + init_sysinfo (server); + return &sysinfo; +} diff --git a/sysdeps/cygwin/uptime.c b/sysdeps/cygwin/uptime.c new file mode 100644 index 0000000..ba6165c --- /dev/null +++ b/sysdeps/cygwin/uptime.c @@ -0,0 +1,61 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +#include + +static const unsigned long _glibtop_sysdeps_uptime = + (1UL << GLIBTOP_UPTIME_UPTIME) \ ++ (1UL << GLIBTOP_UPTIME_IDLETIME) \ ++ (1UL << GLIBTOP_UPTIME_BOOT_TIME); + +/* Init function. */ + +void +_glibtop_init_uptime_s (glibtop *server) +{ + server->sysdeps.uptime = _glibtop_sysdeps_uptime; +} + +/* Provides uptime and idle time. */ + +#define FILENAME "/proc/uptime" + +void +glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf) +{ + char buffer [BUFSIZ], *p; + + memset (buf, 0, sizeof (glibtop_uptime)); + + file_to_buffer(server, buffer, sizeof buffer, FILENAME); + + buf->uptime = g_ascii_strtod (buffer, &p); + buf->idletime = g_ascii_strtod (p, &p); + buf->boot_time = get_boot_time(server); + + buf->flags = _glibtop_sysdeps_uptime; +} diff --git a/sysdeps/darwin/Makefile.am b/sysdeps/darwin/Makefile.am new file mode 100644 index 0000000..046658a --- /dev/null +++ b/sysdeps/darwin/Makefile.am @@ -0,0 +1,16 @@ +AM_CPPFLAGS = @AM_CPPFLAGS@ @LIBGTOP_INCS@ + +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la + +libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c sysinfo.c + +libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c \ +cpu.c mem.c swap.c uptime.c loadavg.c shm_limits.c msg_limits.c \ +sem_limits.c procaffinity.c proclist.c procstate.c procuid.c proctime.c \ +procmem.c procsignal.c prockernel.c procsegment.c procargs.c \ +procmap.c netload.c ppp.c netlist.c procopenfiles.c procwd.c + +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h +libgtopincludedir = $(includedir)/libgtop-2.0 + +noinst_HEADERS = glibtop_suid.h diff --git a/sysdeps/darwin/Makefile.in b/sysdeps/darwin/Makefile.in new file mode 100644 index 0000000..a0f5728 --- /dev/null +++ b/sysdeps/darwin/Makefile.in @@ -0,0 +1,767 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = sysdeps/darwin +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libgtopinclude_HEADERS) \ + $(noinst_HEADERS) $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libgtop_sysdeps_2_0_la_LIBADD = +am_libgtop_sysdeps_2_0_la_OBJECTS = nosuid.lo siglist.lo sysinfo.lo +libgtop_sysdeps_2_0_la_OBJECTS = $(am_libgtop_sysdeps_2_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgtop_sysdeps_suid_2_0_la_LIBADD = +am_libgtop_sysdeps_suid_2_0_la_OBJECTS = open.lo close.lo cpu.lo \ + mem.lo swap.lo uptime.lo loadavg.lo shm_limits.lo \ + msg_limits.lo sem_limits.lo procaffinity.lo proclist.lo \ + procstate.lo procuid.lo proctime.lo procmem.lo procsignal.lo \ + prockernel.lo procsegment.lo procargs.lo procmap.lo netload.lo \ + ppp.lo netlist.lo procopenfiles.lo procwd.lo +libgtop_sysdeps_suid_2_0_la_OBJECTS = \ + $(am_libgtop_sysdeps_suid_2_0_la_OBJECTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +DIST_SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libgtopincludedir)" +HEADERS = $(libgtopinclude_HEADERS) $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ @LIBGTOP_INCS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la +libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c sysinfo.c +libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c \ +cpu.c mem.c swap.c uptime.c loadavg.c shm_limits.c msg_limits.c \ +sem_limits.c procaffinity.c proclist.c procstate.c procuid.c proctime.c \ +procmem.c procsignal.c prockernel.c procsegment.c procargs.c \ +procmap.c netload.c ppp.c netlist.c procopenfiles.c procwd.c + +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h +libgtopincludedir = $(includedir)/libgtop-2.0 +noinst_HEADERS = glibtop_suid.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sysdeps/darwin/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu sysdeps/darwin/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgtop_sysdeps-2.0.la: $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_LIBADD) $(LIBS) + +libgtop_sysdeps_suid-2.0.la: $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netload.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nosuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procaffinity.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prockernel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procopenfiles.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsegment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsignal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procstate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procwd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siglist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-libgtopincludeHEADERS: $(libgtopinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgtopincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgtopincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgtopincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgtopincludedir)" || exit $$?; \ + done + +uninstall-libgtopincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgtopincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libgtopincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libgtopincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libgtopincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libgtopincludeHEADERS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libgtopincludeHEADERS + +.PRECIOUS: Makefile + + +# 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: diff --git a/sysdeps/darwin/close.c b/sysdeps/darwin/close.c new file mode 100644 index 0000000..018fffb --- /dev/null +++ b/sysdeps/darwin/close.c @@ -0,0 +1,27 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +/* Closes pipe to gtop server. */ + +void +glibtop_close_p (glibtop *server) +{ } diff --git a/sysdeps/darwin/cpu.c b/sysdeps/darwin/cpu.c new file mode 100644 index 0000000..f5549f0 --- /dev/null +++ b/sysdeps/darwin/cpu.c @@ -0,0 +1,91 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_cpu = +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + +(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) + +(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY) + +(1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) + +(1L << GLIBTOP_XCPU_NICE) + (1L << GLIBTOP_XCPU_SYS) + +(1L << GLIBTOP_XCPU_IDLE); + +/* Init function. */ + +void +_glibtop_init_cpu_p (glibtop *server) +{ + server->sysdeps.cpu = _glibtop_sysdeps_cpu; +} + +/* Provides information about cpu usage. */ + +void +glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf) +{ + processor_cpu_load_info_data_t *pinfo; + mach_msg_type_number_t info_count; + natural_t processor_count; + int i; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_CPU), 0); + + memset (buf, 0, sizeof (glibtop_cpu)); + + if (host_processor_info (mach_host_self (), + PROCESSOR_CPU_LOAD_INFO, + &processor_count, + (processor_info_array_t*)&pinfo, + &info_count)) { + glibtop_warn_io_r (server, "host_processor_info (cpu)"); + return; + } + + for (i = 0; i < server->ncpu; i++) { + buf->xcpu_user [i] = pinfo[i].cpu_ticks [CPU_STATE_USER]; + buf->xcpu_sys [i] = pinfo[i].cpu_ticks [CPU_STATE_SYSTEM]; + buf->xcpu_idle [i] = pinfo[i].cpu_ticks [CPU_STATE_IDLE]; + buf->xcpu_nice [i] = pinfo[i].cpu_ticks [CPU_STATE_NICE]; + buf->xcpu_total[i] = buf->xcpu_user [i] + buf->xcpu_sys [i] + + buf->xcpu_idle [i] + buf->xcpu_nice [i]; + + buf->user += buf->xcpu_user [i]; + buf->sys += buf->xcpu_sys [i]; + buf->idle += buf->xcpu_idle [i]; + buf->nice += buf->xcpu_nice [i]; + buf->total += buf->xcpu_total[i]; + } + vm_deallocate (mach_task_self (), (vm_address_t) pinfo, info_count); + + buf->frequency = 100; + buf->flags = _glibtop_sysdeps_cpu; +} + diff --git a/sysdeps/darwin/glibtop_machine.h b/sysdeps/darwin/glibtop_machine.h new file mode 100644 index 0000000..a31eb5c --- /dev/null +++ b/sysdeps/darwin/glibtop_machine.h @@ -0,0 +1,33 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_MACHINE_H__ +#define __GLIBTOP_MACHINE_H__ + +G_BEGIN_DECLS + +struct _glibtop_machine +{ + uid_t uid, euid; /* Real and effective user id */ + gid_t gid, egid; /* Real and effective group id */ +}; + +G_END_DECLS + +#endif diff --git a/sysdeps/darwin/glibtop_server.h b/sysdeps/darwin/glibtop_server.h new file mode 100644 index 0000000..6235bc3 --- /dev/null +++ b/sysdeps/darwin/glibtop_server.h @@ -0,0 +1,51 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SERVER_H__ +#define __GLIBTOP_SERVER_H__ + +G_BEGIN_DECLS + +#define GLIBTOP_SUID_CPU (1 << GLIBTOP_SYSDEPS_CPU) +#define GLIBTOP_SUID_MEM (1 << GLIBTOP_SYSDEPS_MEM) +#define GLIBTOP_SUID_SWAP (1 << GLIBTOP_SYSDEPS_SWAP) +#define GLIBTOP_SUID_UPTIME (1 << GLIBTOP_SYSDEPS_UPTIME) +#define GLIBTOP_SUID_LOADAVG (1 << GLIBTOP_SYSDEPS_LOADAVG) +#define GLIBTOP_SUID_SHM_LIMITS (1 << GLIBTOP_SYSDEPS_SHM_LIMITS) +#define GLIBTOP_SUID_MSG_LIMITS (1 << GLIBTOP_SYSDEPS_MSG_LIMITS) +#define GLIBTOP_SUID_SEM_LIMITS (1 << GLIBTOP_SYSDEPS_SEM_LIMITS) +#define GLIBTOP_SUID_PROCLIST (1 << GLIBTOP_SYSDEPS_PROCLIST) +#define GLIBTOP_SUID_PROC_STATE (1 << GLIBTOP_SYSDEPS_PROC_STATE) +#define GLIBTOP_SUID_PROC_UID (1 << GLIBTOP_SYSDEPS_PROC_UID) +#define GLIBTOP_SUID_PROC_MEM (1 << GLIBTOP_SYSDEPS_PROC_MEM) +#define GLIBTOP_SUID_PROC_TIME (1 << GLIBTOP_SYSDEPS_PROC_TIME) +#define GLIBTOP_SUID_PROC_SIGNAL (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL) +#define GLIBTOP_SUID_PROC_KERNEL (1 << GLIBTOP_SYSDEPS_PROC_KERNEL) +#define GLIBTOP_SUID_PROC_SEGMENT (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT) +#define GLIBTOP_SUID_PROC_ARGS (1 << GLIBTOP_SYSDEPS_PROC_ARGS) +#define GLIBTOP_SUID_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP) +#define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) +#define GLIBTOP_SUID_NETLIST 0 +#define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) +#define GLIBTOP_SUID_PROC_WD (1 << GLIBTOP_SYSDEPS_PROC_WD) +#define GLIBTOP_SUID_PROC_AFFINITY 0 + +G_END_DECLS + +#endif diff --git a/sysdeps/darwin/glibtop_suid.h b/sysdeps/darwin/glibtop_suid.h new file mode 100644 index 0000000..df8edd0 --- /dev/null +++ b/sysdeps/darwin/glibtop_suid.h @@ -0,0 +1,46 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SUID_H__ +#define __GLIBTOP_SUID_H__ + +G_BEGIN_DECLS + +#include + +static inline void glibtop_suid_enter (glibtop *server) { + setreuid (server->machine->uid, server->machine->euid); +}; + +static inline void glibtop_suid_leave (glibtop *server) { + if (setreuid (server->machine->euid, server->machine->uid)) + _exit (1); +}; + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags); +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags); + +G_END_DECLS + +#endif diff --git a/sysdeps/darwin/loadavg.c b/sysdeps/darwin/loadavg.c new file mode 100644 index 0000000..ab14fe4 --- /dev/null +++ b/sysdeps/darwin/loadavg.c @@ -0,0 +1,65 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include + +static const unsigned long _glibtop_sysdeps_loadavg = +(1L << GLIBTOP_LOADAVG_LOADAVG); + +/* Init function. */ + +void +_glibtop_init_loadavg_p (glibtop *server) +{ + server->sysdeps.loadavg = _glibtop_sysdeps_loadavg; +} + +/* Provides load averange. */ + +void +glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf) +{ + double ldavg[3]; + int i; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_LOADAVG), 0); + + memset (buf, 0, sizeof (glibtop_loadavg)); + + if (getloadavg (ldavg, 3) != 3) { + glibtop_warn_io_r (server, "getloadavg"); + return; + } + + /* fill in the struct */ + buf->flags = _glibtop_sysdeps_loadavg; + for (i = 0; i < 3; i++) { + buf->loadavg [i] = ldavg [i]; + } +} + diff --git a/sysdeps/darwin/mem.c b/sysdeps/darwin/mem.c new file mode 100644 index 0000000..66bf3c1 --- /dev/null +++ b/sysdeps/darwin/mem.c @@ -0,0 +1,70 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_mem = +(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) + +(1L << GLIBTOP_MEM_FREE); + +/* Init function. */ + +void +_glibtop_init_mem_p (glibtop *server) +{ + server->sysdeps.mem = _glibtop_sysdeps_mem; +} + +/* Provides information about memory usage. */ + +void +glibtop_get_mem_p (glibtop *server, glibtop_mem *buf) +{ + vm_statistics_data_t vm_info; + mach_msg_type_number_t info_count; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MEM), 0); + + memset (buf, 0, sizeof (glibtop_mem)); + + info_count = HOST_VM_INFO_COUNT; + if (host_statistics (mach_host_self (), HOST_VM_INFO, + (host_info_t)&vm_info, &info_count)) { + glibtop_warn_io_r (server, "host_statistics (vm_statistics)"); + return; + } + + buf->total = (vm_info.active_count + vm_info.inactive_count + + vm_info.free_count + vm_info.wire_count) * vm_page_size; + buf->free = vm_info.free_count * vm_page_size; + buf->used = buf->total - buf->free; + buf->flags = _glibtop_sysdeps_mem; +} + diff --git a/sysdeps/darwin/msg_limits.c b/sysdeps/darwin/msg_limits.c new file mode 100644 index 0000000..c1f9b04 --- /dev/null +++ b/sysdeps/darwin/msg_limits.c @@ -0,0 +1,47 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_msg_limits = 0; + +/* Init function. */ + +void +_glibtop_init_msg_limits_p (glibtop *server) +{ + server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf) +{ + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MSG_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_msg_limits)); +} diff --git a/sysdeps/darwin/netlist.c b/sysdeps/darwin/netlist.c new file mode 100644 index 0000000..59550e0 --- /dev/null +++ b/sysdeps/darwin/netlist.c @@ -0,0 +1,66 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + + +static const unsigned long _glibtop_sysdeps_netlist = (1 << GLIBTOP_NETLIST_NUMBER); + +/* Init function. */ + +void +_glibtop_init_netlist_s (glibtop *server) +{ + server->sysdeps.netlist = _glibtop_sysdeps_netlist; +} + + +char** +glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf) +{ + struct if_nameindex *ifstart, *ifs; + GPtrArray *devices; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_NETLIST, 0); + + memset (buf, 0, sizeof (glibtop_netlist)); + + ifs = ifstart = if_nameindex(); + + devices = g_ptr_array_new(); + + while(ifs && ifs->if_name) { + g_ptr_array_add(devices, g_strdup(ifs->if_name)); + buf->number++; + ifs++; + } + + if_freenameindex(ifstart); + + buf->flags = _glibtop_sysdeps_netlist; + + g_ptr_array_add(devices, NULL); + + return (char **) g_ptr_array_free(devices, FALSE); +} + diff --git a/sysdeps/darwin/netload.c b/sysdeps/darwin/netload.c new file mode 100644 index 0000000..3cb44d9 --- /dev/null +++ b/sysdeps/darwin/netload.c @@ -0,0 +1,165 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_netload = +(1L << GLIBTOP_NETLOAD_IF_FLAGS) + +(1L << GLIBTOP_NETLOAD_MTU) + +/* (1L << GLIBTOP_NETLOAD_SUBNET) + */ +/* (1L << GLIBTOP_NETLOAD_ADDRESS) + */ +(1L << GLIBTOP_NETLOAD_PACKETS_IN) + +(1L << GLIBTOP_NETLOAD_PACKETS_OUT) + +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_BYTES_IN) + +(1L << GLIBTOP_NETLOAD_BYTES_OUT) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) + +(1L << GLIBTOP_NETLOAD_ERRORS_IN) + +(1L << GLIBTOP_NETLOAD_ERRORS_OUT) + +(1L << GLIBTOP_NETLOAD_ERRORS_TOTAL) + +(1L << GLIBTOP_NETLOAD_COLLISIONS); + +/* Init function. */ + +void +_glibtop_init_netload_p (glibtop *server) +{ + server->sysdeps.netload = _glibtop_sysdeps_netload; +} + +/* Provides Network statistics. */ + +void +glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, + const char *interface) +{ + int mib[] = { CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST, 0 }; + size_t bufsize; + char *rtbuf, *ptr, *eob; + struct if_msghdr *ifm; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_NETLOAD), 0); + + memset (buf, 0, sizeof (glibtop_netload)); + + if (sysctl (mib, 6, NULL, &bufsize, NULL, 0) < 0) + return; + + rtbuf = (char*)g_malloc (bufsize); + if (rtbuf == NULL) + return; + + if (sysctl (mib, 6, rtbuf, &bufsize, NULL, 0) < 0) { + g_free (rtbuf); + return; + } + + eob = rtbuf + bufsize; + ptr = rtbuf; + while (ptr < eob) { + struct sockaddr_dl *sdl; + + ifm = (struct if_msghdr*) ptr; + + if (ifm->ifm_type != RTM_IFINFO) + break; + ptr += ifm->ifm_msglen; + + while (ptr < eob) { + struct if_msghdr *nextifm = (struct if_msghdr*) ptr; + + if (nextifm->ifm_type != RTM_NEWADDR) + break; + ptr += nextifm->ifm_msglen; + } + + sdl = (struct sockaddr_dl*) (ifm + 1); + if (sdl->sdl_family != AF_LINK) + continue; + if (strlen (interface) != sdl->sdl_nlen) + continue; + if (strcmp (interface, sdl->sdl_data) == 0) + goto FOUND; + } + g_free (rtbuf); + return; + +FOUND: + if (ifm->ifm_flags & IFF_UP) + buf->if_flags |= GLIBTOP_IF_FLAGS_UP; + if (ifm->ifm_flags & IFF_BROADCAST) + buf->if_flags |= GLIBTOP_IF_FLAGS_BROADCAST; + if (ifm->ifm_flags & IFF_DEBUG) + buf->if_flags |= GLIBTOP_IF_FLAGS_DEBUG; + if (ifm->ifm_flags & IFF_LOOPBACK) + buf->if_flags |= GLIBTOP_IF_FLAGS_LOOPBACK; + if (ifm->ifm_flags & IFF_POINTOPOINT) + buf->if_flags |= GLIBTOP_IF_FLAGS_POINTOPOINT; + if (ifm->ifm_flags & IFF_RUNNING) + buf->if_flags |= GLIBTOP_IF_FLAGS_RUNNING; + if (ifm->ifm_flags & IFF_NOARP) + buf->if_flags |= GLIBTOP_IF_FLAGS_NOARP; + if (ifm->ifm_flags & IFF_NOARP) + buf->if_flags |= GLIBTOP_IF_FLAGS_PROMISC; + if (ifm->ifm_flags & IFF_ALLMULTI) + buf->if_flags |= GLIBTOP_IF_FLAGS_ALLMULTI; + if (ifm->ifm_flags & IFF_OACTIVE) + buf->if_flags |= GLIBTOP_IF_FLAGS_OACTIVE; + if (ifm->ifm_flags & IFF_SIMPLEX) + buf->if_flags |= GLIBTOP_IF_FLAGS_SIMPLEX; + if (ifm->ifm_flags & IFF_LINK0) + buf->if_flags |= GLIBTOP_IF_FLAGS_LINK0; + if (ifm->ifm_flags & IFF_LINK1) + buf->if_flags |= GLIBTOP_IF_FLAGS_LINK1; + if (ifm->ifm_flags & IFF_LINK2) + buf->if_flags |= GLIBTOP_IF_FLAGS_LINK2; + if (ifm->ifm_flags & IFF_ALTPHYS) + buf->if_flags |= GLIBTOP_IF_FLAGS_ALTPHYS; + if (ifm->ifm_flags & IFF_MULTICAST) + buf->if_flags |= GLIBTOP_IF_FLAGS_MULTICAST; + buf->mtu = ifm->ifm_data.ifi_mtu; + buf->subnet = 0; /* FIXME */ + buf->address = 0; /* FIXME */ + buf->packets_in = ifm->ifm_data.ifi_ipackets; + buf->packets_out = ifm->ifm_data.ifi_opackets; + buf->packets_total = buf->packets_in + buf->packets_out; + buf->bytes_in = ifm->ifm_data.ifi_ibytes; + buf->bytes_out = ifm->ifm_data.ifi_obytes; + buf->bytes_total = buf->bytes_in + buf->bytes_out; + buf->errors_in = ifm->ifm_data.ifi_ierrors; + buf->errors_out = ifm->ifm_data.ifi_oerrors; + buf->errors_total = buf->errors_in + buf->errors_out; + buf->collisions = ifm->ifm_data.ifi_collisions; + buf->flags = _glibtop_sysdeps_netload; + g_free (buf); +} diff --git a/sysdeps/darwin/nosuid.c b/sysdeps/darwin/nosuid.c new file mode 100644 index 0000000..e00489d --- /dev/null +++ b/sysdeps/darwin/nosuid.c @@ -0,0 +1,55 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include + +void +glibtop_open_s (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags) +{ + processor_cpu_load_info_data_t *pinfo; + mach_msg_type_number_t info_count; + natural_t processor_count; + + if (host_processor_info (mach_host_self (), + PROCESSOR_CPU_LOAD_INFO, + &processor_count, + (processor_info_array_t*)&pinfo, + &info_count)) { + glibtop_error_io_r (server, "host_processor_info"); + } + server->ncpu = (processor_count <= GLIBTOP_NCPU) ? + processor_count : GLIBTOP_NCPU; + vm_deallocate (mach_task_self (), (vm_address_t) pinfo, info_count); +} + +void +glibtop_close_s (glibtop *server) +{ } diff --git a/sysdeps/darwin/open.c b/sysdeps/darwin/open.c new file mode 100644 index 0000000..577b519 --- /dev/null +++ b/sysdeps/darwin/open.c @@ -0,0 +1,100 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include + +#include + +/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags) +{ + const _glibtop_init_func_t *init_fkt; + + if (server == NULL) + glibtop_error_r (NULL, "glibtop_init_p (server == NULL)"); + + /* Do the initialization, but only if not already initialized. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_INIT) == 0) { + glibtop_open_p (server, "glibtop", features, flags); + + for (init_fkt = _glibtop_init_hook_p; *init_fkt; init_fkt++) + (*init_fkt) (server); + + server->flags |= _GLIBTOP_INIT_STATE_INIT; + } +} + +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags) +{ + processor_cpu_load_info_data_t *pinfo; + mach_msg_type_number_t info_count; + natural_t processor_count; + + /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ + + server->name = program_name; + + server->machine->uid = getuid (); + server->machine->euid = geteuid (); + server->machine->gid = getgid (); + server->machine->egid = getegid (); + + /* Drop priviledges. */ + + if (setreuid (server->machine->euid, server->machine->uid)) + _exit (1); + + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); + + /* !!! END OF SUID ROOT PART !!! */ + + /* Our effective uid is now those of the user invoking the server, + * so we do no longer have any priviledges. */ + + if (host_processor_info (mach_host_self (), + PROCESSOR_CPU_LOAD_INFO, + &processor_count, + (processor_info_array_t*)&pinfo, + &info_count)) { + glibtop_error_io_r (server, "host_processor_info"); + } + server->ncpu = (processor_count <= GLIBTOP_NCPU) ? + processor_count : GLIBTOP_NCPU; + vm_deallocate (mach_task_self (), (vm_address_t) pinfo, info_count); +} diff --git a/sysdeps/darwin/ppp.c b/sysdeps/darwin/ppp.c new file mode 100644 index 0000000..7fa5cab --- /dev/null +++ b/sysdeps/darwin/ppp.c @@ -0,0 +1,47 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_ppp = 0; + +/* Init function. */ + +void +_glibtop_init_ppp_p (glibtop *server) +{ + server->sysdeps.ppp = _glibtop_sysdeps_ppp; +} + +/* Provides PPP/ISDN information. */ + +void +glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device) +{ + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PPP), 0); + + memset (buf, 0, sizeof (glibtop_ppp)); +} diff --git a/sysdeps/darwin/procaffinity.c b/sysdeps/darwin/procaffinity.c new file mode 100644 index 0000000..6662406 --- /dev/null +++ b/sysdeps/darwin/procaffinity.c @@ -0,0 +1,44 @@ +/* + + This file is part of LibGTop 2. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +void +_glibtop_init_proc_affinity_s(glibtop *server) +{ + server->sysdeps.proc_affinity = + (1 << GLIBTOP_PROC_AFFINITY_NUMBER) | + (1 << GLIBTOP_PROC_AFFINITY_ALL); + +} + + +guint16 * +glibtop_get_proc_affinity_s(glibtop *server, glibtop_proc_affinity *buf, pid_t pid) +{ + memset(buf, 0, sizeof *buf); + + return NULL; +} + diff --git a/sysdeps/darwin/procargs.c b/sysdeps/darwin/procargs.c new file mode 100644 index 0000000..e357fd3 --- /dev/null +++ b/sysdeps/darwin/procargs.c @@ -0,0 +1,130 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_args = +(1L << GLIBTOP_PROC_ARGS_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_args_p (glibtop *server) +{ + server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; +} + +/* Provides detailed information about a process. */ + +char * +glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len) +{ + char argbuf[4096]; + char *start, *end, *str; + size_t bufsize = 4096; + int mib [3]; + unsigned length; + char *args; + int *ip; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_ARGS), 0); + + memset (buf, 0, sizeof (glibtop_proc_args)); + + mib [0] = CTL_KERN; + mib [1] = KERN_PROCARGS; + mib [2] = pid; + + /* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + if (sysctl (mib, 3, argbuf, &bufsize, NULL, 0) < 0) { + glibtop_suid_leave (server); + return NULL; + } + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + + end = &argbuf[bufsize]; + + ip = (int *)end - 2; + while (*--ip) { + if (ip == (int *)argbuf) { + return NULL; + } + } + + start = (char *)(ip + 1); + while (*--ip) { + if (ip == (int *)argbuf) { + return NULL; + } + } + ip++; + + if ((ip[0] & 0xbfff0000) == 0xbfff0000) { + ip += 2; + start = (char*)(ip + (strlen ((char*)ip) + 3) / 4); + while (!*start) + start++; + } + + for (str = start + strlen (start); str < end - 1; str++) { + if (*str == '=') { + while (*str != '\0' && str > start) + str--; + break; + } + } + end = str; + + if (start[0] == '-' || start[0] == '?' || start[0] <= ' ') { + return NULL; + } + + length = end - start; + if (max_len != 0 && length > max_len) + length = max_len; + args = g_malloc(length + 1); + if (args == NULL) { + glibtop_warn_io_r (server, "malloc(procargs)"); + return NULL; + } + + memcpy (args, start, length); + args [length] = '\0'; + + buf->size = length; + buf->flags = _glibtop_sysdeps_proc_args; + + return args; +} diff --git a/sysdeps/darwin/prockernel.c b/sysdeps/darwin/prockernel.c new file mode 100644 index 0000000..d5f67f5 --- /dev/null +++ b/sysdeps/darwin/prockernel.c @@ -0,0 +1,48 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_kernel = 0; + +/* Init function. */ + +void +_glibtop_init_proc_kernel_p (glibtop *server) +{ + server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_kernel_p (glibtop *server, glibtop_proc_kernel *buf, + pid_t pid) +{ + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_KERNEL), 0); + + memset (buf, 0, sizeof (glibtop_proc_kernel)); +} diff --git a/sysdeps/darwin/proclist.c b/sysdeps/darwin/proclist.c new file mode 100644 index 0000000..e02bc92 --- /dev/null +++ b/sysdeps/darwin/proclist.c @@ -0,0 +1,104 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include +#include + +static const unsigned long _glibtop_sysdeps_proclist = +(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) + +(1L << GLIBTOP_PROCLIST_SIZE); + +/* Init function. */ + +void +_glibtop_init_proclist_p (glibtop *server) +{ + server->sysdeps.proclist = _glibtop_sysdeps_proclist; +} + +pid_t * +glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg) +{ + unsigned count, total, i; + pid_t *pids_chain; + int mib[4]; + struct kinfo_proc *kp; + size_t length; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROCLIST), 0); + + memset (buf, 0, sizeof (glibtop_proclist)); + + mib [0] = CTL_KERN; + mib [1] = KERN_PROC; + mib [2] = (int)(which & GLIBTOP_KERN_PROC_MASK); + mib [3] = (int)arg; + + if (sysctl (mib, 4, NULL, &length, NULL, 0) < 0) { + glibtop_warn_io_r (server, "sysctl (proclist)"); + return NULL; + } + if ((kp = (struct kinfo_proc *) g_malloc(length)) == NULL) { + glibtop_warn_io_r (server, "malloc (proclist)"); + return NULL; + } + if (sysctl (mib, 4, kp, &length, NULL, 0) < 0) { + glibtop_warn_io_r (server, "sysctl (proclist)"); + g_free (kp); + return NULL; + } + + count = length / sizeof (struct kinfo_proc); + pids_chain = g_malloc(count * sizeof (unsigned)); + if (pids_chain == NULL) { + glibtop_warn_io_r (server, "g_realloc (proclist)"); + g_free (kp); + return NULL; + } + + for (total = 0, i = 0; i < count; i++) { + if ((which & GLIBTOP_EXCLUDE_IDLE) && + (kp [i].kp_proc.p_stat != SRUN)) + continue; + if ((which & GLIBTOP_EXCLUDE_SYSTEM) && + (kp [i].kp_eproc.e_pcred.p_ruid == 0)) + continue; + pids_chain [total++] = (unsigned) kp [i].kp_proc.p_pid; + } + + g_free (kp); + + buf->number = total; + buf->size = sizeof (unsigned); + buf->total = total * sizeof (unsigned); + buf->flags = _glibtop_sysdeps_proclist; + + return pids_chain; +} + diff --git a/sysdeps/darwin/procmap.c b/sysdeps/darwin/procmap.c new file mode 100644 index 0000000..46b9384 --- /dev/null +++ b/sysdeps/darwin/procmap.c @@ -0,0 +1,134 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_map = +(1L << GLIBTOP_PROC_MAP_TOTAL) + (1L << GLIBTOP_PROC_MAP_NUMBER) + +(1L << GLIBTOP_PROC_MAP_SIZE); + +static const unsigned long _glibtop_sysdeps_proc_map_entry = +(1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) + +(1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM); + +/* Init function. */ + +void +_glibtop_init_proc_map_p (glibtop *server) +{ + server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; +} + +/* Provides detailed information about a process. */ + +glibtop_map_entry * +glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, pid_t pid) +{ + glibtop_map_entry *maps; + mach_port_t task; + vm_address_t address; + natural_t nesting_depth; + int n; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_MAP), 0); + + memset (buf, 0, sizeof (glibtop_proc_map)); + + /* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + + if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS) { + glibtop_suid_leave (server); + glibtop_warn_io_r (server, "task_for_pid (procmap)"); + return NULL; + } + + maps = NULL; + n = 0; + address = 0; + nesting_depth = 0; + while (1) { + vm_region_submap_info_data_64_t info; + mach_msg_type_number_t info_count; + vm_size_t size; + + info_count = VM_REGION_SUBMAP_INFO_COUNT_64; + if (vm_region_recurse_64 (task, &address, &size, &nesting_depth, + (vm_region_recurse_info_64_t)&info, &info_count)) + break; + + if (info.is_submap) { + nesting_depth++; + continue; + } + + maps = g_realloc (maps, (n + 1) * sizeof (glibtop_map_entry)); + if (!maps) { + glibtop_suid_leave (server); + return NULL; + } + + memset (maps + n, 0, sizeof (glibtop_map_entry)); + + maps[n].start = address; + maps[n].end = address + size - 1; + maps[n].offset = info.offset; + if (info.protection & VM_PROT_READ) + maps[n].perm |= GLIBTOP_MAP_PERM_READ; + if (info.protection & VM_PROT_WRITE) + maps[n].perm |= GLIBTOP_MAP_PERM_WRITE; + if (info.protection & VM_PROT_EXECUTE) + maps[n].perm |= GLIBTOP_MAP_PERM_EXECUTE; + if (info.share_mode == SM_PRIVATE || + info.share_mode == SM_PRIVATE_ALIASED) + maps[n].perm |= GLIBTOP_MAP_PERM_PRIVATE; + if (info.share_mode == SM_SHARED || + info.share_mode == SM_TRUESHARED || + info.share_mode == SM_SHARED_ALIASED) + maps[n].perm |= GLIBTOP_MAP_PERM_SHARED; + + maps[n].flags = _glibtop_sysdeps_proc_map_entry; + + address += size; + n++; + } + + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + + buf->number = n; + buf->size = sizeof (glibtop_map_entry); + buf->total = n * sizeof (glibtop_map_entry); + buf->flags = _glibtop_sysdeps_proc_map; + + return maps; +} diff --git a/sysdeps/darwin/procmem.c b/sysdeps/darwin/procmem.c new file mode 100644 index 0000000..8bf5b5d --- /dev/null +++ b/sysdeps/darwin/procmem.c @@ -0,0 +1,245 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_mem = +(1L << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_VSIZE) + +(1L << GLIBTOP_PROC_MEM_RESIDENT) + (1L << GLIBTOP_PROC_MEM_SHARE) + +(1L << GLIBTOP_PROC_MEM_RSS); + +/* Init function. */ + +void +_glibtop_init_proc_mem_p (glibtop *server) +{ + server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem; +} + + +#define SHARED_TABLE_SIZE 137 +#define TEXT_SEGMENT_START (GLOBAL_SHARED_TEXT_SEGMENT) +#define TEXT_SEGMENT_END (GLOBAL_SHARED_TEXT_SEGMENT + SHARED_TEXT_REGION_SIZE) +#define DATA_SEGMENT_START (GLOBAL_SHARED_DATA_SEGMENT) +#define DATA_SEGMENT_END (GLOBAL_SHARED_DATA_SEGMENT + SHARED_DATA_REGION_SIZE) + +struct shared_info { + unsigned obj_id; + unsigned share_mode; + unsigned page_count; + unsigned ref_count; + unsigned task_ref_count; + vm_size_t size; + struct shared_info *next; +}; +typedef struct shared_info shared_table[SHARED_TABLE_SIZE]; +typedef struct shared_info shared_info; + +static void +shared_table_init (shared_table table) +{ + memset (table, 0, sizeof (shared_table)); +} + +static void +shared_table_free (glibtop *server, shared_table table) +{ + int i; + + for (i = 0; i < SHARED_TABLE_SIZE; i++) { + shared_info *info = table [i].next; + + while (info) { + shared_info *next = info->next; + g_free (info); + info = next; + } + } +} + +static void +shared_table_register (glibtop *server, shared_table table, + vm_region_top_info_data_t *top, vm_size_t size) +{ + shared_info *info, *last; + + info = last = &table [top->obj_id % SHARED_TABLE_SIZE]; + while (info) { + if (info->obj_id == top->obj_id) { + info->task_ref_count++; + return; + } + last = info; + info = info->next; + } + + info = g_malloc (sizeof (shared_info)); + if (info) { + info->obj_id = top->obj_id; + info->share_mode = top->share_mode; + info->page_count = top->shared_pages_resident; + info->ref_count = top->ref_count; + info->task_ref_count = 1; + info->size = size; + info->next = NULL; + last->next = info; + } +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, + pid_t pid) +{ + task_basic_info_data_t tinfo; + mach_msg_type_number_t info_count; + vm_size_t vsize, resident, private, vprivate, shared; + kern_return_t retval; + shared_table stable; + vm_address_t address; + mach_port_t task; + int i, split; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_MEM), 0); + + memset (buf, 0, sizeof (glibtop_proc_mem)); + + address = 0; + split = 0; + vsize = resident = private = vprivate = shared = 0; + shared_table_init (stable); + + /* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + retval = task_for_pid (mach_task_self (), pid, &task); + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + + if (retval) + return; + + info_count = TASK_BASIC_INFO_COUNT; + if (task_info (task, TASK_BASIC_INFO, (task_info_t)&tinfo, &info_count)) { + glibtop_warn_io_r (server, "task_info (procmem)"); + return; + } + vsize = tinfo.virtual_size; + resident = tinfo.resident_size; + + /* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + while (1) { + vm_region_basic_info_data_64_t basic; + vm_region_top_info_data_t top; + mach_port_t object_name; + vm_size_t size; + + info_count = VM_REGION_BASIC_INFO_COUNT_64; + if (vm_region_64 (task, &address, &size, VM_REGION_BASIC_INFO, + (vm_region_info_t)&basic, + &info_count, &object_name)) + break; + + info_count = VM_REGION_TOP_INFO_COUNT; + if (vm_region_64 (task, &address, &size, VM_REGION_TOP_INFO, + (vm_region_info_t)&top, + &info_count, &object_name)) + break; + + if (address >= TEXT_SEGMENT_START && address < DATA_SEGMENT_END) { + if (!split && top.share_mode == SM_EMPTY) { + if (basic.reserved) + split = 1; + } + if (top.share_mode != SM_PRIVATE) { + address += size; + continue; + } + } + + switch (top.share_mode) { + case SM_COW: + if (top.ref_count == 1) { + private += top.private_pages_resident * vm_page_size; + private += top.shared_pages_resident * vm_page_size; + vprivate += size; + } else { + shared_table_register (server, stable, &top, size); + vprivate += top.private_pages_resident * vm_page_size; + } + break; + case SM_PRIVATE: + private += top.private_pages_resident * vm_page_size; + vprivate += size; + break; + case SM_SHARED: + shared_table_register (server, stable, &top, size); + break; + } + + address += size; + } + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + + for (i = 0; i < SHARED_TABLE_SIZE; i++) { + shared_info *sinfo = &stable[i]; + + while (sinfo) { + if (sinfo->share_mode == SM_SHARED && + sinfo->ref_count == sinfo->task_ref_count) { + private += sinfo->page_count * vm_page_size; + vprivate += sinfo->size; + } else { + shared += sinfo->page_count * vm_page_size; + } + sinfo = sinfo->next; + } + } + shared_table_free (server, stable); + + if (split) + vsize -= DATA_SEGMENT_END - TEXT_SEGMENT_START; + + buf->size = vprivate; + buf->vsize = vsize; + buf->resident = resident; + buf->share = shared; + buf->rss = private; + buf->flags = _glibtop_sysdeps_proc_mem; +} diff --git a/sysdeps/darwin/procopenfiles.c b/sysdeps/darwin/procopenfiles.c new file mode 100644 index 0000000..ebd797b --- /dev/null +++ b/sysdeps/darwin/procopenfiles.c @@ -0,0 +1,43 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +/* Init function. */ + +void +_glibtop_init_proc_open_files_s (glibtop *server) +{ + server->sysdeps.proc_open_files = 0; +} + +/* Provides detailed information about a process. */ + +glibtop_open_files_entry * +glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pid_t pid) +{ + glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_MAP, 0); + + memset (buf, 0, sizeof (glibtop_proc_open_files)); + + return NULL; +} diff --git a/sysdeps/darwin/procsegment.c b/sysdeps/darwin/procsegment.c new file mode 100644 index 0000000..19d70a1 --- /dev/null +++ b/sysdeps/darwin/procsegment.c @@ -0,0 +1,48 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_segment = 0; + +/* Init function. */ + +void +_glibtop_init_proc_segment_p (glibtop *server) +{ + server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf, + pid_t pid) +{ + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0); + + memset (buf, 0, sizeof (glibtop_proc_segment)); +} diff --git a/sysdeps/darwin/procsignal.c b/sysdeps/darwin/procsignal.c new file mode 100644 index 0000000..487b6a9 --- /dev/null +++ b/sysdeps/darwin/procsignal.c @@ -0,0 +1,76 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_signal = +(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + +(1L << GLIBTOP_PROC_SIGNAL_BLOCKED) + +(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + +(1L << GLIBTOP_PROC_SIGNAL_SIGCATCH); + +/* Init function. */ + +void +_glibtop_init_proc_signal_p (glibtop *server) +{ + server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_signal_p (glibtop *server, glibtop_proc_signal *buf, + pid_t pid) +{ + int mib[4]; + size_t length; + struct kinfo_proc kinfo; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0); + + memset (buf, 0, sizeof (glibtop_proc_signal)); + + mib [0] = CTL_KERN; + mib [1] = KERN_PROC; + mib [2] = KERN_PROC_PID; + mib [3] = pid; + + length = sizeof (struct kinfo_proc); + if (sysctl (mib, 4, &kinfo, &length, NULL, 0) < 0) { + glibtop_warn_io_r (server, "sysctl (procuid)"); + return; + } + + buf->signal[0] = kinfo.kp_proc.p_siglist; + buf->blocked[0] = kinfo.kp_proc.p_sigmask; + buf->sigignore[0] = kinfo.kp_proc.p_sigignore; + buf->sigcatch[0] = kinfo.kp_proc.p_sigcatch; + buf->flags = _glibtop_sysdeps_proc_signal; +} diff --git a/sysdeps/darwin/procstate.c b/sysdeps/darwin/procstate.c new file mode 100644 index 0000000..e857436 --- /dev/null +++ b/sysdeps/darwin/procstate.c @@ -0,0 +1,94 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_state = +(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_STATE) + +(1L << GLIBTOP_PROC_STATE_UID) + (1L << GLIBTOP_PROC_STATE_GID); + +/* Init function. */ + +void +_glibtop_init_proc_state_p (glibtop *server) +{ + server->sysdeps.proc_state = _glibtop_sysdeps_proc_state; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_state_p (glibtop *server, glibtop_proc_state *buf, + pid_t pid) +{ + int mib[4]; + size_t length; + struct kinfo_proc kinfo; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_STATE), 0); + + memset (buf, 0, sizeof (glibtop_proc_state)); + + mib [0] = CTL_KERN; + mib [1] = KERN_PROC; + mib [2] = KERN_PROC_PID; + mib [3] = pid; + + length = sizeof (struct kinfo_proc); + if (sysctl (mib, 4, &kinfo, &length, NULL, 0) < 0) { + glibtop_warn_io_r (server, "sysctl (procstat)"); + return; + } + + strncpy (buf->cmd, kinfo.kp_proc.p_comm, sizeof (buf->cmd) - 1); + buf->cmd [sizeof (buf->cmd) - 1] = 0; + buf->uid = kinfo.kp_eproc.e_pcred.p_svuid; + buf->gid = kinfo.kp_eproc.e_pcred.p_svgid; + switch (kinfo.kp_proc.p_stat) { + case SIDL: + buf->state = 0; + break; + case SRUN: + buf->state = 'R'; + break; + case SSLEEP: + buf->state = 'S'; + break; + case SSTOP: + buf->state = 'T'; + break; + case SZOMB: + buf->state = 'Z'; + break; + default: + return; + } + buf->flags = _glibtop_sysdeps_proc_state; +} + diff --git a/sysdeps/darwin/proctime.c b/sysdeps/darwin/proctime.c new file mode 100644 index 0000000..9b39bd9 --- /dev/null +++ b/sysdeps/darwin/proctime.c @@ -0,0 +1,118 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_time = +(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_STIME) + +(1L << GLIBTOP_PROC_TIME_FREQUENCY) + (1L << GLIBTOP_PROC_TIME_START_TIME); + +#define tv2sec(tv) (((u_int64_t) tv.seconds * 1000000) + (u_int64_t) tv.microseconds) + +/* Init function. */ + +void +_glibtop_init_proc_time_p (glibtop *server) +{ + server->sysdeps.proc_time = _glibtop_sysdeps_proc_time; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, + pid_t pid) +{ + unsigned int count; + task_basic_info_data_t ti; + task_thread_times_info_data_t tti; + task_port_t task; + time_value_t utime = {0, 0}, stime = {0, 0}; + size_t length; + struct kinfo_proc kinfo; + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, 0 }; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_TIME), 0); + + memset (buf, 0, sizeof (glibtop_proc_time)); + + mib[3] = pid; + length = sizeof (kinfo); + if (sysctl (mib, 4, &kinfo, &length, NULL, 0) < 0) { + glibtop_suid_leave (server); + return; + } + + /* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + + if (task_for_pid (mach_task_self(), pid, &task) != KERN_SUCCESS) { + glibtop_suid_leave (server); + return; + } + + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + + count = TASK_BASIC_INFO_COUNT; + if (task_info(task, TASK_BASIC_INFO, (task_info_t)&ti, &count) != KERN_SUCCESS) { + glibtop_warn_io_r (server, "task_info (proctime)"); + if (task != mach_task_self()) + mach_port_deallocate (mach_task_self(), task); + return; + } + + count = TASK_THREAD_TIMES_INFO_COUNT; + if (task_info(task, TASK_THREAD_TIMES_INFO, (task_info_t)&tti, &count) != KERN_SUCCESS) { + glibtop_warn_io_r (server, "task_info (proctime)"); + if (task != mach_task_self()) + mach_port_deallocate (mach_task_self(), task); + return; + } + + time_value_add (&utime, &ti.user_time); + time_value_add (&stime, &ti.system_time); + time_value_add (&utime, &tti.user_time); + time_value_add (&stime, &tti.system_time); + + /* use the same frequency as cpu.c */ + buf->utime = tv2sec (utime) / 10000; + buf->stime = tv2sec (stime) / 10000; + buf->frequency = 1000000 / 10000; + buf->start_time = kinfo.kp_proc.p_starttime.tv_sec; + + buf->flags = _glibtop_sysdeps_proc_time; +} diff --git a/sysdeps/darwin/procuid.c b/sysdeps/darwin/procuid.c new file mode 100644 index 0000000..47a5f6c --- /dev/null +++ b/sysdeps/darwin/procuid.c @@ -0,0 +1,83 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_uid = +(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) + +(1L << GLIBTOP_PROC_UID_GID) + (1L << GLIBTOP_PROC_UID_EGID) + +(1L << GLIBTOP_PROC_UID_PID) + (1L << GLIBTOP_PROC_UID_PPID) + +(1L << GLIBTOP_PROC_UID_PGRP) + (1L << GLIBTOP_PROC_UID_TTY) + +(1L << GLIBTOP_PROC_UID_TPGID); + +/* Init function. */ + +void +_glibtop_init_proc_uid_p (glibtop *server) +{ + server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, + pid_t pid) +{ + int mib[4]; + size_t length; + struct kinfo_proc kinfo; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_UID), 0); + + memset (buf, 0, sizeof (glibtop_proc_uid)); + + mib [0] = CTL_KERN; + mib [1] = KERN_PROC; + mib [2] = KERN_PROC_PID; + mib [3] = pid; + + length = sizeof (struct kinfo_proc); + if (sysctl (mib, 4, &kinfo, &length, NULL, 0) < 0) { + glibtop_warn_io_r (server, "sysctl (procuid)"); + return; + } + + buf->uid = kinfo.kp_eproc.e_pcred.p_ruid; + buf->euid = kinfo.kp_eproc.e_pcred.p_svuid; + buf->gid = kinfo.kp_eproc.e_pcred.p_rgid; + buf->egid = kinfo.kp_eproc.e_pcred.p_svgid; + buf->ppid = kinfo.kp_eproc.e_ppid; + buf->pgrp = kinfo.kp_eproc.e_pgid; + buf->tpgid = kinfo.kp_eproc.e_tpgid; + buf->nice = kinfo.kp_proc.p_nice; + buf->priority = kinfo.kp_proc.p_priority; + + buf->flags = _glibtop_sysdeps_proc_uid; +} diff --git a/sysdeps/darwin/procwd.c b/sysdeps/darwin/procwd.c new file mode 100644 index 0000000..6ebb1d9 --- /dev/null +++ b/sysdeps/darwin/procwd.c @@ -0,0 +1,50 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_wd = 0; + +/* Init function. */ + +void +_glibtop_init_proc_wd_p (glibtop *server) +{ + server->sysdeps.proc_wd = _glibtop_sysdeps_proc_wd; +} + +/* Provides detailed information about a process. */ + +char ** +glibtop_get_proc_wd_p (glibtop *server, glibtop_proc_wd *buf, + pid_t pid) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_WD, 0); + + memset (buf, 0, sizeof (glibtop_proc_wd)); + return NULL; +} diff --git a/sysdeps/darwin/sem_limits.c b/sysdeps/darwin/sem_limits.c new file mode 100644 index 0000000..b58f5d0 --- /dev/null +++ b/sysdeps/darwin/sem_limits.c @@ -0,0 +1,47 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_sem_limits = 0; + +/* Init function. */ + +void +_glibtop_init_sem_limits_p (glibtop *server) +{ + server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; +} + +/* Provides information about sysv sem limits. */ + +void +glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) +{ + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SEM_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_sem_limits)); +} diff --git a/sysdeps/darwin/shm_limits.c b/sysdeps/darwin/shm_limits.c new file mode 100644 index 0000000..6491805 --- /dev/null +++ b/sysdeps/darwin/shm_limits.c @@ -0,0 +1,47 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_shm_limits = 0; + +/* Init function. */ + +void +_glibtop_init_shm_limits_p (glibtop *server) +{ + server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) +{ + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SHM_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_shm_limits)); +} diff --git a/sysdeps/darwin/siglist.c b/sysdeps/darwin/siglist.c new file mode 100644 index 0000000..d257132 --- /dev/null +++ b/sysdeps/darwin/siglist.c @@ -0,0 +1,60 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 1, "SIGHUP", NULL }, /* hangup */ + { 2, "SIGINT", NULL }, /* interrupt */ + { 3, "SIGQUIT", NULL }, /* quit */ + { 4, "SIGILL", NULL }, /* illegal instruction */ + { 5, "SIGTRAP", NULL }, /* trace trap */ + { 6, "SIGTRAP", NULL }, /* abort */ + { 7, "SIGEMT", NULL }, /* EMT instruction */ + { 8, "SIGFPE", NULL }, /* floating point exception */ + { 9, "SIGKILL", NULL }, /* kill */ + { 10, "SIGBUS", NULL }, /* bus error */ + { 11, "SIGSEGV", NULL }, /* segmentation violation */ + { 12, "SIGSYS", NULL }, /* bad argument to system call */ + { 13, "SIGPIPE", NULL }, /* write on a pipe with no one to read it */ + { 14, "SIGALRM", NULL }, /* alarm clock */ + { 15, "SIGTERM", NULL }, /* software termination signal from kill */ + { 16, "SIGURG", NULL }, /* urgent condition on IO channel */ + { 17, "SIGSTOP", NULL }, /* sendable stop signal not from tty */ + { 18, "SIGTSTP", NULL }, /* stop signal from tty */ + { 19, "SIGCONT", NULL }, /* continue a stopped process */ + { 20, "SIGCHLD", NULL }, /* to parent on child stop or exit */ + { 21, "SIGTTIN", NULL }, /* to readers pgrp upon background tty read */ + { 22, "SIGTTOU", NULL }, /* like TTIN for output */ + { 23, "SIGIO", NULL }, /* input/output possible signal */ + { 24, "SIGXCPU", NULL }, /* exceeded CPU time limit */ + { 25, "SIGXFSZ", NULL }, /* exceeded file size limit */ + { 26, "SIGVTALRM", NULL }, /* virtual time alarm */ + { 27, "SIGPROF", NULL }, /* profiling time alarm */ + { 28, "SIGWINCH", NULL }, /* window size changes */ + { 29, "SIGWINFO", NULL }, /* information request */ + { 30, "SIGUSR1", NULL }, /* user defined signal 1 */ + { 31, "SIGUSR2", NULL }, /* user defined signal 2 */ + { 0, NULL, NULL } +}; + diff --git a/sysdeps/darwin/swap.c b/sysdeps/darwin/swap.c new file mode 100644 index 0000000..5a965b9 --- /dev/null +++ b/sysdeps/darwin/swap.c @@ -0,0 +1,110 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_swap = +(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) + +(1L << GLIBTOP_SWAP_FREE) + (1L << GLIBTOP_SWAP_PAGEIN) + +(1L << GLIBTOP_SWAP_PAGEOUT); + +/* Init function. */ + +void +_glibtop_init_swap_p (glibtop *server) +{ + server->sysdeps.swap = _glibtop_sysdeps_swap; +} + +/* Provides information about swap usage. */ + +void +glibtop_get_swap_p (glibtop *server, glibtop_swap *buf) +{ + vm_statistics_data_t vm_info; + mach_msg_type_number_t info_count; + DIR *dirp; + struct dirent *dp; + struct statfs sfs; + u_int64_t total, used; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SWAP), 0); + + memset (buf, 0, sizeof (glibtop_swap)); + + total = used = 0; + + dirp = opendir ("/private/var/vm"); + if (!dirp) { + glibtop_warn_io_r (server, "opendir (swap)"); + return; + } + while ((dp = readdir (dirp)) != NULL) { + struct stat sb; + char fname [MAXNAMLEN]; + + if (strncmp (dp->d_name, "swapfile", 8)) + continue; + + strcpy (fname, "/private/var/vm/"); + strcat (fname, dp->d_name); + if (stat (fname, &sb) < 0) + continue; + + used += sb.st_size; + } + closedir (dirp); + + if (statfs ("/private/var/vm", &sfs) < 0) { + glibtop_warn_io_r (server, "statfs (swap)"); + return; + } + total = (u_int64_t)sfs.f_bfree * sfs.f_bsize + used; + + info_count = HOST_VM_INFO_COUNT; + if (host_statistics (mach_host_self (), HOST_VM_INFO, + (host_info_t) &vm_info, &info_count)) { + glibtop_warn_io_r (server, "host_statistics (swap)"); + return; + } + + buf->total = total; + buf->used = used; + buf->free = total - used; + buf->pagein = vm_info.pageins; + buf->pageout = vm_info.pageouts; + buf->flags = _glibtop_sysdeps_swap; +} + diff --git a/sysdeps/darwin/sysinfo.c b/sysdeps/darwin/sysinfo.c new file mode 100644 index 0000000..079e2c2 --- /dev/null +++ b/sysdeps/darwin/sysinfo.c @@ -0,0 +1,90 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_sysinfo = +(1L << GLIBTOP_SYSINFO_CPUINFO); + +static glibtop_sysinfo sysinfo = { .flags = 0 }; + +static void +init_sysinfo (glibtop *server) +{ + char *model; + guint64 ncpus = 1; + int mhz = 0; + size_t len; + + if (G_LIKELY (sysinfo.flags)) + return; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0); + + len = sizeof (ncpus); + sysctlbyname ("hw.ncpu", &ncpus, &len, NULL, 0); + len = 0; + sysctlbyname ("hw.model", NULL, &len, NULL, 0); + model = g_malloc (len); + sysctlbyname ("hw.model", model, &len, NULL, 0); + len = sizeof (mhz); + sysctlbyname ("hw.cpufrequency", &mhz, &len, NULL, 0); + mhz = mhz / 1000000; + + for (sysinfo.ncpu = 0; + sysinfo.ncpu < GLIBTOP_NCPU && sysinfo.ncpu < ncpus; + sysinfo.ncpu++) { + glibtop_entry * const cpuinfo = &sysinfo.cpuinfo[sysinfo.ncpu]; + + cpuinfo->labels = g_ptr_array_new (); + + cpuinfo->values = g_hash_table_new_full(g_str_hash, + g_str_equal, + NULL, g_free); + + g_ptr_array_add (cpuinfo->labels, "processor"); + g_hash_table_insert (cpuinfo->values, "processor", + g_strdup_printf("%u", (guint)sysinfo.ncpu)); + + g_ptr_array_add (cpuinfo->labels, "vendor_id"); + g_hash_table_insert (cpuinfo->values, "vendor_id", + g_strdup(model)); + + g_ptr_array_add (cpuinfo->labels, "cpu MHz"); + g_hash_table_insert (cpuinfo->values, "cpu MHz", + g_strdup_printf("%d", mhz)); + } + + g_free (model); + + sysinfo.flags = _glibtop_sysdeps_sysinfo; +} + +const glibtop_sysinfo * +glibtop_get_sysinfo_s (glibtop *server) +{ + init_sysinfo (server); + return &sysinfo; +} diff --git a/sysdeps/darwin/uptime.c b/sysdeps/darwin/uptime.c new file mode 100644 index 0000000..c517c55 --- /dev/null +++ b/sysdeps/darwin/uptime.c @@ -0,0 +1,66 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_uptime = +(1L << GLIBTOP_UPTIME_UPTIME); + +/* Init function. */ + +void +_glibtop_init_uptime_p (glibtop *server) +{ + server->sysdeps.uptime = _glibtop_sysdeps_uptime; +} + +/* Provides uptime and idle time. */ + +void +glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf) +{ + int mib [] = { CTL_KERN, KERN_BOOTTIME }; + struct timeval boottime; + size_t size = sizeof (boottime); + time_t now; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_UPTIME), 0); + + memset (buf, 0, sizeof (glibtop_uptime)); + + /* copied from gkrellm port */ + + if (sysctl (mib, 2, &boottime, &size, NULL, 0) == -1) + return; + time (&now); + + buf->uptime = now - boottime.tv_sec + 30; + buf->flags = _glibtop_sysdeps_uptime; +} diff --git a/sysdeps/freebsd/AUTHORS b/sysdeps/freebsd/AUTHORS new file mode 100644 index 0000000..e274ce5 --- /dev/null +++ b/sysdeps/freebsd/AUTHORS @@ -0,0 +1,3 @@ +Martin Baulig (martin@home-of-linux.org) +Josh Sled (jsled@scam.XCF.Berkeley.EDU) +Joe Marcus Clarke (marcus@FreeBSD.org) diff --git a/sysdeps/freebsd/ChangeLog b/sysdeps/freebsd/ChangeLog new file mode 100644 index 0000000..29489cd --- /dev/null +++ b/sysdeps/freebsd/ChangeLog @@ -0,0 +1,477 @@ +2007-07-01 Benoît Dejean + + Fixe some problems as well as implements procwd and procopenfiles + for FreeBSD using a wrapper around lsof. This same backend should + also work on kFreeBSD. + + Patch by Joe Marcus Clarke + +2007-02-18 Benoît Dejean + + * AUTHORS: + * Makefile.am: + * NOTES: + * cpu.c: (glibtop_init_cpu_s), (glibtop_get_cpu_s): + * fsusage.c: (_glibtop_freebsd_get_fsusage_read_write): + * glibtop_machine.h: + * glibtop_server.h: + * init.c: + * loadavg.c: (glibtop_init_loadavg_s), (glibtop_get_loadavg_s): + * mem.c: (glibtop_init_mem_s), (glibtop_get_mem_s): + * msg_limits.c: (glibtop_init_msg_limits_s), + (glibtop_get_msg_limits_s): + * netload.c: (glibtop_init_netload_p), (glibtop_get_netload_p): + * open.c: (glibtop_open_p): + * ppp.c: (glibtop_init_ppp_p), (glibtop_get_ppp_p): + * procargs.c: (glibtop_get_proc_args_p): + * procdata.c: + * prockernel.c: (glibtop_init_proc_kernel_p), + (glibtop_get_proc_kernel_p): + * proclist.c: (glibtop_get_proclist_p): + * procmap.c: (_glibtop_sysdeps_freebsd_dev_inode), + (glibtop_get_proc_map_p): + * procmem.c: (glibtop_init_proc_mem_p), (glibtop_get_proc_mem_p): + * procsegment.c: (glibtop_init_proc_segment_p), + (glibtop_get_proc_segment_p): + * procsignal.c: (glibtop_get_proc_signal_p): + * procstate.c: (glibtop_init_proc_state_p), + (glibtop_get_proc_state_p): + * proctime.c: (glibtop_get_proc_time_p): + * procuid.c: (glibtop_init_proc_uid_p), (glibtop_get_proc_uid_p): + * sem_limits.c: (glibtop_init_sem_limits_s), + (glibtop_get_sem_limits_s): + * shm_limits.c: (glibtop_init_shm_limits_s), + (glibtop_get_shm_limits_s): + * swap.c: (glibtop_init_swap_p), (glibtop_get_swap_p): + * sysinfo.c: (init_sysinfo): + * uptime.c: (glibtop_init_uptime_s), (glibtop_get_uptime_s): + + Huge (k)FreeBSD update. + (k)FreeBSD support is freebsd/ + Other BSD are in bsd/ + + Patch by Joe Marcus Clarke + Alexander Nedotsukov + + Closes #407693. + +2007-01-31 Benoît Dejean + + * fsusage.c: (_glibtop_freebsd_get_fsusage_read_write): + * netload.c: (glibtop_get_netload_p): + * prockernel.c: (glibtop_get_proc_kernel_p): + * procmap.c: (glibtop_get_proc_map_p): + * proctime.c: + * siglist.c: + * /libgtop-sysdeps.m4: + + Various FreeBSD and kFreeBSD updates. + Patch by Roy Marples . + Reviewed by Petr Salinger . + Closes #387200. + +2006-11-27 Benoît Dejean + + * fsusage.c: (_glibtop_freebsd_get_fsusage_read_write): + * mem.c: (glibtop_get_mem_p): + * prockernel.c: (glibtop_get_proc_kernel_p): + * proclist.c: (glibtop_get_proclist_p): + * procmap.c: (glibtop_get_proc_map_p): + * procmem.c: (glibtop_get_proc_mem_p): + * procsignal.c: (glibtop_get_proc_signal_p): + * procstate.c: (glibtop_get_proc_state_p): + * proctime.c: + * procuid.c: (glibtop_get_proc_uid_p): + * swap.c: (glibtop_init_swap_p), (glibtop_get_swap_p): + + Added kfreebsd support. + Patch by Petr Salinger . + +2006-04-09 Benoît Dejean + + * fsusage.c: (_glibtop_freebsd_get_fsusage_read_write): + + Fixed typo. + +2006-04-04 Julio M. Merino Vidal + + * sysdeps/freebsd/fsusage.c: + + Use statvfs(2) if available instead of statfs(2). The latter was + replaced by the former and is no longer available under, e.g. NetBSD. + + Fixes bug #337235. + +2006-04-04 Benoît Dejean + + * sysinfo.c: (init_sysinfo): + + Store only strings in values' values. g_strdup these strings. + Even if values is never destroyed, set key_destroy_func to NULL. + + Leave description to NULL. + +2006-04-04 Julio M. Merino Vidal + + * sysdeps/freebsd/Makefile.am: + * sysdeps/freebsd/sysinfo.c: + + Bring back to life (from the 1.x versions) the sysinfo.c file for + the freebsd sysdeps. The new file comes from the FreeBSD ports + repository and has some minor style changes by me. This is required + to get the glibtop_get_sysinfo_s function used by the sysdeps common + code. + + Fixes bug #337251. + +2006-04-04 Julio M. Merino Vidal + + * sysdeps/freebsd/proctime.c: + + Remove obsolete and non-functional code that breaks the build under + NetBSD. It was guarded by a conditional but could not compile + anyway because it referred to an undefined variable. + + Fixes bug #337234. + +2005-02-28 Benoît Dejean + + * fsusage.c: (_glibtop_freebsd_get_fsusage_read_write): Forgot to add + this file :) + +2005-02-28 Benoît Dejean + + * Makefile.am: + * cpu.c: (glibtop_get_cpu_p): + * netlist.c: (glibtop_get_netlist_s): + * netload.c: (glibtop_get_netload_p): + * procmem.c: (glibtop_get_proc_mem_p): + + Fix a bug in netlist where glibtop_netlist.number was never initialized to 0 + (this resulted in a NULL pointer dereference in the network load feature + of the multiload applet) + + * Add support for getting interface flags and packet counts even on interfaces + without IP addresses (needed for the network load feature of the multiload applet) + + * Restore per-process limits in the !FreeBSD or __FreeBSD_version < 500013 + case + + * Add CPU interrupt time as IOWAIT to get support for the cpu load feature of + the multiload applet. + + Patch from marcus@freebsd.org (Joe Marcus Clarke). + Closes #168704. + +2005-02-23 Benoît Dejean + + * Makefile.am: + * netlist.c: (glibtop_get_netlist_s): + * procmap.c: (glibtop_get_proc_map_p): + * procmem.c: (glibtop_get_proc_mem_p): + * procopenfiles.c: (glibtop_init_proc_open_files_s), + (glibtop_get_proc_open_files_s): + * proctime.c: + + Add support for FreeBSD 6-CURRENT. + Use the more portable getrlimit to obtain process memory limits. + Correctly determine process time. + Stub out the procopenfiles() function (this is not yet implemented, however). + Fix a nasty infinite loop and memory leak due to a forgot pointer increment. + + Patch from marcus@freebsd.org (Joe Marcus Clarke). + Closes #168232. + +2004-12-05 Benoît Dejean + + * Makefile.am: + * netlist.c: (glibtop_init_netlist_s), (glibtop_get_netlist_s): + Added glibtop_get_netlist. Patch from marcus@freebsd.org (Joe Marcus Clarke). + +2004-08-28 Benoît Dejean + + * mem.c: (glibtop_get_mem_p): + * ppp.c: + * swap.c: (glibtop_init_swap_p), (glibtop_get_swap_p): + * uptime.c: (glibtop_get_uptime_p): Merge a bunch of trivial OpenBSD + patchs. To *BSD maintainers : please report bugs ! don't be selfish, share + your patchs. + +2004-08-22 Benoît Dejean + + * procstate.c: + * uptime.c: (glibtop_get_uptime_p): Merged Marcus' patches. + +2004-07-15 Benoît Dejean + + * procstate.c: (glibtop_get_proc_state_p): Fixed copy/paste error + while setting buf->state. + +2004-06-07 Benoît Dejean + + * netload.c: (glibtop_get_netload_p): + * procstate.c: (glibtop_get_proc_state_p): + * prockernel.c: (glibtop_get_proc_kernel_p): s/strncpy/g_strlcpy/. + + * procargs.c: (glibtop_get_proc_args_p): + * procmap.c: (glibtop_get_proc_map_p): Cleaned. + + +2004-05-26 Benoît Dejean + + * procdata.c: (glibtop_get_procdata_s): Removed Linux related code. + +2004-04-07 Bastien Nocera + + * prockernel.c: (glibtop_get_proc_kernel_p): patch for NetBSD/AMD64 + support (Julio M. Merino Vidal ) + +2004-03-09 Bastien Nocera + + * Makefile.am: + * cpu.c: (glibtop_init_cpu_p), (glibtop_get_cpu_p): + * glibtop_machine.h: + * mem.c: + * netload.c: (glibtop_get_netload_p): + * prockernel.c: (glibtop_get_proc_kernel_p): + * proclist.c: (glibtop_get_proclist_p): + * procmap.c: (glibtop_get_proc_map_p): + * procmem.c: (glibtop_get_proc_mem_p): + * procsignal.c: (glibtop_get_proc_signal_p): + * procstate.c: (glibtop_get_proc_state_p): + * proctime.c: + * procuid.c: (glibtop_get_proc_uid_p): + * uptime.c: (glibtop_get_uptime_p): implement NetBSD support, and + some build problems on FreeBSD (Closes: #135674) + +2004-03-09 Bastien Nocera + + * procargs.c: (glibtop_get_proc_args_p): + * procmap.c: (glibtop_get_proc_map_p): + * swap.c: (glibtop_get_swap_p): fix g_malloc usage on non-Linux + platforms (patch by Benoît Dejean ) + +2003-10-21 Bastien Nocera + + * Makefile.am: install only one library, libgtop-2.0 + Fix build-time warnings due to the redefinition of guint64 + +2003-10-20 Bastien Nocera + + * mem.c: (glibtop_get_mem_p): + * prockernel.c: (glibtop_get_proc_kernel_p): + * procmem.c: (glibtop_get_proc_mem_p): + * proctime.c: (glibtop_get_proc_time_p): s/u_int64_t/guint64/ + +2003-10-20 Bastien Nocera + + * swap.c: (glibtop_get_swap_p): fix swap sizes in FreeBSD, + patch by edwin@mavetju.org + +2003-10-20 Bastien Nocera + + * glibtop_machine.h: + * glibtop_server.h: + * glibtop_suid.h: + * open.c: + * procargs.c: + * proclist.c: + * procmap.c: + * swap.c: fixed compilation + +2003-10-20 Bastien Nocera + + * procargs.c: (glibtop_get_proc_args_p): + * proclist.c: (glibtop_get_proclist_p): + * procmap.c: (glibtop_get_proc_map_p): + * swap.c: (glibtop_get_swap_p): replace all the xmalloc crap by glib + memory management functions + +2001-10-17 Abel Cheung + + * Makefile.am: move header to $(includedir)/libgtop-1.0/glibtop. + +2001-02-27 Martin Baulig + + * netload.c: Comment out the `subnet' field on BSDI; this should + make it compile. Bug #13345. + + * shm_limits.c, msg_limits.c, sem_limits.c: Applied a patch + from Rolf Grossmann (grossman@securitas.net) for FreeBSD 4.2. + Fixes #51334. + +2001-02-14 Martin Baulig + + * proctime.c (glibtop_get_proc_time_p): Make things work on + OpenBSD 2.6; this is basically the same than on NetBSD. + +2000-02-13 Martin Baulig + + * *.c: kvm_nlist () returns -1 on error, but a positive return value + does not necessarily mean failure. Fixes #3302 which was reported by + Matthias Scheler some time ago. + +1999-10-16 Martin Baulig + + Applied all patches from the FreeBSD 3.3 ports collection. + + * swap.c: Only #include for __FreeBSD_version < 400005. + + * prockernel.c: Make it compile on FreeBSD / alpha. + + * procsignal.c: Some fixes for FreeBSD-current. + +1999-10-16 Martin Baulig + + * procstate.c (glibtop_get_proc_state_p): Don't use the + `GLIBTOP_PROCESS_*' constants for process states for + LibGTop 1.0.x. + +1999-07-29 Martin Baulig + + * proctime.c (glibtop_get_proc_time_p): Fix bug reported by + Takis Psarogiannakopoulos: `start_time' are seconds since the + epoch as it is stated in the manual. + +Tue Jun 15 16:04:10 1999 Timur Bakeyev + + * procuid.c: A fix to a ommitted case, when nor NetBSD, nor + LibGTop >= 1.1.0. This should be investigated closely to cover + more cases.... + +1999-05-26 Martin Baulig + + More NetBSD 1.4 fixes. + + * mem.c, procmap.c, procmem.c: Make this work with the new UVM code. + + [FIXME: This following most likely works on all BSD systems, but + this needs to be tested; I made it conditional to NetBSD 1.4 at + the moment. Please extend the conditionals to any other systems + where this works ...] + + * procstate.c: Added `ruid' and `rgid' for LibGTop >= 1.1.0. + * procuid.c: Added `ngroups' and `groups' for LibGTop >= 1.1.0. + +1999-05-25 Martin Baulig + + * ppp.c: Make this work on NetBSD. + +Thu Apr 8 23:47:29 1999 Timur Bakeyev + + * cpu.c, mem.c, netload.c, procargs.c, procstate.c, proctime.c, + sem_limits.c, shm_limits.c, swap.c: Added initial port for BSD/OS + (aka BSDI) 2.x and 3.x. 4.x should also(?) work. + + Still, this port require more close look and extended check. + +1999-03-19 Martin Baulig + + Added basic support for BSDI. It compiles without problems on + BSDI 2.1 and 3.1, but it is *untested* - I'm neither root on + the machine nor have I access to /dev/kmem, so I don't know + whether it will work. + + You need to give configure the `--enable-hacker-mode' parameter + to use the code. + + If someone can verify whether it actually works, please let me + know. + +1999-03-18 Martin Baulig + + * ppp.c: Don't use `sppp.pp_phase' if we don't HAVE_I4B_ACCT. + This is an ugly hack until someone tells me which versions have + this field and which not. + +1999-02-25 Martin Baulig + + * prockernel.c, proctime.c: Applied patch Stanislav Grozev for + OpenBSD: only include for FreeBSD. + +1999-02-24 Martin Baulig + + * swap.c: Applied another patch from Jeremy Lea to + make it work with FreeBSD-current. + +1999-02-21 Martin Baulig + + * procmap.c, procmem.c: Applied patch from Jeremy Lea. + + * prockernel.c, proctime.c: Applied patch from the FreeBSD 2.2.8 + ports collection. + + * procsignal.c: Applied patch from the NetBSD-current ports + collection. + +1998-12-06 Martin Baulig + + * Make it work with OpenBSD 2.4. + +1998-12-05 Martin Baulig + + * Make it work with NetBSD 1.3.2. + +1998-11-17 Martin Baulig + + * Make it work with FreeBSD 3.0. + +1998-11-11 Martin Baulig + + * *.c: It does not work to get information about the swapper task + on FreeBSD 2.2.6, so we simple return if pid == 0. + +1998-10-31 Martin Baulig + + * *.c: Use glibtop_warn_io_r () instead of glibtop_error_io_r (). + + * proctime.c, prockernel.c, procargs.c: Don't call kvm_uread () if + the /proc filesystem is not mounted. + +1998-10-26 Martin Baulig + + * netload.c: New file to get network load. + +1998-10-26 Martin Baulig + + * procargs.c: New file to get command line arguments. + +1998-10-25 Martin Baulig + + * ppp.c: New file to get PPP/ISDN statistics. Currently this only + get ISDN statistics if you have the I4B package. + + To get the number of bytes transferred in/out you need to read the + file `misc/i4b_acct.txt' in the LibGTop source directory to see + how to enable this. + +1998-10-03 Martin Baulig + + * procstate.c (glibtop_get_procstate_s): Use correct values for + the `state' field. + + * proclist.c (glibtop_get_proclist_p): Honor the GLIBTOP_EXCLUDE_IDLE + and GLIBTOP_EXCLUDE_SYSTEM flags of the `which' parameter. + +1998-08-24 Martin Baulig + + * *.c (glibtop_init_p): Using correct `(1 << GLIBTOP_SYSDPES_*)'. + * cpu.c, mem.c: Removed `const' from sysctl () constants to keep + compiler happy. + + * procmem.c: Added missing call to `glibtop_init_p'. + + * prockernel.c: Casting `nwchan' to `unsigned long' since this + normally has the same size than a pointer. Well, is there a + FreeBSD for 64bit architectures ? + +1998-08-08 Martin Baulig + + * swap.c: Added swap usage based upton the source code + of `pinfo'. + +1998-08-07 Martin Baulig + + * *: Imported FreeBSD port of libgtop from Josh Sled. + + * ChangeLog: New file. diff --git a/sysdeps/freebsd/Makefile.am b/sysdeps/freebsd/Makefile.am new file mode 100644 index 0000000..7cacb70 --- /dev/null +++ b/sysdeps/freebsd/Makefile.am @@ -0,0 +1,29 @@ + +AM_CPPFLAGS = @AM_CPPFLAGS@ + +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la + +libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c sysinfo.c shm_limits.c \ + cpu.c msg_limits.c sem_limits.c loadavg.c \ + uptime.c netlist.c fsusage.c mem.c \ + mountlist.c procopenfiles.c procwd.c \ + procaffinity.c glibtop_private.c open.c + +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + +libgtop_sysdeps_suid_2_0_la_LIBADD = $(KVM_LIBS) +libgtop_sysdeps_suid_2_0_la_SOURCES = suid_open.c close.c swap.c \ + proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c \ + prockernel.c procsegment.c procargs.c \ + procio.c \ + procmap.c netload.c ppp.c + +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h \ + glibtop_suid.h + +libgtopincludedir = $(includedir)/libgtop-2.0 + +noinst_HEADERS = glibtop_private.h diff --git a/sysdeps/freebsd/Makefile.in b/sysdeps/freebsd/Makefile.in new file mode 100644 index 0000000..fa0d00c --- /dev/null +++ b/sysdeps/freebsd/Makefile.in @@ -0,0 +1,795 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = sysdeps/freebsd +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libgtopinclude_HEADERS) \ + $(noinst_HEADERS) $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libgtop_sysdeps_2_0_la_LIBADD = +am_libgtop_sysdeps_2_0_la_OBJECTS = nosuid.lo siglist.lo sysinfo.lo \ + shm_limits.lo cpu.lo msg_limits.lo sem_limits.lo loadavg.lo \ + uptime.lo netlist.lo fsusage.lo mem.lo mountlist.lo \ + procopenfiles.lo procwd.lo procaffinity.lo glibtop_private.lo \ + open.lo +libgtop_sysdeps_2_0_la_OBJECTS = $(am_libgtop_sysdeps_2_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgtop_sysdeps_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__DEPENDENCIES_1 = +libgtop_sysdeps_suid_2_0_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_libgtop_sysdeps_suid_2_0_la_OBJECTS = suid_open.lo close.lo swap.lo \ + proclist.lo procstate.lo procuid.lo proctime.lo procmem.lo \ + procsignal.lo prockernel.lo procsegment.lo procargs.lo \ + procio.lo procmap.lo netload.lo ppp.lo +libgtop_sysdeps_suid_2_0_la_OBJECTS = \ + $(am_libgtop_sysdeps_suid_2_0_la_OBJECTS) +libgtop_sysdeps_suid_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_suid_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +DIST_SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libgtopincludedir)" +HEADERS = $(libgtopinclude_HEADERS) $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp AUTHORS \ + ChangeLog +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la +libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c sysinfo.c shm_limits.c \ + cpu.c msg_limits.c sem_limits.c loadavg.c \ + uptime.c netlist.c fsusage.c mem.c \ + mountlist.c procopenfiles.c procwd.c \ + procaffinity.c glibtop_private.c open.c + +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_suid_2_0_la_LIBADD = $(KVM_LIBS) +libgtop_sysdeps_suid_2_0_la_SOURCES = suid_open.c close.c swap.c \ + proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c \ + prockernel.c procsegment.c procargs.c \ + procio.c \ + procmap.c netload.c ppp.c + +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h \ + glibtop_suid.h + +libgtopincludedir = $(includedir)/libgtop-2.0 +noinst_HEADERS = glibtop_private.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sysdeps/freebsd/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu sysdeps/freebsd/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgtop_sysdeps-2.0.la: $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_2_0_la_LINK) $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_LIBADD) $(LIBS) + +libgtop_sysdeps_suid-2.0.la: $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_suid_2_0_la_LINK) $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsusage.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glibtop_private.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mountlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netload.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nosuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procaffinity.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prockernel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procopenfiles.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsegment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsignal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procstate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procwd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siglist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/suid_open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-libgtopincludeHEADERS: $(libgtopinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgtopincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgtopincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgtopincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgtopincludedir)" || exit $$?; \ + done + +uninstall-libgtopincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgtopincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libgtopincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libgtopincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libgtopincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libgtopincludeHEADERS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libgtopincludeHEADERS + +.PRECIOUS: Makefile + + +# 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: diff --git a/sysdeps/freebsd/close.c b/sysdeps/freebsd/close.c new file mode 100644 index 0000000..72ce14d --- /dev/null +++ b/sysdeps/freebsd/close.c @@ -0,0 +1,30 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +/* Closes pipe to gtop server. */ + +void +glibtop_close_p (glibtop *server) +{ } diff --git a/sysdeps/freebsd/cpu.c b/sysdeps/freebsd/cpu.c new file mode 100644 index 0000000..8670f62 --- /dev/null +++ b/sysdeps/freebsd/cpu.c @@ -0,0 +1,133 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_cpu = +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + +(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) + +(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY) + +(1L << GLIBTOP_CPU_IRQ); + +static const unsigned long _glibtop_sysdeps_cpu_smp = +(1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) + +(1L << GLIBTOP_XCPU_NICE) + (1L << GLIBTOP_XCPU_SYS) + +(1L << GLIBTOP_XCPU_IDLE) + (1L << GLIBTOP_XCPU_IRQ); + +/* Init function. */ + +void +_glibtop_init_cpu_s (glibtop *server) +{ + server->sysdeps.cpu = _glibtop_sysdeps_cpu; + + if (server->ncpu) + server->sysdeps.cpu |= _glibtop_sysdeps_cpu_smp; +} + +/* Provides information about cpu usage. */ + +void +glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf) +{ + long cpts [CPUSTATES]; + long *cp_times = NULL; + struct clockinfo ci; + size_t length; + int ncpu, i; + + memset (buf, 0, sizeof (glibtop_cpu)); + + length = sizeof (cpts); + if (sysctlbyname ("kern.cp_time", cpts, &length, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.cp_time)"); + return; + } + + /* Get the clockrate data */ + length = sizeof (ci); + if (sysctlbyname ("kern.clockrate", &ci, &length, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.cockrate)"); + return; + } + + length = 0; + if (sysctlbyname ("kern.cp_times", NULL, &length, NULL, 0) == 0) { + cp_times = g_malloc (length); + length = sizeof(long) * CPUSTATES * (length / (sizeof(long) * CPUSTATES)); + if (sysctlbyname ("kern.cp_times", cp_times, &length, NULL, 0)) { + g_free (cp_times); + cp_times = NULL; + } + } + + /* set user time */ + buf->user = cpts [CP_USER]; + /* set nice time */ + buf->nice = cpts [CP_NICE]; + /* set sys time */ + buf->sys = cpts [CP_SYS]; + /* set idle time */ + buf->idle = cpts [CP_IDLE]; + /* set irq */ + buf->irq = cpts [CP_INTR]; + + /* set frequency */ + buf->frequency = (ci.stathz ? ci.stathz : ci.hz); + /* set total */ + buf->total = cpts [CP_USER] + cpts [CP_NICE] \ + + cpts [CP_SYS] + cpts [CP_IDLE] + cpts [CP_INTR]; + + ncpu = server->ncpu + 1; + + for (i = 0; i < ncpu; i++) { + if (cp_times) { + buf->xcpu_user[i] = cp_times[i * CPUSTATES + CP_USER]; + buf->xcpu_nice[i] = cp_times[i * CPUSTATES + CP_NICE]; + buf->xcpu_sys[i] = cp_times[i * CPUSTATES + CP_SYS]; + buf->xcpu_idle[i] = cp_times[i * CPUSTATES + CP_IDLE]; + buf->xcpu_irq[i] = cp_times[i * CPUSTATES + CP_INTR]; + } else { + buf->xcpu_user[i] = cpts [CP_USER] / ncpu; + buf->xcpu_nice[i] = cpts [CP_NICE] / ncpu; + buf->xcpu_sys[i] = cpts [CP_SYS] / ncpu; + buf->xcpu_idle[i] = cpts [CP_IDLE] / ncpu; + buf->xcpu_irq[i] = cpts [CP_INTR] / ncpu; + } + buf->xcpu_total[i] = buf->xcpu_user[i] + buf->xcpu_nice[i] \ + + buf->xcpu_sys[i] + buf->xcpu_idle[i] \ + + buf->xcpu_irq[i]; + } + + g_free (cp_times); + + /* Set the flags last. */ + buf->flags = _glibtop_sysdeps_cpu; + + if (ncpu > 1) { + buf->flags |= _glibtop_sysdeps_cpu_smp; + } +} diff --git a/sysdeps/freebsd/fsusage.c b/sysdeps/freebsd/fsusage.c new file mode 100644 index 0000000..0463c8c --- /dev/null +++ b/sysdeps/freebsd/fsusage.c @@ -0,0 +1,161 @@ +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#if 0 +#include +#include +#include +#include +#endif + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_fsusage = +(1L << GLIBTOP_FSUSAGE_BLOCKS) + (1L << GLIBTOP_FSUSAGE_BFREE) ++ (1L << GLIBTOP_FSUSAGE_BAVAIL) + (1L << GLIBTOP_FSUSAGE_FILES) ++ (1L << GLIBTOP_FSUSAGE_FFREE) + (1L << GLIBTOP_FSUSAGE_BLOCK_SIZE); + +static void +_glibtop_get_fsusage_read_write (glibtop *server, glibtop_fsusage *buf, const char *path) +{ + int result; + struct statfs sfs; +#if 0 + struct devstat *ds; + void *sc; + struct timespec ts; + struct gprovider *gp; + struct gident *gid; + struct gmesh gmp; + double etime; + uint64_t ld[2]; +#endif + + result = statfs (path, &sfs); + + if (result == -1) { + glibtop_warn_io_r (server, "statfs"); + return; + } +#if 0 + ld[0] = 0; + ld[1] = 0; + result = geom_gettree (&gmp); + if (result != 0) { + glibtop_warn_io_r (server, "geom_gettree = %d", result); + return; + } + + result = geom_stats_open (); + if (result != 0) { + glibtop_warn_io_r (server, "geom_stats_open()"); + geom_deletetree (&gmp); + return; + } + + sc = NULL; + sc = geom_stats_snapshot_get (); + if (sc == NULL) { + glibtop_warn_io_r (server, "geom_stats_snapshot_get()"); + geom_stats_close (); + geom_deletetree (&gmp); + return; + } + geom_stats_snapshot_timestamp (sc, &ts); + etime = ts.tv_sec + (ts.tv_nsec * 1e-9); + geom_stats_snapshot_reset (sc); + + for (;;) { + ds = geom_stats_snapshot_next (sc); + if (ds == NULL) { + break; + } + if (ds->id == NULL) { + continue; + } + + gid = geom_lookupid (&gmp, ds->id); + if (gid == NULL) { + geom_deletetree (&gmp); + result = geom_gettree (&gmp); + gid = geom_lookupid (&gmp, ds->id); + } + + if (gid == NULL) { + continue; + } + if (gid->lg_what == ISCONSUMER) { + continue; + } + + gp = gid->lg_ptr; + + if (!g_str_has_suffix (sfs.f_mntfromname, gp->lg_name)) { + continue; + } else { + result = devstat_compute_statistics (ds, NULL, etime, + DSM_TOTAL_TRANSFERS_READ, + &ld[0], + DSM_TOTAL_TRANSFERS_WRITE, + &ld[1], DSM_NONE); + if (result != 0) { + glibtop_warn_io_r (server, + "devstat_compute_statistics()"); + geom_stats_snapshot_free (sc); + geom_stats_close (); + geom_deletetree (&gmp); + return; + } + break; + } + } + + geom_stats_snapshot_free (sc); + geom_stats_close (); + geom_deletetree (&gmp); + + buf->read = ld[0]; + buf->write = ld[1]; +#else + buf->read = sfs.f_syncreads + sfs.f_asyncreads; + buf->write = sfs.f_syncwrites + sfs.f_asyncwrites; +#endif + if (buf->read || buf->write) { + buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE); + } +} + +void +glibtop_get_fsusage_s(glibtop *server, glibtop_fsusage *buf, const char *path) +{ + struct statvfs fsd; + + memset (buf, 0, sizeof (glibtop_fsusage)); + + if (statvfs (path, &fsd) < 0) + return; + + buf->block_size = fsd.f_frsize; + buf->blocks = fsd.f_blocks; + buf->bfree = fsd.f_bfree; + buf->bavail = (fsd.f_bavail > fsd.f_bfree) ? 0 : fsd.f_bavail; + buf->files = fsd.f_files; + buf->ffree = fsd.f_ffree; + + buf->flags = _glibtop_sysdeps_fsusage; + + _glibtop_get_fsusage_read_write(server, buf, path); +} + diff --git a/sysdeps/freebsd/glibtop_machine.h b/sysdeps/freebsd/glibtop_machine.h new file mode 100644 index 0000000..4fd7025 --- /dev/null +++ b/sysdeps/freebsd/glibtop_machine.h @@ -0,0 +1,54 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_MACHINE_H__ +#define __GLIBTOP_MACHINE_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +G_BEGIN_DECLS + +struct _glibtop_machine +{ + uid_t uid, euid; + gid_t gid, egid; + + /* The kernel descriptor, used by kvm_* calls. We keep and re-use + * it rather than re-getting it for almost all function + * invocations. */ + kvm_t *kd; +}; + +G_END_DECLS + +#endif /* __GLIBTOP_MACHINE_H__ */ diff --git a/sysdeps/freebsd/glibtop_private.c b/sysdeps/freebsd/glibtop_private.c new file mode 100644 index 0000000..5e7ed66 --- /dev/null +++ b/sysdeps/freebsd/glibtop_private.c @@ -0,0 +1,54 @@ +#include +#include +#include + +#include "glibtop_private.h" + +#include +#include +#include +#include +#include + +char * +execute_lsof(pid_t pid) { + char *output = NULL; + char *lsof; + char *command; + int exit_status; + + lsof = g_find_program_in_path("lsof"); + if (lsof == NULL) + return NULL; + + command = g_strdup_printf("%s -n -P -Fftn -p %d", lsof, pid); + g_free(lsof); + + if (g_spawn_command_line_sync (command, &output, NULL, &exit_status, NULL)) { + if (exit_status != 0) { + g_warning("Could not execute \"%s\" (%i)", command, + exit_status); + output = NULL; + } + } + + g_free(command); + return output; +} + +/* Ported from linux/glibtop_private.c */ +gboolean +safe_readlink(const char *path, char *buf, int bufsiz) +{ + int ret; + + ret = readlink(path, buf, bufsiz - 1); + + if (ret == -1) { + g_warning("Could not read link %s : %s", path, strerror(errno)); + return FALSE; + } + + buf[ret] = '\0'; + return TRUE; +} diff --git a/sysdeps/freebsd/glibtop_private.h b/sysdeps/freebsd/glibtop_private.h new file mode 100644 index 0000000..c73947f --- /dev/null +++ b/sysdeps/freebsd/glibtop_private.h @@ -0,0 +1,40 @@ +/* Copyright (C) 2007 Joe Marcus Clarke + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __FREEBSD__GLIBTOP_PRIVATE_H__ +#define __FREEBSD__GLIBTOP_PRIVATE_H__ + +#include +#include + +#include + +#include +#include +#include +#include + +G_BEGIN_DECLS + +char *execute_lsof(pid_t pid); +gboolean safe_readlink(const char *path, char *buf, int bufsiz); + +G_END_DECLS + +#endif /* __FREEBSD__GLIBTOP_PRIVATE_H__ */ diff --git a/sysdeps/freebsd/glibtop_server.h b/sysdeps/freebsd/glibtop_server.h new file mode 100644 index 0000000..d908ea7 --- /dev/null +++ b/sysdeps/freebsd/glibtop_server.h @@ -0,0 +1,54 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __FREEBSD__GLIBTOP_SERVER_H__ +#define __FREEBSD__GLIBTOP_SERVER_H__ + +G_BEGIN_DECLS + +#define GLIBTOP_SUID_SWAP (1 << GLIBTOP_SYSDEPS_SWAP) +#define GLIBTOP_SUID_PROCLIST (1 << GLIBTOP_SYSDEPS_PROCLIST) +#define GLIBTOP_SUID_PROC_STATE (1 << GLIBTOP_SYSDEPS_PROC_STATE) +#define GLIBTOP_SUID_PROC_UID (1 << GLIBTOP_SYSDEPS_PROC_UID) +#define GLIBTOP_SUID_PROC_MEM (1 << GLIBTOP_SYSDEPS_PROC_MEM) +#define GLIBTOP_SUID_PROC_TIME (1 << GLIBTOP_SYSDEPS_PROC_TIME) +#define GLIBTOP_SUID_PROC_SIGNAL (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL) +#define GLIBTOP_SUID_PROC_KERNEL (1 << GLIBTOP_SYSDEPS_PROC_KERNEL) +#define GLIBTOP_SUID_PROC_SEGMENT (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT) +#define GLIBTOP_SUID_PROC_ARGS (1 << GLIBTOP_SYSDEPS_PROC_ARGS) +#define GLIBTOP_SUID_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP) +#define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) +#define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) +#define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_MEM 0 +#define GLIBTOP_SUID_UPTIME 0 +#define GLIBTOP_SUID_LOADAVG 0 +#define GLIBTOP_SUID_SHM_LIMITS 0 +#define GLIBTOP_SUID_MSG_LIMITS 0 +#define GLIBTOP_SUID_SEM_LIMITS 0 +#define GLIBTOP_SUID_NETLIST 0 +#define GLIBTOP_SUID_PROC_WD 0 +#define GLIBTOP_SUID_PROC_AFFINITY 0 +#define GLIBTOP_SUID_PROC_IO (1 << GLIBTOP_SYSDEPS_PROC_IO) + +G_END_DECLS + +#endif diff --git a/sysdeps/freebsd/glibtop_suid.h b/sysdeps/freebsd/glibtop_suid.h new file mode 100644 index 0000000..e548a0d --- /dev/null +++ b/sysdeps/freebsd/glibtop_suid.h @@ -0,0 +1,62 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SUID_H__ +#define __GLIBTOP_SUID_H__ + +G_BEGIN_DECLS + +#if _IN_LIBGTOP +#include +#endif + +#include + +#define KI_PROC(ki) (&(ki))->kp_proc) +#define KI_EPROC(ki) (&(ki))->kp_eproc) + +#define FORCEUREAD 1 +#define UREADOK(ki) (FORCEUREAD || (KI_PROC(ki)->p_flag & P_INMEM)) + +static inline void glibtop_suid_enter (glibtop *server) { + glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid()); + setregid (server->machine->gid, server->machine->egid); + glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid()); +}; + +static inline void glibtop_suid_leave (glibtop *server) { + glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid()); + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); + glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid()); +}; + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags); +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags); + +G_END_DECLS + +#endif diff --git a/sysdeps/freebsd/loadavg.c b/sysdeps/freebsd/loadavg.c new file mode 100644 index 0000000..3436558 --- /dev/null +++ b/sysdeps/freebsd/loadavg.c @@ -0,0 +1,70 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +#include +#include + +static const unsigned long _glibtop_sysdeps_loadavg = +(1L << GLIBTOP_LOADAVG_LOADAVG); + +static const unsigned long _glibtop_sysdeps_last_pid = +(1L << GLIBTOP_LOADAVG_LAST_PID); + +/* Init function. */ + +void +_glibtop_init_loadavg_s (glibtop *server) +{ + server->sysdeps.loadavg = _glibtop_sysdeps_loadavg | + _glibtop_sysdeps_last_pid; +} + +/* Provides load averange. */ + +void +glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf) +{ + pid_t last_pid; + size_t len; + + memset (buf, 0, sizeof (glibtop_loadavg)); + + if (getloadavg (buf->loadavg, G_N_ELEMENTS(buf->loadavg)) == -1) + return; + + buf->flags = _glibtop_sysdeps_loadavg; + + len = sizeof (last_pid); + if (sysctlbyname ("kern.lastpid", &last_pid, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.lastpid)"); + return; + } + + buf->last_pid = last_pid; + + buf->flags |= _glibtop_sysdeps_last_pid; +} diff --git a/sysdeps/freebsd/mem.c b/sysdeps/freebsd/mem.c new file mode 100644 index 0000000..22f560e --- /dev/null +++ b/sysdeps/freebsd/mem.c @@ -0,0 +1,99 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include + +static const unsigned long _glibtop_sysdeps_mem = +(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) + +(1L << GLIBTOP_MEM_FREE) + (1L << GLIBTOP_MEM_SHARED) + +(1L << GLIBTOP_MEM_BUFFER) + (1L << GLIBTOP_MEM_CACHED) + +(1L << GLIBTOP_MEM_USER); + +/* these are for getting the memory statistics */ +static int pagesize; + +/* Init function. */ +void +_glibtop_init_mem_s (glibtop *server) +{ + pagesize = getpagesize (); + + server->sysdeps.mem = _glibtop_sysdeps_mem; +} + +static gulong mem_get_by_bytes (glibtop *server, const char *name) { + gulong result = 0; + size_t len = sizeof (result); + + if (sysctlbyname (name, &result, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (%s)", name); + } + return result; +} + +static gulong mem_get_by_pages (glibtop *server, const char *name) { + guint result = 0; + size_t len = sizeof (result); + + if (sysctlbyname (name, &result, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (%s)", name); + } + return (gulong) result * pagesize; +} + +void +glibtop_get_mem_s (glibtop *server, glibtop_mem *buf) +{ + gulong memtotal; + gulong memactive; + gulong meminactive; + gulong memwired; + gulong memcached; + gulong membuffer; + gulong memfree; + + memset (buf, 0, sizeof *buf); + + memtotal = mem_get_by_bytes (server, "hw.physmem"); + memactive = mem_get_by_pages (server, "vm.stats.vm.v_active_count"); + meminactive = mem_get_by_pages (server, "vm.stats.vm.v_inactive_count"); + memwired = mem_get_by_pages (server, "vm.stats.vm.v_wire_count"); + memcached = mem_get_by_pages (server, "vm.stats.vm.v_cache_count"); + membuffer = mem_get_by_bytes (server, "vfs.bufspace"); + memfree = mem_get_by_pages (server, "vm.stats.vm.v_free_count"); + + buf->total = memtotal; + buf->used = memtotal - memfree; + buf->free = memfree; + buf->shared = 0; + buf->buffer = membuffer; + buf->cached = memcached; + buf->locked = 0; + + buf->user = memactive + memwired; + buf->flags = _glibtop_sysdeps_mem; +} diff --git a/sysdeps/freebsd/mountlist.c b/sysdeps/freebsd/mountlist.c new file mode 100644 index 0000000..9956bd5 --- /dev/null +++ b/sysdeps/freebsd/mountlist.c @@ -0,0 +1,167 @@ +/* mountlist.c -- return a list of mounted filesystems + Copyright (C) 1991, 1992 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +/* A mount table entry. */ +struct mount_entry +{ + char *me_devname; /* Device node pathname, including "/dev/". */ + char *me_mountdir; /* Mount point directory pathname. */ + char *me_type; /* "nfs", "4.2", etc. */ + dev_t me_dev; /* Device number of me_mountdir. */ + struct mount_entry *me_next; +}; + +static struct mount_entry *read_filesystem_list (void); + +/* Return a list of the currently mounted filesystems, or NULL on error. + Add each entry to the tail of the list so that they stay in order. +*/ + +static struct mount_entry * +read_filesystem_list (void) +{ + struct mount_entry *mount_list; + struct mount_entry *me; + struct mount_entry *mtail; + + /* Start the list off with a dummy entry. */ + me = g_new (struct mount_entry, 1); + me->me_next = NULL; + mount_list = mtail = me; + { + struct statfs *fsp; + int entries; + + entries = getmntinfo (&fsp, MNT_NOWAIT); + if (entries < 0) + return NULL; + while (entries-- > 0) + { + me = (struct mount_entry *) g_malloc (sizeof (struct mount_entry)); + me->me_devname = g_strdup (fsp->f_mntfromname); + me->me_mountdir = g_strdup (fsp->f_mntonname); + me->me_type = g_strdup (fsp->f_fstypename); + me->me_dev = (dev_t) -1; /* Magic; means not known yet. */ + me->me_next = NULL; + + /* Add to the linked list. */ + mtail->me_next = me; + mtail = me; + fsp++; + } + } + + /* Free the dummy head. */ + me = mount_list; + mount_list = mount_list->me_next; + g_free (me); + return mount_list; +} + +static gboolean ignore_mount_entry(const struct mount_entry *me) +{ + /* keep sorted */ + static const char ignored[][17] = { + "autofs", + "devfs", + "fdescfs", + "fusectl", + "linprocfs", + "linsysfs", + "mfs", + "none", + "nfs", + "nullfs", + "nwfs", + "portalfs", + "proc", + "procfs", + "smbfs", + "tmpfs", + "unionfs", + "unknown" + }; + + typedef int (*Comparator)(const void*, const void*); + + return bsearch(me->me_type, + ignored, G_N_ELEMENTS(ignored), sizeof ignored[0], + (Comparator) strcmp) != NULL; +} + + +glibtop_mountentry * +glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf, int all_fs) +{ + struct mount_entry *entries, *cur, *next; + + GArray *mount_array = g_array_new(FALSE, FALSE, + sizeof(glibtop_mountentry)); + + memset (buf, 0, sizeof (glibtop_mountlist)); + + /* Read filesystem list. */ + + if((entries = read_filesystem_list ()) == NULL) + return NULL; + + for (cur = &entries[0]; cur != NULL; cur = next) { + + if(all_fs || !ignore_mount_entry(cur)) { + /* add a new glibtop_mountentry */ + glibtop_mountentry e; + + g_strlcpy(e.devname, cur->me_devname, sizeof e.devname); + g_strlcpy(e.mountdir, cur->me_mountdir, sizeof e.mountdir); + g_strlcpy(e.type, cur->me_type, sizeof e.type); + e.dev = cur->me_dev; + + g_array_append_val(mount_array, e); + } + + /* free current mount_entry and move to the next */ + next = cur->me_next; + g_free(cur->me_devname); + g_free(cur->me_mountdir); + g_free(cur->me_type); + g_free(cur); + } + + buf->size = sizeof (glibtop_mountentry); + buf->number = mount_array->len; + buf->total = buf->number * buf->size; + + buf->flags = (1 << GLIBTOP_MOUNTLIST_SIZE) + | (1 << GLIBTOP_MOUNTLIST_NUMBER) + | (1 << GLIBTOP_MOUNTLIST_TOTAL); + + return (glibtop_mountentry*) g_array_free(mount_array, FALSE); +} diff --git a/sysdeps/freebsd/msg_limits.c b/sysdeps/freebsd/msg_limits.c new file mode 100644 index 0000000..87d49b6 --- /dev/null +++ b/sysdeps/freebsd/msg_limits.c @@ -0,0 +1,100 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , August 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include + +static const unsigned long _glibtop_sysdeps_msg_limits = +(1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNI) + +(1L << GLIBTOP_IPC_MSGMNB) + (1L << GLIBTOP_IPC_MSGTQL) + +(1L << GLIBTOP_IPC_MSGSSZ) + (1L << GLIBTOP_IPC_MSGPOOL); + +/* Init function. */ + +void +_glibtop_init_msg_limits_s (glibtop *server) +{ + server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf) +{ + size_t len; + int msgmax, msgmni, msgmnb, msgtql, msgssz, msgseg; + + memset (buf, 0, sizeof (glibtop_msg_limits)); + + if (server->sysdeps.msg_limits == 0) + return; + + len = sizeof (msgseg); + if (sysctlbyname ("kern.ipc.msgseg", &msgseg, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.msgseg)"); + return; + } + + len = sizeof (msgssz); + if (sysctlbyname ("kern.ipc.msgssz", &msgssz, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.msgssz)"); + return; + } + + len = sizeof (msgtql); + if (sysctlbyname ("kern.ipc.msgtql", &msgtql, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.msgtql)"); + return; + } + + len = sizeof (msgmnb); + if (sysctlbyname ("kern.ipc.msgmnb", &msgmnb, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.msgmnb)"); + return; + } + + len = sizeof (msgmni); + if (sysctlbyname ("kern.ipc.msgmni", &msgmni, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.msgmni)"); + return; + } + + len = sizeof (msgmax); + if (sysctlbyname ("kern.ipc.msgmax", &msgmax, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.msgmax)"); + return; + } + + buf->msgmax = msgmax; + buf->msgmni = msgmni; + buf->msgmnb = msgmnb; + buf->msgtql = msgtql; + buf->msgssz = msgssz; + buf->msgpool = msgseg; + + buf->flags = _glibtop_sysdeps_msg_limits; +} diff --git a/sysdeps/freebsd/netlist.c b/sysdeps/freebsd/netlist.c new file mode 100644 index 0000000..ccefffc --- /dev/null +++ b/sysdeps/freebsd/netlist.c @@ -0,0 +1,64 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + + +static const unsigned long _glibtop_sysdeps_netlist = (1 << GLIBTOP_NETLIST_NUMBER); + +/* Init function. */ + +void +_glibtop_init_netlist_s (glibtop *server) +{ + server->sysdeps.netlist = _glibtop_sysdeps_netlist; +} + + +char** +glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf) +{ + struct if_nameindex *ifstart, *ifs; + GPtrArray *devices; + + memset (buf, 0, sizeof (glibtop_netlist)); + + ifs = ifstart = if_nameindex(); + + devices = g_ptr_array_new(); + + while(ifs && ifs->if_name) { + g_ptr_array_add(devices, g_strdup(ifs->if_name)); + buf->number++; + ifs++; + } + + if_freenameindex(ifstart); + + buf->flags = _glibtop_sysdeps_netlist; + + g_ptr_array_add(devices, NULL); + + return (char **) g_ptr_array_free(devices, FALSE); +} + diff --git a/sysdeps/freebsd/netload.c b/sysdeps/freebsd/netload.c new file mode 100644 index 0000000..6a25eb4 --- /dev/null +++ b/sysdeps/freebsd/netload.c @@ -0,0 +1,214 @@ +/* Copyright (C) 1998-99 Martin Baulig + Copyright (C) 2014 Gleb Smirnoff + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + Contributed by Gleb Smirnoff , September 2014 + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_netload = +(1L << GLIBTOP_NETLOAD_IF_FLAGS) + +(1L << GLIBTOP_NETLOAD_MTU) + +(1L << GLIBTOP_NETLOAD_PACKETS_IN) + +(1L << GLIBTOP_NETLOAD_PACKETS_OUT) + +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_BYTES_IN) + +(1L << GLIBTOP_NETLOAD_BYTES_OUT) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) + +(1L << GLIBTOP_NETLOAD_ERRORS_IN) + +(1L << GLIBTOP_NETLOAD_ERRORS_OUT) + +(1L << GLIBTOP_NETLOAD_ERRORS_TOTAL) + +(1L << GLIBTOP_NETLOAD_COLLISIONS) + +(1L << GLIBTOP_NETLOAD_HWADDRESS); + +static const unsigned long _glibtop_sysdeps_netload_data = +(1L << GLIBTOP_NETLOAD_SUBNET) + +(1L << GLIBTOP_NETLOAD_ADDRESS); + +static const unsigned long _glibtop_sysdeps_netload6 = +(1L << GLIBTOP_NETLOAD_ADDRESS6) + +(1L << GLIBTOP_NETLOAD_PREFIX6) + +(1L << GLIBTOP_NETLOAD_SCOPE6); + +/* Init function. */ + +void +_glibtop_init_netload_p (glibtop *server) +{ + server->sysdeps.netload = _glibtop_sysdeps_netload; +} + +/* Provides Network statistics. */ + +void +glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, + const char *interface) +{ + struct ifaddrs *ifap, *ifa; + + memset (buf, 0, sizeof (glibtop_netload)); + + if (server->sysdeps.netload == 0) + return; + + if (getifaddrs(&ifap) != 0) { + glibtop_warn_io_r (server, "getifaddrs"); + return; + } + +#define IFA_STAT(s) (((struct if_data *)ifa->ifa_data)->ifi_ ## s) + + for (ifa = ifap; ifa; ifa = ifa->ifa_next) { + if (strcmp (ifa->ifa_name, interface) != 0) + continue; + + switch (ifa->ifa_addr->sa_family) { + case AF_LINK: { + struct sockaddr_dl *sdl; + struct ifmediareq ifmr; + struct ifreq ifr; + int s, flags; + + s = socket(AF_INET, SOCK_DGRAM, 0); + if (s < 0) { + glibtop_warn_io_r(server, "socket(AF_INET)"); + break; + } + + memset(&ifmr, 0, sizeof(ifmr)); + (void)strlcpy(ifmr.ifm_name, ifa->ifa_name, + sizeof(ifmr.ifm_name)); + if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)&ifmr) < 0 && + ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { + glibtop_warn_io_r(server, "ioctl(SIOCGIFMEDIA)"); + } else { + if (IFM_TYPE (ifmr.ifm_current) & IFM_IEEE80211) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_WIRELESS); + if (IFM_TYPE (ifmr.ifm_active) & IFM_IEEE80211) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_WIRELESS); + } + + memset(&ifr, 0, sizeof(ifr)); + (void)strlcpy(ifr.ifr_name, ifa->ifa_name, + sizeof(ifr.ifr_name)); + if (ioctl(s, SIOCGIFFLAGS, (caddr_t)&ifr) < 0) { + glibtop_warn_io_r(server, "ioctl(SIOCGIFFLAGS)"); + close(s); + break; + } + + close(s); + + flags = (ifr.ifr_flags & 0xffff) | (ifr.ifr_flagshigh << 16); + + if (flags & IFF_UP) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP); + if (flags & IFF_BROADCAST) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST); + if (flags & IFF_DEBUG) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG); + if (flags & IFF_LOOPBACK) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK); + if (flags & IFF_POINTOPOINT) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT); + if (flags & IFF_RUNNING) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING); + if (flags & IFF_NOARP) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP); + if (flags & IFF_PROMISC) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC); + if (flags & IFF_ALLMULTI) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI); + if (flags & IFF_OACTIVE) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_OACTIVE); + if (flags & IFF_SIMPLEX) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_SIMPLEX); + if (flags & IFF_LINK0) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LINK0); + if (flags & IFF_LINK1) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LINK1); + if (flags & IFF_LINK2) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LINK2); + if (flags & IFF_ALTPHYS) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALTPHYS); + if (flags & IFF_MULTICAST) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST); + + buf->packets_in = IFA_STAT(ipackets); + buf->packets_out = IFA_STAT(opackets); + buf->packets_total = buf->packets_in + buf->packets_out; + + buf->bytes_in = IFA_STAT(ibytes); + buf->bytes_out = IFA_STAT(obytes); + buf->bytes_total = buf->bytes_in + buf->bytes_out; + + buf->errors_in = IFA_STAT(ierrors); + buf->errors_out = IFA_STAT(oerrors); + buf->errors_total = buf->errors_in + buf->errors_out; + + buf->collisions = IFA_STAT(collisions); + + sdl = (struct sockaddr_dl *)(void *)ifa->ifa_addr; + memcpy(buf->hwaddress, LLADDR(sdl), + sizeof(buf->hwaddress)); + buf->mtu = IFA_STAT(mtu); + buf->flags |= _glibtop_sysdeps_netload; + break; + } + case AF_INET: { + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)(void *)ifa->ifa_addr; + buf->address = sin->sin_addr.s_addr; + sin = (struct sockaddr_in *)(void *)ifa->ifa_netmask; + buf->subnet = sin->sin_addr.s_addr & buf->address; + buf->flags |= _glibtop_sysdeps_netload_data; + break; + } + case AF_INET6: { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)(void *)ifa->ifa_addr; + memcpy(buf->address6, &sin6->sin6_addr, + sizeof(buf->address6)); + buf->scope6 = (guint8 )sin6->sin6_scope_id; + sin6 = (struct sockaddr_in6 *)(void *)ifa->ifa_netmask; + memcpy(buf->prefix6, &sin6->sin6_addr, + sizeof(buf->prefix6)); + buf->flags |= _glibtop_sysdeps_netload6; + break; + } + } // switch() end + } + freeifaddrs(ifap); +} diff --git a/sysdeps/freebsd/nosuid.c b/sysdeps/freebsd/nosuid.c new file mode 100644 index 0000000..c091a8c --- /dev/null +++ b/sysdeps/freebsd/nosuid.c @@ -0,0 +1,28 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +void +glibtop_close_s (glibtop *server) +{ } diff --git a/sysdeps/freebsd/open.c b/sysdeps/freebsd/open.c new file mode 100644 index 0000000..1618e04 --- /dev/null +++ b/sysdeps/freebsd/open.c @@ -0,0 +1,48 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include + + +void +glibtop_open_s (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags) +{ + int ncpus; + size_t len; + + len = sizeof (ncpus); + sysctlbyname ("hw.ncpu", &ncpus, &len, NULL, 0); + server->real_ncpu = ncpus - 1; + server->ncpu = MIN(GLIBTOP_NCPU - 1, server->real_ncpu); + + server->os_version_code = __FreeBSD_version; + +} diff --git a/sysdeps/freebsd/ppp.c b/sysdeps/freebsd/ppp.c new file mode 100644 index 0000000..a0c98dd --- /dev/null +++ b/sysdeps/freebsd/ppp.c @@ -0,0 +1,143 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#ifdef HAVE_I4B + +#include +#include + +#ifdef HAVE_NET_IF_VAR_H +#include +#endif + +#include +#include + +#include + +/* Read `misc/i4b_acct.txt' for details ... */ +#ifdef HAVE_I4B_ACCT +#include +#endif + +static const unsigned long _glibtop_sysdeps_ppp = +(1L << GLIBTOP_PPP_STATE); + +#ifdef HAVE_I4B_ACCT +static const unsigned long _glibtop_sysdeps_ppp_acct = +(1L << GLIBTOP_PPP_BYTES_IN) + (1L << GLIBTOP_PPP_BYTES_OUT); +#endif + +#endif /* HAVE_I4B */ + +/* nlist structure for kernel access */ +static struct nlist nlst [] = { +#ifdef HAVE_I4B + { "_i4bisppp_softc" }, +#endif + { 0 } +}; + +/* Init function. */ + +void +_glibtop_init_ppp_p (glibtop *server) +{ +#ifdef HAVE_I4B +#ifdef HAVE_I4B_ACCT + server->sysdeps.ppp = _glibtop_sysdeps_ppp | + _glibtop_sysdeps_ppp_acct; +#else + server->sysdeps.ppp = _glibtop_sysdeps_ppp; +#endif +#endif /* HAVE_I4B */ + + if (kvm_nlist (server->machine->kd, nlst) < 0) { + glibtop_warn_io_r (server, "kvm_nlist"); + server->sysdeps.ppp = 0; + } +} + +/* Provides information about ppp usage. */ + +void +glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device) +{ +#ifdef HAVE_I4B +#ifdef HAVE_I4B_ACCT + struct i4bisppp_softc data; +#else + struct sppp data; +#endif + int phase; + + memset (buf, 0, sizeof (glibtop_ppp)); + + if (server->sysdeps.ppp == 0) return; + + if (kvm_read (server->machine->kd, nlst [0].n_value, + &data, sizeof (data)) != sizeof (data)) { + glibtop_warn_io_r (server, "kvm_read (i4bisppp_softc)"); + return; + } + +#ifdef HAVE_I4B_ACCT + phase = data.sc_if_un.scu_sp.pp_phase; +#else + /* FIXME: Which FreeBSD version have this field and + * which not. */ +#if 0 + phase = data.pp_phase; +#endif +#endif + + switch (phase) { +#ifdef HAVE_I4B_ACCT + case PHASE_DEAD: + case PHASE_TERMINATE: + buf->state = GLIBTOP_PPP_STATE_HANGUP; + break; + case PHASE_ESTABLISH: + case PHASE_NETWORK: + buf->state = GLIBTOP_PPP_STATE_ONLINE; + break; +#endif + default: + buf->state = GLIBTOP_PPP_STATE_UNKNOWN; + break; + } + + buf->flags = _glibtop_sysdeps_ppp; + +#ifdef HAVE_I4B_ACCT + buf->bytes_in = data.sc_inb; + buf->bytes_out = data.sc_outb; + buf->flags |= _glibtop_sysdeps_ppp_acct; +#endif +#endif /* HAVE_I4B */ +} diff --git a/sysdeps/freebsd/procaffinity.c b/sysdeps/freebsd/procaffinity.c new file mode 100644 index 0000000..a66aaf7 --- /dev/null +++ b/sysdeps/freebsd/procaffinity.c @@ -0,0 +1,84 @@ +/* Copyright (C) 2007 Joe Marcus Clarke + This file is part of LibGTop 2. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +#include +#if __FreeBSD_version > 800024 +#include +#endif + +void +_glibtop_init_proc_affinity_s(glibtop *server) +{ + server->sysdeps.proc_affinity = + (1 << GLIBTOP_PROC_AFFINITY_NUMBER) | + (1 << GLIBTOP_PROC_AFFINITY_ALL); + +} + + +guint16 * +glibtop_get_proc_affinity_s(glibtop *server, glibtop_proc_affinity *buf, pid_t pid) +{ +#if __FreeBSD_version > 800024 + id_t id; + cpulevel_t level; + cpuwhich_t which; + cpuset_t mask; + size_t i; + GArray* cpus; + + memset(buf, 0, sizeof *buf); + + which = CPU_WHICH_PID; + level = CPU_LEVEL_WHICH; + id = pid; + + if (cpuset_getaffinity(level, which, id, sizeof(mask), &mask) != 0) { + glibtop_error_r(server, "cpuset_getaffinity failed"); + return NULL; + } + + cpus = g_array_new(FALSE, FALSE, sizeof(guint16)); + + for (i = 0; i < MIN(CPU_SETSIZE, (size_t)(server->ncpu + 1)); i++) { + if (CPU_ISSET(i, &mask)) { + guint16 n = i; + g_array_append_val(cpus, n); + } + } + + buf->number = cpus->len; + buf->all = (cpus->len == (size_t)(server->ncpu + 1)); + buf->flags = (1 << GLIBTOP_PROC_AFFINITY_NUMBER) + | (1 << GLIBTOP_PROC_AFFINITY_ALL); + + return (guint16*) g_array_free(cpus, FALSE); +#else + memset(buf, 0, sizeof *buf); + + return NULL; +#endif +} + diff --git a/sysdeps/freebsd/procargs.c b/sysdeps/freebsd/procargs.c new file mode 100644 index 0000000..2186b46 --- /dev/null +++ b/sysdeps/freebsd/procargs.c @@ -0,0 +1,96 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_args = +(1L << GLIBTOP_PROC_ARGS_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_args_p (glibtop *server) +{ + server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; +} + +/* Provides detailed information about a process. */ + +char * +glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len) +{ + struct kinfo_proc *pinfo; + char *retval, **args, **ptr; + size_t size = 0, pos = 0; + int count; + + memset (buf, 0, sizeof (glibtop_proc_args)); + + /* swapper, init, pagedaemon, vmdaemon, update - this doen't work. */ + if (pid < 5) return NULL; + + glibtop_suid_enter (server); + + /* Get the process data */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count < 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + glibtop_suid_leave (server); + return NULL; + } + + args = kvm_getargv (server->machine->kd, pinfo, max_len); + if (args == NULL) { + glibtop_warn_io_r (server, "kvm_getargv (%d)", pid); + glibtop_suid_leave (server); + return NULL; + } + + glibtop_suid_leave (server); + + for (ptr = args; *ptr; ptr++) + size += strlen (*ptr)+1; + + size += 2; + retval = g_malloc0 (size); + + for (ptr = args; *ptr; ptr++) { + const size_t len = strlen (*ptr)+1; + memcpy (retval+pos, *ptr, len); + pos += len; + } + + buf->size = pos ? pos-1 : 0; + + buf->flags = _glibtop_sysdeps_proc_args; + + return retval; +} diff --git a/sysdeps/freebsd/procio.c b/sysdeps/freebsd/procio.c new file mode 100644 index 0000000..0525a2a --- /dev/null +++ b/sysdeps/freebsd/procio.c @@ -0,0 +1,80 @@ +/* Copyright (C) 2017 Robert Roth + This file is part of LibGTop. + + Contributed by Robert Roth , February 2017. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_io = + (1UL << GLIBTOP_PROC_IO_DISK_RBYTES) + (1UL << GLIBTOP_PROC_IO_DISK_WBYTES); + +/* Init function. */ + +void +_glibtop_init_proc_io_p (glibtop *server) +{ + server->sysdeps.proc_io = _glibtop_sysdeps_proc_io; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_io_p (glibtop *server, glibtop_proc_io *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_io)); + + struct kinfo_proc *pinfo; + int count; + + glibtop_suid_enter (server); + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count != 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + glibtop_suid_leave (server); + return; + } + + glibtop_suid_leave (server); + + /* man getrusage + + long ru_inblock; == block input operations + long ru_oublock; == block output operations + + ru_inblock the number of times the file system had to perform input. + ru_oublock the number of times the file system had to perform output. + + And then it says 'account only for real IO'. + + But if I write 1MB in a process, I can see ru_oublock increased + 1024. So it's neither a number of operations or times. + + FIXME: seems the blocksize is 1024 but ... + */ + buf->disk_rbytes = pinfo->ki_rusage.ru_inblock << 10; + buf->disk_wbytes = pinfo->ki_rusage.ru_oublock << 10; + buf->flags = _glibtop_sysdeps_proc_io; +} diff --git a/sysdeps/freebsd/prockernel.c b/sysdeps/freebsd/prockernel.c new file mode 100644 index 0000000..0d3d3fe --- /dev/null +++ b/sysdeps/freebsd/prockernel.c @@ -0,0 +1,119 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_kernel_pstats = +(1L << GLIBTOP_PROC_KERNEL_K_FLAGS) + +(1L << GLIBTOP_PROC_KERNEL_MIN_FLT) + +(1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) + +#if (__FreeBSD_version >= 600006) || defined(__FreeBSD_kernel__) +(1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) + +(1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT); +#else +0; +#endif + +static const unsigned long _glibtop_sysdeps_proc_kernel_wchan = +(1L << GLIBTOP_PROC_KERNEL_WCHAN) + +(1L << GLIBTOP_PROC_KERNEL_NWCHAN); + +/* Init function. */ + +void +_glibtop_init_proc_kernel_p (glibtop *server) +{ + server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel_pstats | + _glibtop_sysdeps_proc_kernel_wchan; +} + +void +glibtop_get_proc_kernel_p (glibtop *server, + glibtop_proc_kernel *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + int count; + + memset (buf, 0, sizeof (glibtop_proc_kernel)); + + if (server->sysdeps.proc_time == 0) + return; + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + glibtop_suid_enter (server); + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count != 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + glibtop_suid_leave (server); + return; + } + + glibtop_suid_leave (server); + +#define PROC_WCHAN ki_wchan +#define PROC_WMESG ki_wmesg +#define PROC_WMESG ki_wmesg + + buf->nwchan = (unsigned long) pinfo [0].PROC_WCHAN; + + buf->flags |= (1L << GLIBTOP_PROC_KERNEL_NWCHAN); + + if (pinfo [0].PROC_WCHAN && pinfo [0].PROC_WMESG[0] != 0) { + g_strlcpy (buf->wchan, pinfo [0].PROC_WMESG, + sizeof buf->wchan); + buf->flags |= (1L << GLIBTOP_PROC_KERNEL_WCHAN); + } else { + buf->wchan [0] = 0; + } + + buf->k_flags = (unsigned long) pinfo [0].ki_flag; + buf->min_flt = (unsigned long) pinfo [0].ki_rusage.ru_minflt; + buf->maj_flt = (unsigned long) pinfo [0].ki_rusage.ru_majflt; +#if (__FreeBSD_version >= 600006) || defined(__FreeBSD_kernel__) + buf->cmin_flt = (unsigned long) buf->min_flt + pinfo [0].ki_rusage_ch.ru_minflt; + buf->cmaj_flt = (unsigned long) buf->maj_flt + pinfo [0].ki_rusage_ch.ru_majflt; +#endif + + buf->flags |= _glibtop_sysdeps_proc_kernel_pstats; + + return; +} diff --git a/sysdeps/freebsd/proclist.c b/sysdeps/freebsd/proclist.c new file mode 100644 index 0000000..898f9d4 --- /dev/null +++ b/sysdeps/freebsd/proclist.c @@ -0,0 +1,165 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proclist = +(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) + +(1L << GLIBTOP_PROCLIST_SIZE); + +/* Fetch list of currently running processes. + * The interface of this function is a little bit different from the others: + * buf->flags is only set if the call succeeded, in this case pids_chain, + * a list of the pids of all currently running processes is returned, + * buf->number is the number of elements of this list and buf->size is + * the size of one single element (sizeof (pid_t)). The total size is + * stored in buf->total. + * + * The calling function has to free the memory to which a pointer is returned. + * + * IMPORTANT NOTE: + * On error, this function MUST return NULL and set buf->flags to zero ! + * On success, it returnes a pointer to a list of buf->number elements + * each buf->size big. The total size is stored in buf->total. + * The calling function has to free the memory to which a pointer is returned. + * + * On error, NULL is returned and buf->flags is zero. */ + +/* Init function. */ + +void +_glibtop_init_proclist_p (glibtop *server) +{ + server->sysdeps.proclist = _glibtop_sysdeps_proclist; +} + +pid_t * +glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg) +{ + struct kinfo_proc *pinfo; + GArray *pids; + glibtop_proc_state procstate; + size_t len; + unsigned int i; + pid_t prev; + + memset (buf, 0, sizeof (glibtop_proclist)); + + if (sysctlbyname ("kern.proc.all", NULL, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.proc.all)"); + return NULL; + } + + pinfo = (struct kinfo_proc *) g_malloc0 (len); + + if (sysctlbyname ("kern.proc.all", pinfo, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.proc.all)"); + g_free (pinfo); + return NULL; + } + + len /= sizeof (struct kinfo_proc); + + pids = g_array_sized_new (FALSE, FALSE, sizeof (pid_t), len); + + for (i = 0; i < len; i++) { + pid_t pid; + + pid = (pid_t) pinfo[i].ki_pid; + + /* If a process has many threads, kern.proc.all reports multiple + times the same pid. So don't look twice at the same pid. + FIXME?: not sure that kern.proc.all reports a partially sorted + list (all pid/threads grouped). + */ + if (i > 0 && pid == prev) { + continue; + } + + prev = pid; + + switch (which & GLIBTOP_KERN_PROC_MASK) { + case GLIBTOP_KERN_PROC_ALL: + break; + case GLIBTOP_KERN_PROC_PID: + if ((pid_t) arg != pid) + continue; + break; + case GLIBTOP_KERN_PROC_UID: + if ((uid_t) arg != pinfo[i].ki_ruid) + continue; + break; + case GLIBTOP_KERN_PROC_PGRP: + if ((pid_t) arg != pinfo[i].ki_pgid) + continue; + break; + case GLIBTOP_KERN_PROC_SESSION: + if ((pid_t) arg != pinfo[i].ki_sid) + continue; + break; + case GLIBTOP_KERN_PROC_TTY: + if ((dev_t) arg != pinfo[i].ki_tdev) + continue; + break; + case GLIBTOP_KERN_PROC_RUID: + if ((uid_t) arg != pinfo[i].ki_ruid) + continue; + break; + } + + if (which & GLIBTOP_EXCLUDE_NOTTY) + if (pinfo[i].ki_tdev == (dev_t) -1) continue; + + if (which & GLIBTOP_EXCLUDE_IDLE) { + glibtop_get_proc_state_p (server, &procstate, pid); + if (procstate.flags & (1L << GLIBTOP_PROC_STATE_STATE)) + if (procstate.state != GLIBTOP_PROCESS_RUNNING) continue; + + if (pinfo[i].ki_ppid == 0 && !strcmp(pinfo[i].ki_comm, "idle")) + continue; + } + + if (which & GLIBTOP_EXCLUDE_SYSTEM) + if (pinfo[i].ki_ruid == (uid_t) 0) continue; + + g_array_append_val (pids, pid); + } + + g_free (pinfo); + + buf->flags = _glibtop_sysdeps_proclist; + buf->size = sizeof (pid_t); + buf->number = pids->len; + buf->total = buf->number * buf->size; + + return (pid_t *) g_array_free (pids, FALSE); +} diff --git a/sysdeps/freebsd/procmap.c b/sysdeps/freebsd/procmap.c new file mode 100644 index 0000000..ffd88e1 --- /dev/null +++ b/sysdeps/freebsd/procmap.c @@ -0,0 +1,391 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#define _KVM_VNODE +#include +#undef _KVM_VNODE + +#include +#if (__FreeBSD_version >= 800038) || (__FreeBSD_kernel_version >= 800038) +#define _WANT_FILE +#include +#undef _WANT_FILE +#else +#define _KERNEL +#include +#undef _KERNEL +#endif +#define _KERNEL +#include +#include +#include +#include +#if (__FreeBSD_version >= 600006) || defined(__FreeBSD_kernel__) +#include +#endif +#undef _KERNEL + + +#if (__FreeBSD_version >= 1101001) +#define _KERNEL +#include +#include +#undef _KERNEL +#endif + + +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_map = + (1L << GLIBTOP_PROC_MAP_TOTAL) + (1L << GLIBTOP_PROC_MAP_NUMBER) + + (1L << GLIBTOP_PROC_MAP_SIZE); + +static const unsigned long _glibtop_sysdeps_map_entry = + (1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) + + (1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) + + (1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE); + +#if (__FreeBSD_version >= 600006) || defined(__FreeBSD_kernel__) +void _glibtop_sysdeps_freebsd_dev_inode (glibtop *server, struct vnode *vnode, struct vnode *vn, guint64 *inum, guint64 *dev); + +void +_glibtop_sysdeps_freebsd_dev_inode (glibtop *server, struct vnode *vnode, + struct vnode *vn, guint64 *inum, + guint64 *dev) +{ + char *tagptr; + char tagstr[12]; + enum FS_TYPE { UNKNOWN, IS_UFS, IS_ZFS }; + int fs_type = UNKNOWN; + struct inode inode; + struct cdev_priv priv; +#if __FreeBSD_version < 800039 + struct cdev si; +#endif + + *inum = 0; + *dev = 0; + + if (kvm_read (server->machine->kd, (gulong) &vnode->v_tag, + (char *) &tagptr, sizeof (tagptr)) != sizeof (tagptr) || + kvm_read (server->machine->kd, (gulong) tagptr, + (char *) tagstr, sizeof (tagstr)) != sizeof (tagstr)) + { + glibtop_warn_io_r (server, "kvm_read (tagptr)"); + return; + } + + tagstr[sizeof(tagstr) - 1] = '\0'; + + if (!strcmp(tagstr, "ufs")) { + fs_type = IS_UFS; + } else if (!strcmp(tagstr, "zfs")) { + fs_type = IS_ZFS; + } else { + glibtop_warn_io_r (server, "ignoring fstype %s", tagstr); + return; + } + + if (kvm_read (server->machine->kd, (gulong) VTOI(vn), (char *) &inode, + sizeof (inode)) != sizeof (inode)) + { + glibtop_warn_io_r (server, "kvm_read (inode)"); + return; + } + + + if (fs_type == IS_ZFS) { + /* FIXME: I have no idea about what is the actual layout of what we've read + but the inode number is definitely at offset 16, 8 bytes of amd64. + *inum = *(guint64*) ((unsigned char*)&inode + 16); + So this is really hugly, but I don't have anything better for now. + + Actually, this looks like a znode_t as described in kernel's zfs_znode.h. + I don't have that header file, so let's just mimic that. + */ + + struct my_zfsvfs { + /* vfs_t */ void *z_vfs; + /* zfsvfs_t */ void *z_parent; + /* objset_t */ void *z_os; + uint64_t z_root; + /* ... */ + }; + + typedef struct my_znode { + struct my_zfsvfs *z_zfsvfs; + /* vnode_t */ void *z_vnode; + uint64_t z_id; + /* ... */ + } my_znode_t; + + G_STATIC_ASSERT(sizeof(my_znode_t) <= sizeof(struct inode)); + + my_znode_t* znode = (my_znode_t*)&inode; + *inum = znode->z_id; + + struct my_zfsvfs zvfs; + + if (kvm_read(server->machine->kd, + (unsigned long)(znode->z_zfsvfs), + &zvfs, sizeof zvfs) != sizeof zvfs) { + glibtop_warn_io_r(server, "kvm_read (z_zfsvfs)"); + return; + } + + *dev = zvfs.z_root; + } + else if (fs_type == IS_UFS) { + /* Set inum as soon as possible, so that if the next kvm_reads fail + we still have something */ + *inum = inode.i_number; + + +#if (__FreeBSD_version >= 1101001) +/* + The ufs struct inode changed between 11.0 and 11.1. + + commit 20f1e8ac63b58708989267ea34a6aefa90b46577 + Author: kib + Date: Sat Sep 17 16:47:34 2016 +0000 + + Reduce size of ufs inode. + [...] +*/ + struct ufsmount um; + + if (kvm_read(server->machine->kd, (gulong)inode.i_ump, &um, sizeof um) != sizeof um) { + glibtop_warn_io_r (server, "kvm_read (ufsmount)"); + return; + } + + if (kvm_read(server->machine->kd, (gulong)cdev2priv(um.um_dev), &priv, sizeof priv) != sizeof priv) { + glibtop_warn_io_r (server, "kvm_read (priv)"); + return; + } + + *dev = priv.cdp_inode; + +#else /* older versions */ +#if (__FreeBSD_version >= 800039) || (__FreeBSD_kernel_version >= 800039) + if (kvm_read (server->machine->kd, (gulong) cdev2priv(inode.i_dev), (char *) &priv, + sizeof (priv)) +#else + if (kvm_read (server->machine->kd, (gulong) inode.i_dev, (char *) &si, + sizeof (si)) != sizeof (si) || + kvm_read (server->machine->kd, (gulong) si.si_priv, (char *) &priv, + sizeof (priv)) +#endif + != sizeof (priv)) + { + glibtop_warn_io_r (server, "kvm_read (priv)"); + return; + } + + *dev = (guint64) priv.cdp_inode; +#endif /* older versions */ + + } /* end-if IS_UFS */ +} +#endif + +/* Init function. */ + +void +_glibtop_init_proc_map_p (glibtop *server) +{ + server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; +} + +/* Provides detailed information about a process. */ + +glibtop_map_entry * +glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + struct vm_map_entry entry, *first; + struct vmspace vmspace; + struct vm_object object; + GArray *maps; + struct vnode vnode; + int count; + int update = 0; + + memset (buf, 0, sizeof (glibtop_proc_map)); + + /* It does not work for the swapper task. */ + if (pid == 0) return NULL; + + /*return (glibtop_map_entry*) g_array_free(maps, TRUE);*/ + + glibtop_suid_enter (server); + + /* Get the process data */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count < 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + glibtop_suid_leave (server); + return NULL; + } + + /* Now we get the memory maps. */ + + if (kvm_read (server->machine->kd, + (gulong) pinfo [0].ki_vmspace, + (char *) &vmspace, sizeof (vmspace)) != sizeof (vmspace)) { + glibtop_warn_io_r (server, "kvm_read (vmspace)"); + glibtop_suid_leave (server); + return NULL; + } + + first = vmspace.vm_map.header.next; + + if (kvm_read (server->machine->kd, + (gulong) vmspace.vm_map.header.next, + (char *) &entry, sizeof (entry)) != sizeof (entry)) { + glibtop_warn_io_r (server, "kvm_read (entry)"); + glibtop_suid_leave (server); + return NULL; + } + + /* Walk through the `vm_map_entry' list ... */ + + /* I tested this a few times with `mmap'; as soon as you write + * to the mmap'ed area, the object type changes from OBJT_VNODE + * to OBJT_DEFAULT so if seems this really works. */ + + maps = g_array_sized_new(FALSE, FALSE, sizeof(glibtop_map_entry), + vmspace.vm_map.nentries); + + do { + glibtop_map_entry *mentry; + guint64 inum, dev; + guint len; + + if (update) { + if (kvm_read (server->machine->kd, + (gulong) entry.next, + (char *) &entry, sizeof (entry)) != sizeof (entry)) { + glibtop_warn_io_r (server, "kvm_read (entry)"); + continue; + } + } else { + update = 1; + } + + if (entry.eflags & (MAP_ENTRY_IS_SUB_MAP)) + continue; + + if (!entry.object.vm_object) + continue; + + /* We're only interested in `vm_object's */ + + if (kvm_read (server->machine->kd, + (gulong) entry.object.vm_object, + (char *) &object, sizeof (object)) != sizeof (object)) { + glibtop_warn_io_r (server, "kvm_read (object)"); + continue; + } + + /* If the object is of type vnode, add its size */ + + if (object.type != OBJT_VNODE) + continue; + + if (!object.handle) + continue; + + if (kvm_read (server->machine->kd, + (gulong) object.handle, + (char *) &vnode, sizeof (vnode)) != sizeof (vnode)) { + glibtop_warn_io_r (server, "kvm_read (vnode)"); + continue; + } + + switch (vnode.v_type) { + case VNON: + case VBAD: + continue; + default: +#if (__FreeBSD_version < 600006) && !defined(__FreeBSD_kernel__) + inum = vnode.v_cachedid; + dev = vnode.v_cachedfs; + +#else + _glibtop_sysdeps_freebsd_dev_inode (server, + (struct vnode *) object.handle, + &vnode, &inum, &dev); +#endif + break; + } + + len = maps->len; + g_array_set_size(maps, len + 1); + mentry = &g_array_index(maps, glibtop_map_entry, len); + + memset (mentry, 0, sizeof (glibtop_map_entry)); + + mentry->flags = _glibtop_sysdeps_map_entry; + mentry->start = (guint64) entry.start; + mentry->end = (guint64) entry.end; + mentry->offset = (guint64) entry.offset; + mentry->device = (guint64) dev; + mentry->inode = (guint64) inum; + + mentry->perm = (guint64) 0; + + if (entry.protection & VM_PROT_READ) + mentry->perm |= GLIBTOP_MAP_PERM_READ; + if (entry.protection & VM_PROT_WRITE) + mentry->perm |= GLIBTOP_MAP_PERM_WRITE; + if (entry.protection & VM_PROT_EXECUTE) + mentry->perm |= GLIBTOP_MAP_PERM_EXECUTE; + + } while (entry.next != first); + + glibtop_suid_leave (server); + + buf->flags = _glibtop_sysdeps_proc_map; + + buf->number = (guint64) maps->len; + buf->size = (guint64) sizeof (glibtop_map_entry); + buf->total = (guint64) (buf->number * buf->size); + + return (glibtop_map_entry*) g_array_free(maps, FALSE); +} diff --git a/sysdeps/freebsd/procmem.c b/sysdeps/freebsd/procmem.c new file mode 100644 index 0000000..c7ffbee --- /dev/null +++ b/sysdeps/freebsd/procmem.c @@ -0,0 +1,164 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_mem = +(1L << GLIBTOP_PROC_MEM_SIZE) + +(1L << GLIBTOP_PROC_MEM_VSIZE) + +(1L << GLIBTOP_PROC_MEM_RESIDENT) + +(1L << GLIBTOP_PROC_MEM_RSS) + +(1L << GLIBTOP_PROC_MEM_RSS_RLIM); + +static const unsigned long _glibtop_sysdeps_proc_mem_share = +(1L << GLIBTOP_PROC_MEM_SHARE); + +/* define pagetok in terms of pageshift */ +#define ps_pgtok(a) (((a) * getpagesize()) / 1024) + +/* Init function. */ + +void +_glibtop_init_proc_mem_p (glibtop *server) +{ + server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + struct vm_map_entry entry, *first; + struct vmspace vmspace; + struct vm_object object; + int count; + + memset (buf, 0, sizeof (glibtop_proc_mem)); + + if (server->sysdeps.proc_mem == 0) + return; + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + /* Get the process data */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count < 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + +#define PROC_VMSPACE ki_vmspace + + buf->rss_rlim = pinfo [0].ki_rssize; + + buf->vsize = buf->size = (guint64) + pinfo [0].ki_size; + buf->resident = buf->rss = (guint64) + ps_pgtok (pinfo [0].ki_rssize) * 1024; + + buf->flags |= _glibtop_sysdeps_proc_mem; + +#if 0 + /* + * It doesn't make any sense to count as shared each and every mmaped file + */ + + /* Now we get the shared memory. */ + + if (kvm_read (server->machine->kd, + (unsigned long) pinfo [0].PROC_VMSPACE, + (char *) &vmspace, sizeof (vmspace)) != sizeof (vmspace)) { + glibtop_warn_io_r (server, "kvm_read (vmspace)"); + return; + } + + first = vmspace.vm_map.header.next; + + if (kvm_read (server->machine->kd, + (unsigned long) vmspace.vm_map.header.next, + (char *) &entry, sizeof (entry)) != sizeof (entry)) { + glibtop_warn_io_r (server, "kvm_read (entry)"); + return; + } + + /* Walk through the `vm_map_entry' list ... */ + + /* I tested this a few times with `mmap'; as soon as you write + * to the mmap'ed area, the object type changes from OBJT_VNODE + * to OBJT_DEFAULT so if seems this really works. */ + + while (entry.next != first) { + if (kvm_read (server->machine->kd, + (unsigned long) entry.next, + (char *) &entry, sizeof (entry)) != sizeof (entry)) { + glibtop_warn_io_r (server, "kvm_read (entry)"); + return; + } + + if (entry.eflags & (MAP_ENTRY_IS_SUB_MAP)) + continue; + + if (!entry.object.vm_object) + continue; + + /* We're only interested in `vm_object's */ + + if (kvm_read (server->machine->kd, + (unsigned long) entry.object.vm_object, + (char *) &object, sizeof (object)) != sizeof (object)) { + glibtop_warn_io_r (server, "kvm_read (object)"); + return; + } + + if (object.type != OBJT_VNODE) + continue; + + buf->share += object.un_pager.vnp.vnp_size; + } + + buf->flags |= _glibtop_sysdeps_proc_mem_share; +#endif +} diff --git a/sysdeps/freebsd/procopenfiles.c b/sysdeps/freebsd/procopenfiles.c new file mode 100644 index 0000000..e411298 --- /dev/null +++ b/sysdeps/freebsd/procopenfiles.c @@ -0,0 +1,389 @@ +/* Copyright (C) 1998-99 Martin Baulig + Copyright (C) 2004 Nicol�s Lichtmaier + Copyright (C) 2007 Joe Marcus Clarke + This file is part of LibGTop 1.0. + + Modified by Nicol�s Lichtmaier to give a process open files. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_KINFO_GETFILE +#include +#endif +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_open_files = +(1L << GLIBTOP_PROC_OPEN_FILES_NUMBER)| +(1L << GLIBTOP_PROC_OPEN_FILES_TOTAL)| +(1L << GLIBTOP_PROC_OPEN_FILES_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_open_files_s (glibtop *server) +{ + server->sysdeps.proc_open_files = _glibtop_sysdeps_proc_open_files; +} + +#if __FreeBSD_version > 800018 || (__FreeBSD_version < 800000 && __FreeBSD_version >= 700104) +static char * +addr_to_string(struct sockaddr_storage *ss) +{ + char *buffer = NULL; + char buffer2[INET6_ADDRSTRLEN]; + struct sockaddr_in6 *sin6; + struct sockaddr_in *sin; + struct sockaddr_un *sun; + + switch (ss->ss_family) { + case AF_LOCAL: + sun = (struct sockaddr_un *)ss; + if (strlen(sun->sun_path) == 0) + buffer = g_strdup("-"); + else + buffer = g_strdup(sun->sun_path); + break; + case AF_INET: + sin = (struct sockaddr_in *)ss; + buffer = g_strdup(inet_ntoa(sin->sin_addr)); + break; + case AF_INET6: + sin6 = (struct sockaddr_in6 *)ss; + if (inet_ntop(AF_INET6, &sin6->sin6_addr, buffer2, + sizeof(buffer2)) != NULL) + buffer = g_strdup(buffer2); + else + buffer = g_strdup("-"); + break; + } + + return buffer; +} + +static int +addr_to_port(struct sockaddr_storage *ss) +{ + int port = 0; + struct sockaddr_in6 *sin6; + struct sockaddr_in *sin; + + switch (ss->ss_family) { + case AF_INET: + sin = (struct sockaddr_in *)ss; + port = ntohs(sin->sin_port); + break; + case AF_INET6: + sin6 = (struct sockaddr_in6 *)ss; + port = ntohs(sin6->sin6_port); + break; + } + + return port; +} +#else + +static GArray * +parse_output(const char *output) { + GArray *entries; + char **lines; + char *ftype = NULL; + char *fname = NULL; + guint i; + guint len; + int fd = -1; + + entries = g_array_new(FALSE, FALSE, sizeof(glibtop_open_files_entry)); + + lines = g_strsplit(output, "\n", 0); + len = g_strv_length(lines); + + for (i = 0; i < len && lines[i]; i++) { + glibtop_open_files_entry entry = {0}; + + if (strlen(lines[i]) < 2) + continue; + + if (!g_str_has_prefix(lines[i], "f") && + !g_str_has_prefix(lines[i], "t") && + !g_str_has_prefix(lines[i], "n")) + continue; + + if (g_str_has_prefix(lines[i], "f")) { + if (!g_ascii_isdigit(*(lines[i] + 1))) + i += 2; + else + fd = atoi(lines[i] + 1); + continue; + } + + if (g_str_has_prefix(lines[i], "t")) { + ftype = lines[i]; + ftype++; + continue; + } else { + fname = lines[i]; + fname++; + } + + if (ftype == NULL || fname == NULL) + continue; + + if (!strcmp(ftype, "unix")) { + entry.type = GLIBTOP_FILE_TYPE_LOCALSOCKET; + g_strlcpy(entry.info.localsock.name, fname, + sizeof(entry.info.localsock.name)); + } else if (!strcmp(ftype, "PIPE")) { + entry.type = GLIBTOP_FILE_TYPE_PIPE; + } else if (!strcmp(ftype, "VREG") || + !strcmp(ftype, "GDIR") || + !strcmp(ftype, "GREG") || + !strcmp(ftype, "VCHR") || + !strcmp(ftype, "VBLK") || + !strcmp(ftype, "DIR") || + !strcmp(ftype, "LINK") || + !strcmp(ftype, "REG") || + !strcmp(ftype, "VDIR")) { + entry.type = GLIBTOP_FILE_TYPE_FILE; + g_strlcpy(entry.info.file.name, fname, + sizeof(entry.info.file.name)); + } else if (!strcmp(ftype, "IPv4")) { + char **hosts; + char **remote_host; + + if (!strstr(fname, "->")) { + remote_host = g_strsplit(fname, ":", 0); + } else { + hosts = g_strsplit(fname, "->", 0); + if (g_strv_length(hosts) < 2) { + g_strfreev(hosts); + continue; + } + + remote_host = g_strsplit(hosts[1], ":", 0); + g_strfreev(hosts); + } + + if (g_strv_length(remote_host) < 2) { + g_strfreev(remote_host); + continue; + } + + entry.type = GLIBTOP_FILE_TYPE_INETSOCKET; + if (!strcmp(remote_host[0], "*")) + g_strlcpy(entry.info.sock.dest_host, "0.0.0.0", + sizeof(entry.info.sock.dest_host)); + else + g_strlcpy(entry.info.sock.dest_host, + remote_host[0], + sizeof(entry.info.sock.dest_host)); + entry.info.sock.dest_port = atoi(remote_host[1]); + + g_strfreev(remote_host); + } else if (!strcmp(ftype, "IPv6")) { + char **hosts; + char **remote_host; + + if (!strstr(fname, "->")) { + remote_host = g_strsplit(fname, ":", 0); + } else { + hosts = g_strsplit(fname, "->", 0); + if (g_strv_length(hosts) < 2) { + g_strfreev(hosts); + continue; + } + + remote_host = g_strsplit(hosts[1], "]", 0); + g_strfreev(hosts); + } + + if (g_strv_length(remote_host) < 2) { + g_strfreev(remote_host); + continue; + } + + entry.type = GLIBTOP_FILE_TYPE_INET6SOCKET; + if (!strcmp(remote_host[0], "*")) + g_strlcpy(entry.info.sock.dest_host, "0.0.0.0", + sizeof(entry.info.sock.dest_host)); + else + g_strlcpy(entry.info.sock.dest_host, + remote_host[0] + 1, + sizeof(entry.info.sock.dest_host)); + entry.info.sock.dest_port = atoi(remote_host[1] + 1); + + g_strfreev(remote_host); + } else + continue; + + entry.fd = fd; + + fd = -1; + ftype = NULL; + fname = NULL; + + g_array_append_val(entries, entry); + } + + g_strfreev(lines); + + return entries; +} +#endif + +glibtop_open_files_entry * +glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pid_t pid) +{ +#if __FreeBSD_version > 800018 || (__FreeBSD_version < 800000 && __FreeBSD_version >= 700104) + struct kinfo_file *freep, *kif; +#ifndef HAVE_KINFO_GETFILE + int name[4]; + size_t len; +#else + int cnt; +#endif + ssize_t i; +#else + char *output; +#endif + GArray *entries; + + memset(buf, 0, sizeof (glibtop_proc_open_files)); + +#if __FreeBSD_version > 800018 || (__FreeBSD_version < 800000 && __FreeBSD_version >= 700104) +#ifndef HAVE_KINFO_GETFILE + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_FILEDESC; + name[3] = pid; + + if (sysctl(name, 4, NULL, &len, NULL, 0) < 0) + return NULL; + + freep = kif = g_malloc(len); + if (sysctl(name, 4, kif, &len, NULL, 0) < 0) { + g_free(freep); + return NULL; + } +#else + freep = kinfo_getfile(pid, &cnt); +#endif + + entries = g_array_new(FALSE, FALSE, sizeof(glibtop_open_files_entry)); + +#ifndef HAVE_KINFO_GETFILE + for (i = 0; i < len / sizeof(*kif); i++, kif++) { + glibtop_open_files_entry entry = {0}; + + if (kif->kf_structsize != sizeof(*kif)) + continue; +#else + for (i = 0; i < cnt; i++) { + glibtop_open_files_entry entry = {0}; + + kif = &freep[i]; +#endif + + if (kif->kf_fd < 0) + continue; + + if (kif->kf_type == KF_TYPE_SOCKET) { + if (kif->kf_sock_domain == AF_LOCAL) { + struct sockaddr_un *sun; + + entry.type = GLIBTOP_FILE_TYPE_LOCALSOCKET; + sun = (struct sockaddr_un *)&kif->kf_sa_local; + + if (sun->sun_path[0]) { + char *addrstr; + + addrstr = addr_to_string(&kif->kf_sa_local); + g_strlcpy(entry.info.localsock.name, + addrstr, + sizeof(entry.info.localsock.name)); + g_free(addrstr); + } else { + char *addrstr; + + addrstr = addr_to_string(&kif->kf_sa_peer); + g_strlcpy(entry.info.localsock.name, + addrstr, + sizeof(entry.info.localsock.name)); + g_free(addrstr); + } + } else if (kif->kf_sock_domain == AF_INET || + kif->kf_sock_domain == AF_INET6) { + char *addrstr; + + if (kif->kf_sock_domain == AF_INET) + entry.type = GLIBTOP_FILE_TYPE_INETSOCKET; + else + entry.type = GLIBTOP_FILE_TYPE_INET6SOCKET; + addrstr = addr_to_string(&kif->kf_sa_peer); + g_strlcpy(entry.info.sock.dest_host, + addrstr, + sizeof(entry.info.sock.dest_host)); + g_free(addrstr); + entry.info.sock.dest_port = addr_to_port(&kif->kf_sa_peer); + } + } else if (kif->kf_type == KF_TYPE_PIPE) { + entry.type = GLIBTOP_FILE_TYPE_PIPE; + } else if (kif->kf_type == KF_TYPE_VNODE) { + entry.type = GLIBTOP_FILE_TYPE_FILE; + g_strlcpy(entry.info.file.name, kif->kf_path, + sizeof(entry.info.file.name)); + } else + continue; + + entry.fd = kif->kf_fd; + + g_array_append_val(entries, entry); + } + g_free(freep); +#else + + output = execute_lsof(pid); + if (output == NULL) return NULL; + + entries = parse_output(output); + + g_free(output); +#endif + + buf->flags = _glibtop_sysdeps_proc_open_files; + buf->number = entries->len; + buf->size = sizeof(glibtop_open_files_entry); + buf->total = buf->number * buf->size; + + return (glibtop_open_files_entry*)g_array_free(entries, FALSE); +} diff --git a/sysdeps/freebsd/procsegment.c b/sysdeps/freebsd/procsegment.c new file mode 100644 index 0000000..e445598 --- /dev/null +++ b/sysdeps/freebsd/procsegment.c @@ -0,0 +1,74 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_segment = +(1L << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_DATA_RSS); + +static int pagesize; + +/* Init function. */ + +void +_glibtop_init_proc_segment_p (glibtop *server) +{ + pagesize = getpagesize (); + server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_segment_p (glibtop *server, + glibtop_proc_segment *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + int count = 0; + + memset (buf, 0, sizeof (glibtop_proc_segment)); + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + /* Get the process info from the kernel */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count != 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + + buf->text_rss = pinfo[0].ki_tsize * pagesize; + buf->data_rss = pinfo[0].ki_dsize * pagesize; + + buf->flags = _glibtop_sysdeps_proc_segment; +} diff --git a/sysdeps/freebsd/procsignal.c b/sysdeps/freebsd/procsignal.c new file mode 100644 index 0000000..c5dbc03 --- /dev/null +++ b/sysdeps/freebsd/procsignal.c @@ -0,0 +1,93 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_signal = +(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + +(1L << GLIBTOP_PROC_SIGNAL_BLOCKED) + +(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + +(1L << GLIBTOP_PROC_SIGNAL_SIGCATCH); + +/* Init function. */ + +void +_glibtop_init_proc_signal_p (glibtop *server) +{ + server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; +} + +void +glibtop_get_proc_signal_p (glibtop *server, + glibtop_proc_signal *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + int count = 0; + + memset (buf, 0, sizeof (glibtop_proc_signal)); + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count != 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + +#define PROC_SIGLIST ki_siglist +#define PROC_SIGMASK ki_sigmask +#define PROC_SIGIGNORE ki_sigignore +#define PROC_SIGCATCH ki_sigcatch + + /* signal: mask of pending signals. + * pinfo [0].kp_proc.p_siglist + */ + buf->signal [0] = pinfo [0].PROC_SIGLIST.__bits[0]; + + /* blocked: mask of blocked signals. + * pinfo [0].kp_proc.p_sigmask + */ + buf->blocked [0] = pinfo [0].PROC_SIGMASK.__bits[0]; + + /* sigignore: mask of ignored signals. + * pinfo [0].kp_proc.p_sigignore + */ + buf->sigignore [0] = pinfo [0].PROC_SIGIGNORE.__bits[0]; + + /* sigcatch: mask of caught signals. + * pinfo [0].kp_proc.p_sigcatch + */ + buf->sigcatch [0] = pinfo [0].PROC_SIGCATCH.__bits[0]; + + buf->flags = _glibtop_sysdeps_proc_signal; +} diff --git a/sysdeps/freebsd/procstate.c b/sysdeps/freebsd/procstate.c new file mode 100644 index 0000000..a7fd215 --- /dev/null +++ b/sysdeps/freebsd/procstate.c @@ -0,0 +1,91 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_state = +(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_STATE) + +(1L << GLIBTOP_PROC_STATE_UID) + (1L << GLIBTOP_PROC_STATE_GID); + +/* Init function. */ + +void +_glibtop_init_proc_state_p (glibtop *server) +{ + server->sysdeps.proc_state = _glibtop_sysdeps_proc_state; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_state_p (glibtop *server, + glibtop_proc_state *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + int count = 0; + + memset (buf, 0, sizeof (glibtop_proc_state)); + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count != 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + + buf->uid = pinfo[0].ki_ruid; + buf->gid = pinfo[0].ki_rgid; + + g_strlcpy (buf->cmd, pinfo[0].ki_comm, sizeof (buf->cmd)); + + switch (pinfo[0].ki_stat) { + case SRUN: + buf->state = GLIBTOP_PROCESS_RUNNING; + break; + case SSLEEP: + buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE; + break; + case SSTOP: + buf->state = GLIBTOP_PROCESS_STOPPED; + break; + case SZOMB: + buf->state = GLIBTOP_PROCESS_ZOMBIE; + break; + case SWAIT: + case SLOCK: + buf->state = GLIBTOP_PROCESS_UNINTERRUPTIBLE; + break; + case SIDL: + default: + buf->state = 0; + break; + } + + buf->flags = _glibtop_sysdeps_proc_state; +} diff --git a/sysdeps/freebsd/proctime.c b/sysdeps/freebsd/proctime.c new file mode 100644 index 0000000..f01b905 --- /dev/null +++ b/sysdeps/freebsd/proctime.c @@ -0,0 +1,114 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_time = +(1L << GLIBTOP_PROC_TIME_RTIME) + (1L << GLIBTOP_PROC_TIME_FREQUENCY); + +static const unsigned long _glibtop_sysdeps_proc_time_user = +(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_STIME) + +(1L << GLIBTOP_PROC_TIME_CUTIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) + +(1L << GLIBTOP_PROC_TIME_START_TIME); + +static guint64 tv2sec_freq(struct timeval tv, guint64 freq) +{ + return tv.tv_sec * freq + tv.tv_usec * freq / 1000000; +} + +#define tv2sec(tv) tv2sec_freq(tv, 1) + +/* Init function. */ + +void +_glibtop_init_proc_time_p (glibtop *server) +{ + server->sysdeps.proc_time = _glibtop_sysdeps_proc_time | + _glibtop_sysdeps_proc_time_user; +} + +/* Taken from /usr/src/sys/kern/kern_resource.c */ + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + struct clockinfo ci; + int count; + size_t len; + + memset (buf, 0, sizeof (glibtop_proc_time)); + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + glibtop_suid_enter (server); + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count != 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + glibtop_suid_leave (server); + return; + } + + glibtop_suid_leave (server); + + + len = sizeof (ci); + if (sysctlbyname ("kern.clockrate", &ci, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.clockrate) (%d)", pid); + glibtop_suid_leave (server); + return; + } + + buf->frequency = (ci.stathz ? ci.stathz : ci.hz); + buf->rtime = pinfo [0].ki_runtime * buf->frequency / 1000000; + buf->flags = _glibtop_sysdeps_proc_time; + + /* + All the following used to be 'if (pinfo [0].ki_flag & PS_INMEM)' + but it was never entered. + I have no idea what this PS_INMEM is, but it works perfectly + without this check. + */ + buf->utime = tv2sec_freq (pinfo [0].ki_rusage.ru_utime, buf->frequency); + buf->stime = tv2sec_freq (pinfo [0].ki_rusage.ru_stime, buf->frequency); + buf->cutime = tv2sec_freq (pinfo [0].ki_childtime, buf->frequency); +#if (__FreeBSD_version >= 600006) || defined(__FreeBSD_kernel__) + buf->cstime = tv2sec_freq (pinfo [0].ki_rusage_ch.ru_stime, buf->frequency); +#else + buf->cstime = 0; +#endif + buf->start_time = tv2sec (pinfo [0].ki_start); + buf->flags |= _glibtop_sysdeps_proc_time_user; +} diff --git a/sysdeps/freebsd/procuid.c b/sysdeps/freebsd/procuid.c new file mode 100644 index 0000000..b3fecf7 --- /dev/null +++ b/sysdeps/freebsd/procuid.c @@ -0,0 +1,88 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_uid = +(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) + +(1L << GLIBTOP_PROC_UID_EGID) + (1L << GLIBTOP_PROC_UID_PID) + +(1L << GLIBTOP_PROC_UID_PPID) + (1L << GLIBTOP_PROC_UID_PGRP) + +(1L << GLIBTOP_PROC_UID_TPGID) + (1L << GLIBTOP_PROC_UID_PRIORITY) + +(1L << GLIBTOP_PROC_UID_NICE) + (1L << GLIBTOP_PROC_UID_GID); + +/* Init function. */ + +void +_glibtop_init_proc_uid_p (glibtop *server) +{ + server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + int count = 0; + + memset (buf, 0, sizeof (glibtop_proc_uid)); + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count != 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + +#define PROC_RUID ki_ruid +#define PROC_EUID ki_uid +#define PROC_RGID ki_rgid +#define PROC_SVGID ki_svgid +#define PROC_PPID ki_ppid +#define PROC_PGID ki_pgid +#define PROC_TPGID ki_tpgid +#define PROC_NICE ki_nice +#define PROC_PRIORITY ki_pri.pri_user + + buf->uid = pinfo [0].PROC_RUID; + buf->euid = pinfo [0].PROC_EUID; + buf->gid = pinfo [0].PROC_RGID; + buf->egid = pinfo [0].PROC_SVGID; + + buf->ppid = pinfo [0].PROC_PPID; + buf->pgrp = pinfo [0].PROC_PGID; + buf->tpgid = pinfo [0].PROC_TPGID; + + buf->nice = pinfo [0].PROC_NICE; + buf->priority = pinfo [0].PROC_PRIORITY; + + buf->flags = _glibtop_sysdeps_proc_uid; +} diff --git a/sysdeps/freebsd/procwd.c b/sysdeps/freebsd/procwd.c new file mode 100644 index 0000000..8ece92f --- /dev/null +++ b/sysdeps/freebsd/procwd.c @@ -0,0 +1,200 @@ +/* Copyright (C) 2007 Joe Marcus Clarke + This file is part of LibGTop 2. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +#include +#include +#include +#include +#ifdef HAVE_KINFO_GETFILE +#include +#endif +#include + +static const unsigned long _glibtop_sysdeps_proc_wd = +(1 << GLIBTOP_PROC_WD_EXE) | +(1 << GLIBTOP_PROC_WD_ROOT) | +(1 << GLIBTOP_PROC_WD_NUMBER); + +void +_glibtop_init_proc_wd_s(glibtop *server) +{ + server->sysdeps.proc_wd = _glibtop_sysdeps_proc_wd; +} + +#if (__FreeBSD_version >= 800000 && __FreeBSD_version < 800019) || __FreeBSD_version < 700104 +static GPtrArray * +parse_output(const char *output, glibtop_proc_wd *buf) +{ + GPtrArray *dirs; + char **lines; + gboolean nextwd = FALSE; + gboolean nextrtd = FALSE; + gboolean havertd = FALSE; + guint i; + guint len; + + dirs = g_ptr_array_sized_new(1); + + lines = g_strsplit(output, "\n", 0); + len = g_strv_length(lines); + + for (i = 0; i < len && lines[i]; i++) { + if (strlen(lines[i]) < 2) + continue; + + if (!strcmp(lines[i], "fcwd")) { + nextwd = TRUE; + continue; + } + + if (!strcmp(lines[i], "frtd")) { + nextrtd = TRUE; + continue; + } + + if (!g_str_has_prefix(lines[i], "n")) + continue; + + if (nextwd) { + g_ptr_array_add(dirs, g_strdup(lines[i] + 1)); + nextwd = FALSE; + } + + if (nextrtd && !havertd) { + g_strlcpy(buf->root, lines[i] + 1, + sizeof(buf->root)); + buf->flags |= (1 << GLIBTOP_PROC_WD_ROOT); + nextrtd = FALSE; + havertd = TRUE; + } + } + + g_strfreev(lines); + + return dirs; +} +#endif + +char** +glibtop_get_proc_wd_s(glibtop *server, glibtop_proc_wd *buf, pid_t pid) +{ + int exe_mib[4]; + size_t len; +#if __FreeBSD_version > 800018 || (__FreeBSD_version < 800000 && __FreeBSD_version >= 700104) + struct kinfo_file *freep, *kif; + GPtrArray *dirs; +#ifndef HAVE_KINFO_GETFILE + int name[4]; +#else + int cnt; +#endif + int i; +#else + char *output; +#endif + + memset (buf, 0, sizeof (glibtop_proc_wd)); + len = 0; + + exe_mib[0] = CTL_KERN; + exe_mib[1] = KERN_PROC; + exe_mib[2] = KERN_PROC_PATHNAME; + exe_mib[3] = pid; + + if (sysctl(exe_mib, 4, NULL, &len, NULL, 0) == 0) { + if (len > sizeof(buf->exe)) + len = sizeof(buf->exe); + if (sysctl(exe_mib, 4, buf->exe, &len, NULL, 0) == 0) + buf->flags |= (1 << GLIBTOP_PROC_WD_EXE); + } + +#if __FreeBSD_version > 800018 || (__FreeBSD_version < 800000 && __FreeBSD_version >= 700104) +#ifndef HAVE_KINFO_GETFILE + len = 0; + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_FILEDESC; + name[3] = pid; + + if (sysctl(name, 4, NULL, &len, NULL, 0) < 0) + return NULL; + freep = kif = g_malloc(len); + if (sysctl(name, 4, kif, &len, NULL, 0) < 0) { + g_free(freep); + return NULL; + } +#else + freep = kinfo_getfile(pid, &cnt); +#endif + + dirs = g_ptr_array_sized_new(1); + +#ifndef HAVE_KINFO_GETFILE + for (i = 0; i < len / sizeof(*kif); i++, kif++) { + if (kif->kf_structsize != sizeof(*kif)) + continue; +#else + for (i = 0; i < cnt; i++) { + kif = &freep[i]; +#endif + + switch (kif->kf_fd) { + case KF_FD_TYPE_ROOT: + g_strlcpy(buf->root, kif->kf_path, + sizeof(buf->root)); + buf->flags |= (1 << GLIBTOP_PROC_WD_ROOT); + break; + case KF_FD_TYPE_CWD: + g_ptr_array_add(dirs, g_strdup (kif->kf_path)); + break; + } + } + g_free(freep); + + buf->number = dirs->len; + buf->flags |= (1 << GLIBTOP_PROC_WD_NUMBER); + + g_ptr_array_add(dirs, NULL); + + return (char **)g_ptr_array_free(dirs, FALSE); +#else + output = execute_lsof(pid); + if (output != NULL) { + GPtrArray *dirs; + + dirs = parse_output(output, buf); + g_free(output); + + buf->number = dirs->len; + buf->flags |= (1 << GLIBTOP_PROC_WD_NUMBER); + + g_ptr_array_add(dirs, NULL); + + return (char **)g_ptr_array_free(dirs, FALSE); + } +#endif + + return NULL; +} diff --git a/sysdeps/freebsd/sem_limits.c b/sysdeps/freebsd/sem_limits.c new file mode 100644 index 0000000..078a245 --- /dev/null +++ b/sysdeps/freebsd/sem_limits.c @@ -0,0 +1,132 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , August 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include + +static unsigned long _glibtop_sysdeps_sem_limits = +(1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) + +(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) + +(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) + +(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) + +(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM); + +/* Init function. */ + +void +_glibtop_init_sem_limits_s (glibtop *server) +{ + server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; +} + +/* Provides information about sysv sem limits. */ + +void +glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf) +{ + size_t len; + int semmap, semmni, semmns, semmnu, semmsl, semopm, semume, semusz; + int semvmx, semaem; + + memset (buf, 0, sizeof (glibtop_sem_limits)); + + if (server->sysdeps.sem_limits == 0) + return; + + len = sizeof (semmap); + if (sysctlbyname ("kern.ipc.semmap", &semmap, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.semmap)"); + return; + } + + len = sizeof (semmni); + if (sysctlbyname ("kern.ipc.semmni", &semmni, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.semmni)"); + return; + } + + len = sizeof (semmns); + if (sysctlbyname ("kern.ipc.semmns", &semmns, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.semmns)"); + return; + } + + len = sizeof (semmnu); + if (sysctlbyname ("kern.ipc.semmnu", &semmnu, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.semmnu)"); + return; + } + + len = sizeof (semmsl); + if (sysctlbyname ("kern.ipc.semmsl", &semmsl, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.semmsl)"); + return; + } + + len = sizeof (semopm); + if (sysctlbyname ("kern.ipc.semopm", &semopm, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.semopm)"); + return; + } + + len = sizeof (semume); + if (sysctlbyname ("kern.ipc.semume", &semume, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.semume)"); + return; + } + + len = sizeof (semusz); + if (sysctlbyname ("kern.ipc.semusz", &semusz, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.semusz)"); + return; + } + + len = sizeof (semvmx); + if (sysctlbyname ("kern.ipc.semvmx", &semvmx, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.semvmx)"); + return; + } + + len = sizeof (semaem); + if (sysctlbyname ("kern.ipc.semaem", &semaem, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.semaem)"); + return; + } + + buf->semmap = semmap; + buf->semmni = semmni; + buf->semmns = semmns; + buf->semmnu = semmnu; + buf->semmsl = semmsl; + buf->semopm = semopm; + buf->semume = semume; + buf->semusz = semusz; + buf->semvmx = semvmx; + buf->semaem = semaem; + + buf->flags = _glibtop_sysdeps_sem_limits; +} + diff --git a/sysdeps/freebsd/shm_limits.c b/sysdeps/freebsd/shm_limits.c new file mode 100644 index 0000000..6704289 --- /dev/null +++ b/sysdeps/freebsd/shm_limits.c @@ -0,0 +1,98 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , August 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include +#include + +static unsigned long _glibtop_sysdeps_shm_limits = +(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) + +(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) + +(1L << GLIBTOP_IPC_SHMALL); + +/* Init function. */ + +void +_glibtop_init_shm_limits_s (glibtop *server) +{ + server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf) +{ + size_t len; +#if __FreeBSD_version < 700002 + int shmmax, shmmin, shmmni, shmseg, shmall; +#else + unsigned long shmmax, shmmin, shmmni, shmseg, shmall; +#endif + + memset (buf, 0, sizeof (glibtop_shm_limits)); + + if (server->sysdeps.shm_limits == 0) + return; + + len = sizeof (shmmax); + if (sysctlbyname ("kern.ipc.shmmax", &shmmax, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.shmmax)"); + return; + } + + len = sizeof (shmmin); + if (sysctlbyname ("kern.ipc.shmmin", &shmmin, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.shmmin)"); + return; + } + + len = sizeof (shmmni); + if (sysctlbyname ("kern.ipc.shmmni", &shmmni, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.shmmni)"); + return; + } + + len = sizeof (shmseg); + if (sysctlbyname ("kern.ipc.shmseg", &shmseg, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.shmseg)"); + return; + } + + len = sizeof (shmall); + if (sysctlbyname ("kern.ipc.shmall", &shmall, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.ipc.shmall)"); + return; + } + + buf->shmmax = shmmax; + buf->shmmin = shmmin; + buf->shmmni = shmmni; + buf->shmseg = shmseg; + buf->shmall = shmall; + + buf->flags = _glibtop_sysdeps_shm_limits; +} diff --git a/sysdeps/freebsd/siglist.c b/sysdeps/freebsd/siglist.c new file mode 100644 index 0000000..48ccad7 --- /dev/null +++ b/sysdeps/freebsd/siglist.c @@ -0,0 +1,60 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 1, "SIGHUP", "Hangup" }, + { 2, "SIGINT", "Interrupt" }, + { 3, "SIGQUIT", "Quit" }, + { 4, "SIGILL", "Illegal Instruction" }, + { 5, "SIGTRAP", "Trace/Breakpoint Trap" }, + { 6, "SIGABRT", "Abort" }, + { 7, "SIGEMT", "Emulation Trap" }, + { 8, "SIGFPE", "Arithmetic Exception" }, + { 9, "SIGKILL", "Killed" }, + { 10, "SIGBUS", "Bus Error" }, + { 11, "SIGSEGV", "Segmentation Fault" }, + { 12, "SIGSYS", "Bad System Call" }, + { 13, "SIGPIPE", "Broken Pipe" }, + { 14, "SIGALRM", "Alarm Clock" }, + { 15, "SIGTERM", "Terminated" }, + { 16, "SIGURG", "Urgent Condition Present On Socket" }, + { 17, "SIGSTOP", "Stop (cannot be caught or ignored)" }, + { 18, "SIGTSTP", "Stop Signal Generated From Keyboard" }, + { 19, "SIGCONT", "Continue After Stop" }, + { 20, "SIGCHLD", "Child Status Has Changed" }, + { 21, "SIGTTIN", "Background Read Attempted From Control Terminal" }, + { 22, "SIGTTOU", "Background Write Attempted To Control Terminal" }, + { 23, "SIGIO", "I/O Is Possible On A Descriptor" }, + { 24, "SIGXCPU", "CPU Time Limit Exceeded" }, + { 25, "SIGXFSZ", "File Size Limit Exceeded" }, + { 26, "SIGVTALRM","Virtual Time Alarm" }, + { 27, "SIGPROF", "Profiling Timer Alarm" }, + { 28, "SIGWINCH","Window Size Change" }, + { 29, "SIGINFO", "Status Request From Keyboard" }, + { 30, "SIGUSR1", "User Defined Signal 1" }, + { 31, "SIGUSR2", "User Defined Signal 2" }, + { 32, "SIGTHR", "Thread Interrupt" }, + { 0, NULL, NULL } +}; diff --git a/sysdeps/freebsd/suid_open.c b/sysdeps/freebsd/suid_open.c new file mode 100644 index 0000000..00349ae --- /dev/null +++ b/sysdeps/freebsd/suid_open.c @@ -0,0 +1,95 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + + +/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags) +{ + const _glibtop_init_func_t *init_fkt; + + if (server == NULL) + glibtop_error_r (NULL, "glibtop_init_p (server == NULL)"); + + /* Do the initialization, but only if not already initialized. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SYSDEPS) == 0) { + glibtop_open_p (server, "glibtop", features, flags); + + for (init_fkt = _glibtop_init_hook_p; *init_fkt; init_fkt++) + (*init_fkt) (server); + + server->flags |= _GLIBTOP_INIT_STATE_SYSDEPS; + } +} + +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags) +{ + char errbuf[_POSIX2_LINE_MAX]; + glibtop_debug ("glibtop_open_p ()"); + + /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ + server->machine->uid = getuid (); + server->machine->euid = geteuid (); + server->machine->gid = getgid (); + server->machine->egid = getegid (); + /* Setup machine-specific data */ + server->machine->kd = kvm_openfiles (NULL, NULL, NULL, O_RDONLY, errbuf); + + if (server->machine->kd == NULL) + glibtop_error_io_r (server, "kvm_open"); + + /* Drop priviledges. */ + + glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid()); + + if (setreuid (server->machine->euid, server->machine->uid)) + _exit (1); + + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); + + glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid()); + + /* !!! END OF SUID ROOT PART !!! */ + + /* Our effective uid is now those of the user invoking the server, + * so we do no longer have any priviledges. */ + + /* NOTE: On FreeBSD, we do not need to be suid root, we just need to + * be sgid kmem. + * + * The server will only use setegid() to get back it's priviledges, + * so it will fail if it is suid root and not sgid kmem. */ +} diff --git a/sysdeps/freebsd/swap.c b/sysdeps/freebsd/swap.c new file mode 100644 index 0000000..1b4cbad --- /dev/null +++ b/sysdeps/freebsd/swap.c @@ -0,0 +1,92 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_swap = +(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) + +(1L << GLIBTOP_SWAP_FREE); + +static const unsigned long _glibtop_sysdeps_swap_paging = +(1L << GLIBTOP_SWAP_PAGEIN) + (1L << GLIBTOP_SWAP_PAGEOUT); + +static int pagesize; + +/* Init function. */ + +void +_glibtop_init_swap_p (glibtop *server) +{ + pagesize = getpagesize (); + + server->sysdeps.swap = _glibtop_sysdeps_swap | + _glibtop_sysdeps_swap_paging; +} + +/* Provides information about swap usage. */ + +void +glibtop_get_swap_p (glibtop *server, glibtop_swap *buf) +{ + size_t len; + unsigned int swappgsout, swappgsin; + int nswdev; + struct kvm_swap kvmsw[16]; + + memset (buf, 0, sizeof (glibtop_swap)); + memset (kvmsw, 0, sizeof (kvmsw)); + + nswdev = kvm_getswapinfo (server->machine->kd, kvmsw, 16, 0); + if (nswdev < 1) return; + + buf->flags = _glibtop_sysdeps_swap; + + /* See the man page for kvm_getswapinfo(3) to see why we can do this. */ + buf->used = kvmsw[nswdev].ksw_used; + buf->total = kvmsw[nswdev].ksw_total; + + buf->total *= pagesize; + buf->used *= pagesize; + + buf->free = buf->total - buf->used; + + len = sizeof (swappgsout); + if (sysctlbyname ("vm.stats.vm.v_swappgsout", &swappgsout, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (vm.stats.vm.v_swappgsout)"); + return; + } + + len = sizeof (swappgsin); + if (sysctlbyname ("vm.stats.vm.v_swappgsin", &swappgsin, &len, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (vm.stats.vm.v_swappgsin)"); + return; + } + + buf->pagein = (guint64) swappgsin; + buf->pageout = (guint64) swappgsout; + + buf->flags |= _glibtop_sysdeps_swap_paging; +} diff --git a/sysdeps/freebsd/sysinfo.c b/sysdeps/freebsd/sysinfo.c new file mode 100644 index 0000000..551efbe --- /dev/null +++ b/sysdeps/freebsd/sysinfo.c @@ -0,0 +1,93 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_sysinfo = +(1L << GLIBTOP_SYSINFO_CPUINFO); + +static glibtop_sysinfo sysinfo = { .flags = 0 }; + +static void +init_sysinfo (glibtop *server) +{ + char *model; + guint64 ncpus = 1; + int mhz = 0; + size_t len; + + if (G_LIKELY (sysinfo.flags)) + return; + + ncpus = server->ncpu + 1; + + len = 0; + sysctlbyname ("hw.model", NULL, &len, NULL, 0); + model = g_malloc (len); + sysctlbyname ("hw.model", model, &len, NULL, 0); + len = sizeof (mhz); + sysctlbyname ("hw.clockrate", &mhz, &len, NULL, 0); + + for (sysinfo.ncpu = 0; + sysinfo.ncpu < GLIBTOP_NCPU && sysinfo.ncpu < ncpus; + sysinfo.ncpu++) { + glibtop_entry * const cpuinfo = &sysinfo.cpuinfo[sysinfo.ncpu]; + + cpuinfo->labels = g_ptr_array_new (); + + cpuinfo->values = g_hash_table_new_full(g_str_hash, + g_str_equal, + NULL, g_free); + + g_ptr_array_add (cpuinfo->labels, "processor"); + g_hash_table_insert (cpuinfo->values, "processor", + g_strdup_printf("%u", (guint)sysinfo.ncpu)); + + g_ptr_array_add (cpuinfo->labels, "vendor_id"); + g_hash_table_insert (cpuinfo->values, "vendor_id", + g_strdup(model)); + + g_ptr_array_add (cpuinfo->labels, "model name"); + g_hash_table_insert (cpuinfo->values, "model name", + g_strdup(model)); + + g_ptr_array_add (cpuinfo->labels, "cpu MHz"); + g_hash_table_insert (cpuinfo->values, "cpu MHz", + g_strdup_printf("%d", mhz)); + } + + g_free (model); + + sysinfo.flags = _glibtop_sysdeps_sysinfo; +} + +const glibtop_sysinfo * +glibtop_get_sysinfo_s (glibtop *server) +{ + init_sysinfo (server); + return &sysinfo; +} diff --git a/sysdeps/freebsd/uptime.c b/sysdeps/freebsd/uptime.c new file mode 100644 index 0000000..68c58c8 --- /dev/null +++ b/sysdeps/freebsd/uptime.c @@ -0,0 +1,86 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include + +static const unsigned long _glibtop_sysdeps_uptime = +(1L << GLIBTOP_UPTIME_UPTIME); + +static const unsigned long _glibtop_sysdeps_idletime = +(1L << GLIBTOP_UPTIME_IDLETIME); + +static const unsigned long _required_cpu_flags = +(1L << GLIBTOP_CPU_IDLE) + +(1L << GLIBTOP_CPU_FREQUENCY); + +/* Init function. */ + +void +_glibtop_init_uptime_s (glibtop *server) +{ + server->sysdeps.uptime = _glibtop_sysdeps_uptime; +} + +/* Provides uptime and idle time. */ + +void +glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf) +{ + time_t now; + int mib[2]; + struct timeval boottime; + size_t size; + glibtop_cpu cpu; + + memset (buf, 0, sizeof (glibtop_uptime)); + + mib[0] = CTL_KERN; + mib[1] = KERN_BOOTTIME; + size = sizeof(boottime); + if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && + boottime.tv_sec != 0) { + time(&now); + buf->uptime = now - boottime.tv_sec; + buf->flags = _glibtop_sysdeps_uptime; + } + + glibtop_get_cpu_s (server, &cpu); + + /* Make sure all required fields are present. */ + + if ((cpu.flags & _required_cpu_flags) != _required_cpu_flags) + return; + + /* Calculate values. */ + + buf->idletime = (double) cpu.idle / (double) cpu.frequency; + buf->idletime /= (double) (server->ncpu + 1); + + buf->flags |= _glibtop_sysdeps_idletime; +} diff --git a/sysdeps/linux/ChangeLog b/sysdeps/linux/ChangeLog new file mode 100644 index 0000000..e4401e4 --- /dev/null +++ b/sysdeps/linux/ChangeLog @@ -0,0 +1,784 @@ +2007-05-20 Benoît Dejean + + * *.c: + + Got rid of glibtop_init_s calls. + If i'm right, these are only no-op and the legacy stub/ don't + have any calls to them, so it's should harmless. + So let's try it. + +2007-05-19 Benoît Dejean + + * proclist.c: (glibtop_get_proclist_s): + + Fixed warnings. + +2007-05-17 Benoît Dejean + + * procopenfiles.c: (glibtop_get_proc_open_files_s): + + Added missing sizeof. + +2007-05-07 Benoît Dejean + + * procwd.c: + + Always set buf->number. + +2007-05-07 Benoît Dejean + + * glibtop_private.c (safe_readlink): + + Simplified. + + * procopenfiles.c: + + Use safe_readlink. + +2007-05-07 Benoît Dejean + + * procwd.c: + + Implemented. + + * glibtop_private.c (safe_readlink): + + New function. + +2007-03-13 Benoît Dejean + + * fsusage.c: (get_sys_path), (linux_2_6_0): + + Fixed stat parsing for md devices. + Patch by Martin Bailey . + +2007-02-15 Benoît Dejean + + * procmap.c: (add_smaps): + + Some more const. + +2007-01-14 Benoît Dejean + + * procmap.c: (glibtop_get_proc_map_s): + * procopenfiles.c: (parse_file): + + Fixed stack overflow in proc_map. + Switched to Glibc getline because fgets gets fooled by long + lines. + Closes #396477. + +2007-01-11 Benoît Dejean + + * glibtop_private.c: (get_scaled): + + Replaced two strstr by a hand-written loop in this critical code. + +2006-09-11 Benoît Dejean + + * procmap.c: (glibtop_get_proc_map_s): + + Fixed parsing s?maps on 64bit kernel. + Closes #355290. + Removed useless casts. + +2006-08-10 Benoît Dejean + + * open.c: (glibtop_open_s): + + Only print the warning if + (number of real cpu's) != (number of cpu's monitored). + Patch by Wouter Bolsterlee (uws) . + Closes #350705. + +2006-07-27 Benoît Dejean + + * netload.c: (glibtop_get_netload_s): + + Updated implementation. + +2006-07-27 Benoît Dejean + + * glibtop_private.c: (has_sysfs): + * glibtop_private.h: + * netload.c: (glibtop_get_netload_s): + * open.c: (set_linux_version): + + New has_sysfs function to avoid stating + over and over '/sys' on each netload call. + +2006-04-02 Benoît Dejean + + * msg_limits.c: (glibtop_get_msg_limits_s): + * sem_limits.c: (glibtop_get_sem_limits_s): + * shm_limits.c: (glibtop_get_shm_limits_s): + + Fixed a bunch of warnings. + +2006-01-23 Benoît Dejean + + * procmap.c: (glibtop_get_proc_map_s): + + I can't believe i've been so stupid :) + Uses smaps if linux > 2.6.14. + +2005-12-15 Benoît Dejean + + * proclist.c: (glibtop_get_proclist_s): + + Fixed when which == GLIBTOP_KERN_PROC_UID. + Closes #324055. + +2005-12-14 Benoît Dejean + + * open.c: (glibtop_open_s): + + Implemented server->real_ncpu. + Add a warning to display ncpu and real_ncpu on open. + +2005-12-13 Benoît Dejean + + * cpu.c: (glibtop_get_cpu_s): + * glibtop_private.c: (get_scaled), (check_cpu_line): + * glibtop_private.h: + * open.c: (glibtop_open_s): + * proctime.c: (glibtop_get_proc_time_s): + + Fixed server->ncpu usage (SMP handling). Need more testing. + +2005-12-12 Benoît Dejean + + * procmap.c: (add_smaps), (glibtop_get_proc_map_s): + + Implemented smap support. + Closes #320710. + +2005-12-12 Benoît Dejean + + * proclist.c: (glibtop_get_proclist_s): + + Improved so that it doesn't stat(2) every /proc//. + +2005-12-07 Benoît Dejean + + * procmap.c: (glibtop_get_proc_map_s): + + Small improvements. + Use g_array_sized_new instead of g_array_new with + reserved_size = 100. + Don't use g_array_append_val to avoid copying + glibtop_map_entries. Use g_array_set_size(size + 1) instead. + + I've run a little python benchmark and this shows a little + speedup. I hope this would be more sensible in + gnome-system-monitor (glibtop_get_procmap is intensively used for + the 'Writable Memory' column). + +2005-10-29 Benoît Dejean + + * glibtop_private.c: (read_boot_time): + + Removed 1 g_return_*. + +2005-08-15 Benoît Dejean + + * cpu.c: (glibtop_get_cpu_s): + + Do not add irq, softirq and iowait to idle. + +2005-08-04 Benoît Dejean + + * open.c: (set_linux_version), (glibtop_open_s): + + Reworked a bit. + Warn on 2.6 without /sys. + +2005-08-03 Benoît Dejean + + * netload.c: (glibtop_get_netload_s): + + Fixed for people running 2.6 without /sys. + +2005-08-02 Benoît Dejean + + * glibtop_server.h: + + Added GLIBTOP_SUID_NETLIST. + +2005-07-23 Benoît Dejean + + * uptime.c: + + Fixed .flags. + +2005-07-22 Benoît Dejean + + * glibtop_private.c: (get_page_size): + * glibtop_private.h: + * procmem.c: (glibtop_get_proc_mem_s): + * procsegment.c: (glibtop_get_proc_segment_s): + + Cached getpagesize(). + +2005-07-09 Benoît Dejean + + * netload.c: (read_value), (linux_2_6_stats), (linux_2_0_stats), + (linux_2_4_stats), (glibtop_get_netload_s): Split implementations. + New (simpler) implementation for 2.6 (/sys is so nice ;) + +2005-07-07 Benoît Dejean + + * glibtop_private.c: (read_boot_time), (get_boot_time): Cached boot_time. + +2005-07-06 Benoît Dejean + + Et m***e ... CVS got me. I wanted to commit a single change on the + toplevel configure.in but commited the whole tree. Sorry. + + * glibtop_private.c: + * glibtop_private.h: + * proctime.c: + * uptime.c: + + Added new function get_boot_time. + + Retrieve boot_time from /proc/stat. + +2005-06-13 Benoît Dejean + + * glibtop_private.c: (try_file_to_buffer): Ensures buffer is 0-terminated. + +2005-06-13 Benoît Dejean + + * swap.c: (glibtop_get_swap_s): Added pagein/pageout for linux 2.6. + +2005-05-26 Benoît Dejean + + * siglist.c: Fixed compilation on mips. Closes #304570. + +2005-04-01 Benoît Dejean + + * glibtop_private.h: Fixed gcc-4.0 warnings. + +2005-03-29 Benoît Dejean + + * fsusage.c: (get_partition): Removed a g_return_if_fail. + +2005-03-27 Benoît Dejean + + * loadavg.c: (glibtop_get_loadavg_s): + * uptime.c: (glibtop_get_uptime_s): Fixed behaviour when locale is not C + s/strtod/g_ascii_strod/. (strtod behaviour is locale specific, which is bad + because linux /proc is always C.) + +2005-03-25 Benoît Dejean + + * netload.c: (get_ipv6): s/strerror/g_strerror/ + +2005-03-25 Benoît Dejean + + * siglist.c: Updated. + +2005-02-15 Benoît Dejean + + * fsusage.c: Fixed G_GNUC attribute usage. + +2005-01-22 Benoît Dejean + + * procopenfiles.c: (parse_file), (get_all), (inet_socket_parser), + (get_all_inet_sockets), (local_socket_parser), + (get_all_local_sockets), (glibtop_get_proc_open_files_s): Total rewrite. + socket/localsocket should be much faster. + +2005-01-16 Benoît Dejean + + * glibtop_private.c: (skip_token): + * glibtop_private.h: Uninlined. + +2005-01-13 Benoît Dejean + + * fsusage.c: (get_partition), (get_sys_path), (linux_2_6_0): Reworked. + Should works with IDE, SCSI. DM support is ready, but i don't know why + their /stat is empty ... + +2005-01-12 Benoît Dejean + + * procopenfiles.c: (get_all_sockets), + (glibtop_get_proc_open_files_s): Parses /proc/net/tcp only once. + +2005-01-10 Benoît Dejean + + * procopenfiles.c: (get_socket_endpoint): Fixed. + +2005-01-10 Benoît Dejean + + * glibtop_server.h: + * procopenfiles.c: (get_socket_endpoint): Disabled. + + (glibtop_get_proc_open_files_s): Secured -> g_snprintf. + +2004-12-23 Benoît Dejean + + * fsusage.c: (_glibtop_linux_get_fsusage_read_write): + * glibtop_private.h: Marked private functions G_GNUC_INTERNAL. + +2004-11-30 Benoît Dejean + + * proclist.c: (glibtop_get_proclist_s): Glibified. g_array_free which + returns a char* ! If you want to change this, please tell them + http://bugzilla.gnome.org/show_bug.cgi?id=145767 . + +2004-11-28 Benoît Dejean + + * Makefile.am: + * cpu.c: + * fsusage.c: + * glibtop_private.c: (get_scaled), (try_file_to_buffer), + (file_to_buffer): Added + * glibtop_private.h: Added + * glibtop_server.c: Removed + * glibtop_server.h: + * loadavg.c: + * mem.c: + * netload.c: + * open.c: + * prockernel.c: + * procmem.c: + * procsegment.c: + * procsignal.c: + * procstate.c: + * proctime.c: + * procuid.c: + * swap.c: + * sysinfo.c: + * uptime.c: Moved linux impl utils function from glibtop_server.* to + glibtob_private.* because glibtop_server.h is a public header. + +2004-11-15 Benoît Dejean + + * netload.c: (get_ipv6), (glibtop_get_netload_s): Added a check for NULL + pointer when wlaking though interfaces (though i don't understand why some + interface don't have an ifa_addr). + Move all ipv6 code into a separate function. Added a paranoid check on + getifaddrs. + +2004-11-13 Benoît Dejean + + * netlist.c: (glibtop_get_netlist_s): Killed warning. + +2004-10-26 Benoît Dejean + + * proctime.c: (glibtop_get_proc_time_s): Set .rtime. At last ! + +2004-09-24 Benoît Dejean + + * loadavg.c: (glibtop_get_loadavg_s): + * msg_limits.c: (glibtop_get_msg_limits_s): + * shm_limits.c: (glibtop_get_shm_limits_s): Small cleanup. + +2004-09-23 Benoît Dejean + + * glibtop_server.c: + * glibtop_server.h: + * procmem.c: (glibtop_get_proc_mem_s): + * procsegment.c: (glibtop_get_proc_segment_s): Removed get_pageshift(). + Every one can affort a * instead of a >>, no need for this kind of + non-reentrant optimization. Saved 144B (obviously perfect cleanup ;) + +2004-09-22 Benoît Dejean + + * glibtop_server.c: Removed #warning, my gcc is not buggy anymore. + +2004-09-21 Benoît Dejean + + * fsusage.c: (linux_2_6_0), (linux_2_4_0), + (_glibtop_linux_get_fsusage_read_write): Back to previous version. + Now set .flags correctly. + +2004-09-19 Benoît Dejean + + * fsusage.c: (linux_2_6_0), (linux_2_4_0), + (_glibtop_linux_get_fsusage_read_write): Updated to match new prototype. + +2004-09-19 Benoît Dejean + + * mem.c: (glibtop_get_mem_s): Added missing memset( , 0, ). + +2004-08-03 Benoît Dejean + + * glibtop_server.h: Added next_token(). Changed skip_token(), + i hope it won't break any bad code. + * procstate.c: (glibtop_get_proc_state_s): Used next_token. + * proctime.c: (glibtop_get_proc_time_s): Implemented .start_time + the way it ought to be. Clean ups + +2004-07-22 Benoît Dejean + + * netload.c: (glibtop_get_netload_s): Fixed leak. + * proctime.c: (glibtop_get_proc_time_s): Don't set .timeout anymore. + +2004-07-17 Benoît Dejean + + * Makefile.am: + * fsusage.c: (linux_2_6_0), (linux_2_4_0), + (_glibtop_linux_get_fsusage_read_write): Added to repository. WIP. + + + * glibtop_server.h: LINUX_VERSION -> LINUX_VERSION_CODE + + * netload.c: (glibtop_get_netload_s): Cleanups. Added support for + hardware address. s/LINUX_VERSION/LINUX_VERSION_CODE/ + + * open.c: (get_linux_version): s/LINUX_VERSION/LINUX_VERSION_CODE/ + + * procmap.c: (glibtop_get_proc_map_s): glibify: used GArray + + * procuid.c: (glibtop_get_proc_uid_s): s/LINUX_VERSION/LINUX_VERSION_CODE/. + Used Linux MKDEV. + +2004-07-15 Benoît Dejean + + * procstate.c: (glibtop_get_proc_state_s): Wake, we're libgtop2.7.x, + lets get rid of old buf->state format. Now using bitfield instead + letters. + +2004-07-07 Benoît Dejean + + * procargs.c: (glibtop_get_proc_args_s): Fixed. error is now correctly + set to NULL before is's used. Fixed max_len behaviour. + +2004-07-03 Benoît Dejean + + * sysinfo.c: (init_sysinfo): Removed useless memset. + +2004-07-03 Benoît Dejean + + * glibtop_server.h: + * glibtop_server.c: (try_file_to_buffer), (file_to_buffer): Added. These + functions are commonly used. Misc cleanups. + + * cpu.c: (glibtop_get_cpu_s): + * loadavg.c: (glibtop_get_loadavg_s): + * mem.c: (glibtop_get_mem_s): + * open.c: (glibtop_open_s): + * swap.c: (glibtop_get_swap_s): + * sysinfo.c: (init_sysinfo): + * uptime.c: (glibtop_get_uptime_s): Replaced open/read/close by file_to_buffer(). + +2004-06-18 Benoît Dejean + + * loadavg.c: (glibtop_get_loadavg_s): Whitespace cleanup. + + * ppp.c: (get_ISDN_stats), (is_ISDN_on): Replace g_malloc by an + array. + + * glibtop_server.c: (get_pageshift): + * glibtop_server.h: + * procmem.c: (glibtop_init_proc_mem_s), (glibtop_get_proc_mem_s): + * procsegment.c: (glibtop_init_proc_segment_s), + (glibtop_get_proc_segment_s): Moved the pageshift calculation to + glibtop_server.[ch] + + * procstate.c: (glibtop_get_proc_state_s): + * procuid.c: (glibtop_get_proc_uid_s): + * sysinfo.c: (init_sysinfo): Minor cleanups. + +2004-06-18 Benoît Dejean + + * netload.c: (glibtop_get_netload_s): Implemented new IPv6 feature. + +2004-06-13 Benoît Dejean + + * procargs.c: (glibtop_get_proc_args_s): Replaced by g_file_get_contents. + +2004-06-13 Benoît Dejean + + * glibtop_server.h: + * glibtop_server.c: (get_scaled): Cleaned. + (proc_file_to_buffer): Uninlined. + + * sysinfo.c: (init_sysinfo): Re-implemented. + Fixed segfault on SMP. + Stores keys in cpuinfo->labels. + +2004-06-12 Benoît Dejean + + * Makefile.am: + * glibtop_server.c: Added to repository. + + * glibtop_server.h: (get_scaled): Uninlined and moved it to glibtop_server.c. + (skip_token) : Fixed indentation. + + * procmap.c: (glibtop_get_proc_map_s): Big cleanup. Better allocation + algorithm. + + * procmem.c: + * procsegment.c: Added missing initializations. + + * sem_limits.c: + * shm_limits.c: (glibtop_get_shm_limits_s): + * swap.c: + * uptime.c: Added missing const qualifiers. + + * sysinfo.c: (init_sysinfo): Added missing 0 initialization. + Saved 1 gboolean :D. + +2004-06-08 Benoît Dejean + + * procuid.c: (glibtop_get_proc_uid_s): Whitespace clean up. + +2004-06-08 Benoît Dejean + + * glibtop_server.h: Small clean up. + +2004-06-07 Benoît Dejean + + * glibtop_machine.h (skip_token): Removed. + * glibtop_server.h (skip_multiple_token): Cleaned. + * netload.c: (glibtop_get_netload_s): Replaced unsafe strcpy by g_strlcpy. + * procmap.c: (glibtop_get_proc_map_s): s/strncpy/g_strlcpy/. + * procstate.c: (glibtop_get_proc_state_s): Likewise. + * sysinfo.c: (init_sysinfo): Cleaned. + +2004-05-26 Benoît Dejean + + * cpu.c: (glibtop_get_cpu_s): Cleaned whitespaces. + + * open.c: (get_linux_version), (glibtop_open_s): Removed get_linux_version() + Cleaned. Remove static struct utsname. + +2004-05-26 Benoît Dejean + + * glibtop_server.h: + * open.c: + * procuid.c: Moved LINUX_VERSION macro to glibtop_server.h. + + * Changelog: Converted to UTF-8. + +2004-05-19 Benoît Dejean + + * glibtop_server.h (skip_line): Added test for end of string. + (get_scaled): Cleaned. + + * cpu.c (glibtop_get_cpu_s): + * open.c (glibtop_open_s): Fixed SMP detection. Closes #142597. + + * uptime.c (glibtop_get_uptime_s): Added boot_time. + +2004-03-09 Bastien Nocera + + * cpu.c: (glibtop_get_cpu_s): fixup CPU usage calculation on 2.6 + kernels (patch by Benoît Dejean ) (Closes: #134252) + +2004-03-04 Bastien Nocera + + * ppp.c: use a config.h define instead of copying the values in + the file (Closes: #126504) + +2004-02-02 Sebastien Bacher + + * sysdeps/linux/mem.c: (glibtop_get_mem_s): patch from + Benoît Dejean to fix libtop_mem.used + and glibtop_mem.shared values (Closes: #129863). + +2003-12-23 Bastien Nocera + + * cpu.c: (glibtop_get_cpu_s): + * glibtop_server.h: + * loadavg.c: (glibtop_get_loadavg_s): + * mem.c: (glibtop_get_mem_s): + * netload.c: (glibtop_get_netload_s): + * prockernel.c: (glibtop_get_proc_kernel_s): + * procmem.c: (glibtop_get_proc_mem_s): + * procsegment.c: (glibtop_get_proc_segment_s): + * procsignal.c: (glibtop_get_proc_signal_s): + * proctime.c: (glibtop_get_proc_time_s): + * procuid.c: (glibtop_get_proc_uid_s): + * swap.c: (glibtop_get_swap_s): Apply patch from Benoît Dejean + to fix overflow issues using strtol + (Closes: #129881) + +2003-12-23 Bastien Nocera + + * mem.c: (glibtop_get_mem_s): Fix calculation of used memory, + patch by Benoît Dejean, (Closes: #129863) + +2003-12-07 Jon K Hellan + + * ppp.c: Copy needed defines from linux/isdn.h instead of + including it, unbreaking build with linux 2.6 kernel headers. + +2003-10-21 Bastien Nocera + + * Makefile.am: install only one library, libgtop-2.0 + Fix build-time warnings due to the redefinition of guint64 + +2003-10-20 Bastien Nocera + + * glibtop_server.h: + * mem.c: (glibtop_get_mem_s): + * swap.c: (glibtop_get_swap_s): committing patch from Sebastien + Bacher for Linux 2.6 support (Closes: #104747) + +2003-10-20 Bastien Nocera + + * cpu.c: (glibtop_get_cpu_s): + * procmap.c: (glibtop_get_proc_map_s): s/u_int64_t/guint64/ + +2003-10-20 Bastien Nocera + + * glibtop_machine.h: + * glibtop_server.h: + * ppp.c: + * procargs.c: (glibtop_get_proc_args_s): + * proclist.c: + * procmap.c: fixed compilation + +2003-10-20 Bastien Nocera + + * ppp.c: (get_ISDN_stats): + * procargs.c: (glibtop_get_proc_args_s): + * proclist.c: (glibtop_get_proclist_s): + * procmap.c: (glibtop_get_proc_map_s): + replace all the xmalloc crap by glib memory management functions + +2001-10-17 Abel Cheung + + * Makefile.am: move header to $(includedir)/libgtop-1.0/glibtop. + +2001-02-13 Martin Baulig + + Fix bug #14076. + + * open.c (glibtop_open_s): Check whether /proc/1/cpu exists to + detect SMP support rather than reading /proc/stat; on Linux 2.4.x, + /proc/stat has "cpu" and "cpu0" entries even for non-SMP systems. + +2000-01-22 Martin Baulig + + * procargs.c (glibtop_get_proc_args_s): Set correct `buf->size' and + `buf->flags' fields when `max_length' was given. Fixes #5183. + +1999-11-28 Martin Baulig + + * procstate.c (glibtop_get_procstate_s): Stat "/proc/" instead + of "/proc//state" to get `uid' and `gid'. Thanks to Jason Becker + for pointing out that GTop reported wrong uid's. + +1999-10-19 Martin Baulig + + * uptime.c (glibtop_get_uptime_s): Don't cast uptime and idletime + to float as suggested by John Kodis. + +1999-07-29 Martin Baulig + + * proctime.c (glibtop_get_proctime_s): Don't provide `rtime' + any longer since we must not use `rtime = utime + stime'. + +1999-02-20 Martin Baulig + + * netload.c: Don't include for libc5 systems + since it is no longer required and makes trouble on Slakware. + +1999-01-06 Martin Baulig + + * netload.c (glibtop_get_netload_s): Use `server->os_version_code' + instead of GLIBTOP_LINUX_VERSION_CODE. + +1999-01-06 Martin Baulig + + Unconditionally enable SMP support for linux. + + * open.c (_glibtop_open_s): Always determine the number of CPUs + we have here, not only when SMP support was enabled. + + * cpu.c, proctime.c: Use `server->ncpu' to determine whether to + enable SMP support. + +1998-12-28 Martin Baulig + + * netload.c: When using glibc, don't include + any longer but all headers that were included there; we only + needed this file to get those headers. + +1998-12-09 Martin Baulig + + * procargs.c (glibtop_get_proc_args_s): Added implementation + for this function. + +1998-12-03 Martin Baulig + + * netload.c: No longer include , but use + GLIBTOP_LINUX_VERSION_CODE which is set by configure instead. + Define _GLIBTOP_IP_FW_ACCTIN and _GLIBTOP_IP_FW_ACCTOUT here + and use them instead of IP_FW_F_ACCTIN and IP_FW_F_ACCTOUT. + +1998-11-30 Martin Baulig + + * netload.c: Use correct header files both for libc5 and glibc. + With Linux >= 2.1.114 we no longer use IP accounting since it + already has byte counts in /proc/net/dev. + +1998-11-22 Martin Baulig + + * netload.c (glibtop_get_netload_s): Added implementation + for this function. + + The code here is smart enough to use /proc/net/ip_acct if + IP accounting is enabled in the kernel and activated on the + requested device and /proc/net/dev if not. + + To get separate statistics for received and transmitted + packets you need to use two accounting rules: + + ipfwadm -A in -a -P all -W eth0 + ipfwadm -A out -a -P all -W eth0 + + But before you activate IP accounting, please have a look + at /proc/net/dev - if if already contains byte counters, + then don't use IP accounting. + +1998-10-28 Martin Baulig + + * ppp.c: Added code for ISDN here. + +1998-10-26 Martin Baulig + + * netload.c: New file. Currently empty. + +1998-10-26 Martin Baulig + + * procargs.c: New file. Currently empty. + +1998-10-25 Martin Baulig + + * ppp.c: New file. Currently empty. + +1998-10-11 Martin Baulig + + * procdata.c: Removed this obsolete file. + +1998-10-02 Martin Baulig + + * proclist.c (glibtop_init_proclist_s): You can now also use the + `GLIBTOP_EXCLUDE_*' flags for the `which' parameter. + +1998-10-01 Martin Baulig + + * proclist.c (glibtop_init_proclist_s): Honor the `which' parameter + to select which processes to fetch. + +1998-09-12 Martin Baulig + + * sysinfo.c: New file. + +1998-09-09 Martin Baulig + + * proctime.c (glibtop_get_proc_time_s): Added SMP support. + + * open.c (glibtop_init_s): Initialize `ncpu' on SMP systems. + + * cpu.c (glibtop_get_cpu_s): Added SMP support. + + * ChangeLog: New file. + diff --git a/sysdeps/linux/Makefile.am b/sysdeps/linux/Makefile.am new file mode 100644 index 0000000..7baabe0 --- /dev/null +++ b/sysdeps/linux/Makefile.am @@ -0,0 +1,23 @@ +AM_CPPFLAGS = @AM_CPPFLAGS@ + +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la + +EXTRA_DIST = procmap_smaps.gperf procmap_smaps.c + +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ + uptime.c loadavg.c shm_limits.c msg_limits.c \ + sem_limits.c proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c prockernel.c \ + procsegment.c procargs.c procmap.c siglist.c \ + sysinfo.c netload.c ppp.c glibtop_private.c \ + mountlist.c procaffinity.c procio.c \ + fsusage.c netlist.c procopenfiles.c procwd.c + +libgtop_sysdeps_2_0_la_LIBADD = @GLIB_LIBS@ + +# libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h +libgtopincludedir = $(includedir)/libgtop-2.0 + +noinst_HEADERS = glibtop_private.h diff --git a/sysdeps/linux/Makefile.in b/sysdeps/linux/Makefile.in new file mode 100644 index 0000000..b44b5f4 --- /dev/null +++ b/sysdeps/linux/Makefile.in @@ -0,0 +1,769 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = sysdeps/linux +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libgtopinclude_HEADERS) \ + $(noinst_HEADERS) $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libgtop_sysdeps_2_0_la_DEPENDENCIES = +am_libgtop_sysdeps_2_0_la_OBJECTS = open.lo close.lo cpu.lo mem.lo \ + swap.lo uptime.lo loadavg.lo shm_limits.lo msg_limits.lo \ + sem_limits.lo proclist.lo procstate.lo procuid.lo proctime.lo \ + procmem.lo procsignal.lo prockernel.lo procsegment.lo \ + procargs.lo procmap.lo siglist.lo sysinfo.lo netload.lo ppp.lo \ + glibtop_private.lo mountlist.lo procaffinity.lo procio.lo \ + fsusage.lo netlist.lo procopenfiles.lo procwd.lo +libgtop_sysdeps_2_0_la_OBJECTS = $(am_libgtop_sysdeps_2_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) +DIST_SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libgtopincludedir)" +HEADERS = $(libgtopinclude_HEADERS) $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + ChangeLog +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la +EXTRA_DIST = procmap_smaps.gperf procmap_smaps.c +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ + uptime.c loadavg.c shm_limits.c msg_limits.c \ + sem_limits.c proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c prockernel.c \ + procsegment.c procargs.c procmap.c siglist.c \ + sysinfo.c netload.c ppp.c glibtop_private.c \ + mountlist.c procaffinity.c procio.c \ + fsusage.c netlist.c procopenfiles.c procwd.c + +libgtop_sysdeps_2_0_la_LIBADD = @GLIB_LIBS@ + +# libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h +libgtopincludedir = $(includedir)/libgtop-2.0 +noinst_HEADERS = glibtop_private.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sysdeps/linux/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu sysdeps/linux/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgtop_sysdeps-2.0.la: $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsusage.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glibtop_private.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mountlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netload.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procaffinity.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prockernel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procopenfiles.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsegment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsignal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procstate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procwd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siglist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-libgtopincludeHEADERS: $(libgtopinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgtopincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgtopincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgtopincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgtopincludedir)" || exit $$?; \ + done + +uninstall-libgtopincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgtopincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libgtopincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libgtopincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libgtopincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libgtopincludeHEADERS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libgtopincludeHEADERS + +.PRECIOUS: Makefile + + +# 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: diff --git a/sysdeps/linux/close.c b/sysdeps/linux/close.c new file mode 100644 index 0000000..bee09f3 --- /dev/null +++ b/sysdeps/linux/close.c @@ -0,0 +1,29 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +/* Closes pipe to gtop server. */ + +void +glibtop_close_s (glibtop *server) +{ } diff --git a/sysdeps/linux/cpu.c b/sysdeps/linux/cpu.c new file mode 100644 index 0000000..c65b423 --- /dev/null +++ b/sysdeps/linux/cpu.c @@ -0,0 +1,151 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_cpu = +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + +(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) + +(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY); + +static const unsigned long _glibtop_sysdeps_cpu_smp = +(1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) + +(1L << GLIBTOP_XCPU_NICE) + (1L << GLIBTOP_XCPU_SYS) + +(1L << GLIBTOP_XCPU_IDLE); + +static const unsigned long _glibtop_sysdeps_cpu_2_6 = +(1L << GLIBTOP_CPU_IOWAIT) + (1L << GLIBTOP_CPU_IRQ) + +(1L << GLIBTOP_CPU_SOFTIRQ); + +static const unsigned long _glibtop_sysdeps_cpu_smp_2_6 = +(1L << GLIBTOP_XCPU_IOWAIT) + (1L << GLIBTOP_XCPU_IRQ) + +(1L << GLIBTOP_XCPU_SOFTIRQ); + +/* Init function. */ + +void +_glibtop_init_cpu_s (glibtop *server) +{ + server->sysdeps.cpu = _glibtop_sysdeps_cpu; + + if (server->ncpu) + server->sysdeps.cpu |= _glibtop_sysdeps_cpu_smp; + + + if(server->os_version_code >= LINUX_VERSION_CODE(2, 6, 0)) + { + server->sysdeps.cpu |= _glibtop_sysdeps_cpu_2_6; + + if (server->ncpu) + server->sysdeps.cpu |= _glibtop_sysdeps_cpu_smp_2_6; + } +} + +/* Provides information about cpu usage. */ + +#define FILENAME "/proc/stat" +#define STAT_BUFSIZ 81920 + +void +glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf) +{ + char buffer [STAT_BUFSIZ], *p; + int i; + + memset (buf, 0, sizeof (glibtop_cpu)); + + file_to_buffer(server, buffer, sizeof buffer, FILENAME); + + /* + * GLOBAL + */ + + p = skip_token (buffer); /* "cpu" */ + + buf->user = strtoull (p, &p, 0); + buf->nice = strtoull (p, &p, 0); + buf->sys = strtoull (p, &p, 0); + buf->idle = strtoull (p, &p, 0); + buf->total = buf->user + buf->nice + buf->sys + buf->idle; + + /* 2.6 kernel */ + if(server->os_version_code >= LINUX_VERSION_CODE(2, 6, 0)) + { + buf->iowait = strtoull(p, &p, 0); + buf->irq = strtoull(p, &p, 0); + buf->softirq = strtoull(p, &p, 0); + + buf->total += buf->iowait + buf->irq + buf->softirq; + } + + buf->frequency = 100; + buf->flags = _glibtop_sysdeps_cpu; + + /* + * PER CPU + */ + + for (i = 0; i <= server->ncpu; i++) { + + p = skip_line(p); /* move to ^ */ + + if (!check_cpu_line_warn(server, p, i)) + break; + + p = skip_token(p); /* "cpuN" */ + + buf->xcpu_user [i] = strtoull (p, &p, 0); + buf->xcpu_nice [i] = strtoull (p, &p, 0); + buf->xcpu_sys [i] = strtoull (p, &p, 0); + buf->xcpu_idle [i] = strtoull (p, &p, 0); + buf->xcpu_total[i] = buf->xcpu_user [i] \ + + buf->xcpu_nice [i] \ + + buf->xcpu_sys [i] \ + + buf->xcpu_idle [i]; + + /* 2.6 kernel */ + if(server->os_version_code >= LINUX_VERSION_CODE(2, 6, 0)) + { + buf->xcpu_iowait [i] = strtoull(p, &p, 0); + buf->xcpu_irq [i] = strtoull(p, &p, 0); + buf->xcpu_softirq [i] = strtoull(p, &p, 0); + + buf->xcpu_total [i] += buf->xcpu_iowait [i] \ + + buf->xcpu_irq [i] \ + + buf->xcpu_softirq [i]; + } + } + + if(server->ncpu) /* ok, that's a real SMP */ + buf->flags |= _glibtop_sysdeps_cpu_smp; + + if(server->os_version_code >= LINUX_VERSION_CODE(2, 6, 0)) + { + buf->flags |= _glibtop_sysdeps_cpu_2_6; + + if(server->ncpu) /* ok, that's a real SMP */ + buf->flags |= _glibtop_sysdeps_cpu_smp_2_6; + } +} diff --git a/sysdeps/linux/fsusage.c b/sysdeps/linux/fsusage.c new file mode 100644 index 0000000..2c5654f --- /dev/null +++ b/sysdeps/linux/fsusage.c @@ -0,0 +1,214 @@ +#include +#include +#include +#include + +#include "glibtop_private.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/* + * Linux 2.6.x + * linux/Documentation/iostats.txt + */ + + + + +static gboolean +get_device(glibtop* server, const char *mountpoint, + char* device, size_t device_size) +{ + const struct mntent *mnt; + FILE *fp; + gboolean found = FALSE; + + if (!(fp = setmntent(MOUNTED, "r"))) { + glibtop_warn_io_r(server, "Could not open %s", MOUNTED); + goto out; + } + + while ((mnt = getmntent(fp))) + { + /* There can be multiple root mount entries, skip the unuseful one */ + if (!strcmp(mnt->mnt_fsname, "rootfs")) + continue; + + if (!strcmp(mountpoint, mnt->mnt_dir)) { + if (!strncmp(mnt->mnt_fsname, "/dev/", 5)) { + g_strlcpy(device, mnt->mnt_fsname + 5, device_size); + found = TRUE; + } + break; + } + } + + endmntent(fp); +out: + return found; +} + + +/* + TRUE if device is like "hda3" and then set prefix to "hda". + */ +static gboolean +is_partition(const char* device, char* prefix, size_t prefix_size) +{ + g_strlcpy(prefix, device, prefix_size); + + for ( ; *prefix; prefix++) { + if (isdigit(*prefix)) { + *prefix = '\0'; + return TRUE; + } + } + + return FALSE; +} + + +/* + Bug #539360. + /sys/.../stat format is partially defined in + linux/Documentation/block/stat.txt (looks outdated). Before linux + 2.5.25, /sys/block/%s/stat and /sys/block/%s/%s/stat were not the + same, but the following commit changed the latter to have the same + format and broke compatibility. + + Commit 34e8beac92c27d292938065f8375842d2840767c + Author: Jerome Marchand + Date: Fri Feb 8 11:04:55 2008 +0100 + + Enhanced partition statistics: sysfs + + Reports enhanced partition statistics in sysfs. + + Signed-off-by: Jerome Marchand + + fs/partitions/check.c | 22 +++++++++++++++++++--- + 1 files changed, 19 insertions(+), 3 deletions(-) + + */ + +static void +get_sys_path(glibtop* server, const char *device, char **stat_path, const char **parse_format) +{ + const char* linux_2_6_25_format = "%*llu %*llu %llu %*llu" + "%*llu %*llu %llu %*llu"; + + char prefix[32]; + + if (is_partition(device, prefix, sizeof prefix)) { + + *stat_path = g_strdup_printf("/sys/block/%s/%s/stat", + prefix, device); + if (server->os_version_code < LINUX_VERSION_CODE(2, 6, 25)) + *parse_format = "%*llu %llu %*llu %llu"; + else + *parse_format = linux_2_6_25_format; + } + else + { + *stat_path = g_strdup_printf("/sys/block/%s/stat", device); + if (server->os_version_code < LINUX_VERSION_CODE(2, 6, 25)) + *parse_format = "%*llu %*llu %llu %*llu %*llu %*llu %llu"; + else + *parse_format = linux_2_6_25_format; + } +} + + + +static void linux_2_6_0(glibtop *server, glibtop_fsusage *buf, const char *path) +{ + char *filename = NULL; + const char *format; + int ret; + char buffer[BUFSIZ]; + char device[64]; + + if (!get_device(server, path, device, sizeof device)) + goto out; + + get_sys_path(server, device, &filename, &format); + + ret = try_file_to_buffer(buffer, sizeof buffer, "%s", filename); + + if (ret < 0) goto out; + + if (sscanf(buffer, format, &buf->read, &buf->write) != 2) { + glibtop_warn_io_r(server, "Could not parse %s", filename); + goto out; + } + + buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE); + out: + g_free(filename); +} + + +static void linux_2_4_0(glibtop *server, glibtop_fsusage *buf, const char *path) +{ +} + + +static void +get_fsusage_read_write(glibtop *server, glibtop_fsusage *buf, const char *path) +{ + if(server->os_version_code >= LINUX_VERSION_CODE(2, 6, 0)) + { + linux_2_6_0(server, buf, path); + } + else if(server->os_version_code >= LINUX_VERSION_CODE(2, 4, 0)) + { + linux_2_4_0(server, buf, path); + } +} + + +/* the following comes from sysdeps/common/mountlist.c if copyright matters... + */ + +static const unsigned long _glibtop_sysdeps_fsusage = +(1L << GLIBTOP_FSUSAGE_BLOCKS) + (1L << GLIBTOP_FSUSAGE_BFREE) ++ (1L << GLIBTOP_FSUSAGE_BAVAIL) + (1L << GLIBTOP_FSUSAGE_FILES) ++ (1L << GLIBTOP_FSUSAGE_FFREE) + (1L << GLIBTOP_FSUSAGE_BLOCK_SIZE); + + + +void +glibtop_get_fsusage_s(glibtop *server, glibtop_fsusage *buf, const char *path) +{ + struct statvfs fsd; + + memset(buf, 0, sizeof(glibtop_fsusage)); + + if (statvfs(path, &fsd) < 0) { + glibtop_warn_r(server, "statvfs '%s' failed: %s", path, strerror (errno)); + return; + } + + buf->blocks = fsd.f_blocks; + buf->bfree = fsd.f_bfree; + buf->bavail = (fsd.f_bavail > fsd.f_bfree) ? 0 : fsd.f_bavail; + buf->files = fsd.f_files; + buf->ffree = fsd.f_ffree; + buf->block_size = fsd.f_bsize; + buf->flags = _glibtop_sysdeps_fsusage; + + /* setting additional flags is delegated */ + get_fsusage_read_write(server, buf, path); +} diff --git a/sysdeps/linux/glibtop_machine.h b/sysdeps/linux/glibtop_machine.h new file mode 100644 index 0000000..5c1daad --- /dev/null +++ b/sysdeps/linux/glibtop_machine.h @@ -0,0 +1,35 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_MACHINE_H__ +#define __GLIBTOP_MACHINE_H__ + +#include + +G_BEGIN_DECLS + +struct _glibtop_machine +{ +}; + +G_END_DECLS + +#endif diff --git a/sysdeps/linux/glibtop_private.c b/sysdeps/linux/glibtop_private.c new file mode 100644 index 0000000..d3a49aa --- /dev/null +++ b/sysdeps/linux/glibtop_private.c @@ -0,0 +1,223 @@ +#include +#include +#include + +#include "glibtop_private.h" + +#include + +#include +#include +#include + +#include +#include + + +unsigned long long +get_scaled(const char *buffer, const char *key) +{ + const char *ptr = buffer; + char *next; + unsigned long long value; + + if (key) { + if (G_LIKELY((ptr = strstr(buffer, key)))) + ptr += strlen(key); + else { + g_warning("Could not read key '%s' in buffer '%s'", + key, buffer); + return 0; + } + } + + value = strtoull(ptr, &next, 0); + + for ( ; *next; ++next) { + if (*next == 'k') { + value *= 1024; + break; + } else if (*next == 'M') { + value *= 1024 * 1024; + break; + } + } + + return value; +} + + +char * +skip_token (const char *p) +{ + p = next_token(p); + while (*p && !g_ascii_isspace(*p)) p++; + p = next_token(p); + return (char *)p; +} + + +/* + * Read functions + */ +enum TRY_FILE_TO_BUFFER +{ + TRY_FILE_TO_BUFFER_OK = 0, + TRY_FILE_TO_BUFFER_OPEN = -1, + TRY_FILE_TO_BUFFER_READ = -2 +}; + +/* + * Doesn't handle bufsiz == 0 + */ +int try_file_to_buffer(char *buffer, size_t bufsiz, const char *format, ...) +{ + char path[4096]; + int fd; + size_t len = 0; + ssize_t nread = 0; + va_list pa; + + if (G_UNLIKELY(bufsiz <= sizeof(char*))) + g_warning("Huhu, bufsiz of %lu looks bad", (gulong)bufsiz); + + va_start(pa, format); + + /* C99 also provides vsnprintf */ + g_vsnprintf(path, sizeof path, format, pa); + + va_end(pa); + + bufsiz--; /* reserve 1 for trailing NUL */ + buffer [0] = '\0'; + + if((fd = open (path, O_RDONLY)) < 0) + return TRY_FILE_TO_BUFFER_OPEN; + + while (len < bufsiz) { + nread = read (fd, buffer + len, bufsiz - len); + + if (G_UNLIKELY(nread < 0)) { + if (errno == EINTR) + continue; + else + break; + } + + len += nread; + + if (nread == 0) + break; + } + + close (fd); + + if (nread < 0) + return TRY_FILE_TO_BUFFER_READ; + + buffer [len] = '\0'; + + return TRY_FILE_TO_BUFFER_OK; +} + + +void +file_to_buffer(glibtop *server, char *buffer, size_t bufsiz, const char *filename) +{ + switch(try_file_to_buffer(buffer, bufsiz, "%s", filename)) + { + case TRY_FILE_TO_BUFFER_OPEN: + glibtop_error_io_r (server, "open (%s)", filename); + case TRY_FILE_TO_BUFFER_READ: + glibtop_error_io_r (server, "read (%s)", filename); + } +} + + + + +static unsigned long +read_boot_time(glibtop *server) +{ + char* line = NULL; + size_t size = 0; + FILE* stat; + unsigned long btime = 0; + + if (!(stat = fopen("/proc/stat", "r"))) { + glibtop_error_io_r(server, "fopen(\"/proc/stat\")"); + goto out; + } + + while (getline(&line, &size, stat) != -1) { + if (!strncmp(line, "btime", 5)) { + btime = strtoul(skip_token(line), NULL, 10); + break; + } + } + + free(line); + fclose(stat); +out: + return btime; +} + + + +unsigned long +get_boot_time(glibtop *server) +{ + static unsigned long boot_time = 0UL; + + if(G_UNLIKELY(!boot_time)) + { + boot_time = read_boot_time(server); + } + + return boot_time; +} + + + +gboolean +check_cpu_line(glibtop *server, const char *line, unsigned i) +{ + char start[10]; + + g_snprintf(start, sizeof start, "cpu%u", i); + + return g_str_has_prefix(line, start); +} + + + +gboolean +has_sysfs(void) +{ + static gboolean init; + static gboolean sysfs; + + if (G_UNLIKELY(!init)) { + sysfs = g_file_test("/sys", G_FILE_TEST_IS_DIR); + init = TRUE; + } + + return sysfs; +} + + + +gboolean safe_readlink(const char *path, char *buf, size_t bufsiz) +{ + ssize_t ret; + + ret = readlink(path, buf, bufsiz - 1); + + if (ret == -1) { + g_warning("Could not read link %s : %s", path, strerror(errno)); + return FALSE; + } + + buf[ret] = '\0'; + return TRUE; +} diff --git a/sysdeps/linux/glibtop_private.h b/sysdeps/linux/glibtop_private.h new file mode 100644 index 0000000..03761f4 --- /dev/null +++ b/sysdeps/linux/glibtop_private.h @@ -0,0 +1,153 @@ +/* Copyright (C) 2004 Benoît Dejean + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __LINUX__GLIBTOP_PRIVATE_H__ +#define __LINUX__GLIBTOP_PRIVATE_H__ + +#include +#include + +#include + +#include +#include +#include + +G_BEGIN_DECLS + +#define LINUX_VERSION_CODE(x,y,z) (0x10000*(x) + 0x100*(y) + z) + + +static inline char* +next_token(const char *p) +{ + while (g_ascii_isspace(*p)) p++; + return (char*) p; +} + +char * +skip_token (const char *p); + +static inline char * +skip_multiple_token (const char *p, size_t count) +{ + while(count--) + p = skip_token (p); + + return (char *)p; +} + + +static inline char * +skip_line (const char *p) +{ + while (*p && *p != '\n') p++; + return (char *) (*p ? p+1 : p); +} + +/* + * Smart strtoul which handles binary suffixes + * e.g: get_scaled("Size: 32 kB", "Size:") == 32768 + * key can be NULL if there's not prefix to strip (or prefix size is known + */ +unsigned long long +get_scaled(const char *buffer, const char *key); + + +/* aborts on error */ +void +file_to_buffer(glibtop *server, char *buffer, size_t bufsiz, const char *filename); + +/* return < 0 on error, otherwise 0 on success */ +int +try_file_to_buffer(char *buffer, size_t bufsiz, const char *format, ...) G_GNUC_PRINTF(3, 4); + + +/* some inline functions that wrap proc path + * as fast as macros :) + */ + +static inline int +proc_file_to_buffer (char *buffer, size_t bufsiz, const char *fmt, pid_t pid) +{ + return try_file_to_buffer(buffer, bufsiz, fmt, pid); +} + +static inline int +proc_stat_to_buffer (char *buffer, size_t bufsiz, pid_t pid) +{ + return proc_file_to_buffer(buffer, bufsiz, "/proc/%d/stat", pid); +} + +static inline int +proc_status_to_buffer (char *buffer, size_t bufsiz, pid_t pid) +{ + return proc_file_to_buffer(buffer, bufsiz, "/proc/%d/status", pid); +} + +static inline int +proc_statm_to_buffer (char *buffer, size_t bufsiz, pid_t pid) +{ + return proc_file_to_buffer(buffer, bufsiz, "/proc/%d/statm", pid); +} + + +static inline char * +proc_stat_after_cmd (char *p) +{ + p = strrchr (p, ')'); + if (G_LIKELY(p)) + *p++ = '\0'; + return p; +} + + +unsigned long +get_boot_time(glibtop *server); + + +gboolean +check_cpu_line(glibtop *server, const char *line, unsigned n); + + +static inline gboolean +check_cpu_line_warn(glibtop *server, const char *line, unsigned i) +{ + gboolean ret; + + ret = check_cpu_line(server, line, i); + + if (G_UNLIKELY(!ret)) + glibtop_warn_io_r(server, + "'%s' does not start with 'cpu%u'", + line, i); + + return ret; +} + + +gboolean +has_sysfs(void) G_GNUC_CONST; + +gboolean safe_readlink(const char *path, char *buf, size_t bufsiz); + + +G_END_DECLS + +#endif /* __LINUX__GLIBTOP_PRIVATE_H__ */ diff --git a/sysdeps/linux/glibtop_server.h b/sysdeps/linux/glibtop_server.h new file mode 100644 index 0000000..8e591ea --- /dev/null +++ b/sysdeps/linux/glibtop_server.h @@ -0,0 +1,51 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __LINUX__GLIBTOP_SERVER_H__ +#define __LINUX__GLIBTOP_SERVER_H__ + +#define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_MEM 0 +#define GLIBTOP_SUID_SWAP 0 +#define GLIBTOP_SUID_UPTIME 0 +#define GLIBTOP_SUID_LOADAVG 0 +#define GLIBTOP_SUID_SHM_LIMITS 0 +#define GLIBTOP_SUID_MSG_LIMITS 0 +#define GLIBTOP_SUID_SEM_LIMITS 0 +#define GLIBTOP_SUID_PROCLIST 0 +#define GLIBTOP_SUID_PROC_STATE 0 +#define GLIBTOP_SUID_PROC_UID 0 +#define GLIBTOP_SUID_PROC_MEM 0 +#define GLIBTOP_SUID_PROC_TIME 0 +#define GLIBTOP_SUID_PROC_SIGNAL 0 +#define GLIBTOP_SUID_PROC_KERNEL 0 +#define GLIBTOP_SUID_PROC_SEGMENT 0 +#define GLIBTOP_SUID_PROC_ARGS 0 +#define GLIBTOP_SUID_PROC_MAP 0 +#define GLIBTOP_SUID_NETLOAD 0 +#define GLIBTOP_SUID_NETLIST 0 +#define GLIBTOP_SUID_PROC_WD 0 +#define GLIBTOP_SUID_PROC_AFFINITY 0 +#define GLIBTOP_SUID_PPP 0 +#define GLIBTOP_SUID_PROC_FILE 0 +#define GLIBTOP_SUID_PROC_IO 0 + +#endif /* __LINUX__GLIBTOP_SERVER_H__ */ diff --git a/sysdeps/linux/loadavg.c b/sysdeps/linux/loadavg.c new file mode 100644 index 0000000..be0d5fc --- /dev/null +++ b/sysdeps/linux/loadavg.c @@ -0,0 +1,81 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_loadavg = +(1L << GLIBTOP_LOADAVG_LOADAVG); + +static const unsigned long _glibtop_sysdeps_loadavg_tasks = +(1L << GLIBTOP_LOADAVG_NR_RUNNING) + +(1L << GLIBTOP_LOADAVG_NR_TASKS) + +(1L << GLIBTOP_LOADAVG_LAST_PID); + +/* Init function. */ + +void +_glibtop_init_loadavg_s (glibtop *server) +{ + server->sysdeps.loadavg = _glibtop_sysdeps_loadavg; +} + +/* Provides load load averange. */ + +#define FILENAME "/proc/loadavg" + +void +glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf) +{ + char buffer [BUFSIZ], *p, *old; + + memset (buf, 0, sizeof (glibtop_loadavg)); + + file_to_buffer(server, buffer, sizeof buffer, FILENAME); + + buf->loadavg [0] = g_ascii_strtod (buffer, &p); + buf->loadavg [1] = g_ascii_strtod (p, &p); + buf->loadavg [2] = g_ascii_strtod (p, &p); + + buf->flags = _glibtop_sysdeps_loadavg; + + p = next_token(p); + + /* Older Linux versions don't have the nr_running/nr_tasks fields. */ + + old = p; + while (*p) { + if (*p == '/') + break; + if (!isdigit (*p)) + return; + p++; + } + + buf->nr_running = strtoull (old, &p, 0); p++; + buf->nr_tasks = strtoull (p, &p, 0); + buf->last_pid = strtoull (p, &p, 0); + + buf->flags |= _glibtop_sysdeps_loadavg_tasks; +} diff --git a/sysdeps/linux/mem.c b/sysdeps/linux/mem.c new file mode 100644 index 0000000..e37a922 --- /dev/null +++ b/sysdeps/linux/mem.c @@ -0,0 +1,71 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_mem = +(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) + +(1L << GLIBTOP_MEM_FREE) + (1L << GLIBTOP_MEM_SHARED) + +(1L << GLIBTOP_MEM_BUFFER) + (1L << GLIBTOP_MEM_CACHED) + +(1L << GLIBTOP_MEM_USER); + +/* Init function. */ + +void +_glibtop_init_mem_s (glibtop *server) +{ + server->sysdeps.mem = _glibtop_sysdeps_mem; +} + +/* Provides information about memory usage. */ + +#define FILENAME "/proc/meminfo" + +void +glibtop_get_mem_s (glibtop *server, glibtop_mem *buf) +{ + char buffer [BUFSIZ]; + + memset(buf, 0, sizeof *buf); + + file_to_buffer(server, buffer, sizeof buffer, FILENAME); + + /* try to match procps's `free` */ + buf->total = get_scaled(buffer, "MemTotal:"); + buf->free = get_scaled(buffer, "MemFree:"); + buf->used = buf->total - buf->free; + buf->shared = get_scaled(buffer, "Shmem:"); + buf->buffer = get_scaled(buffer, "Buffers:"); + buf->cached = get_scaled(buffer, "Cached:") + get_scaled(buffer, "Slab:"); + + if (server->os_version_code >= LINUX_VERSION_CODE(3, 14, 0)) { + buf->user = buf->total - get_scaled(buffer, "MemAvailable:"); + } + else { + buf->user = buf->total - buf->free - buf->cached - buf->buffer; + } + + buf->flags = _glibtop_sysdeps_mem; +} diff --git a/sysdeps/linux/mountlist.c b/sysdeps/linux/mountlist.c new file mode 100644 index 0000000..7c376fd --- /dev/null +++ b/sysdeps/linux/mountlist.c @@ -0,0 +1,167 @@ +/* mountlist.c -- return a list of mounted filesystems + Copyright (C) 1991, 1992 Free Software Foundation, Inc. + + This file is a fork of sysdeps/common/mountlist.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, 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. */ + + +/* +Local Variables: +mode: C +c-file-style: "gnu" +End: +*/ + +#include + +#include +#include + +#include +#include +#include + + +/* IgnoreList */ + + +typedef struct +{ + GHashTable *table; +} IgnoreList; + + +static IgnoreList* +ignore_list_new(void) +{ + IgnoreList* ig; + ig = g_new(IgnoreList, 1); + ig->table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); + return ig; +} + + +static void +ignore_list_delete(IgnoreList* ig) +{ + if (ig) { + g_hash_table_destroy(ig->table); + g_free(ig); + } +} + + +static void +ignore_list_add(IgnoreList* ig, const char* fs) +{ + g_hash_table_insert(ig->table, g_strdup(fs), GINT_TO_POINTER(1)); +} + + +static gboolean +ignore_list_has(IgnoreList* ig, const char* fs) +{ + gpointer data; + data = g_hash_table_lookup(ig->table, fs); + return data != NULL; +} + + +/* ~IgnoreList */ + + +static gboolean +ignore_fs(const char *fstype, IgnoreList** ig) +{ + if (!*ig) { + FILE* fs; + char line[128]; + + *ig = ignore_list_new(); + + ignore_list_add(*ig, "none"); + + if ((fs = fopen("/proc/filesystems", "r")) != NULL) { + while (fgets(line, sizeof line, fs)) { + if (!strncmp(line, "nodev", 5)) { + char *type; + type = g_strstrip(line + 5); + ignore_list_add(*ig, type); + } + } + fclose(fs); + } + } + + return ignore_list_has(*ig, fstype); +} + + +glibtop_mountentry * +glibtop_get_mountlist_s(glibtop *server, glibtop_mountlist *buf, int all_fs) +{ + const struct mntent *mnt; + FILE *fp; + GArray* entries; + IgnoreList* ig = NULL; + + memset(buf, 0, sizeof(glibtop_mountlist)); + + /* wild guess, preallocate 8 entries + on a desktop, almost everyone has / and a tmpfs for udev + if all_fs, there are also proc, sys, fuse, binfmt, etc */ + entries = g_array_sized_new(FALSE, FALSE, sizeof(glibtop_mountentry), 8); + + if (!(fp = setmntent(MOUNTED, "r"))) { + glibtop_warn_io_r(server, "Could not open %s", MOUNTED); + goto out; + } + + while ((mnt = getmntent(fp))) + { + glibtop_mountentry *me; + const char *devopt; + gsize len; + + if (!all_fs && ignore_fs(mnt->mnt_type, &ig)) + continue; + + len = entries->len; + g_array_set_size(entries, len + 1); + me = &g_array_index(entries, glibtop_mountentry, len); + + g_strlcpy(me->devname, mnt->mnt_fsname, sizeof me->devname); + g_strlcpy(me->mountdir, mnt->mnt_dir, sizeof me->mountdir); + g_strlcpy(me->type, mnt->mnt_type, sizeof me->type); + devopt = strstr(mnt->mnt_opts, "dev="); + me->dev = (devopt ? strtoull(devopt + sizeof "dev=", NULL, 0) : (dev_t)-1); + } + + endmntent(fp); + + + out: + ignore_list_delete(ig); + + buf->size = sizeof(glibtop_mountentry); + buf->number = entries->len; + buf->total = buf->number * buf->size; + buf->flags = (1 << GLIBTOP_MOUNTLIST_SIZE) + | (1 << GLIBTOP_MOUNTLIST_NUMBER) + | (1 << GLIBTOP_MOUNTLIST_TOTAL); + + return (glibtop_mountentry*) g_array_free(entries, FALSE); +} diff --git a/sysdeps/linux/msg_limits.c b/sysdeps/linux/msg_limits.c new file mode 100644 index 0000000..298d81c --- /dev/null +++ b/sysdeps/linux/msg_limits.c @@ -0,0 +1,61 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include + +static const unsigned long _glibtop_sysdeps_msg_limits = +(1L << GLIBTOP_IPC_MSGPOOL) + (1L << GLIBTOP_IPC_MSGMAP) + +(1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNB) + +(1L << GLIBTOP_IPC_MSGMNI) + (1L << GLIBTOP_IPC_MSGSSZ) + +(1L << GLIBTOP_IPC_MSGTQL); + +/* Init function. */ + +void +_glibtop_init_msg_limits_s (glibtop *server) +{ + server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf) +{ + struct msginfo msginfo; + + memset (buf, 0, sizeof (glibtop_msg_limits)); + + msgctl (0, IPC_INFO, (void*) &msginfo); + + buf->msgpool = msginfo.msgpool; + buf->msgmap = msginfo.msgmap; + buf->msgmax = msginfo.msgmax; + buf->msgmnb = msginfo.msgmnb; + buf->msgmni = msginfo.msgmni; + buf->msgssz = msginfo.msgssz; + buf->msgtql = msginfo.msgtql; + buf->flags = _glibtop_sysdeps_msg_limits; +} diff --git a/sysdeps/linux/netlist.c b/sysdeps/linux/netlist.c new file mode 100644 index 0000000..369fba6 --- /dev/null +++ b/sysdeps/linux/netlist.c @@ -0,0 +1,80 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + + +static const unsigned long _glibtop_sysdeps_netlist = (1 << GLIBTOP_NETLIST_NUMBER); + +/* Init function. */ + +void +_glibtop_init_netlist_s (glibtop *server) +{ + server->sysdeps.netlist = _glibtop_sysdeps_netlist; +} + + +char** +glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf) +{ + char line[1024]; + FILE *f; + GPtrArray *devices; + + memset (buf, 0, sizeof (glibtop_netlist)); + + f = fopen("/proc/net/dev", "r"); + + if(!f) + { + glibtop_warn_io_r (server, "cannot open \"/proc/net/dev\""); + return NULL; + } + + devices = g_ptr_array_new(); + + while(fgets(line, sizeof line, f)) + { + char *sep = strchr(line, ':'); + + if(!sep) continue; + + *sep = '\0'; /* truncate : we only need the name */ + + g_strstrip(line); + g_ptr_array_add(devices, g_strdup(line)); + buf->number++; + } + + fclose(f); + + buf->flags = _glibtop_sysdeps_netlist; + + g_ptr_array_add(devices, NULL); + + return (char**) g_ptr_array_free(devices, FALSE); +} + diff --git a/sysdeps/linux/netload.c b/sysdeps/linux/netload.c new file mode 100644 index 0000000..dcfea34 --- /dev/null +++ b/sysdeps/linux/netload.c @@ -0,0 +1,561 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include +#include +#include + +#include "glibtop_private.h" + +#include +#include + +#include +#include +#include + +#if !defined (__GLIBC__) || __GNU_LIBRARY__ > 1 +/* GNU LibC */ +#include +#include +#include +#include +#include +#include +#include +#elif defined (__GLIBC__) /* Libc 5 */ +#include +#include +#include +#include +#include +#include +#endif + + +#ifdef HAVE_IFADDRS_H +/* needed for IPV6 support */ + +#include + +#ifndef IN6_IS_ADDR_GLOBAL +#define IN6_IS_ADDR_GLOBAL(a) \ + (((((__const uint8_t *) (a))[0] & 0xff) == 0x3f \ + || (((__const uint8_t *) (a))[0] & 0xff) == 0x20)) +#endif +#endif /* HAVE_IFADDRS_H */ + + +#define _GLIBTOP_IP_FW_ACCTIN 0x1000 /* Account incoming packets only. */ +#define _GLIBTOP_IP_FW_ACCTOUT 0x2000 /* Account outgoing packets only. */ + +static const unsigned long _glibtop_sysdeps_netload = +(1L << GLIBTOP_NETLOAD_ERRORS_IN) + +(1L << GLIBTOP_NETLOAD_ERRORS_OUT) + +(1L << GLIBTOP_NETLOAD_COLLISIONS); + +static const unsigned long _glibtop_sysdeps_netload_data = +(1L << GLIBTOP_NETLOAD_ADDRESS) + +(1L << GLIBTOP_NETLOAD_SUBNET) + +(1L << GLIBTOP_NETLOAD_MTU); + +static const unsigned long _glibtop_sysdeps_netload_bytes = +(1L << GLIBTOP_NETLOAD_BYTES_IN) + +(1L << GLIBTOP_NETLOAD_BYTES_OUT) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL); + +static const unsigned long _glibtop_sysdeps_netload_packets = +(1L << GLIBTOP_NETLOAD_PACKETS_IN) + +(1L << GLIBTOP_NETLOAD_PACKETS_OUT) + +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL); + +static const unsigned long _glibtop_sysdeps_netload_total = +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL); + +static const unsigned long _glibtop_sysdeps_netload_in = +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) + +(1L << GLIBTOP_NETLOAD_PACKETS_IN) + +(1L << GLIBTOP_NETLOAD_BYTES_IN); + +static const unsigned long _glibtop_sysdeps_netload_out = +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) + +(1L << GLIBTOP_NETLOAD_PACKETS_OUT) + +(1L << GLIBTOP_NETLOAD_BYTES_OUT); + +static const unsigned long _glibtop_sysdeps_netload_6 = +(1L << GLIBTOP_NETLOAD_ADDRESS6) + +(1L << GLIBTOP_NETLOAD_PREFIX6) + +(1L << GLIBTOP_NETLOAD_SCOPE6); + +/* Init function. */ + +void +_glibtop_init_netload_s (glibtop *server) +{ + server->sysdeps.netload = _glibtop_sysdeps_netload | + _glibtop_sysdeps_netload_data | + _glibtop_sysdeps_netload_bytes | + _glibtop_sysdeps_netload_packets; +} + + +#ifdef HAVE_IFADDRS_H + +static void get_ipv6(glibtop *server, glibtop_netload *buf, + const char *interface) +{ + struct ifaddrs *ifa0, *ifr6; + + if(getifaddrs (&ifa0) != 0) + { + glibtop_warn_r(server, "getifaddrs failed : %s", g_strerror(errno)); + return; + } + + for (ifr6 = ifa0; ifr6; ifr6 = ifr6->ifa_next) { + if (strcmp (ifr6->ifa_name, interface) == 0 + && ifr6->ifa_addr != NULL + && ifr6->ifa_addr->sa_family == AF_INET6) + break; + } + + if(!ifr6) goto free_ipv6; + + memcpy(buf->address6, + &((struct sockaddr_in6 *) ifr6->ifa_addr)->sin6_addr, + 16); + + memcpy(buf->prefix6, + &((struct sockaddr_in6 *) ifr6->ifa_netmask)->sin6_addr, + 16); + + + if (IN6_IS_ADDR_LINKLOCAL (buf->address6)) + buf->scope6 = GLIBTOP_IF_IN6_SCOPE_LINK; + + else if (IN6_IS_ADDR_SITELOCAL (buf->address6)) + buf->scope6 = GLIBTOP_IF_IN6_SCOPE_SITE; + + else if (IN6_IS_ADDR_GLOBAL (buf->address6) + || IN6_IS_ADDR_MC_ORGLOCAL (buf->address6) + || IN6_IS_ADDR_V4COMPAT (buf->address6) + || IN6_IS_ADDR_MULTICAST (buf->address6) + || IN6_IS_ADDR_UNSPECIFIED (buf->address6) + ) + buf->scope6 = GLIBTOP_IF_IN6_SCOPE_GLOBAL; + + else if (IN6_IS_ADDR_LOOPBACK (buf->address6)) + buf->scope6 = GLIBTOP_IF_IN6_SCOPE_HOST; + + else + buf->scope6 = GLIBTOP_IF_IN6_SCOPE_UNKNOWN; + + buf->flags |= _glibtop_sysdeps_netload_6; + + free_ipv6: + freeifaddrs(ifa0); +} + +#endif /* HAVE_IFADDRS_H */ + + + + +static gboolean +read_value(glibtop *server, + const char *device, + const char *filename, + guint64 *value) +{ + char buffer[BUFSIZ]; + + if(try_file_to_buffer(buffer, + sizeof buffer, + "/sys/class/net/%s/statistics/%s", + device, + filename)) + { + glibtop_warn_io_r(server, + "Failed to open \"/sys/class/net/%s/statistics/%s\"", + device, + filename); + + return FALSE; + } + + *value = strtoull(buffer, NULL, 10); + return TRUE; +} + + + + +static void +linux_2_6_stats(glibtop *server, + glibtop_netload *buf, + const char *dev) +{ + if(read_value(server, dev, "rx_packets", &buf->packets_in)) + buf->flags |= (1 << GLIBTOP_NETLOAD_PACKETS_IN); + + if(read_value(server, dev, "tx_packets", &buf->packets_out)) + buf->flags |= (1 << GLIBTOP_NETLOAD_PACKETS_OUT); + + buf->packets_total = buf->packets_in + buf->packets_out; + buf->flags |= (1 << GLIBTOP_NETLOAD_PACKETS_TOTAL); + + + if(read_value(server, dev, "rx_bytes", &buf->bytes_in)) + buf->flags |= (1 << GLIBTOP_NETLOAD_BYTES_IN); + + if(read_value(server, dev, "tx_bytes", &buf->bytes_out)) + buf->flags |= (1 << GLIBTOP_NETLOAD_BYTES_OUT); + + buf->bytes_total = buf->bytes_in + buf->bytes_out; + buf->flags |= (1 << GLIBTOP_NETLOAD_BYTES_TOTAL); + + + if(read_value(server, dev, "rx_errors", &buf->errors_in)) + buf->flags |= (1 << GLIBTOP_NETLOAD_ERRORS_IN); + + if(read_value(server, dev, "tx_errors", &buf->errors_out)) + buf->flags |= (1 << GLIBTOP_NETLOAD_ERRORS_OUT); + + buf->errors_total = buf->errors_in + buf->errors_out; + buf->flags |= (1 << GLIBTOP_NETLOAD_ERRORS_TOTAL); + + + if(read_value(server, dev, "collisions", &buf->collisions)) + buf->flags |= (1 << GLIBTOP_NETLOAD_COLLISIONS); +} + + + + +static void +linux_2_0_stats(glibtop *server, + glibtop_netload *buf, + const char *interface) +{ + FILE *f; + char buffer[BUFSIZ]; + + f = fopen ("/proc/net/ip_acct", "r"); + + if (!f) { + glibtop_warn_io_r (server, + "Failed to open \"/proc/net/ip_acct\""); + return; + } + + /* Skip over the header line. */ + fgets (buffer, BUFSIZ-1, f); + + while (fgets (buffer, BUFSIZ-1, f)) { + unsigned long long flags, packets, bytes; + char *p, *dev; + + /* Skip over the network thing. */ + dev = skip_token (buffer) + 1; + p = skip_token (dev); + *p++ = 0; + + if (strcmp (dev, interface)) + continue; + + p = skip_token (p); + + flags = strtoull (p, &p, 16); + + p = skip_multiple_token (p, 2); + + packets = strtoull (p, &p, 0); + bytes = strtoull (p, &p, 0); + + if (flags & _GLIBTOP_IP_FW_ACCTIN) { + /* Incoming packets only. */ + + buf->packets_total += packets; + buf->packets_in += packets; + + buf->bytes_total += bytes; + buf->bytes_in += bytes; + + buf->flags |= _glibtop_sysdeps_netload_in; + + } else if (flags & _GLIBTOP_IP_FW_ACCTOUT) { + /* Outgoing packets only. */ + + buf->packets_total += packets; + buf->packets_out += packets; + + buf->bytes_total += bytes; + buf->bytes_out += bytes; + + buf->flags |= _glibtop_sysdeps_netload_out; + + } else { + /* Only have total values. */ + + buf->packets_total += packets; + buf->bytes_total += bytes; + + buf->flags |= _glibtop_sysdeps_netload_total; + } + } + + fclose (f); +} + + + + +static void +linux_2_4_stats(glibtop *server, + glibtop_netload *buf, + const char *interface) +{ + char buffer [BUFSIZ], *p; + int have_bytes, fields; + FILE *f; + + /* Ok, either IP accounting is not enabled in the kernel or + * it was not enabled for the requested interface. */ + + f = fopen ("/proc/net/dev", "r"); + if (!f) { + glibtop_warn_io_r(server, + "Failed to open \"/proc/net/dev\""); + return; + } + + /* Skip over the header line. */ + fgets (buffer, BUFSIZ-1, f); + fgets (buffer, BUFSIZ-1, f); + + /* Starting with 2.1.xx (don't know exactly which version) + * /proc/net/dev contains both byte and package counters. */ + + p = strchr (buffer, '|'); + if (!p) { + fclose (f); + return; + } + + /* Do we already have byte counters ? */ + have_bytes = strncmp (++p, "bytes", 5) == 0; + + /* Count remaining 'Receive' fields so we know where + * the first 'Transmit' field starts. */ + + fields = 0; + while (*p != '|') { + if (!isspace (*p++)) continue; + while (isspace (*p++)) ; + fields++; + } + + /* Should never happen. */ + if (fields < 2) { + fclose (f); + return; + } + fields--; + + while (fgets (buffer, BUFSIZ-1, f)) { + char *p, *dev; + + dev = buffer; + while (isspace (*dev)) dev++; + + p = strchr (dev, ':'); + if (!p) continue; + *p++ = 0; + + /* If it's not a digit, then it's most likely an error + * message like 'No statistics available'. */ + while (isspace (*p)) p++; + if (!isdigit (*p)) continue; + + if (strcmp (dev, interface)) + continue; + + /* Ok, we've found the interface */ + + /* Only read byte counts if we really have them. */ + + if (have_bytes) { + buf->bytes_in = strtoull (p, &p, 0); + fields--; + } + + buf->packets_in = strtoull (p, &p, 0); + buf->errors_in = strtoull (p, &p, 0); + + p = skip_multiple_token (p, fields); + + if (have_bytes) + buf->bytes_out = strtoull (p, &p, 0); + + buf->packets_out = strtoull (p, &p, 0); + buf->errors_out = strtoull (p, &p, 0); + + p = skip_multiple_token (p, 2); + + buf->collisions = strtoull (p, &p, 0); + + /* Compute total valules. */ + + buf->bytes_total = buf->bytes_in + buf->bytes_out; + buf->packets_total = buf->packets_in + buf->packets_out; + + /* And now the flags. */ + + buf->flags |= _glibtop_sysdeps_netload; + buf->flags |= _glibtop_sysdeps_netload_packets; + + if (have_bytes) + buf->flags |= _glibtop_sysdeps_netload_bytes; + + break; /* finished */ + } + + fclose (f); +} + + + + +/* Provides network statistics. */ + +void +glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, + const char *interface) +{ + int skfd; + memset (buf, 0, sizeof (glibtop_netload)); + + skfd = socket (AF_INET, SOCK_DGRAM, 0); + if (skfd) { + struct ifreq ifr; + + g_strlcpy (ifr.ifr_name, interface, sizeof ifr.ifr_name); + if (!ioctl (skfd, SIOCGIFFLAGS, &ifr)) { + const unsigned long long flags = ifr.ifr_flags; + + buf->flags |= (1L << GLIBTOP_NETLOAD_IF_FLAGS); + + if (flags & IFF_UP) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP); + + if (flags & IFF_BROADCAST) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST); + + if (flags & IFF_DEBUG) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG); + + if (flags & IFF_LOOPBACK) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK); + + if (flags & IFF_POINTOPOINT) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT); + + if (flags & IFF_RUNNING) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING); + + if (flags & IFF_NOARP) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP); + + if (flags & IFF_PROMISC) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC); + + if (flags & IFF_ALLMULTI) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI); + + if (flags & IFF_MULTICAST) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST); + } + + g_strlcpy (ifr.ifr_name, interface, sizeof ifr.ifr_name); + if (!ioctl(skfd, /* SIOCGIWNAME */ 0x8B01, &ifr)) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_WIRELESS); + + g_strlcpy (ifr.ifr_name, interface, sizeof ifr.ifr_name); + if (!ioctl (skfd, SIOCGIFADDR, &ifr)) { + buf->address = ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr; + buf->flags |= (1L << GLIBTOP_NETLOAD_ADDRESS); + } + + g_strlcpy (ifr.ifr_name, interface, sizeof ifr.ifr_name); + if (!ioctl (skfd, SIOCGIFNETMASK, &ifr)) { + buf->subnet = ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr; + buf->flags |= (1L << GLIBTOP_NETLOAD_SUBNET); + } + + g_strlcpy (ifr.ifr_name, interface, sizeof ifr.ifr_name); + if (!ioctl (skfd, SIOCGIFMTU, &ifr)) { + buf->mtu = ifr.ifr_mtu; + buf->flags |= (1L << GLIBTOP_NETLOAD_MTU); + } + + g_strlcpy (ifr.ifr_name, interface, sizeof ifr.ifr_name); + if (!ioctl (skfd, SIOCGIFHWADDR, &ifr)) { + memcpy(buf->hwaddress, &ifr.ifr_hwaddr.sa_data, 8); + buf->flags |= (1L << GLIBTOP_NETLOAD_HWADDRESS); + } + + close (skfd); + } + + + /* + * Statistics + */ + + /* Linux 2.1.114 - don't know where exactly this was added, but + * recent kernels have byte count in /proc/net/dev so we don't + * need IP accounting. + */ + + if (server->os_version_code < LINUX_VERSION_CODE(2, 1, 14)) { + linux_2_0_stats(server, buf, interface); + } + else if (server->os_version_code > LINUX_VERSION_CODE(2, 6, 0) + && has_sysfs()) { + linux_2_6_stats(server, buf, interface); + } + else { + /* 2.4 and 2.6 without /sys (?$£Z¥!) */ + linux_2_4_stats(server, buf, interface); + } + +#ifdef HAVE_IFADDRS_H + get_ipv6(server, buf, interface); +#endif /* HAVE_IFADDRS_H */ +} + + + diff --git a/sysdeps/linux/open.c b/sysdeps/linux/open.c new file mode 100644 index 0000000..d5e5c68 --- /dev/null +++ b/sysdeps/linux/open.c @@ -0,0 +1,104 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +#include "glibtop_private.h" + +/* ===================================================== + * Linux kernel version information for procps utilities + * Copyright (c) 1996 Charles Blake + */ +#include + +static void set_linux_version(glibtop *server) +{ + struct utsname uts; + unsigned x = 0, y = 0, z = 0; /* cleared in case sscanf() < 3 */ + int version_string_depth; + + if (uname(&uts) == -1) /* failure most likely implies impending death */ + glibtop_error_r(server, "uname() failed"); + + version_string_depth = sscanf(uts.release, "%u.%u.%u", &x, &y, &z); + + if ((version_string_depth < 2) || /* Non-standard for all known kernels */ + ((version_string_depth < 3) && (x < 3))) /* Non-standard for 2.x.x kernels */ + glibtop_warn_r(server, + "Non-standard uts for running kernel:\n" + "release %s=%u.%u.%u gives version code %d\n", + uts.release, x, y, z, LINUX_VERSION_CODE(x,y,z)); + + if (LINUX_VERSION_CODE(x, y, z) >= LINUX_VERSION_CODE(2, 6, 0) + && !has_sysfs()) + glibtop_warn_r(server, + "You're running a 2.6 kernel without /sys." + "You should mount it."); + + server->os_version_code = LINUX_VERSION_CODE(x, y, z); +} + +/* ======================================================= */ + +/* Opens pipe to gtop server. Returns 0 on success and -1 on error. */ + +#define FILENAME "/proc/stat" +#define STAT_BUFSIZ 81920 + +void +glibtop_open_s (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags) +{ + char buffer [STAT_BUFSIZ], *p = buffer; + + server->name = program_name; + + set_linux_version(server); + + file_to_buffer(server, buffer, sizeof buffer, FILENAME); + + p = skip_line(p); /* cpu */ + + for (server->real_ncpu = 0; /* nop */; server->real_ncpu++) { + + if (!check_cpu_line(server, p, server->real_ncpu)) { + server->real_ncpu--; + break; + } + + p = skip_line(p); + } + + server->ncpu = MIN(GLIBTOP_NCPU - 1, server->real_ncpu); + + if (server->real_ncpu != server->ncpu) { + glibtop_warn_r(server, + "This machine has %d CPUs, " + "%d are being monitored.", + server->real_ncpu + 1, + server->ncpu + 1); + } +} diff --git a/sysdeps/linux/ppp.c b/sysdeps/linux/ppp.c new file mode 100644 index 0000000..989ca57 --- /dev/null +++ b/sysdeps/linux/ppp.c @@ -0,0 +1,197 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +#ifdef HAVE_ISDN_H +#include +#else +#define ISDN_MAX_CHANNELS 64 +#define IIOCGETCPS _IO('I',21) +#endif /* HAVE_ISDN_H */ + +static const unsigned long _glibtop_sysdeps_ppp = +(1L << GLIBTOP_PPP_STATE) + (1L << GLIBTOP_PPP_BYTES_IN) + +(1L << GLIBTOP_PPP_BYTES_OUT); + +/* Init function. */ + +void +_glibtop_init_ppp_s (glibtop *server) +{ + server->sysdeps.ppp = _glibtop_sysdeps_ppp; +} + +static gboolean +get_ISDN_stats (glibtop *server, int *in, int *out) +{ + unsigned long isdn_stats[2 * ISDN_MAX_CHANNELS], *ptr; + int fd; + + *in = *out = 0; + + fd = open ("/dev/isdninfo", O_RDONLY); + if (fd < 0) { + return FALSE; + } + + if ((ioctl (fd, IIOCGETCPS, isdn_stats) < 0) && (errno != 0)) { + close(fd); + return FALSE; + } + + for (ptr = isdn_stats; + ptr != (isdn_stats + G_N_ELEMENTS(isdn_stats)); + /* NOOP */) { + *in += *ptr++; *out += *ptr++; + } + + close (fd); + return TRUE; +} + +static gboolean is_ISDN_on (glibtop *server, int *online) +{ + FILE *f = NULL; + char buffer [BUFSIZ], *p; + int i; + + /* Perhaps I should try to explain this code a little bit. + * + * ------------------------------------------------------------ + * This is from the manpage of isdninfo(4): + * + * DESCRIPTION + * /dev/isdninfo is a character device with major number 45 + * and minor number 255. It delivers status information from + * the Linux ISDN subsystem to user level. + * + * DATA FORMAT + * When reading from this device, the current status of the + * Linux ISDN subsystem is delivered in 6 lines of text. Each + * line starts with a tag string followed by a colon and + * whitespace. After that the status values are appended sep- + * arated by whitespace. + * + * flags is the tag of line 5. In this line for every driver + * slot, it's B-Channel status is shown. If no driver + * is registered in a slot, a ? is shown. For every + * established B-Channel of the driver, a bit is set + * in the shown value. The driver's first channel is + * mapped to bit 0, the second channel to bit 1 and so + * on. + * ------------------------------------------------------------ + * + * So we open /dev/isdninfo, discard the first four lines of text + * and then check whether we have something that is not `0' or `?' + * in one of the flags fields. + * + * Sounds complicated, but I don't see any other way to check whether + * we are connected. Also, this is the method some other ISDN tools + * for Linux use. + * + * Martin + */ + + f = fopen ("/dev/isdninfo", "r"); + + if (!f) return FALSE; + + for (i = 0; i < 5; i++) { + if (fgets (buffer, BUFSIZ, f) == NULL) { + fclose (f); + return FALSE; + } + } + + if (strncmp (buffer, "flags:", 6)) { + fclose (f); + return FALSE; + } + + p = buffer+6; + + while (*p) { + char *end = p; + + if (isspace (*p)) { + p++; + continue; + } + + for (end = p; *end && !isspace (*end); end++) + ; + + if (*end == 0) + break; + else + *end = 0; + + if (!strcmp (p, "?") || !strcmp (p, "0")) { + p = end+1; + continue; + } + + fclose (f); + + *online = TRUE; + return TRUE; + } + + fclose (f); + + *online = FALSE; + return TRUE; +} + +/* Provides PPP/ISDN information. */ + +void +glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device) +{ + int in, out, online; + + memset (buf, 0, sizeof (glibtop_ppp)); + + if (is_ISDN_on (server, &online)) { + buf->state = online ? GLIBTOP_PPP_STATE_ONLINE : + GLIBTOP_PPP_STATE_HANGUP; + buf->flags |= (1L << GLIBTOP_PPP_STATE); + } + + if (get_ISDN_stats (server, &in, &out)) { + buf->bytes_in = in; + buf->bytes_out = out; + buf->flags |= (1L << GLIBTOP_PPP_BYTES_IN) | + (1L << GLIBTOP_PPP_BYTES_OUT); + } +} diff --git a/sysdeps/linux/procaffinity.c b/sysdeps/linux/procaffinity.c new file mode 100644 index 0000000..6ddf338 --- /dev/null +++ b/sysdeps/linux/procaffinity.c @@ -0,0 +1,69 @@ +/* Copyright (C) 2007 Benoît Dejean + This file is part of LibGTop 2. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +#include + + +void +_glibtop_init_proc_affinity_s(glibtop *server) +{ + server->sysdeps.proc_affinity = + (1 << GLIBTOP_PROC_AFFINITY_NUMBER) | + (1 << GLIBTOP_PROC_AFFINITY_ALL); + +} + + +guint16 * +glibtop_get_proc_affinity_s(glibtop *server, glibtop_proc_affinity *buf, pid_t pid) +{ + cpu_set_t set; + size_t i; + GArray* cpus; + + memset(buf, 0, sizeof *buf); + + if (sched_getaffinity(pid, sizeof set, &set) == -1) { + glibtop_error_r(server, "sched_getaffinity failed"); + return NULL; + } + + cpus = g_array_new(FALSE, FALSE, sizeof(guint16)); + + for (i = 0; i < MIN(CPU_SETSIZE, (size_t)(server->ncpu + 1)); i++) { + if (CPU_ISSET(i, &set)) { + guint16 n = i; + g_array_append_val(cpus, n); + } + } + + buf->number = cpus->len; + buf->all = (cpus->len == (size_t)(server->ncpu + 1)); + buf->flags = (1 << GLIBTOP_PROC_AFFINITY_NUMBER) + | (1 << GLIBTOP_PROC_AFFINITY_ALL); + + return (guint16*) g_array_free(cpus, FALSE); +} + diff --git a/sysdeps/linux/procargs.c b/sysdeps/linux/procargs.c new file mode 100644 index 0000000..74d9057 --- /dev/null +++ b/sysdeps/linux/procargs.c @@ -0,0 +1,70 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_args = +(1L << GLIBTOP_PROC_ARGS_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_args_s (glibtop *server) +{ + server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; +} + +/* Provides detailed information about a process. */ + +char * +glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len) +{ + char filename[48]; /* magiv */ + + char *args; + gsize length; + GError *error = NULL; + + memset (buf, 0, sizeof (glibtop_proc_args)); + + sprintf (filename, "/proc/%d/cmdline", pid); + + if(!g_file_get_contents(filename, &args, &length, &error)) { + g_error_free(error); + buf->size = 0; + return NULL; + } + + if(max_len && max_len < length) { + args = g_realloc(args, max_len); + args[max_len - 1] = '\0'; + length = max_len; + } + + buf->size = length; + buf->flags = _glibtop_sysdeps_proc_args; + + return args; +} diff --git a/sysdeps/linux/procio.c b/sysdeps/linux/procio.c new file mode 100644 index 0000000..2240022 --- /dev/null +++ b/sysdeps/linux/procio.c @@ -0,0 +1,70 @@ +/* Copyright (C) 2017 Robert Roth + This file is part of LibGTop. + + Contributed by Robert Roth , February 2017. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_io = +(1L << GLIBTOP_PROC_IO_DISK_RCHAR) + (1L << GLIBTOP_PROC_IO_DISK_WCHAR) + +(1L << GLIBTOP_PROC_IO_DISK_RBYTES) + (1L << GLIBTOP_PROC_IO_DISK_WBYTES); + +/* Init function. */ + +void +_glibtop_init_proc_io_s (glibtop *server) +{ + server->sysdeps.proc_io = _glibtop_sysdeps_proc_io; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_io_s (glibtop *server, glibtop_proc_io *buf, pid_t pid) +{ + char buffer [BUFSIZ], *p; + memset (buf, 0, sizeof (glibtop_proc_io)); + + if (server->os_version_code < LINUX_VERSION_CODE(2, 6, 20)) + return; + + if (proc_file_to_buffer(buffer, sizeof buffer, "/proc/%d/io", pid)) + return; + + p = skip_token (buffer); + buf->disk_rchar = g_ascii_strtoull (p, &p, 10); + p = skip_line (p); + p = skip_token (p); + buf->disk_wchar = g_ascii_strtoull (p, &p, 10); + p = skip_line (p); + p = skip_line (p); + p = skip_line (p); + p = skip_token (p); + buf->disk_rbytes = g_ascii_strtoull (p, &p, 10); + p = skip_line (p); + p = skip_token (p); + buf->disk_wbytes = g_ascii_strtoull (p, &p, 10); + + buf->flags = _glibtop_sysdeps_proc_io; +} diff --git a/sysdeps/linux/prockernel.c b/sysdeps/linux/prockernel.c new file mode 100644 index 0000000..3e513bf --- /dev/null +++ b/sysdeps/linux/prockernel.c @@ -0,0 +1,79 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_kernel = +(1L << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1L << GLIBTOP_PROC_KERNEL_MIN_FLT) + +(1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) + (1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) + +(1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT) + (1L << GLIBTOP_PROC_KERNEL_KSTK_ESP) + +(1L << GLIBTOP_PROC_KERNEL_KSTK_EIP) + (1L << GLIBTOP_PROC_KERNEL_NWCHAN) + +(1L << GLIBTOP_PROC_KERNEL_WCHAN); + +/* Init function. */ + +void +_glibtop_init_proc_kernel_s (glibtop *server) +{ + server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, pid_t pid) +{ + char buffer [BUFSIZ], *p; + + memset (buf, 0, sizeof (glibtop_proc_kernel)); + + if (proc_stat_to_buffer(buffer, sizeof buffer, pid)) + return; + + p = proc_stat_after_cmd (buffer); + if (!p) return; + + p = skip_multiple_token (p, 6); + + buf->k_flags = strtoull (p, &p, 0); + buf->min_flt = strtoull (p, &p, 0); + buf->cmin_flt = strtoull (p, &p, 0); + buf->maj_flt = strtoull (p, &p, 0); + buf->cmaj_flt = strtoull (p, &p, 0); + + p = skip_multiple_token (p, 15); + + buf->kstk_esp = strtoull (p, &p, 0); + buf->kstk_eip = strtoull (p, &p, 0); + + p = skip_multiple_token (p, 4); + + buf->nwchan = strtoull (p, &p, 0); + + proc_file_to_buffer(buf->wchan, sizeof buf->wchan, "/proc/%d/wchan", pid), + + buf->flags = _glibtop_sysdeps_proc_kernel; +} diff --git a/sysdeps/linux/proclist.c b/sysdeps/linux/proclist.c new file mode 100644 index 0000000..de1ce87 --- /dev/null +++ b/sysdeps/linux/proclist.c @@ -0,0 +1,169 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proclist = +(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) + +(1L << GLIBTOP_PROCLIST_SIZE); + +/* Init function. */ + +void +_glibtop_init_proclist_s (glibtop *server) +{ + server->sysdeps.proclist = _glibtop_sysdeps_proclist; +} + +/* Fetch list of currently running processes. + * + * The interface of this function is a little bit different from the others: + * buf->flags is only set if the call succeeded, in this case pids_chain, + * a list of the pids of all currently running processes is returned, + * buf->number is the number of elements of this list and buf->size is + * the size of one single element (sizeof (unsigned)). The total size is + * stored in buf->total. + * + * The calling function has to free the memory to which a pointer is returned. + * + * On error, NULL is returned and buf->flags is zero. */ + +pid_t* +glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg) +{ + DIR *proc; + struct dirent *entry; + GArray *pids; + glibtop_proc_uid procuid; + glibtop_proc_state procstate; + struct stat statb; + + memset (buf, 0, sizeof (glibtop_proclist)); + + proc = opendir ("/proc"); + if (!proc) return NULL; + + if(fstat(dirfd(proc), &statb) != 0) return NULL; + + pids = g_array_sized_new(FALSE, FALSE, sizeof(pid_t), statb.st_nlink); + + /* read every every entry in /proc */ + + while((entry = readdir (proc))) { + pid_t pid; + + if (entry->d_type != DT_DIR) + continue; + + if (!(pid = strtoul(entry->d_name, NULL, 10))) + continue; + + switch (which & GLIBTOP_KERN_PROC_MASK) { + case GLIBTOP_KERN_PROC_ALL: + break; + case GLIBTOP_KERN_PROC_PID: + if ((pid_t) arg != pid) + continue; + break; + case GLIBTOP_KERN_PROC_UID: + { + char path[32]; + struct stat path_stat; + + snprintf(path, sizeof path, "/proc/%u", (unsigned)pid); + + if (stat(path, &path_stat)) + continue; + + if ((uid_t) arg != path_stat.st_uid) + continue; + } + break; + case GLIBTOP_KERN_PROC_PGRP: + /* Do you really, really need this ? */ + glibtop_get_proc_uid_s (server, &procuid, pid); + if (procuid.flags & (1L << GLIBTOP_PROC_UID_PGRP)) + if ((int) arg != procuid.pgrp) + continue; + break; + case GLIBTOP_KERN_PROC_SESSION: + /* Do you really, really need this ? */ + glibtop_get_proc_uid_s (server, &procuid, pid); + if (procuid.flags & (1L << GLIBTOP_PROC_UID_SESSION)) + if ((int) arg != procuid.session) + continue; + break; + case GLIBTOP_KERN_PROC_TTY: + /* Do you really, really need this ? */ + glibtop_get_proc_uid_s (server, &procuid, pid); + if (procuid.flags & (1L << GLIBTOP_PROC_UID_TTY)) + if ((int) arg != procuid.tty) + continue; + break; + case GLIBTOP_KERN_PROC_RUID: + /* Do you really, really need this ? */ + glibtop_get_proc_uid_s (server, &procuid, pid); + if (procuid.flags & (1L << GLIBTOP_PROC_UID_EUID)) + if ((int) arg != procuid.euid) + continue; + break; + } + + if (which & GLIBTOP_EXCLUDE_NOTTY) { + glibtop_get_proc_uid_s (server, &procuid, pid); + if (procuid.flags & (1L << GLIBTOP_PROC_UID_TTY)) + if (procuid.tty == -1) continue; + } + + if (which & GLIBTOP_EXCLUDE_IDLE) { + glibtop_get_proc_state_s (server, &procstate, pid); + if (procstate.flags & (1L << GLIBTOP_PROC_STATE_STATE)) + if (procstate.state != GLIBTOP_PROCESS_RUNNING) continue; + } + + if (which & GLIBTOP_EXCLUDE_SYSTEM) { + glibtop_get_proc_uid_s (server, &procuid, pid); + if (procuid.flags & (1L << GLIBTOP_PROC_UID_UID)) + if (procuid.uid == 0) continue; + } + + g_array_append_val(pids, pid); + } + + closedir (proc); + + buf->flags = _glibtop_sysdeps_proclist; + buf->size = sizeof(pid_t); + buf->number = pids->len; + buf->total = buf->number * buf->size; + + return (pid_t*)g_array_free(pids, FALSE); +} diff --git a/sysdeps/linux/procmap.c b/sysdeps/linux/procmap.c new file mode 100644 index 0000000..546d08a --- /dev/null +++ b/sysdeps/linux/procmap.c @@ -0,0 +1,318 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include +#include + +#include "glibtop_private.h" + +#include "procmap_smaps.c" + +#define MAPS_FILE "/proc/%u/maps" +#define SMAPS_FILE "/proc/%u/smaps" + + +#define PROC_MAPS_FORMAT "%16" G_GINT64_MODIFIER "x-%16" G_GINT64_MODIFIER "x %4c %16" G_GINT64_MODIFIER "x %02hx:%02hx %" G_GINT64_MODIFIER "u%*[ ]%n" + + +static const unsigned long _glibtop_sysdeps_proc_map = +(1L << GLIBTOP_PROC_MAP_NUMBER) + (1L << GLIBTOP_PROC_MAP_TOTAL) + +(1L << GLIBTOP_PROC_MAP_SIZE); + +static const unsigned long _glibtop_sysdeps_map_entry = +(1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) + +(1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) + +(1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE) + +(1L << GLIBTOP_MAP_ENTRY_FILENAME); + +static const unsigned long _glibtop_sysdeps_map_entry_smaps = +(1UL << GLIBTOP_MAP_ENTRY_SIZE) + (1UL << GLIBTOP_MAP_ENTRY_RSS) + +(1UL << GLIBTOP_MAP_ENTRY_PSS) + (1UL << GLIBTOP_MAP_ENTRY_SWAP) + +(1UL << GLIBTOP_MAP_ENTRY_SHARED_DIRTY) + (1UL << GLIBTOP_MAP_ENTRY_SHARED_CLEAN) + +(1UL << GLIBTOP_MAP_ENTRY_PRIVATE_DIRTY) + (1UL << GLIBTOP_MAP_ENTRY_PRIVATE_CLEAN); + + +/* Init function. */ + +void +_glibtop_init_proc_map_s (glibtop *server) +{ + server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; +} + +/* Provides detailed information about a process. */ + + +static const char* +is_smap_value(const char* s) +{ + for ( ; *s; ++s) { + + if (isspace(*s)) + return NULL; + + if (*s == ':') + return s; + } + + return NULL; +} + + +/* + Returns whether line is a 'value' line + and add if we know its meaning +*/ +static gboolean +parse_smaps(glibtop_map_entry *entry, const char* line) +{ + + const struct smap_value* smap; + size_t len; + const char* colon; + + if ((colon = is_smap_value(line)) == NULL) + return FALSE; + + len = colon - line; + smap = _glibtop_find_smap(line, len); + +// g_debug("smap %s -> %p", line, smap); + + if (smap) { + char *offset; + guint64 *value; + + offset = (void*) entry; + offset += smap->offset; + value = (void*) offset; + + *value = get_scaled(line + len, NULL); + } + + return TRUE; +} + + +/* + sscanf is too slow + and system-monitor calls procmap for each pid every second + + manual parsing is faster + + error checking is weaker +*/ + +static gboolean +parse_line(char* line, + guint64* start, guint64* end, char flags[4], guint64* offset, + gushort* dev_major, gushort* dev_minor, guint64* inode, + char** filename) +{ + /* %16llx-%16llx %4c %16llx %02hx:%02hx %llu%*[ ]%n */ + + char *p, *next; + + p = line; + + *start = strtoull(p, &p, 16); + + if (G_UNLIKELY(*p != '-')) + return FALSE; + p++; + + *end = strtoull(p, &p, 16); + + p = next_token(p); + + memcpy(flags, p, 4); + p += 4; + + *offset = strtoull(p, &p, 16); + + *dev_major = strtoul(p, &p, 16); + + if (G_UNLIKELY(*p != ':')) + return FALSE; + p++; + + *dev_minor = strtoul(p, &p, 16); + + *inode = strtoull(p, &p, 10); + + p = next_token(p); + + *filename = p; + + for ( ; *p; p++) { + if (*p == '\n') { + *p = '\0'; + break; + } + } + + return TRUE; +} + + + + + +glibtop_map_entry * +glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid) +{ + char procfilename[GLIBTOP_MAP_FILENAME_LEN+1]; + + /* + default size of 100 maybe inaccurate. + It's the average number of entry per process on my laptop + */ + + size_t added = 0, entry_list_capacity = 100; + GArray *entry_list = g_array_sized_new(FALSE, FALSE, + sizeof(glibtop_map_entry), + entry_list_capacity); + FILE *maps; + const char *filename; + gboolean has_smaps; + char *line = NULL; + size_t line_size = 0; + + memset (buf, 0, sizeof (glibtop_proc_map)); + + has_smaps = server->os_version_code >= LINUX_VERSION_CODE(2, 6, 14); + + if (has_smaps) + filename = SMAPS_FILE; + else + filename = MAPS_FILE; + + snprintf (procfilename, sizeof procfilename, filename, (unsigned)pid); + + if((maps = fopen (procfilename, "r")) == NULL) { + return (glibtop_map_entry*) g_array_free(entry_list, TRUE); + } + + while(TRUE) + { + unsigned long perm; + /* int line_end; */ + + unsigned short dev_major, dev_minor; + guint64 start, end, offset, inode; + char flags[4]; + char *filename; + + glibtop_map_entry *entry; + + if (getline(&line, &line_size, maps) == -1) + break; + + new_entry_line: + + if (!parse_line(line, + &start, &end, flags, &offset, + &dev_major, &dev_minor, &inode, &filename)) + continue; + + /* + if (sscanf(line, PROC_MAPS_FORMAT, + &start, &end, flags, &offset, + &dev_major, &dev_minor, &inode, &line_end) != 7) + continue; + + filename = line + line_end; + g_strstrip(filename); + */ + + /* Compute access permissions. */ + perm = 0; + + if (flags [0] == 'r') + perm |= GLIBTOP_MAP_PERM_READ; + + if (flags [1] == 'w') + perm |= GLIBTOP_MAP_PERM_WRITE; + + if (flags [2] == 'x') + perm |= GLIBTOP_MAP_PERM_EXECUTE; + + if (flags [3] == 's') + perm |= GLIBTOP_MAP_PERM_SHARED; + else if (flags [3] == 'p') + perm |= GLIBTOP_MAP_PERM_PRIVATE; + + /* + avoid copying the entry, grow by 1 and point to the last + element. + */ + + if (G_UNLIKELY(added >= entry_list_capacity)) { + entry_list_capacity *= 2; + g_array_set_size(entry_list, entry_list_capacity); + } + + entry = &g_array_index(entry_list, glibtop_map_entry, added++); + + entry->flags = _glibtop_sysdeps_map_entry; + entry->start = start; + entry->end = end; + entry->offset = offset; + entry->perm = perm; + entry->device = MKDEV(dev_major, dev_minor); + entry->inode = inode; + g_strlcpy(entry->filename, filename, sizeof entry->filename); + + if (has_smaps) { + ssize_t ret; + entry->flags |= _glibtop_sysdeps_map_entry_smaps; + + while ((ret = getline(&line, &line_size, maps)) != -1) { + if (!parse_smaps(entry, line)) + goto new_entry_line; + } + + if (ret == -1) + goto eof; + } + } + +eof: + + g_array_set_size(entry_list, added); + free(line); + fclose (maps); + + buf->flags = _glibtop_sysdeps_proc_map; + + buf->number = added; + buf->size = sizeof (glibtop_map_entry); + buf->total = buf->number * buf->size; + + return (glibtop_map_entry*) g_array_free(entry_list, FALSE); +} diff --git a/sysdeps/linux/procmap_smaps.c b/sysdeps/linux/procmap_smaps.c new file mode 100644 index 0000000..132a072 --- /dev/null +++ b/sysdeps/linux/procmap_smaps.c @@ -0,0 +1,161 @@ +/* ANSI-C code produced by gperf version 3.1 */ +/* Command-line: gperf sysdeps/linux/procmap_smaps.gperf */ +/* Computed positions: -k'1,$' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to ." +#endif + +#line 8 "sysdeps/linux/procmap_smaps.gperf" + +#include "glibtop_private.h" +#include +#include +#define SMAP_OFFSET(MEMBER) offsetof(glibtop_map_entry, MEMBER) +#line 14 "sysdeps/linux/procmap_smaps.gperf" +struct smap_value { int name; ptrdiff_t offset; }; +#include + +#define TOTAL_KEYWORDS 8 +#define MIN_WORD_LENGTH 3 +#define MAX_WORD_LENGTH 13 +#define MIN_HASH_VALUE 3 +#define MAX_HASH_VALUE 18 +/* maximum key range = 16, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +hash (register const char *str, register size_t len) +{ + static const unsigned char asso_values[] = + { + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 0, 19, 5, 0, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 5, 19, 19, 19, 19, 19, 19, 19, 19, + 5, 19, 0, 19, 19, 0, 19, 19, 19, 19, + 19, 0, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19 + }; + return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]]; +} + +struct stringpool_t + { + char stringpool_str3[sizeof("Pss")]; + char stringpool_str4[sizeof("Swap")]; + char stringpool_str8[sizeof("Rss")]; + char stringpool_str9[sizeof("Size")]; + char stringpool_str12[sizeof("Shared_Dirty")]; + char stringpool_str13[sizeof("Private_Dirty")]; + char stringpool_str17[sizeof("Shared_Clean")]; + char stringpool_str18[sizeof("Private_Clean")]; + }; +static const struct stringpool_t stringpool_contents = + { + "Pss", + "Swap", + "Rss", + "Size", + "Shared_Dirty", + "Private_Dirty", + "Shared_Clean", + "Private_Clean" + }; +#define stringpool ((const char *) &stringpool_contents) +static /* manually added */ +const struct smap_value * +_glibtop_find_smap (register const char *str, register size_t len) +{ + static const unsigned char lengthtable[] = + { + 0, 0, 0, 3, 4, 0, 0, 0, 3, 4, 0, 0, 12, 13, + 0, 0, 0, 12, 13 + }; + static const struct smap_value wordlist[] = + { + {-1}, {-1}, {-1}, +#line 18 "sysdeps/linux/procmap_smaps.gperf" + {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str3, SMAP_OFFSET(pss)}, +#line 23 "sysdeps/linux/procmap_smaps.gperf" + {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str4, SMAP_OFFSET(swap),}, + {-1}, {-1}, {-1}, +#line 19 "sysdeps/linux/procmap_smaps.gperf" + {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, SMAP_OFFSET(rss)}, +#line 22 "sysdeps/linux/procmap_smaps.gperf" + {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, SMAP_OFFSET(size)}, + {-1}, {-1}, +#line 21 "sysdeps/linux/procmap_smaps.gperf" + {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, SMAP_OFFSET(shared_dirty)}, +#line 17 "sysdeps/linux/procmap_smaps.gperf" + {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, SMAP_OFFSET(private_dirty)}, + {-1}, {-1}, {-1}, +#line 20 "sysdeps/linux/procmap_smaps.gperf" + {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, SMAP_OFFSET(shared_clean)}, +#line 16 "sysdeps/linux/procmap_smaps.gperf" + {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, SMAP_OFFSET(private_clean)} + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register unsigned int key = hash (str, len); + + if (key <= MAX_HASH_VALUE) + if (len == lengthtable[key]) + { + register const char *s = wordlist[key].name + stringpool; + + if (*str == *s && !memcmp (str + 1, s + 1, len - 1)) + return &wordlist[key]; + } + } + return 0; +} diff --git a/sysdeps/linux/procmap_smaps.gperf b/sysdeps/linux/procmap_smaps.gperf new file mode 100644 index 0000000..a3fd4b2 --- /dev/null +++ b/sysdeps/linux/procmap_smaps.gperf @@ -0,0 +1,23 @@ +%language=ANSI-C +%includes +%struct-type +%readonly-tables +%pic +%define lookup-function-name _glibtop_find_smap +%compare-lengths +%{ +#include "glibtop_private.h" +#include +#include +#define SMAP_OFFSET(MEMBER) offsetof(glibtop_map_entry, MEMBER) +%} +struct smap_value { int name; ptrdiff_t offset; }; +%% +Private_Clean, SMAP_OFFSET(private_clean) +Private_Dirty, SMAP_OFFSET(private_dirty) +Pss, SMAP_OFFSET(pss) +Rss, SMAP_OFFSET(rss) +Shared_Clean, SMAP_OFFSET(shared_clean) +Shared_Dirty, SMAP_OFFSET(shared_dirty) +Size, SMAP_OFFSET(size) +Swap, SMAP_OFFSET(swap), diff --git a/sysdeps/linux/procmem.c b/sysdeps/linux/procmem.c new file mode 100644 index 0000000..523fd62 --- /dev/null +++ b/sysdeps/linux/procmem.c @@ -0,0 +1,144 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_mem = +(1L << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_RESIDENT) + +(1L << GLIBTOP_PROC_MEM_SHARE); + +static const unsigned long _glibtop_sysdeps_proc_mem_pss = +(1L << GLIBTOP_PROC_MEM_RSS); + + +static unsigned long +get_pss(glibtop* server, pid_t pid) +{ + char filepath[128]; + FILE* smaps; + char* line = NULL; + size_t line_size = 0; + unsigned long pss = 0; + + snprintf(filepath, sizeof filepath, "/proc/%u/smaps", (unsigned)pid); + + if (!(smaps = fopen(filepath, "r"))) { + glibtop_error_io_r(server, "Cannot open %s", filepath); + goto out; + } + + while (getline(&line, &line_size, smaps) != -1) { + if (strncmp(line, "Pss:", 4)) + continue; + pss += get_scaled(line + 4, NULL); + } + +out: + if (smaps) + fclose(smaps); + + free(line); + + return pss; +} + + +/* Init function. */ + +void +_glibtop_init_proc_mem_s (glibtop *server) +{ + server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem; + if (server->os_version_code >= LINUX_VERSION_CODE(2, 6, 25)) + server->sysdeps.proc_mem |= _glibtop_sysdeps_proc_mem_pss; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid) +{ + char buffer [BUFSIZ], *p; + const size_t pagesize = getpagesize(); + + memset (buf, 0, sizeof (glibtop_proc_mem)); + + /* As of 2.6.24 in fs/proc/*.c + + == rss vs. resident == + + stat/rss: + get_mm_rss where + #define get_mm_rss(mm) \ + (get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss)) + + statm/resident: + *shared = get_mm_counter(mm, file_rss); + *resident = *shared + get_mm_counter(mm, anon_rss); + + == vsize vs. size == + + stat/vsize: + task_vsize(mm) ... total_vm * pagesize + + statm/size + mm->total_vm + + ================= + rss == resident + vsize == size + rss_lim is not implemented in statm, but there's limits which + provides all limits + share is only implemented in statm + */ + + if (proc_statm_to_buffer(buffer, sizeof buffer, pid)) + return; + + buf->size = strtoull (buffer, &p, 0); + buf->resident = strtoull (p, &p, 0); + buf->share = strtoull (p, &p, 0); + + buf->size *= pagesize; + buf->resident *= pagesize; + buf->share *= pagesize; + + /* dummy values */ + buf->vsize = buf->size; + buf->rss_rlim = ~0; + + buf->flags |= _glibtop_sysdeps_proc_mem; + +#if 0 + /* FIXME: see previous comment */ + if (server->os_version_code >= LINUX_VERSION_CODE(2, 6, 25)) { + buf->rss = get_pss(server, pid); + buf->flags |= _glibtop_sysdeps_proc_mem_pss; + } +#else + buf->rss = buf->resident; +#endif +} diff --git a/sysdeps/linux/procopenfiles.c b/sysdeps/linux/procopenfiles.c new file mode 100644 index 0000000..caed854 --- /dev/null +++ b/sysdeps/linux/procopenfiles.c @@ -0,0 +1,324 @@ +/* Copyright (C) 1998-99 Martin Baulig + Copyright (C) 2004 Nicolás Lichtmaier + This file is part of LibGTop 1.0. + + Modified by Nicolás Lichtmaier to give a process open files. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_open_files = +(1L << GLIBTOP_PROC_OPEN_FILES_NUMBER)| +(1L << GLIBTOP_PROC_OPEN_FILES_TOTAL)| +(1L << GLIBTOP_PROC_OPEN_FILES_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_open_files_s (glibtop *server) +{ + server->sysdeps.proc_open_files = _glibtop_sysdeps_proc_open_files; +} + + + +typedef void (*LineParser)(GHashTable *dict, const char *line); + + +static void +parse_file(const char *filename, LineParser parser, GHashTable *dict) +{ + FILE *f; + char *line = NULL; + size_t size = 0; + + f = fopen(filename, "r"); + + if(!f) { + g_warning("Cannot open '%s'", filename); + return; + } + + + /* skip the first line */ + if (getline(&line, &size, f) == -1) + goto eof; + + while (getline(&line, &size, f) != -1) + parser(dict, line); + + eof: + free(line); + fclose(f); +} + + +static GHashTable* +get_all(const char *filename, LineParser parser) +{ + GHashTable *dict; + + dict = g_hash_table_new_full(g_direct_hash, g_direct_equal, + NULL, g_free); + + parse_file(filename, parser, dict); + + return dict; +} + + + + + +struct Inet6SocketEntry +{ + char host[GLIBTOP_OPEN_DEST_HOST_LEN + 1]; + int port; +}; + + +static void +inet6_socket_parser(GHashTable *dict, const char* line) +{ + struct Inet6SocketEntry *se; + int sock; + struct in6_addr addr; + + se = g_malloc0(sizeof *se); + + if(sscanf(line, "%*d: %*s %8x%8x%8x%8x:%4x %*x %*x:%*x %*x:%*x %*d %*d %*d %d", + &addr.s6_addr32[0], &addr.s6_addr32[1], &addr.s6_addr32[2], + &addr.s6_addr32[3], &se->port, &sock) != 6) + goto error; + + if(!inet_ntop(AF_INET6, &addr, se->host, sizeof se->host)) + goto error; + + g_hash_table_insert(dict, GINT_TO_POINTER(sock), se); + return; + + error: + g_free(se); +} + + +static inline GHashTable * +get_all_inet6_sockets() +{ + return get_all("/proc/net/tcp6", inet6_socket_parser); +} + + + + + +struct InetSocketEntry +{ + char host[GLIBTOP_OPEN_DEST_HOST_LEN + 1]; + int port; +}; + + +static void +inet_socket_parser(GHashTable *dict, const char* line) +{ + struct InetSocketEntry *se; + int sock; + unsigned addr; + + se = g_malloc0(sizeof *se); + + if(sscanf(line, "%*d: %*x:%*x %8x:%4x %*x %*x:%*x %*x:%*x %*d %*d %*d %d", + &addr, &se->port, &sock) != 3) + goto error; + + if(!inet_ntop(AF_INET, &addr, se->host, sizeof se->host)) + goto error; + + g_hash_table_insert(dict, GINT_TO_POINTER(sock), se); + return; + + error: + g_free(se); +} + + +static inline GHashTable * +get_all_inet_sockets() +{ + return get_all("/proc/net/tcp", inet_socket_parser); +} + + + + + +struct LocalSocketEntry +{ + char name[GLIBTOP_OPEN_DEST_HOST_LEN + 1]; +}; + + +static void +local_socket_parser(GHashTable *dict, const char *line) +{ + int sock; + struct LocalSocketEntry *use; + char *p; + + use = g_malloc0(sizeof *use); + + /* dfaf1640: 00000003 00000000 00000000 0001 03 6457 /dev/log */ + p = skip_multiple_token(line, 6); + + sock = strtoul(p, &p, 10); + g_strlcpy(use->name, p, sizeof use->name); + g_strstrip(use->name); + g_hash_table_insert(dict, GINT_TO_POINTER(sock), use); +} + + +static inline GHashTable * +get_all_local_sockets() +{ + return get_all("/proc/net/unix", local_socket_parser); +} + + + +/* Provides detailed information about a process' open files */ + +glibtop_open_files_entry * +glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pid_t pid) +{ + char fn [BUFSIZ]; + GArray *entries; + GHashTable *inet6_sockets = NULL, *inet_sockets = NULL, *local_sockets = NULL; + struct dirent *direntry; + DIR *dir; + + memset (buf, 0, sizeof (glibtop_proc_open_files)); + + sprintf (fn, "/proc/%d/fd", pid); + + dir = opendir (fn); + if (!dir) return NULL; + + entries = g_array_new(FALSE, FALSE, sizeof(glibtop_open_files_entry)); + + while((direntry = readdir(dir))) { + char tgt [BUFSIZ]; + glibtop_open_files_entry entry = {0}; + + if(direntry->d_name[0] == '.') + continue; + + g_snprintf(fn, sizeof fn, "/proc/%d/fd/%s", + pid, direntry->d_name); + + if (!safe_readlink(fn, tgt, sizeof tgt)) + continue; + + entry.fd = atoi(direntry->d_name); + + if(g_str_has_prefix(tgt, "socket:[")) + { + int sockfd; + struct Inet6SocketEntry *i6se; + struct InetSocketEntry *ise; + struct LocalSocketEntry *lse; + + if(!inet6_sockets) inet6_sockets = get_all_inet6_sockets(); + if(!inet_sockets) inet_sockets = get_all_inet_sockets(); + if(!local_sockets) local_sockets = get_all_local_sockets(); + + sockfd = atoi(tgt + 8); + + i6se = g_hash_table_lookup(inet6_sockets, + GINT_TO_POINTER(sockfd)); + + if(i6se) { + entry.type = GLIBTOP_FILE_TYPE_INET6SOCKET; + entry.info.sock.dest_port = i6se->port; + g_strlcpy(entry.info.sock.dest_host, i6se->host, + sizeof entry.info.sock.dest_host); + goto found; + } + + ise = g_hash_table_lookup(inet_sockets, + GINT_TO_POINTER(sockfd)); + + if(ise) { + entry.type = GLIBTOP_FILE_TYPE_INETSOCKET; + entry.info.sock.dest_port = ise->port; + g_strlcpy(entry.info.sock.dest_host, ise->host, + sizeof entry.info.sock.dest_host); + goto found; + } + + lse = g_hash_table_lookup(local_sockets, + GINT_TO_POINTER(sockfd)); + + if(lse) { + entry.type = GLIBTOP_FILE_TYPE_LOCALSOCKET; + g_strlcpy(entry.info.localsock.name, lse->name, + sizeof entry.info.localsock.name); + goto found; + } + + found: + (void)0; /* kills warning */ + } + else if(g_str_has_prefix(tgt, "pipe:[")) + { + entry.type = GLIBTOP_FILE_TYPE_PIPE; + } + else + { + entry.type = GLIBTOP_FILE_TYPE_FILE; + g_strlcpy(entry.info.file.name, tgt, sizeof entry.info.file.name); + } + + g_array_append_val(entries, entry); + } + + closedir (dir); + + if(inet_sockets) g_hash_table_destroy(inet_sockets); + if(inet6_sockets) g_hash_table_destroy(inet6_sockets); + if(local_sockets) g_hash_table_destroy(local_sockets); + + buf->flags = _glibtop_sysdeps_proc_open_files; + buf->number = entries->len; + buf->size = sizeof(glibtop_open_files_entry); + buf->total = buf->number * buf->size; + + return (glibtop_open_files_entry*)g_array_free(entries, FALSE); +} diff --git a/sysdeps/linux/procsegment.c b/sysdeps/linux/procsegment.c new file mode 100644 index 0000000..b190203 --- /dev/null +++ b/sysdeps/linux/procsegment.c @@ -0,0 +1,93 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_segment = +(1L << GLIBTOP_PROC_SEGMENT_START_CODE) + +(1L << GLIBTOP_PROC_SEGMENT_END_CODE) + +(1L << GLIBTOP_PROC_SEGMENT_START_STACK); + +static const unsigned long _glibtop_sysdeps_proc_segment_statm = +(1L << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + +/* Disabled due to bug in the Linux Kernel. */ +/* (1L << GLIBTOP_PROC_SEGMENT_SHLIB_RSS) + */ +(1L << GLIBTOP_PROC_SEGMENT_DATA_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_DIRTY_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_segment_s (glibtop *server) +{ + server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment | + _glibtop_sysdeps_proc_segment_statm; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf, + pid_t pid) +{ + char buffer [BUFSIZ], *p; + const size_t pagesize = getpagesize(); + + memset (buf, 0, sizeof (glibtop_proc_segment)); + + if (proc_stat_to_buffer(buffer, sizeof buffer, pid)) + return; + + p = proc_stat_after_cmd (buffer); + if (!p) return; + + p = skip_multiple_token (p, 23); + + buf->start_code = strtoull (p, &p, 0); + buf->end_code = strtoull (p, &p, 0); + buf->start_stack = strtoull (p, &p, 0); + + buf->flags = _glibtop_sysdeps_proc_segment; + + if (proc_statm_to_buffer(buffer, sizeof buffer, pid)) + return; + + p = skip_multiple_token (buffer, 3); + + /* This doesn't work very well due to a bug in the Linux kernel. + * I'll submit a patch to the kernel mailing list soon. */ + + buf->text_rss = strtoull (p, &p, 0); + buf->shlib_rss = strtoull (p, &p, 0); + buf->data_rss = strtoull (p, &p, 0); + buf->dirty_size = strtoull (p, &p, 0); + + buf->text_rss *= pagesize; + buf->shlib_rss *= pagesize; + buf->data_rss *= pagesize; + buf->dirty_size *= pagesize; + + buf->flags |= _glibtop_sysdeps_proc_segment_statm; +} diff --git a/sysdeps/linux/procsignal.c b/sysdeps/linux/procsignal.c new file mode 100644 index 0000000..0fc9dca --- /dev/null +++ b/sysdeps/linux/procsignal.c @@ -0,0 +1,64 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_signal = +(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1L << GLIBTOP_PROC_SIGNAL_BLOCKED) + +(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1L << GLIBTOP_PROC_SIGNAL_SIGCATCH); + +/* Init function. */ + +void +_glibtop_init_proc_signal_s (glibtop *server) +{ + server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, pid_t pid) +{ + char buffer [BUFSIZ], *p; + + memset (buf, 0, sizeof (glibtop_proc_signal)); + + if (proc_stat_to_buffer(buffer, sizeof buffer, pid)) + return; + + p = proc_stat_after_cmd (buffer); + if (!p) return; + + p = skip_multiple_token (p, 28); + + buf->signal [0] = strtoull (p, &p, 0); + buf->blocked [0] = strtoull (p, &p, 0); + buf->sigignore [0] = strtoull (p, &p, 0); + buf->sigcatch [0] = strtoull (p, &p, 0); + + buf->flags = _glibtop_sysdeps_proc_signal; +} diff --git a/sysdeps/linux/procstate.c b/sysdeps/linux/procstate.c new file mode 100644 index 0000000..9fd173d --- /dev/null +++ b/sysdeps/linux/procstate.c @@ -0,0 +1,123 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "glibtop_private.h" + +#include + +static const unsigned long _glibtop_sysdeps_proc_state = +(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_STATE); + +static const unsigned long _glibtop_sysdeps_proc_state_uid = +(1L << GLIBTOP_PROC_STATE_UID) + (1L << GLIBTOP_PROC_STATE_GID); + +/* Init function. */ + +void +_glibtop_init_proc_state_s (glibtop *server) +{ + server->sysdeps.proc_state = _glibtop_sysdeps_proc_state | + _glibtop_sysdeps_proc_state_uid; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid) +{ + char buffer [BUFSIZ], *p; + struct stat statb; + + memset (buf, 0, sizeof (glibtop_proc_state)); + + /* IMPORTANT NOTICE: For security reasons it is extremely important + * that the 'uid' and 'gid' fields have correct + * values; NEVER set their flags values if this + * is not the case !!! */ + + sprintf (buffer, "/proc/%d", pid); + + if (stat (buffer, &statb)) + return; + + /* For security reasons we use stat () since it is + * more failsafe than parsing the file. */ + + buf->uid = statb.st_uid; + buf->gid = statb.st_gid; + + buf->flags = _glibtop_sysdeps_proc_state_uid; + + /* Now we read the remaining fields. */ + + if (proc_stat_to_buffer(buffer, sizeof buffer, pid)) + return; + + p = proc_stat_after_cmd(buffer); + p = next_token(p); + + switch(*p) + { + case 'R': + buf->state = GLIBTOP_PROCESS_RUNNING; + break; + + case 'Z': + buf->state = GLIBTOP_PROCESS_ZOMBIE; + break; + + case 'S': + buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE; + break; + + case 'T': + buf->state = GLIBTOP_PROCESS_STOPPED; + break; + + case 'D': + buf->state = GLIBTOP_PROCESS_UNINTERRUPTIBLE; + break; + + case 'W': + buf->state = GLIBTOP_PROCESS_SWAPPING; + break; + + case 'X': + buf->state = GLIBTOP_PROCESS_DEAD; + break; + } + + p = skip_multiple_token (p, 36); + buf->last_processor = atoi (p); + + p = skip_token (buffer); /* pid */ + if (G_UNLIKELY(*p++ != '(')) + glibtop_error_r (server, "Bad data in /proc/%d/stat", pid); + + g_strlcpy (buf->cmd, p, sizeof buf->cmd); + + buf->flags |= _glibtop_sysdeps_proc_state; +} diff --git a/sysdeps/linux/proctime.c b/sysdeps/linux/proctime.c new file mode 100644 index 0000000..20be904 --- /dev/null +++ b/sysdeps/linux/proctime.c @@ -0,0 +1,132 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_time = +(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_CUTIME) + +(1L << GLIBTOP_PROC_TIME_RTIME) + +(1L << GLIBTOP_PROC_TIME_STIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) + +(1L << GLIBTOP_PROC_TIME_FREQUENCY) + (1L << GLIBTOP_PROC_TIME_TIMEOUT) + +(1L << GLIBTOP_PROC_TIME_IT_REAL_VALUE) + (1L << GLIBTOP_PROC_TIME_START_TIME); + +static const unsigned long _glibtop_sysdeps_proc_time_smp = +(1L << GLIBTOP_PROC_TIME_XCPU_UTIME) + (1L << GLIBTOP_PROC_TIME_XCPU_STIME); + +/* Init function. */ + +void +_glibtop_init_proc_time_s (glibtop *server) +{ + server->sysdeps.proc_time = _glibtop_sysdeps_proc_time; + + if (server->ncpu) + server->sysdeps.proc_time |= _glibtop_sysdeps_proc_time_smp; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid) +{ + char buffer [BUFSIZ], *p; + int i; + + memset (buf, 0, sizeof (glibtop_proc_time)); + + if (proc_stat_to_buffer(buffer, sizeof buffer, pid)) + return; + + p = proc_stat_after_cmd (buffer); + if (!p) return; + + p = skip_multiple_token (p, 11); + + /* clock_t (1/100 s) */ + buf->utime = strtoull (p, &p, 0); + buf->stime = strtoull (p, &p, 0); + buf->rtime = buf->utime + buf->stime; + + buf->cutime = strtoull (p, &p, 0); + buf->cstime = strtoull (p, &p, 0); + + p = skip_multiple_token (p, 3); + + /* timeout is 0 on 2.4 and "thread_number" on 2.6 + lets skip it (using previous skip_multiple_token) + buf->timeout = strtoull (p, &p, 0); + */ + buf->it_real_value = strtoull (p, &p, 0); + + /* seconds since epoch */ + { + /* + See libgtop documentation. + + #ifdef __KERNEL__ + ... + * + * Have the 32 bit jiffies value wrap 5 minutes after boot + * so jiffies wrap bugs show up earlier. + * + #define INITIAL_JIFFIES ((unsigned long)(unsigned int) (-300*HZ)) + ... + #endif + + start_time may be incremented by INITIAL_JIFFIES, so start_time + may be not be exact. You may also get wrong start_time if your + system clock is not synchronised with you hardware clock. + 'man hwclock' + */ + buf->start_time = get_boot_time(server) + strtoull (p, &p, 0) / 100; + } + + buf->frequency = 100; + + buf->flags = _glibtop_sysdeps_proc_time; + + if (!server->ncpu) + return; + + /* FIXME: doesn't work with 2.6 */ + if (proc_file_to_buffer(buffer, sizeof buffer, "/proc/%d/cpu", pid)) + return; + + p = skip_multiple_token (p, 3); + + for (i = 0; i <= server->ncpu; i++) { + + if (!check_cpu_line_warn(server, p + 1, i)) + break; + + p = skip_token(p); + buf->xcpu_utime [i] = strtoull (p, &p, 0); + buf->xcpu_stime [i] = strtoull (p, &p, 0); + } + + buf->flags |= _glibtop_sysdeps_proc_time_smp; +} diff --git a/sysdeps/linux/procuid.c b/sysdeps/linux/procuid.c new file mode 100644 index 0000000..0dfc1d2 --- /dev/null +++ b/sysdeps/linux/procuid.c @@ -0,0 +1,124 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_uid = +(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) + +(1L << GLIBTOP_PROC_UID_GID) + (1L << GLIBTOP_PROC_UID_EGID); + +static const unsigned long _glibtop_sysdeps_proc_uid_stat = +(1L << GLIBTOP_PROC_UID_PID) + (1L << GLIBTOP_PROC_UID_PPID) + +(1L << GLIBTOP_PROC_UID_PGRP) + (1L << GLIBTOP_PROC_UID_SESSION) + +(1L << GLIBTOP_PROC_UID_TTY) + (1L << GLIBTOP_PROC_UID_TPGID) + +(1L << GLIBTOP_PROC_UID_PRIORITY) + (1L << GLIBTOP_PROC_UID_NICE); + + +/* Init function. */ + +void +_glibtop_init_proc_uid_s (glibtop *server) +{ + server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid | + _glibtop_sysdeps_proc_uid_stat; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid) +{ + char buffer [BUFSIZ], *p; + + memset (buf, 0, sizeof (glibtop_proc_uid)); + + if (proc_status_to_buffer(buffer, sizeof buffer, pid)) + return; + + /* Search substring 'Pid:' */ + + p = strstr (buffer, "\nPid:"); + if (!p) return; + + p = skip_token (p); /* "Pid:" */ + buf->pid = strtol (p, &p, 0); + + p = skip_token (p); /* "PPid:" */ + buf->ppid = strtol (p, &p, 0); + + /* Maybe future Linux versions place something between + * "PPid" and "Uid", so we catch this here. */ + p = strstr (p, "\nUid:"); + if (!p) return; + + p = skip_token (p); /* "Uid:" */ + buf->uid = strtol (p, &p, 0); + buf->euid = strtol (p, &p, 0); + + /* We don't know how many entries on the "Uid:" line + * future Linux version will have, so we catch this here. */ + p = strstr (p, "\nGid:"); + if (!p) return; + + p = skip_token (p); /* "Gid:" */ + buf->gid = strtol (p, &p, 0); + buf->egid = strtol (p, &p, 0); + + buf->flags = _glibtop_sysdeps_proc_uid; + + if (proc_stat_to_buffer(buffer, sizeof buffer, pid)) + return; + + p = proc_stat_after_cmd (buffer); + if (!p) return; + + p = skip_multiple_token (p, 2); + + buf->pgrp = strtol (p, &p, 0); + buf->session = strtol (p, &p, 0); + buf->tty = strtol (p, &p, 0); + buf->tpgid = strtol (p, &p, 0); + + p = skip_multiple_token (p, 9); + + buf->priority = strtol (p, &p, 0); + buf->nice = strtol (p, &p, 0); + + if (buf->tty == 0) + /* the old notty val, update elsewhere bef. moving to 0 */ + buf->tty = -1; + + if (server->os_version_code < LINUX_VERSION_CODE(1,3,39)) { + /* map old meanings to new */ + buf->priority = 2*15 - buf->priority; + buf->nice = 15 - buf->nice; + } + else if (server->os_version_code < LINUX_VERSION_CODE(1,1,30) && buf->tty != -1) + /* when tty wasn't full devno */ + buf->tty = 4*0x100 + buf->tty; + + buf->flags |= _glibtop_sysdeps_proc_uid_stat; +} diff --git a/sysdeps/linux/procwd.c b/sysdeps/linux/procwd.c new file mode 100644 index 0000000..a5af41c --- /dev/null +++ b/sysdeps/linux/procwd.c @@ -0,0 +1,99 @@ +/* Copyright (C) 2007 Benoît Dejean + This file is part of LibGTop 2. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +#include +#include +#include + + +void +_glibtop_init_proc_wd_s(glibtop *server) +{ + server->sysdeps.proc_wd = + (1 << GLIBTOP_PROC_WD_EXE) + + (1 << GLIBTOP_PROC_WD_ROOT) + + (1 << GLIBTOP_PROC_WD_NUMBER); + +} + +static gboolean is_in(GPtrArray *array, const char *str) +{ + guint i; + + for (i = 0; i != array->len; ++i) { + if (strcmp(g_ptr_array_index(array, i), str) == 0) + return TRUE; + } + + return FALSE; +} + + +char** +glibtop_get_proc_wd_s(glibtop *server, glibtop_proc_wd *buf, pid_t pid) +{ + GPtrArray *dirs; + char path[80]; + char dir[256]; + DIR *task; + + memset(buf, 0, sizeof(glibtop_proc_wd)); + + g_snprintf(path, sizeof path, "/proc/%u/root", pid); + if (safe_readlink(path, buf->root, sizeof buf->root)) + buf->flags |= (1 << GLIBTOP_PROC_WD_ROOT); + + g_snprintf(path, sizeof path, "/proc/%u/exe", pid); + if (safe_readlink(path, buf->exe, sizeof buf->exe)) + buf->flags |= (1 << GLIBTOP_PROC_WD_EXE); + + dirs = g_ptr_array_sized_new(2); + + g_snprintf(path, sizeof path, "/proc/%u/cwd", pid); + if (safe_readlink(path, dir, sizeof dir)) + g_ptr_array_add(dirs, g_strdup(dir)); + + g_snprintf(path, sizeof path, "/proc/%u/task", pid); + if ((task = opendir(path)) != NULL) { + struct dirent *sub; + while ((sub = readdir(task)) != NULL) { + /* task dirs have numeric name */ + if (!isdigit(sub->d_name[0])) + continue; + g_snprintf(path, sizeof path, "/proc/%u/task/%s/cwd", pid, sub->d_name); + if (safe_readlink(path, dir, sizeof dir) && !is_in(dirs, dir)) + g_ptr_array_add(dirs, g_strdup(dir)); + } + closedir(task); + } + + buf->number = dirs->len; + buf->flags |= (1 << GLIBTOP_PROC_WD_NUMBER); + + g_ptr_array_add(dirs, NULL); + + return (char**) g_ptr_array_free(dirs, FALSE); +} + diff --git a/sysdeps/linux/sem_limits.c b/sysdeps/linux/sem_limits.c new file mode 100644 index 0000000..305e213 --- /dev/null +++ b/sysdeps/linux/sem_limits.c @@ -0,0 +1,83 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include + +#ifdef _SEM_SEMUN_UNDEFINED + +/* glibc 2.1 will no longer defines semun, instead it defines + * _SEM_SEMUN_UNDEFINED so users can define semun on their own. + * Thanks to Albert K T Hui . */ + +union semun +{ + int val; + struct semid_ds *buf; + unsigned short int *array; + struct seminfo *__buf; +}; +#endif + +static const unsigned long _glibtop_sysdeps_sem_limits = +(1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) + +(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) + +(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) + +(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) + +(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM); + +/* Init function. */ + +void +_glibtop_init_sem_limits_s (glibtop *server) +{ + server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf) +{ + struct seminfo seminfo; + union semun arg; + + memset (buf, 0, sizeof (glibtop_sem_limits)); + + buf->flags = _glibtop_sysdeps_sem_limits; + + arg.array = (void *) &seminfo; + semctl (0, 0, IPC_INFO, arg); + + buf->semmap = seminfo.semmap; + buf->semmni = seminfo.semmni; + buf->semmns = seminfo.semmns; + buf->semmnu = seminfo.semmnu; + buf->semmsl = seminfo.semmsl; + buf->semopm = seminfo.semopm; + buf->semume = seminfo.semume; + buf->semusz = seminfo.semusz; + buf->semvmx = seminfo.semvmx; + buf->semaem = seminfo.semaem; +} diff --git a/sysdeps/linux/shm_limits.c b/sysdeps/linux/shm_limits.c new file mode 100644 index 0000000..da4888f --- /dev/null +++ b/sysdeps/linux/shm_limits.c @@ -0,0 +1,58 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include + +static const unsigned long _glibtop_sysdeps_shm_limits = +(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) + +(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) + +(1L << GLIBTOP_IPC_SHMALL); + +/* Init function. */ + +void +_glibtop_init_shm_limits_s (glibtop *server) +{ + server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf) +{ + struct shminfo shminfo; + + memset (buf, 0, sizeof (glibtop_shm_limits)); + + shmctl (0, IPC_INFO, (void *) &shminfo); + + buf->shmmax = shminfo.shmmax; + buf->shmmin = shminfo.shmmin; + buf->shmmni = shminfo.shmmni; + buf->shmseg = shminfo.shmseg; + buf->shmall = shminfo.shmall; + buf->flags = _glibtop_sysdeps_shm_limits; +} diff --git a/sysdeps/linux/siglist.c b/sysdeps/linux/siglist.c new file mode 100644 index 0000000..ddecf08 --- /dev/null +++ b/sysdeps/linux/siglist.c @@ -0,0 +1,143 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include +#include + +#include + + +#if 0 /* comment */ +perl -nle 'print "{$1,\t\"$1\",\t\"$2\"}," if m|^#define\s*(SIG[A-Z0-9]+).*?/\*\s*(.*?)\s*\*/|' + < /usr/include/bits/signum.h +#endif + + +const glibtop_signame glibtop_sys_siglist [] = +{ +#ifdef SIGHUP + {SIGHUP, "SIGHUP", "Hangup (POSIX)."}, +#endif +#ifdef SIGINT + {SIGINT, "SIGINT", "Interrupt (ANSI)."}, +#endif +#ifdef SIGQUIT + {SIGQUIT, "SIGQUIT", "Quit (POSIX)."}, +#endif +#ifdef SIGILL + {SIGILL, "SIGILL", "Illegal instruction (ANSI)."}, +#endif +#ifdef SIGTRAP + {SIGTRAP, "SIGTRAP", "Trace trap (POSIX)."}, +#endif +#ifdef SIGABRT + {SIGABRT, "SIGABRT", "Abort (ANSI)."}, +#endif +#ifdef SIGIOT + {SIGIOT, "SIGIOT", "IOT trap (4.2 BSD)."}, +#endif +#ifdef SIGBUS + {SIGBUS, "SIGBUS", "BUS error (4.2 BSD)."}, +#endif +#ifdef SIGFPE + {SIGFPE, "SIGFPE", "Floating-point exception (ANSI)."}, +#endif +#ifdef SIGKILL + {SIGKILL, "SIGKILL", "Kill, unblockable (POSIX)."}, +#endif +#ifdef SIGUSR1 + {SIGUSR1, "SIGUSR1", "User-defined signal 1 (POSIX)."}, +#endif +#ifdef SIGSEGV + {SIGSEGV, "SIGSEGV", "Segmentation violation (ANSI)."}, +#endif +#ifdef SIGUSR2 + {SIGUSR2, "SIGUSR2", "User-defined signal 2 (POSIX)."}, +#endif +#ifdef SIGPIPE + {SIGPIPE, "SIGPIPE", "Broken pipe (POSIX)."}, +#endif +#ifdef SIGALRM + {SIGALRM, "SIGALRM", "Alarm clock (POSIX)."}, +#endif +#ifdef SIGTERM + {SIGTERM, "SIGTERM", "Termination (ANSI)."}, +#endif +#ifdef SIGSTKFLT + {SIGSTKFLT, "SIGSTKFLT", "Stack fault."}, +#endif +#ifdef SIGCLD + {SIGCLD, "SIGCLD", "Same as SIGCHLD (System V)."}, +#endif +#ifdef SIGCHLD + {SIGCHLD, "SIGCHLD", "Child status has changed (POSIX)."}, +#endif +#ifdef SIGCONT + {SIGCONT, "SIGCONT", "Continue (POSIX)."}, +#endif +#ifdef SIGSTOP + {SIGSTOP, "SIGSTOP", "Stop, unblockable (POSIX)."}, +#endif +#ifdef SIGTSTP + {SIGTSTP, "SIGTSTP", "Keyboard stop (POSIX)."}, +#endif +#ifdef SIGTTIN + {SIGTTIN, "SIGTTIN", "Background read from tty (POSIX)."}, +#endif +#ifdef SIGTTOU + {SIGTTOU, "SIGTTOU", "Background write to tty (POSIX)."}, +#endif +#ifdef SIGURG + {SIGURG, "SIGURG", "Urgent condition on socket (4.2 BSD)."}, +#endif +#ifdef SIGXCPU + {SIGXCPU, "SIGXCPU", "CPU limit exceeded (4.2 BSD)."}, +#endif +#ifdef SIGXFSZ + {SIGXFSZ, "SIGXFSZ", "File size limit exceeded (4.2 BSD)."}, +#endif +#ifdef SIGVTALRM + {SIGVTALRM, "SIGVTALRM", "Virtual alarm clock (4.2 BSD)."}, +#endif +#ifdef SIGPROF + {SIGPROF, "SIGPROF", "Profiling alarm clock (4.2 BSD)."}, +#endif +#ifdef SIGWINCH + {SIGWINCH, "SIGWINCH", "Window size change (4.3 BSD, Sun)."}, +#endif +#ifdef SIGPOLL + {SIGPOLL, "SIGPOLL", "Pollable event occurred (System V)."}, +#endif +#ifdef SIGIO + {SIGIO, "SIGIO", "I/O now possible (4.2 BSD)."}, +#endif +#ifdef SIGPWR + {SIGPWR, "SIGPWR", "Power failure restart (System V)."}, +#endif +#ifdef SIGSYS + {SIGSYS, "SIGSYS", "Bad system call."}, +#endif +#ifdef SIGUNUSED + {SIGUNUSED, "SIGUNUSED", ""}, +#endif + {0, NULL, NULL} +}; diff --git a/sysdeps/linux/swap.c b/sysdeps/linux/swap.c new file mode 100644 index 0000000..0468a7c --- /dev/null +++ b/sysdeps/linux/swap.c @@ -0,0 +1,103 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +#include + +static const unsigned long _glibtop_sysdeps_swap = +(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) + +(1L << GLIBTOP_SWAP_FREE); + +static const unsigned long _glibtop_sysdeps_swap_paging = +(1L << GLIBTOP_SWAP_PAGEIN) + (1L << GLIBTOP_SWAP_PAGEOUT); + +/* Init function. */ + +void +_glibtop_init_swap_s (glibtop *server) +{ + server->sysdeps.swap = _glibtop_sysdeps_swap | + _glibtop_sysdeps_swap_paging; +} + +/* Provides information about swap usage. */ + +#define MEMINFO "/proc/meminfo" +#define PROC_STAT "/proc/stat" +#define PROC_VMSTAT "/proc/vmstat" + +void +glibtop_get_swap_s (glibtop *server, glibtop_swap *buf) +{ + char buffer [BUFSIZ], *p; + + memset (buf, 0, sizeof (glibtop_swap)); + + file_to_buffer(server, buffer, sizeof buffer, MEMINFO); + + /* Kernel 2.6 with multiple lines */ + + buf->total = get_scaled(buffer, "SwapTotal:"); + buf->free = get_scaled(buffer, "SwapFree:"); + buf->used = buf->total - buf->free; + + buf->flags = _glibtop_sysdeps_swap; + + + if(server->os_version_code >= LINUX_VERSION_CODE(2, 6, 0)) + { + file_to_buffer (server, buffer, sizeof buffer, PROC_VMSTAT); + + p = strstr (buffer, "\npswpin"); + + if(p) + { + p = skip_token(p); + buf->pagein = strtoull (p, &p, 0); + + p = skip_token(p); + buf->pageout = strtoull (p, &p, 0); + + buf->flags |= _glibtop_sysdeps_swap_paging; + } + } + else /* Linux 2.4 */ + { + file_to_buffer (server, buffer, sizeof buffer, PROC_STAT); + + p = strstr (buffer, "\nswap"); + + if(p) + { + p = skip_token (p); + + buf->pagein = strtoull (p, &p, 0); + buf->pageout = strtoull (p, &p, 0); + + buf->flags |= _glibtop_sysdeps_swap_paging; + } + } +} diff --git a/sysdeps/linux/sysinfo.c b/sysdeps/linux/sysinfo.c new file mode 100644 index 0000000..7dbd5ee --- /dev/null +++ b/sysdeps/linux/sysinfo.c @@ -0,0 +1,112 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "glibtop_private.h" + +#define FILENAME "/proc/cpuinfo" + +static const unsigned long _glibtop_sysdeps_sysinfo = +(1L << GLIBTOP_SYSINFO_CPUINFO); + +static glibtop_sysinfo sysinfo = { .flags = 0 }; + +static void +init_sysinfo (glibtop *server) +{ + char* buffer; + gchar ** processors; + + if(G_LIKELY(sysinfo.flags)) return; + + if (!g_file_get_contents(FILENAME, &buffer, NULL, NULL)) { + glibtop_error_io_r(server, "g_file_get_contents(%s)", FILENAME); + } + + /* cpuinfo records are seperated by a blank line */ + processors = g_strsplit(buffer, "\n\n", 0); + + g_free(buffer); + + sysinfo.ncpu = 0; + for (char** this_proc = &processors[0]; *this_proc && **this_proc; this_proc++) { + + if (sysinfo.ncpu >= GLIBTOP_NCPU) { + glibtop_warn_r(server, "Cannot deal with more than %d CPUs", GLIBTOP_NCPU); + break; + } + + gchar **parts, **p; + if (g_strrstr (*this_proc, "processor" ) == NULL) { + /* skip unknown paragraph */ + continue; + } + + glibtop_entry * const cpuinfo = &sysinfo.cpuinfo[sysinfo.ncpu]; + + cpuinfo->labels = g_ptr_array_new (); + + cpuinfo->values = g_hash_table_new_full(g_str_hash, g_str_equal, + g_free, g_free); + + cpuinfo->descriptions = g_hash_table_new_full(g_str_hash, g_str_equal, + g_free, g_free); + + /* " : " */ + parts = g_strsplit_set(*this_proc, ":\n", 0); + + for(p = parts; *p && *(p+1); p += 2) { + + /* stole the allocated memory */ + gchar * const key = g_strstrip( *p ); + gchar * const value = g_strstrip( *(p+1) ); + + g_ptr_array_add(cpuinfo->labels, key); + g_hash_table_insert(cpuinfo->values, key, value); + } + + + /* the last key has no value and has not been added */ + if(*p) g_free(*p); + + /* just g_free instead of g_strvfree because we stole + the memory*/ + + g_free(parts); + + sysinfo.ncpu++; + } + + g_strfreev(processors); + + sysinfo.flags = _glibtop_sysdeps_sysinfo; +} + +const glibtop_sysinfo * +glibtop_get_sysinfo_s (glibtop *server) +{ + init_sysinfo (server); + return &sysinfo; +} diff --git a/sysdeps/linux/uptime.c b/sysdeps/linux/uptime.c new file mode 100644 index 0000000..ba6165c --- /dev/null +++ b/sysdeps/linux/uptime.c @@ -0,0 +1,61 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +#include + +static const unsigned long _glibtop_sysdeps_uptime = + (1UL << GLIBTOP_UPTIME_UPTIME) \ ++ (1UL << GLIBTOP_UPTIME_IDLETIME) \ ++ (1UL << GLIBTOP_UPTIME_BOOT_TIME); + +/* Init function. */ + +void +_glibtop_init_uptime_s (glibtop *server) +{ + server->sysdeps.uptime = _glibtop_sysdeps_uptime; +} + +/* Provides uptime and idle time. */ + +#define FILENAME "/proc/uptime" + +void +glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf) +{ + char buffer [BUFSIZ], *p; + + memset (buf, 0, sizeof (glibtop_uptime)); + + file_to_buffer(server, buffer, sizeof buffer, FILENAME); + + buf->uptime = g_ascii_strtod (buffer, &p); + buf->idletime = g_ascii_strtod (p, &p); + buf->boot_time = get_boot_time(server); + + buf->flags = _glibtop_sysdeps_uptime; +} diff --git a/sysdeps/openbsd/AUTHORS b/sysdeps/openbsd/AUTHORS new file mode 100644 index 0000000..2b0f17f --- /dev/null +++ b/sysdeps/openbsd/AUTHORS @@ -0,0 +1,7 @@ +Martin Baulig (martin@home-of-linux.org) +Josh Sled (jsled@scam.XCF.Berkeley.EDU) + +Contributions/bugfixes by: +Antoine Jacoutot +Ariane van der Steldt +Jasper Lievisse Adriaanse diff --git a/sysdeps/openbsd/Makefile.am b/sysdeps/openbsd/Makefile.am new file mode 100644 index 0000000..8f62eae --- /dev/null +++ b/sysdeps/openbsd/Makefile.am @@ -0,0 +1,28 @@ +AM_CPPFLAGS = @AM_CPPFLAGS@ + +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la + +libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c sysinfo.c \ + cpu.c loadavg.c \ + uptime.c netlist.c fsusage.c mem.c \ + mountlist.c procopenfiles.c procwd.c \ + procaffinity.c glibtop_private.c open.c + +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + +libgtop_sysdeps_suid_2_0_la_LIBADD = $(KVM_LIBS) +libgtop_sysdeps_suid_2_0_la_SOURCES = suid_open.c close.c swap.c \ + proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c \ + prockernel.c procsegment.c procargs.c \ + procmap.c netload.c ppp.c + +# TODO should be made nosuid like FreeBSD +libgtop_sysdeps_suid_2_0_la_SOURCES += shm_limits.c msg_limits.c sem_limits.c + +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h \ + glibtop_suid.h glibtop_private.h + +libgtopincludedir = $(includedir)/libgtop-2.0 diff --git a/sysdeps/openbsd/Makefile.in b/sysdeps/openbsd/Makefile.in new file mode 100644 index 0000000..c51f489 --- /dev/null +++ b/sysdeps/openbsd/Makefile.in @@ -0,0 +1,791 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = sysdeps/openbsd +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libgtopinclude_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libgtop_sysdeps_2_0_la_LIBADD = +am_libgtop_sysdeps_2_0_la_OBJECTS = nosuid.lo siglist.lo sysinfo.lo \ + cpu.lo loadavg.lo uptime.lo netlist.lo fsusage.lo mem.lo \ + mountlist.lo procopenfiles.lo procwd.lo procaffinity.lo \ + glibtop_private.lo open.lo +libgtop_sysdeps_2_0_la_OBJECTS = $(am_libgtop_sysdeps_2_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgtop_sysdeps_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__DEPENDENCIES_1 = +libgtop_sysdeps_suid_2_0_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_libgtop_sysdeps_suid_2_0_la_OBJECTS = suid_open.lo close.lo swap.lo \ + proclist.lo procstate.lo procuid.lo proctime.lo procmem.lo \ + procsignal.lo prockernel.lo procsegment.lo procargs.lo \ + procmap.lo netload.lo ppp.lo shm_limits.lo msg_limits.lo \ + sem_limits.lo +libgtop_sysdeps_suid_2_0_la_OBJECTS = \ + $(am_libgtop_sysdeps_suid_2_0_la_OBJECTS) +libgtop_sysdeps_suid_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_suid_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +DIST_SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libgtopincludedir)" +HEADERS = $(libgtopinclude_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp AUTHORS +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la +libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c sysinfo.c \ + cpu.c loadavg.c \ + uptime.c netlist.c fsusage.c mem.c \ + mountlist.c procopenfiles.c procwd.c \ + procaffinity.c glibtop_private.c open.c + +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_suid_2_0_la_LIBADD = $(KVM_LIBS) + +# TODO should be made nosuid like FreeBSD +libgtop_sysdeps_suid_2_0_la_SOURCES = suid_open.c close.c swap.c \ + proclist.c procstate.c procuid.c proctime.c procmem.c \ + procsignal.c prockernel.c procsegment.c procargs.c procmap.c \ + netload.c ppp.c shm_limits.c msg_limits.c sem_limits.c +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h \ + glibtop_suid.h glibtop_private.h + +libgtopincludedir = $(includedir)/libgtop-2.0 +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sysdeps/openbsd/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu sysdeps/openbsd/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgtop_sysdeps-2.0.la: $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_2_0_la_LINK) $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_LIBADD) $(LIBS) + +libgtop_sysdeps_suid-2.0.la: $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_suid_2_0_la_LINK) $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsusage.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glibtop_private.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mountlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netload.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nosuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procaffinity.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prockernel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procopenfiles.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsegment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsignal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procstate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procwd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siglist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/suid_open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-libgtopincludeHEADERS: $(libgtopinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgtopincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgtopincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgtopincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgtopincludedir)" || exit $$?; \ + done + +uninstall-libgtopincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgtopincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libgtopincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libgtopincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libgtopincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libgtopincludeHEADERS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libgtopincludeHEADERS + +.PRECIOUS: Makefile + + +# 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: diff --git a/sysdeps/openbsd/close.c b/sysdeps/openbsd/close.c new file mode 100644 index 0000000..72ce14d --- /dev/null +++ b/sysdeps/openbsd/close.c @@ -0,0 +1,30 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +/* Closes pipe to gtop server. */ + +void +glibtop_close_p (glibtop *server) +{ } diff --git a/sysdeps/openbsd/cpu.c b/sysdeps/openbsd/cpu.c new file mode 100644 index 0000000..e15f7cb --- /dev/null +++ b/sysdeps/openbsd/cpu.c @@ -0,0 +1,148 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_cpu = +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + +(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) + +(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY) + +(1L << GLIBTOP_CPU_IRQ); + +static const unsigned long _glibtop_sysdeps_cpu_smp = +(1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) + +(1L << GLIBTOP_XCPU_NICE) + (1L << GLIBTOP_XCPU_SYS) + +(1L << GLIBTOP_XCPU_IDLE) + (1L << GLIBTOP_XCPU_IRQ); + +/* MIB array for sysctl */ +static int mib_length=2; +static int mib_cr [] = { CTL_KERN, KERN_CLOCKRATE }; +static int mib_cptime [] = { CTL_KERN, KERN_CPTIME }; +static int mib_cptime_s [] = { CTL_KERN, KERN_CPTIME2, 0 }; + +/* Init function. */ + +void +_glibtop_init_cpu_s (glibtop *server) +{ + server->sysdeps.cpu = _glibtop_sysdeps_cpu; + + if (server->ncpu) + server->sysdeps.cpu |= _glibtop_sysdeps_cpu_smp; +} + +/* Provides information about cpu usage. */ + +void +glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf) +{ + long cpts [CPUSTATES]; + int64_t *cp_times = NULL; + struct clockinfo ci; + size_t length; + int ncpu, i; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0); + + memset (buf, 0, sizeof (glibtop_cpu)); + + /* If this fails, the nlist may not be valid. */ + if (server->sysdeps.cpu == 0) + return; + + length = sizeof (cpts); + if (sysctl (mib_cptime, mib_length, cpts, &length, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.cptime)"); + return; + } + + /* Get the clockrate data */ + length = sizeof (struct clockinfo); + if (sysctl (mib_cr, mib_length, &ci, &length, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (kern.clockrate)"); + return; + } + + /* set user time */ + buf->user = cpts [CP_USER]; + /* set nice time */ + buf->nice = cpts [CP_NICE]; + /* set sys time */ + buf->sys = cpts [CP_SYS]; + /* set idle time */ + buf->idle = cpts [CP_IDLE]; + /* set irq */ + buf->irq = cpts [CP_INTR]; + + /* set frequency */ + buf->frequency = (ci.stathz ? ci.stathz : ci.hz); + /* set total */ + buf->total = cpts [CP_USER] + cpts [CP_NICE] \ + + cpts [CP_SYS] + cpts [CP_IDLE] + cpts [CP_INTR]; + + ncpu = server->ncpu + 1; + + /* + if (!cp_times) { + if ((cp_times = calloc(sizeof(int64_t *), ncpu)) == NULL) + return; + } + */ + + length = CPUSTATES * sizeof(int64_t); + for (i = 0; i < ncpu; i++) { + mib_cptime_s[2] = i; + cp_times = g_malloc (length); + if (sysctl (mib_cptime_s, 3, cp_times, &length, NULL, 0) < 0) + free(cp_times); + + if (cp_times) { + buf->xcpu_user[i] = cp_times[CP_USER]; + buf->xcpu_nice[i] = cp_times[CP_NICE]; + buf->xcpu_sys[i] = cp_times[CP_SYS]; + buf->xcpu_idle[i] = cp_times[CP_IDLE]; + buf->xcpu_irq[i] = cp_times[CP_INTR]; + } else { + buf->xcpu_user[i] = cpts [CP_USER] / ncpu; + buf->xcpu_nice[i] = cpts [CP_NICE] / ncpu; + buf->xcpu_sys[i] = cpts [CP_SYS] / ncpu; + buf->xcpu_idle[i] = cpts [CP_IDLE] / ncpu; + buf->xcpu_irq[i] = cpts [CP_INTR] / ncpu; + } + buf->xcpu_total[i] = buf->xcpu_user[i] + buf->xcpu_nice[i] \ + + buf->xcpu_sys[i] + buf->xcpu_idle[i] \ + + buf->xcpu_irq[i]; + } + + g_free (cp_times); + + /* Set the flags last. */ + buf->flags = _glibtop_sysdeps_cpu; + + if (ncpu > 1) { + buf->flags |= _glibtop_sysdeps_cpu_smp; + } +} diff --git a/sysdeps/openbsd/fsusage.c b/sysdeps/openbsd/fsusage.c new file mode 100644 index 0000000..832d036 --- /dev/null +++ b/sysdeps/openbsd/fsusage.c @@ -0,0 +1,65 @@ +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_fsusage = +(1L << GLIBTOP_FSUSAGE_BLOCKS) + (1L << GLIBTOP_FSUSAGE_BFREE) ++ (1L << GLIBTOP_FSUSAGE_BAVAIL) + (1L << GLIBTOP_FSUSAGE_FILES) ++ (1L << GLIBTOP_FSUSAGE_FFREE) + (1L << GLIBTOP_FSUSAGE_BLOCK_SIZE); + +static void +_glibtop_get_fsusage_read_write (glibtop *server, glibtop_fsusage *buf, const char *path) +{ + int result; + struct statfs sfs; + + result = statfs (path, &sfs); + + if (result == -1) { + glibtop_warn_io_r (server, "statfs"); + return; + } + + buf->read = sfs.f_syncreads + sfs.f_asyncreads; + buf->write = sfs.f_syncwrites + sfs.f_asyncwrites; + buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE); +} + +void +glibtop_get_fsusage_s(glibtop *server, glibtop_fsusage *buf, const char *path) +{ + struct statvfs fsd; + + glibtop_init_r (&server, 0, 0); + + memset (buf, 0, sizeof (glibtop_fsusage)); + + if (statvfs (path, &fsd) < 0) + return; + + buf->block_size = fsd.f_frsize; + buf->blocks = fsd.f_blocks; + buf->bfree = fsd.f_bfree; + buf->bavail = (fsd.f_bavail > fsd.f_bfree) ? 0 : fsd.f_bavail; + buf->files = fsd.f_files; + buf->ffree = fsd.f_ffree; + + buf->flags = _glibtop_sysdeps_fsusage; + + _glibtop_get_fsusage_read_write(server, buf, path); +} + diff --git a/sysdeps/openbsd/glibtop_machine.h b/sysdeps/openbsd/glibtop_machine.h new file mode 100644 index 0000000..b435ed7 --- /dev/null +++ b/sysdeps/openbsd/glibtop_machine.h @@ -0,0 +1,52 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_MACHINE_H__ +#define __GLIBTOP_MACHINE_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +G_BEGIN_DECLS + +struct _glibtop_machine +{ + uid_t uid, euid; + gid_t gid, egid; + + /* The kernel descriptor, used by kvm_* calls. We keep and re-use + * it rather than re-getting it for almost all function + * invocations. */ + kvm_t *kd; +}; + +G_END_DECLS + +#endif /* __GLIBTOP_MACHINE_H__ */ diff --git a/sysdeps/openbsd/glibtop_private.c b/sysdeps/openbsd/glibtop_private.c new file mode 100644 index 0000000..87bec62 --- /dev/null +++ b/sysdeps/openbsd/glibtop_private.c @@ -0,0 +1,28 @@ +#include +#include +#include + +#include "glibtop_private.h" + +#include +#include +#include +#include +#include + +/* Ported from linux/glibtop_private.c */ +gboolean +safe_readlink(const char *path, char *buf, int bufsiz) +{ + int ret; + + ret = readlink(path, buf, bufsiz - 1); + + if (ret == -1) { + g_warning("Could not read link %s : %s", path, strerror(errno)); + return FALSE; + } + + buf[ret] = '\0'; + return TRUE; +} diff --git a/sysdeps/openbsd/glibtop_private.h b/sysdeps/openbsd/glibtop_private.h new file mode 100644 index 0000000..7d30def --- /dev/null +++ b/sysdeps/openbsd/glibtop_private.h @@ -0,0 +1,39 @@ +/* Copyright (C) 2007 Joe Marcus Clarke + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __OPENBSD__GLIBTOP_PRIVATE_H__ +#define __OPENBSD__GLIBTOP_PRIVATE_H__ + +#include +#include + +#include + +#include +#include +#include +#include + +G_BEGIN_DECLS + +gboolean safe_readlink(const char *path, char *buf, int bufsiz); + +G_END_DECLS + +#endif /* __OPENBSD__GLIBTOP_PRIVATE_H__ */ diff --git a/sysdeps/openbsd/glibtop_server.h b/sysdeps/openbsd/glibtop_server.h new file mode 100644 index 0000000..fc9bb30 --- /dev/null +++ b/sysdeps/openbsd/glibtop_server.h @@ -0,0 +1,53 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SERVER_H__ +#define __GLIBTOP_SERVER_H__ + +G_BEGIN_DECLS + +#define GLIBTOP_SUID_SWAP (1 << GLIBTOP_SYSDEPS_SWAP) +#define GLIBTOP_SUID_SHM_LIMITS (1 << GLIBTOP_SYSDEPS_SHM_LIMITS) +#define GLIBTOP_SUID_MSG_LIMITS (1 << GLIBTOP_SYSDEPS_MSG_LIMITS) +#define GLIBTOP_SUID_SEM_LIMITS (1 << GLIBTOP_SYSDEPS_SEM_LIMITS) +#define GLIBTOP_SUID_PROCLIST (1 << GLIBTOP_SYSDEPS_PROCLIST) +#define GLIBTOP_SUID_PROC_STATE (1 << GLIBTOP_SYSDEPS_PROC_STATE) +#define GLIBTOP_SUID_PROC_UID (1 << GLIBTOP_SYSDEPS_PROC_UID) +#define GLIBTOP_SUID_PROC_MEM (1 << GLIBTOP_SYSDEPS_PROC_MEM) +#define GLIBTOP_SUID_PROC_TIME (1 << GLIBTOP_SYSDEPS_PROC_TIME) +#define GLIBTOP_SUID_PROC_SIGNAL (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL) +#define GLIBTOP_SUID_PROC_KERNEL (1 << GLIBTOP_SYSDEPS_PROC_KERNEL) +#define GLIBTOP_SUID_PROC_SEGMENT (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT) +#define GLIBTOP_SUID_PROC_ARGS (1 << GLIBTOP_SYSDEPS_PROC_ARGS) +#define GLIBTOP_SUID_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP) +#define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) +#define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) +#define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_MEM 0 +#define GLIBTOP_SUID_UPTIME 0 +#define GLIBTOP_SUID_LOADAVG 0 +#define GLIBTOP_SUID_NETLIST 0 +#define GLIBTOP_SUID_PROC_WD 0 +#define GLIBTOP_SUID_PROC_AFFINITY 0 + +G_END_DECLS + +#endif diff --git a/sysdeps/openbsd/glibtop_suid.h b/sysdeps/openbsd/glibtop_suid.h new file mode 100644 index 0000000..6b9a5a9 --- /dev/null +++ b/sysdeps/openbsd/glibtop_suid.h @@ -0,0 +1,58 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SUID_H__ +#define __GLIBTOP_SUID_H__ + +G_BEGIN_DECLS + +#if _IN_LIBGTOP +#include +#endif + +#include + +#define KI_PROC(ki) (&(ki))->kp_proc) +#define KI_EPROC(ki) (&(ki))->kp_eproc) + +#define FORCEUREAD 1 +#define UREADOK(ki) (FORCEUREAD || (KI_PROC(ki)->p_flag & P_INMEM)) + +static inline void glibtop_suid_enter (glibtop *server) { + setregid (server->machine->gid, server->machine->egid); +}; + +static inline void glibtop_suid_leave (glibtop *server) { + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); +}; + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags); +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags); + +G_END_DECLS + +#endif diff --git a/sysdeps/openbsd/loadavg.c b/sysdeps/openbsd/loadavg.c new file mode 100644 index 0000000..5b3afae --- /dev/null +++ b/sysdeps/openbsd/loadavg.c @@ -0,0 +1,59 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_loadavg = +(1L << GLIBTOP_LOADAVG_LOADAVG); + +/* Init function. */ + +void +_glibtop_init_loadavg_s (glibtop *server) +{ + server->sysdeps.loadavg = _glibtop_sysdeps_loadavg; +} + +/* Provides load averange. */ + +void +glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf) +{ + double ldavg[3]; + int i; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_LOADAVG), 0); + + memset (buf, 0, sizeof (glibtop_loadavg)); + + getloadavg (ldavg, 3); + + /* fill in the struct */ + buf->flags = _glibtop_sysdeps_loadavg; + for (i = 0; i < 3; i++) { + buf->loadavg [i] = ldavg [i]; + } /* end for */ +} diff --git a/sysdeps/openbsd/mem.c b/sysdeps/openbsd/mem.c new file mode 100644 index 0000000..636979f --- /dev/null +++ b/sysdeps/openbsd/mem.c @@ -0,0 +1,116 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_mem = +(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) + +(1L << GLIBTOP_MEM_FREE) + (1L << GLIBTOP_MEM_SHARED) + +(1L << GLIBTOP_MEM_BUFFER) + (1L << GLIBTOP_MEM_CACHED) + +(1L << GLIBTOP_MEM_USER) + (1L << GLIBTOP_MEM_LOCKED); + +#ifndef LOG1024 +#define LOG1024 10 +#endif + +/* these are for getting the memory statistics */ +static int pageshift; /* log base 2 of the pagesize */ + +/* define pagetok in terms of pageshift */ +#define pagetok(size) ((size) << pageshift) + +/* MIB array for sysctl */ +static int uvmexp_mib [] = { CTL_VM, VM_UVMEXP }; +static int bcstats_mib [] = { CTL_VFS, VFS_GENERIC, VFS_BCACHESTAT }; + +/* Init function. */ + +void +_glibtop_init_mem_s (glibtop *server) +{ + register int pagesize; + + /* get the page size and calculate pageshift from it */ + pagesize = sysconf(_SC_PAGESIZE); + pageshift = 0; + while (pagesize > 1) { + pageshift++; + pagesize >>= 1; + } + + /* we only need the amount of log(2)1024 for our conversion */ + pageshift -= LOG1024; + + server->sysdeps.mem = _glibtop_sysdeps_mem; +} + +void +glibtop_get_mem_s (glibtop *server, glibtop_mem *buf) +{ + struct uvmexp uvmexp; + struct bcachestats bcstats; + size_t length; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MEM), 0); + + memset (buf, 0, sizeof (glibtop_mem)); + + if (server->sysdeps.mem == 0) + return; + + /* Get the data from sysctl */ + length = sizeof (uvmexp); + if (sysctl (uvmexp_mib, 2, &uvmexp, &length, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (vm.uvmexp)"); + bzero(&uvmexp, sizeof(length)); + return; + } + + length = sizeof (bcstats); + if (sysctl (bcstats_mib, 3, &bcstats, &length, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (vfs.generic.bcstats)"); + bzero(&bcstats, sizeof(length)); + return; + } + + /* convert memory stats to Kbytes */ + buf->total = (guint64) pagetok (uvmexp.npages) << LOG1024; + buf->used = (guint64) pagetok (uvmexp.npages - uvmexp.free) << LOG1024; + buf->free = (guint64) pagetok (uvmexp.free) << LOG1024; + buf->locked = (guint64) pagetok (uvmexp.wired) << LOG1024; + buf->shared = (guint64) pagetok (0 /* XXX */) << LOG1024; + buf->cached = (guint64) pagetok (bcstats.numbufpages) << LOG1024; + buf->buffer = 0; + + buf->user = buf->total - buf->free - buf->cached - buf->buffer; + + /* Set the values to return */ + buf->flags = _glibtop_sysdeps_mem; +} diff --git a/sysdeps/openbsd/mountlist.c b/sysdeps/openbsd/mountlist.c new file mode 100644 index 0000000..381091f --- /dev/null +++ b/sysdeps/openbsd/mountlist.c @@ -0,0 +1,168 @@ +/* mountlist.c -- return a list of mounted filesystems + Copyright (C) 1991, 1992 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +/* A mount table entry. */ +struct mount_entry +{ + char *me_devname; /* Device node pathname, including "/dev/". */ + char *me_mountdir; /* Mount point directory pathname. */ + char *me_type; /* "nfs", "4.2", etc. */ + dev_t me_dev; /* Device number of me_mountdir. */ + struct mount_entry *me_next; +}; + +static struct mount_entry *read_filesystem_list (void); + +/* Return a list of the currently mounted filesystems, or NULL on error. + Add each entry to the tail of the list so that they stay in order. +*/ + +static struct mount_entry * +read_filesystem_list (void) +{ + struct mount_entry *mount_list; + struct mount_entry *me; + struct mount_entry *mtail; + + /* Start the list off with a dummy entry. */ + me = g_new (struct mount_entry, 1); + me->me_next = NULL; + mount_list = mtail = me; + { + struct statfs *fsp; + int entries; + + entries = getmntinfo (&fsp, MNT_NOWAIT); + if (entries < 0) + return NULL; + while (entries-- > 0) + { + me = (struct mount_entry *) g_malloc (sizeof (struct mount_entry)); + me->me_devname = g_strdup (fsp->f_mntfromname); + me->me_mountdir = g_strdup (fsp->f_mntonname); + me->me_type = g_strdup (fsp->f_fstypename); + me->me_dev = (dev_t) -1; /* Magic; means not known yet. */ + me->me_next = NULL; + + /* Add to the linked list. */ + mtail->me_next = me; + mtail = me; + fsp++; + } + } + + /* Free the dummy head. */ + me = mount_list; + mount_list = mount_list->me_next; + g_free (me); + return mount_list; +} + +static gboolean ignore_mount_entry(const struct mount_entry *me) +{ + /* keep sorted */ + static const char ignored[][17] = { + "autofs", + "devfs", + "fusectl", + "linprocfs", + "linsysfs", + "mfs", + "none", + "nfs", + "nullfs", + "nwfs", + "portalfs", + "proc", + "procfs", + "smbfs", + "tmpfs", + "unionfs", + "unknown" + }; + + typedef int (*Comparator)(const void*, const void*); + + return bsearch(me->me_type, + ignored, G_N_ELEMENTS(ignored), sizeof ignored[0], + (Comparator) strcmp) != NULL; +} + + +glibtop_mountentry * +glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf, int all_fs) +{ + struct mount_entry *entries, *cur, *next; + + GArray *mount_array = g_array_new(FALSE, FALSE, + sizeof(glibtop_mountentry)); + + glibtop_init_r (&server, 0, 0); + + memset (buf, 0, sizeof (glibtop_mountlist)); + + /* Read filesystem list. */ + + if((entries = read_filesystem_list ()) == NULL) + return NULL; + + for (cur = &entries[0]; cur != NULL; cur = next) { + + if(all_fs || !ignore_mount_entry(cur)) { + /* add a new glibtop_mountentry */ + glibtop_mountentry e; + + g_strlcpy(e.devname, cur->me_devname, sizeof e.devname); + g_strlcpy(e.mountdir, cur->me_mountdir, sizeof e.mountdir); + g_strlcpy(e.type, cur->me_type, sizeof e.type); + e.dev = cur->me_dev; + + g_array_append_val(mount_array, e); + } + + /* free current mount_entry and move to the next */ + next = cur->me_next; + g_free(cur->me_devname); + g_free(cur->me_mountdir); + g_free(cur->me_type); + g_free(cur); + } + + buf->size = sizeof (glibtop_mountentry); + buf->number = mount_array->len; + buf->total = buf->number * buf->size; + + buf->flags = (1 << GLIBTOP_MOUNTLIST_SIZE) + | (1 << GLIBTOP_MOUNTLIST_NUMBER) + | (1 << GLIBTOP_MOUNTLIST_TOTAL); + + return (glibtop_mountentry*) g_array_free(mount_array, FALSE); +} diff --git a/sysdeps/openbsd/msg_limits.c b/sysdeps/openbsd/msg_limits.c new file mode 100644 index 0000000..bc7c6e2 --- /dev/null +++ b/sysdeps/openbsd/msg_limits.c @@ -0,0 +1,94 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , August 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +/* Define the appropriate macro (if any) to get declaration of `struct + * msginfo'. Needed on, at least, FreeBSD. */ +#if defined (STRUCT_MSGINFO_NEEDS_KERNEL) +#define KERNEL 1 +#elif defined (STRUCT_MSGINFO_NEEDS__KERNEL) +#define _KERNEL 1 +#endif + +#include +#include + +static const unsigned long _glibtop_sysdeps_msg_limits = +(1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNI) + +(1L << GLIBTOP_IPC_MSGMNB) + (1L << GLIBTOP_IPC_MSGTQL) + +(1L << GLIBTOP_IPC_MSGSSZ); + +/* The values in this structure never change at runtime, so we only + * read it once during initialization. We have to use the name `_msginfo' + * since `msginfo' is already declared external in . */ +static struct msginfo _msginfo; + +/* nlist structure for kernel access */ +static struct nlist nlst [] = { + { "_msginfo" }, + { 0 } +}; + +/* Init function. */ + +void +_glibtop_init_msg_limits_p (glibtop *server) +{ + if (kvm_nlist (server->machine->kd, nlst) < 0) { + glibtop_warn_io_r (server, "kvm_nlist (msg_limits)"); + return; + } + + if (kvm_read (server->machine->kd, nlst [0].n_value, + &_msginfo, sizeof (_msginfo)) != sizeof (_msginfo)) { + glibtop_warn_io_r (server, "kvm_read (msginfo)"); + return; + } + + server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf) +{ + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MSG_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_msg_limits)); + + if (server->sysdeps.msg_limits == 0) + return; + + buf->msgmax = _msginfo.msgmax; + buf->msgmni = _msginfo.msgmni; + buf->msgmnb = _msginfo.msgmnb; + buf->msgtql = _msginfo.msgtql; + buf->msgssz = _msginfo.msgtql; + + buf->flags = _glibtop_sysdeps_msg_limits; +} diff --git a/sysdeps/openbsd/netlist.c b/sysdeps/openbsd/netlist.c new file mode 100644 index 0000000..59550e0 --- /dev/null +++ b/sysdeps/openbsd/netlist.c @@ -0,0 +1,66 @@ +/* + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + + +static const unsigned long _glibtop_sysdeps_netlist = (1 << GLIBTOP_NETLIST_NUMBER); + +/* Init function. */ + +void +_glibtop_init_netlist_s (glibtop *server) +{ + server->sysdeps.netlist = _glibtop_sysdeps_netlist; +} + + +char** +glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf) +{ + struct if_nameindex *ifstart, *ifs; + GPtrArray *devices; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_NETLIST, 0); + + memset (buf, 0, sizeof (glibtop_netlist)); + + ifs = ifstart = if_nameindex(); + + devices = g_ptr_array_new(); + + while(ifs && ifs->if_name) { + g_ptr_array_add(devices, g_strdup(ifs->if_name)); + buf->number++; + ifs++; + } + + if_freenameindex(ifstart); + + buf->flags = _glibtop_sysdeps_netlist; + + g_ptr_array_add(devices, NULL); + + return (char **) g_ptr_array_free(devices, FALSE); +} + diff --git a/sysdeps/openbsd/netload.c b/sysdeps/openbsd/netload.c new file mode 100644 index 0000000..6591b4f --- /dev/null +++ b/sysdeps/openbsd/netload.c @@ -0,0 +1,237 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +#include + +#include + +#include +#define _KERNEL +#include +#undef _KERNEL +#include + +static const unsigned long _glibtop_sysdeps_netload = +(1L << GLIBTOP_NETLOAD_IF_FLAGS) + +(1L << GLIBTOP_NETLOAD_PACKETS_IN) + +(1L << GLIBTOP_NETLOAD_PACKETS_OUT) + +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_BYTES_IN) + +(1L << GLIBTOP_NETLOAD_BYTES_OUT) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) + +(1L << GLIBTOP_NETLOAD_ERRORS_IN) + +(1L << GLIBTOP_NETLOAD_ERRORS_OUT) + +(1L << GLIBTOP_NETLOAD_ERRORS_TOTAL) + +(1L << GLIBTOP_NETLOAD_COLLISIONS); + +static const unsigned _glibtop_sysdeps_netload_data = +(1L << GLIBTOP_NETLOAD_ADDRESS) + +(1L << GLIBTOP_NETLOAD_SUBNET) + +(1L << GLIBTOP_NETLOAD_MTU); + +/* nlist structure for kernel access */ +static struct nlist nlst [] = { + { "_ifnet" }, + { 0 } +}; + +/* Init function. */ + +void +_glibtop_init_netload_p (glibtop *server) +{ + server->sysdeps.netload = _glibtop_sysdeps_netload; + + if (kvm_nlist (server->machine->kd, nlst) < 0) + glibtop_error_io_r (server, "kvm_nlist"); +} + +/* Provides Network statistics. */ + +void +glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, + const char *interface) +{ + struct ifnet ifnet; + u_long ifnetaddr, ifnetfound; + struct sockaddr *sa = NULL; + char name [32]; + + union { + struct ifaddr ifa; + struct in_ifaddr in; + } ifaddr; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_NETLOAD), 0); + + memset (buf, 0, sizeof (glibtop_netload)); + + if (kvm_read (server->machine->kd, nlst [0].n_value, + &ifnetaddr, sizeof (ifnetaddr)) != sizeof (ifnetaddr)) + glibtop_error_io_r (server, "kvm_read (ifnet)"); + + while (ifnetaddr) { + struct sockaddr_in *sin; + register char *cp; + u_long ifaddraddr; + + { + ifnetfound = ifnetaddr; + + if (kvm_read (server->machine->kd, ifnetaddr, &ifnet, + sizeof (ifnet)) != sizeof (ifnet)) + glibtop_error_io_r (server, "kvm_read (ifnetaddr)"); + + g_strlcpy (name, ifnet.if_xname, sizeof(name)); + ifnetaddr = (u_long) ifnet.if_list.tqe_next; + + if (strcmp (name, interface) != 0) + continue; + + ifaddraddr = (u_long) ifnet.if_addrlist.tqh_first; + } + if (ifnet.if_flags & IFF_UP) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP); + if (ifnet.if_flags & IFF_BROADCAST) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST); + if (ifnet.if_flags & IFF_DEBUG) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG); + if (ifnet.if_flags & IFF_LOOPBACK) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK); + if (ifnet.if_flags & IFF_POINTOPOINT) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT); +#ifdef IFF_DRV_RUNNING + if (ifnet.if_drv_flags & IFF_DRV_RUNNING) +#else + if (ifnet.if_flags & IFF_RUNNING) +#endif + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING); + if (ifnet.if_flags & IFF_NOARP) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP); + if (ifnet.if_flags & IFF_PROMISC) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC); + if (ifnet.if_flags & IFF_ALLMULTI) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI); +#ifdef IFF_DRV_OACTIVE + if (ifnet.if_drv_flags & IFF_DRV_OACTIVE) +#else + if (ifnet.if_flags & IFF_OACTIVE) +#endif + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_OACTIVE); + if (ifnet.if_flags & IFF_SIMPLEX) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_SIMPLEX); + if (ifnet.if_flags & IFF_LINK0) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LINK0); + if (ifnet.if_flags & IFF_LINK1) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LINK1); + if (ifnet.if_flags & IFF_LINK2) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LINK2); + if (ifnet.if_flags & IFF_MULTICAST) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST); + + buf->packets_in = ifnet.if_ipackets; + buf->packets_out = ifnet.if_opackets; + buf->packets_total = buf->packets_in + buf->packets_out; + + buf->bytes_in = ifnet.if_ibytes; + buf->bytes_out = ifnet.if_obytes; + buf->bytes_total = buf->bytes_in + buf->bytes_out; + + buf->errors_in = ifnet.if_ierrors; + buf->errors_out = ifnet.if_oerrors; + buf->errors_total = buf->errors_in + buf->errors_out; + + buf->collisions = ifnet.if_collisions; + buf->flags = _glibtop_sysdeps_netload; + + while (ifaddraddr) { + if ((kvm_read (server->machine->kd, ifaddraddr, &ifaddr, + sizeof (ifaddr)) != sizeof (ifaddr))) + glibtop_error_io_r (server, "kvm_read (ifaddraddr)"); + +#define CP(x) ((char *)(x)) + cp = (CP(ifaddr.ifa.ifa_addr) - CP(ifaddraddr)) + + CP(&ifaddr); + sa = (struct sockaddr *)cp; + + if (sa->sa_family == AF_LINK) { + struct sockaddr_dl *dl = (struct sockaddr_dl *) sa; + + memcpy (buf->hwaddress, LLADDR (dl), sizeof (buf->hwaddress)); + buf->flags |= (1L << GLIBTOP_NETLOAD_HWADDRESS); + } else if (sa->sa_family == AF_INET) { + sin = (struct sockaddr_in *)sa; + buf->subnet = ifaddr.in.ia_netmask; + buf->address = sin->sin_addr.s_addr; + buf->mtu = ifnet.if_mtu; + + buf->flags |= _glibtop_sysdeps_netload_data; + } else if (sa->sa_family == AF_INET6) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa; + int in6fd; + + memcpy (buf->address6, &sin6->sin6_addr, + sizeof (buf->address6)); + buf->flags |= (1L << GLIBTOP_NETLOAD_ADDRESS6); + + if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { + sin6->sin6_scope_id = + ntohs(*(u_int16_t *)&sin6->sin6_addr.s6_addr[2]); + sin6->sin6_addr.s6_addr[2] = sin6->sin6_addr.s6_addr[3] = 0; + } + + buf->scope6 = (guint8) sin6->sin6_scope_id; + buf->flags |= (1L << GLIBTOP_NETLOAD_SCOPE6); + + in6fd = socket (AF_INET6, SOCK_DGRAM, 0); + if (in6fd >= 0) { + struct in6_ifreq ifr; + + memset (&ifr, 0, sizeof (ifr)); + ifr.ifr_addr = *sin6; + g_strlcpy (ifr.ifr_name, interface, + sizeof (ifr.ifr_name)); + if (ioctl (in6fd, SIOCGIFNETMASK_IN6, (char *) &ifr) >= 0) { + memcpy (buf->prefix6, &ifr.ifr_addr.sin6_addr, + sizeof (buf->prefix6)); + buf->flags |= (1L << GLIBTOP_NETLOAD_PREFIX6); + } + close (in6fd); + } + } + ifaddraddr = (u_long) ifaddr.ifa.ifa_list.tqe_next; + } + return; + } +} diff --git a/sysdeps/openbsd/nosuid.c b/sysdeps/openbsd/nosuid.c new file mode 100644 index 0000000..c091a8c --- /dev/null +++ b/sysdeps/openbsd/nosuid.c @@ -0,0 +1,28 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +void +glibtop_close_s (glibtop *server) +{ } diff --git a/sysdeps/openbsd/open.c b/sysdeps/openbsd/open.c new file mode 100644 index 0000000..c6ee970 --- /dev/null +++ b/sysdeps/openbsd/open.c @@ -0,0 +1,58 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include + + +void +glibtop_open_s (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags) +{ + int ncpus = 1; + int mib[2] = { CTL_HW, HW_NCPU }; + size_t len; + + len = sizeof(ncpus); + if (sysctl(mib, 2, &ncpus, &len, NULL, 0) != 0) + printf("Couldn't determine hw.ncpu.\n"); + + server->real_ncpu = ncpus - 1; + server->ncpu = MIN(GLIBTOP_NCPU - 1, server->real_ncpu); + + server->os_version_code = OpenBSD; + + if (server->real_ncpu != server->ncpu) { + glibtop_warn_r(server, + "This machine has %d CPUs, " + "%d are being monitored.", + server->real_ncpu + 1, + server->ncpu + 1); + } +} diff --git a/sysdeps/openbsd/ppp.c b/sysdeps/openbsd/ppp.c new file mode 100644 index 0000000..4403272 --- /dev/null +++ b/sysdeps/openbsd/ppp.c @@ -0,0 +1,139 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#ifdef HAVE_I4B + +#include +#include + +#ifdef HAVE_NET_IF_VAR_H +#include +#endif + +#include +#include + +#include + +/* Read `misc/i4b_acct.txt' for details ... */ +#ifdef HAVE_I4B_ACCT +#include +#endif + +static const unsigned long _glibtop_sysdeps_ppp = +(1L << GLIBTOP_PPP_STATE); + +#ifdef HAVE_I4B_ACCT +static const unsigned long _glibtop_sysdeps_ppp_acct = +(1L << GLIBTOP_PPP_BYTES_IN) + (1L << GLIBTOP_PPP_BYTES_OUT); +#endif + +#endif /* HAVE_I4B */ + +/* nlist structure for kernel access */ +static struct nlist nlst [] = { +#ifdef HAVE_I4B + { "_i4bisppp_softc" }, +#endif + { 0 } +}; + +/* Init function. */ + +void +_glibtop_init_ppp_p (glibtop *server) +{ +#ifdef HAVE_I4B +#ifdef HAVE_I4B_ACCT + server->sysdeps.ppp = _glibtop_sysdeps_ppp | + _glibtop_sysdeps_ppp_acct; +#else + server->sysdeps.ppp = _glibtop_sysdeps_ppp; +#endif +#endif /* HAVE_I4B */ + + if (kvm_nlist (server->machine->kd, nlst) < 0) + glibtop_error_io_r (server, "kvm_nlist"); +} + +/* Provides information about ppp usage. */ + +void +glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device) +{ +#ifdef HAVE_I4B +#ifdef HAVE_I4B_ACCT + struct i4bisppp_softc data; +#else + struct sppp data; +#endif + int phase; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PPP), 0); + + memset (buf, 0, sizeof (glibtop_ppp)); + + if (kvm_read (server->machine->kd, nlst [0].n_value, + &data, sizeof (data)) != sizeof (data)) + glibtop_error_io_r (server, "kvm_read (i4bisppp_softc)"); + +#ifdef HAVE_I4B_ACCT + phase = data.sc_if_un.scu_sp.pp_phase; +#else + /* FIXME: Which FreeBSD version have this field and + * which not. */ +#if 0 + phase = data.pp_phase; +#endif +#endif + + switch (phase) { +#ifdef HAVE_I4B_ACCT + case PHASE_DEAD: + case PHASE_TERMINATE: + buf->state = GLIBTOP_PPP_STATE_HANGUP; + break; + case PHASE_ESTABLISH: + case PHASE_NETWORK: + buf->state = GLIBTOP_PPP_STATE_ONLINE; + break; +#endif + default: + buf->state = GLIBTOP_PPP_STATE_UNKNOWN; + break; + } + + buf->flags = _glibtop_sysdeps_ppp; + +#ifdef HAVE_I4B_ACCT + buf->bytes_in = data.sc_inb; + buf->bytes_out = data.sc_outb; + buf->flags |= _glibtop_sysdeps_ppp_acct; +#endif +#endif /* HAVE_I4B */ +} diff --git a/sysdeps/openbsd/procaffinity.c b/sysdeps/openbsd/procaffinity.c new file mode 100644 index 0000000..4164cd9 --- /dev/null +++ b/sysdeps/openbsd/procaffinity.c @@ -0,0 +1,26 @@ +/* + * TODO (procaffinity stub) + */ + +#include +#include +#include + + +void +_glibtop_init_proc_affinity_s(glibtop *server) +{ + server->sysdeps.proc_affinity = + (1 << GLIBTOP_PROC_AFFINITY_NUMBER) | + (1 << GLIBTOP_PROC_AFFINITY_ALL); + +} + + +guint16 * +glibtop_get_proc_affinity_s(glibtop *server, glibtop_proc_affinity *buf, pid_t pid) +{ + memset(buf, 0, sizeof *buf); + + return NULL; +} diff --git a/sysdeps/openbsd/procargs.c b/sysdeps/openbsd/procargs.c new file mode 100644 index 0000000..c686bd3 --- /dev/null +++ b/sysdeps/openbsd/procargs.c @@ -0,0 +1,99 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_args = +(1L << GLIBTOP_PROC_ARGS_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_args_p (glibtop *server) +{ + server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; +} + +/* Provides detailed information about a process. */ + +char * +glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len) +{ + struct kinfo_proc *pinfo; + char *retval, **args, **ptr; + size_t size = 0, pos = 0; + int count; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_ARGS), 0); + + memset (buf, 0, sizeof (glibtop_proc_args)); + + /* Ignore init */ + if (pid < 2) return NULL; + + glibtop_suid_enter (server); + + /* Get the process data */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, + sizeof (*pinfo), &count); + if (pinfo == NULL) { + glibtop_suid_leave (server); + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return NULL; + } + + args = kvm_getargv (server->machine->kd, pinfo, max_len); + if (args == NULL) { + glibtop_suid_leave (server); + glibtop_warn_io_r (server, "kvm_getargv (%d)", pid); + return NULL; + } + + glibtop_suid_leave (server); + + for (ptr = args; *ptr; ptr++) + size += strlen (*ptr)+1; + + size += 2; + retval = g_malloc0 (size); + + for (ptr = args; *ptr; ptr++) { + const size_t len = strlen (*ptr)+1; + memcpy (retval+pos, *ptr, len); + pos += len; + } + + buf->size = pos ? pos-1 : 0; + + buf->flags = _glibtop_sysdeps_proc_args; + + return retval; +} diff --git a/sysdeps/openbsd/prockernel.c b/sysdeps/openbsd/prockernel.c new file mode 100644 index 0000000..2b28033 --- /dev/null +++ b/sysdeps/openbsd/prockernel.c @@ -0,0 +1,107 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_kernel_pstats = +(1L << GLIBTOP_PROC_KERNEL_K_FLAGS) + +(1L << GLIBTOP_PROC_KERNEL_MIN_FLT) + +(1L << GLIBTOP_PROC_KERNEL_MAJ_FLT); + +static const unsigned long _glibtop_sysdeps_proc_kernel_wchan = +(1L << GLIBTOP_PROC_KERNEL_WCHAN) + +(1L << GLIBTOP_PROC_KERNEL_NWCHAN); + +/* Init function. */ + +void +_glibtop_init_proc_kernel_p (glibtop *server) +{ + server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel_pstats | + _glibtop_sysdeps_proc_kernel_wchan; +} + +void +glibtop_get_proc_kernel_p (glibtop *server, + glibtop_proc_kernel *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + int count; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_KERNEL), 0); + + memset (buf, 0, sizeof (glibtop_proc_kernel)); + + if (server->sysdeps.proc_time == 0) + return; + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + glibtop_suid_enter (server); + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, + sizeof(*pinfo), &count); + if (pinfo == NULL) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + glibtop_suid_leave (server); + return; + } + + glibtop_suid_leave (server); + +#define PROC_WCHAN p_wchan +#define PROC_WMESG p_wmesg + + buf->nwchan = (unsigned long) pinfo [0].PROC_WCHAN; + + buf->flags |= (1L << GLIBTOP_PROC_KERNEL_NWCHAN); + + if (pinfo [0].PROC_WCHAN && pinfo [0].PROC_WMESG[0] != 0) { + g_strlcpy (buf->wchan, pinfo [0].PROC_WMESG, + sizeof buf->wchan); + buf->flags |= (1L << GLIBTOP_PROC_KERNEL_WCHAN); + } else { + buf->wchan [0] = 0; + } + + buf->k_flags = (unsigned long) pinfo [0].p_flag; + buf->min_flt = (unsigned long) pinfo [0].p_uru_minflt; + buf->maj_flt = (unsigned long) pinfo [0].p_uru_majflt; + + buf->flags |= _glibtop_sysdeps_proc_kernel_pstats; + + return; +} diff --git a/sysdeps/openbsd/proclist.c b/sysdeps/openbsd/proclist.c new file mode 100644 index 0000000..19fc2ae --- /dev/null +++ b/sysdeps/openbsd/proclist.c @@ -0,0 +1,106 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proclist = +(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) + +(1L << GLIBTOP_PROCLIST_SIZE); + +/* Fetch list of currently running processes. + * The interface of this function is a little bit different from the others: + * buf->flags is only set if the call succeeded, in this case pids_chain, + * a list of the pids of all currently running processes is returned, + * buf->number is the number of elements of this list and buf->size is + * the size of one single element (sizeof (unsigned)). The total size is + * stored in buf->total. + * + * The calling function has to free the memory to which a pointer is returned. + * + * IMPORTANT NOTE: + * On error, this function MUST return NULL and set buf->flags to zero ! + * On success, it returnes a pointer to a list of buf->number elements + * each buf->size big. The total size is stored in buf->total. + * The calling function has to free the memory to which a pointer is returned. + * + * On error, NULL is returned and buf->flags is zero. */ + +/* Init function. */ + +void +_glibtop_init_proclist_p (glibtop *server) +{ + server->sysdeps.proclist = _glibtop_sysdeps_proclist; +} + +pid_t * +glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf, + gint64 real_which, gint64 arg) +{ + struct kinfo_proc *pinfo; + unsigned *pids = NULL; + int which, count; + int i,j; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROCLIST), 0); + + memset (buf, 0, sizeof (glibtop_proclist)); + + which = (int)(real_which & GLIBTOP_KERN_PROC_MASK); + + /* Get the process data */ + pinfo = kvm_getprocs (server->machine->kd, which, arg, + sizeof (*pinfo), &count); + if ((pinfo == NULL) || (count < 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (proclist)"); + return NULL; + } + count--; + + /* Allocate count objects in the pids_chain array + * Same as malloc is pids is NULL, which it is. */ + pids = g_realloc (pids, count * sizeof (unsigned)); + /* Copy the pids over to this chain */ + for (i=j=0; i < count; i++) { +#define PROC_STAT p_stat +#define PROC_RUID p_ruid +#define PROC_PID p_pid + + if ((real_which & GLIBTOP_EXCLUDE_IDLE) && + (pinfo[i].PROC_STAT != SRUN)) + continue; + else if ((real_which & GLIBTOP_EXCLUDE_SYSTEM) && + (pinfo[i].PROC_RUID == 0)) + continue; + pids [j++] = (unsigned) pinfo[i].PROC_PID; + } /* end for */ + /* Set the fields in buf */ + buf->number = j; + buf->size = sizeof (unsigned); + buf->total = j * sizeof (unsigned); + buf->flags = _glibtop_sysdeps_proclist; + return pids; +} diff --git a/sysdeps/openbsd/procmap.c b/sysdeps/openbsd/procmap.c new file mode 100644 index 0000000..eb3bb34 --- /dev/null +++ b/sysdeps/openbsd/procmap.c @@ -0,0 +1,313 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +/* XXX until uvm gets cleaned up */ +#include +typedef int boolean_t; + +#undef _KERNEL +#define _UVM_UVM_AMAP_I_H_ 1 +#define _UVM_UVM_MAP_I_H_ 1 +#include + +static const unsigned long _glibtop_sysdeps_proc_map = +(1L << GLIBTOP_PROC_MAP_TOTAL) + (1L << GLIBTOP_PROC_MAP_NUMBER) + +(1L << GLIBTOP_PROC_MAP_SIZE); + +static const unsigned long _glibtop_sysdeps_map_entry = +(1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) + +(1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) + +(1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE); + +/* Local helper functions. */ + +ssize_t load_vmmap_entries(glibtop*, unsigned long, struct vm_map_entry**, + struct vm_map_entry*); +void unload_vmmap_entries(struct vm_map_entry *); + +/* Init function. */ + +void +_glibtop_init_proc_map_p (glibtop *server) +{ + server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; +} + +/* + * Download vmmap_entries from the kernel into our address space. + * We fix up the addr tree while downloading. + * + * Returns: the size of the tree on succes, or -1 on failure. + * On failure, *rptr needs to be passed to unload_vmmap_entries to free + * the lot. + */ +ssize_t +load_vmmap_entries(glibtop *server, unsigned long kptr, + struct vm_map_entry **rptr, struct vm_map_entry *parent) +{ + struct vm_map_entry *entry; + unsigned long left_kptr, right_kptr; + ssize_t left_sz; + ssize_t right_sz; + + if (kptr == 0) + return 0; + + /* Need space. */ + entry = malloc(sizeof(*entry)); + if (entry == NULL) + return -1; + + /* Download entry at kptr. */ + if (kvm_read (server->machine->kd, kptr, + (char *)entry, sizeof(*entry)) != sizeof(*entry)) { + free(entry); + return -1; + } + + /* + * Update addr pointers to have sane values in this address space. + * We save the kernel pointers in {left,right}_kptr, so we have them + * available to download children. + */ + left_kptr = (unsigned long) RB_LEFT(entry, daddrs.addr_entry); + right_kptr = (unsigned long) RB_RIGHT(entry, daddrs.addr_entry); + RB_LEFT(entry, daddrs.addr_entry) = + RB_RIGHT(entry, daddrs.addr_entry) = NULL; + /* Fill in parent pointer. */ + RB_PARENT(entry, daddrs.addr_entry) = parent; + + /* + * Consistent state reached, fill in *rptr. + */ + *rptr = entry; + + /* + * Download left, right. + * On failure, our map is in a state that can be handled by + * unload_vmmap_entries. + */ + left_sz = load_vmmap_entries(server, left_kptr, + &RB_LEFT(entry, daddrs.addr_entry), entry); + if (left_sz == -1) + return -1; + right_sz = load_vmmap_entries(server, right_kptr, + &RB_RIGHT(entry, daddrs.addr_entry), entry); + if (right_sz == -1) + return -1; + + return 1 + left_sz + right_sz; +} + +/* + * Free the vmmap entries in the given tree. + */ +void +unload_vmmap_entries(struct vm_map_entry *entry) +{ + if (entry == NULL) + return; + + unload_vmmap_entries(RB_LEFT(entry, daddrs.addr_entry)); + unload_vmmap_entries(RB_RIGHT(entry, daddrs.addr_entry)); + free(entry); +} + +/* + * Provides detailed information about a process. + * Due to the fact we are only requested info about one process, it's possible + * the process has been reaped before we get to kvm_getprocs. Tough luck. + */ + +glibtop_map_entry * +glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + struct vm_map_entry *entry; + struct uvm_map_addr root; + struct vmspace vmspace; + struct vnode vnode; + struct inode inode; + ssize_t nentries; + GArray *maps = g_array_sized_new(FALSE, FALSE, + sizeof(glibtop_map_entry), + 100); + int count = 0; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MAP), 0); + + memset (buf, 0, sizeof (glibtop_proc_map)); + + /* It does not work for the swapper task. */ + if (pid == 0) return (glibtop_map_entry*) g_array_free(maps, TRUE); + + glibtop_suid_enter (server); + + /* Get the process data */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, sizeof(struct kinfo_proc), &count); + if (pinfo == NULL) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return (glibtop_map_entry*) g_array_free(maps, TRUE); + } + + /* Now we get the memory maps. */ + + if (kvm_read (server->machine->kd, + (unsigned long) pinfo [0].p_vmspace, + (char *) &vmspace, sizeof (vmspace)) != sizeof (vmspace)) { + glibtop_warn_io_r (server, "kvm_read (vmspace)"); + glibtop_suid_leave (server); + return NULL; + } + + RB_INIT(&root); + nentries = load_vmmap_entries(server, + (unsigned long) RB_ROOT(&vmspace.vm_map.addr), + &RB_ROOT(&root), NULL); + if (nentries == -1) { + unload_vmmap_entries(RB_ROOT(&root)); + glibtop_error_io_r (server, "kvm_read (entry)"); + } + + /* Allocate space. */ + + buf->number = nentries; + buf->size = sizeof (glibtop_map_entry); + + buf->total = buf->number * buf->size; + + buf->flags = _glibtop_sysdeps_proc_map; + + /* Walk through the `vm_map_entry' list ... */ + + /* I tested this a few times with `mmap'; as soon as you write + * to the mmap'ed area, the object type changes from OBJT_VNODE + * to OBJT_DEFAULT so it seems this really works. + */ + + RB_FOREACH(entry, uvm_map_addr, &root) { + glibtop_map_entry *mentry; + unsigned long inum, dev; + guint len; + + if (UVM_ET_ISSUBMAP(entry)) + continue; + if (!entry->object.uvm_obj) + continue; + + /* We're only interested in vnodes */ + + if (kvm_read (server->machine->kd, + (unsigned long) entry->object.uvm_obj, + &vnode, sizeof (vnode)) != sizeof (vnode)) { + glibtop_warn_io_r (server, "kvm_read (vnode)"); + unload_vmmap_entries(RB_ROOT(&root)); + glibtop_suid_leave (server); + return (glibtop_map_entry*) g_array_free(maps, TRUE); + } + +#if defined(UVM_VNODE_VALID) + if (!vnode.v_uvm.u_flags & UVM_VNODE_VALID) + continue; +#endif + if ((vnode.v_type != VREG) || (vnode.v_tag != VT_UFS) || + !vnode.v_data) continue; + + if (kvm_read (server->machine->kd, + (unsigned long) vnode.v_data, + &inode, sizeof (inode)) != sizeof (inode)) { + glibtop_warn_io_r (server, "kvm_read (inode)"); + unload_vmmap_entries(RB_ROOT(&root)); + glibtop_suid_leave (server); + return (glibtop_map_entry*) g_array_free(maps, TRUE); + } + + inum = inode.i_number; + dev = inode.i_dev; + + len = maps->len; + g_array_set_size(maps, len + 1); + mentry = &g_array_index(maps, glibtop_map_entry, len); + + mentry->flags = _glibtop_sysdeps_map_entry; + + mentry->start = (guint64) entry->start; + mentry->end = (guint64) entry->end; + mentry->offset = (guint64) entry->offset; + mentry->device = (guint64) dev; + mentry->inode = (guint64) inum; + + mentry->perm = (guint64) 0; + + if (entry->protection & PROT_READ) + mentry->perm |= GLIBTOP_MAP_PERM_READ; + if (entry->protection & PROT_WRITE) + mentry->perm |= GLIBTOP_MAP_PERM_WRITE; + if (entry->protection & PROT_EXEC) + mentry->perm |= GLIBTOP_MAP_PERM_EXECUTE; + } + + glibtop_suid_leave (server); + + buf->flags = _glibtop_sysdeps_proc_map; + + buf->number = maps->len; + buf->size = sizeof (glibtop_map_entry); + buf->total = buf->number * buf->size; + + unload_vmmap_entries(RB_ROOT(&root)); + return (glibtop_map_entry*) g_array_free(maps, FALSE); +} + +/* + * Don't implement address comparison. + */ +static __inline int +no_impl(void *p, void *q) +{ + abort(); /* Should not be called. */ + return 0; +} + +RB_GENERATE(uvm_map_addr, vm_map_entry, daddrs.addr_entry, no_impl); diff --git a/sysdeps/openbsd/procmem.c b/sysdeps/openbsd/procmem.c new file mode 100644 index 0000000..de50f80 --- /dev/null +++ b/sysdeps/openbsd/procmem.c @@ -0,0 +1,136 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +/* XXX until uvm gets cleaned up */ +#include +typedef int boolean_t; +#include + +/* Fixme ... */ +#undef _KERNEL +#define _UVM_UVM_AMAP_I_H_ 1 +#define _UVM_UVM_MAP_I_H_ 1 +#include + +static const unsigned long _glibtop_sysdeps_proc_mem = +(1L << GLIBTOP_PROC_MEM_SIZE) + +(1L << GLIBTOP_PROC_MEM_VSIZE) + +(1L << GLIBTOP_PROC_MEM_RESIDENT) + +(1L << GLIBTOP_PROC_MEM_RSS) + +(1L << GLIBTOP_PROC_MEM_RSS_RLIM); + +static const unsigned long _glibtop_sysdeps_proc_mem_share = +(1L << GLIBTOP_PROC_MEM_SHARE); + +#ifndef LOG1024 +#define LOG1024 10 +#endif + +/* these are for getting the memory statistics */ +static int pageshift; /* log base 2 of the pagesize */ + +/* define pagetok in terms of pageshift */ +#define pagetok(size) ((size) << pageshift) + +/* Init function. */ + +void +_glibtop_init_proc_mem_p (glibtop *server) +{ + register int pagesize; + + /* get the page size and calculate pageshift from it */ + pagesize = sysconf(_SC_PAGESIZE); + pageshift = 0; + while (pagesize > 1) { + pageshift++; + pagesize >>= 1; + } + + /* we only need the amount of log(2)1024 for our conversion */ + pageshift -= LOG1024; + + server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem | + _glibtop_sysdeps_proc_mem_share; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + + int count; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MEM), 0); + + memset (buf, 0, sizeof (glibtop_proc_mem)); + + if (server->sysdeps.proc_mem == 0) + return; + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + /* Get the process data */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, + sizeof (*pinfo), &count); + if ((pinfo == NULL) || (count < 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + + buf->rss_rlim = pinfo[0].p_uru_maxrss; + buf->vsize = buf->size = (guint64)pagetok + (pinfo[0].p_vm_tsize + pinfo[0].p_vm_dsize + pinfo[0].p_vm_ssize) + << LOG1024; + buf->resident = buf->rss = (guint64)pagetok + (pinfo[0].p_vm_rssize) << LOG1024; + + /* Now we get the shared memory. */ + + buf->share = pinfo[0].p_uru_ixrss; + + buf->flags = _glibtop_sysdeps_proc_mem | + _glibtop_sysdeps_proc_mem_share; +} diff --git a/sysdeps/openbsd/procopenfiles.c b/sysdeps/openbsd/procopenfiles.c new file mode 100644 index 0000000..a651da3 --- /dev/null +++ b/sysdeps/openbsd/procopenfiles.c @@ -0,0 +1,198 @@ +/* Copyright (C) 1998-99 Martin Baulig + Copyright (C) 2004 Nicol\ufffds Lichtmaier + Copyright (C) 2007 Joe Marcus Clarke + Copyright (C) 2013 Robert Nagy + This file is part of LibGTop 1.0. + + Modified by Nicol\ufffds Lichtmaier to give a process open files. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#define _KERNEL +#include +#undef _KERNEL +#include +#include +#include +#include +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_open_files = +(1L << GLIBTOP_PROC_OPEN_FILES_NUMBER)| +(1L << GLIBTOP_PROC_OPEN_FILES_TOTAL)| +(1L << GLIBTOP_PROC_OPEN_FILES_SIZE); + +kvm_t *kd; + +struct filearg { + SLIST_ENTRY(filearg) next; + dev_t dev; + ino_t ino; + char *name; + TAILQ_HEAD(fuserhead, fuser) fusers; +}; + +SLIST_HEAD(fileargs, filearg); + +struct fileargs fileargs = SLIST_HEAD_INITIALIZER(fileargs); + +/* Init function. */ + +void +_glibtop_init_proc_open_files_s (glibtop *server) +{ + server->sysdeps.proc_open_files = _glibtop_sysdeps_proc_open_files; +} + +static char * +addr_to_string(struct kinfo_file *kf) +{ + char *buffer = NULL; + struct in_addr faddr; + + memcpy(&faddr, kf->inp_faddru, sizeof(faddr)); + + if ((kf->so_protocol == IPPROTO_TCP) || + (kf->so_protocol == IPPROTO_UDP)) { + if (kf->inp_fport) { + buffer = g_strdup(faddr.s_addr == INADDR_ANY ? "*" : + inet_ntoa(faddr)); + } + } + + return buffer; +} + +glibtop_open_files_entry * +glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pid_t pid) +{ + struct kinfo_file *kf, *kflast; + int cnt; + char kbuf[_POSIX2_LINE_MAX]; + GArray *entries; + + memset(buf, 0, sizeof (glibtop_proc_open_files)); + + if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, kbuf)) == NULL) + g_warning("%s", kbuf); + + if ((kf = kvm_getfiles(kd, KERN_FILE_BYPID, pid, sizeof(*kf), &cnt)) == NULL) + g_warning("%s", kvm_geterr(kd)); + + entries = g_array_new(FALSE, FALSE, sizeof(glibtop_open_files_entry)); + + for (kflast = &kf[cnt]; kf < kflast; ++kf) { + glibtop_open_files_entry entry = {0}; + + if (kf->fd_fd < 0) + continue; + + if (kf->f_type == DTYPE_SOCKET) { + if (kf->so_family == AF_LOCAL) { + entry.type = GLIBTOP_FILE_TYPE_LOCALSOCKET; + static char *stypename[] = { + "unused", /* 0 */ + "stream", + "dgram", + "raw", + "rdm", + "seqpak" + }; +#define STYPEMAX 5 + char *stype, stypebuf[24]; + + if (kf->so_type > STYPEMAX) { + snprintf(stypebuf, sizeof(stypebuf), "?%d", kf->so_type); + stype = stypebuf; + } else { + stype = stypename[kf->so_type]; + } + g_strlcpy(entry.info.localsock.name, stype, + sizeof(entry.info.localsock.name)); + } else if (kf->so_family == AF_INET || + kf->so_family == AF_INET6) { + char *addrstr; + + if (kf->so_family == AF_INET) + entry.type = GLIBTOP_FILE_TYPE_INETSOCKET; + else + entry.type = GLIBTOP_FILE_TYPE_INET6SOCKET; + + addrstr = addr_to_string(kf); + g_strlcpy(entry.info.sock.dest_host, + addrstr, + sizeof(entry.info.sock.dest_host)); + g_free(addrstr); + entry.info.sock.dest_port = kf->inp_fport ? ntohs(kf->inp_fport) : 0; + } + } else if (kf->f_type == DTYPE_PIPE) { + entry.type = GLIBTOP_FILE_TYPE_PIPE; + } else if (kf->f_type == DTYPE_VNODE) { + int badtype = 0; + char nbuf[MAXPATHLEN]; + + entry.type = GLIBTOP_FILE_TYPE_FILE; + + if ((kf->v_type == VNON) || + (kf->v_type == VBAD) || + (kf->v_tag == VT_NON && !(kf->v_flag & VCLONE))) { + badtype = 1; + } + + if (badtype) + continue; + + if ((kf->v_type == VBLK) || + (kf->v_type == VCHR)) { + snprintf(nbuf, sizeof(nbuf), "/dev/%s", + devname(kf->va_rdev, kf->v_type == VCHR ? S_IFCHR : S_IFBLK)); + } else { + snprintf(nbuf, sizeof(nbuf), "inode %llu on %s", kf->va_fileid, + kf->f_mntonname); + } + g_strlcpy(entry.info.file.name, nbuf, + sizeof(entry.info.file.name)); + } else + continue; + + entry.fd = kf->fd_fd; + + g_array_append_val(entries, entry); + } + + buf->flags = _glibtop_sysdeps_proc_open_files; + buf->number = entries->len; + buf->size = sizeof(glibtop_open_files_entry); + buf->total = buf->number * buf->size; + + return (glibtop_open_files_entry*)g_array_free(entries, FALSE); +} diff --git a/sysdeps/openbsd/procsegment.c b/sysdeps/openbsd/procsegment.c new file mode 100644 index 0000000..2bee4a5 --- /dev/null +++ b/sysdeps/openbsd/procsegment.c @@ -0,0 +1,77 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_segment = +(1L << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_DATA_RSS); + +static int pagesize; + +/* Init function. */ + +void +_glibtop_init_proc_segment_p (glibtop *server) +{ + pagesize = getpagesize (); + server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_segment_p (glibtop *server, + glibtop_proc_segment *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + int count = 0; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0); + + memset (buf, 0, sizeof (glibtop_proc_segment)); + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + /* Get the process info from the kernel */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, + sizeof (*pinfo), &count); + if (pinfo == NULL) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + + buf->text_rss = pinfo[0].p_vm_tsize * pagesize; + buf->data_rss = pinfo[0].p_vm_dsize * pagesize; + + buf->flags = _glibtop_sysdeps_proc_segment; +} diff --git a/sysdeps/openbsd/procsignal.c b/sysdeps/openbsd/procsignal.c new file mode 100644 index 0000000..ad16f75 --- /dev/null +++ b/sysdeps/openbsd/procsignal.c @@ -0,0 +1,89 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_signal = +(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + +(1L << GLIBTOP_PROC_SIGNAL_BLOCKED) + +(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + +(1L << GLIBTOP_PROC_SIGNAL_SIGCATCH); + +/* Init function. */ + +void +_glibtop_init_proc_signal_p (glibtop *server) +{ + server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; +} + +void +glibtop_get_proc_signal_p (glibtop *server, + glibtop_proc_signal *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + int count = 0; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0); + + memset (buf, 0, sizeof (glibtop_proc_signal)); + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, + sizeof (*pinfo), &count); + if (pinfo == NULL) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + + /* signal: mask of pending signals. + * pinfo [0].kp_proc.p_siglist + */ + buf->signal [0] = pinfo [0].p_siglist; + + /* blocked: mask of blocked signals. + * pinfo [0].kp_proc.p_sigmask + */ + buf->blocked [0] = pinfo [0].p_sigmask; + + /* sigignore: mask of ignored signals. + * pinfo [0].kp_proc.p_sigignore + */ + buf->sigignore [0] = pinfo [0].p_sigignore; + + /* sigcatch: mask of caught signals. + * pinfo [0].kp_proc.p_sigcatch + */ + buf->sigcatch [0] = pinfo [0].p_sigcatch; + + buf->flags = _glibtop_sysdeps_proc_signal; +} diff --git a/sysdeps/openbsd/procstate.c b/sysdeps/openbsd/procstate.c new file mode 100644 index 0000000..d277acb --- /dev/null +++ b/sysdeps/openbsd/procstate.c @@ -0,0 +1,131 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_state = +(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_UID) + +(1L << GLIBTOP_PROC_STATE_GID); + +static const unsigned long _glibtop_sysdeps_proc_state_new = +0; + +/* Init function. */ + +void +_glibtop_init_proc_state_p (glibtop *server) +{ + server->sysdeps.proc_state = _glibtop_sysdeps_proc_state | + _glibtop_sysdeps_proc_state_new; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_state_p (glibtop *server, + glibtop_proc_state *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + int count = 0; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_STATE), 0); + + memset (buf, 0, sizeof (glibtop_proc_state)); + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, + sizeof (*pinfo), &count); + if (pinfo == NULL) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + +#define PROC_COMM p_comm +#define PROC_SVUID p_svuid +#define PROC_SVGID p_svgid +#define PROC_STAT p_stat + + g_strlcpy (buf->cmd, pinfo [0].PROC_COMM, sizeof buf->cmd); + + buf->uid = pinfo [0].PROC_SVUID; + buf->gid = pinfo [0].PROC_SVGID; + + /* Set the flags for the data we're about to return*/ + buf->flags = _glibtop_sysdeps_proc_state | + _glibtop_sysdeps_proc_state_new; + +#if LIBGTOP_VERSION_CODE >= 1001000 + switch (pinfo [0].PROC_STAT) { + case SIDL: + buf->state = 0; + break; + case SRUN: + buf->state = GLIBTOP_PROCESS_RUNNING; + break; +#ifdef SSLEEP + case SSLEEP: + buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE; + break; +#endif + case SSTOP: + buf->state = GLIBTOP_PROCESS_STOPPED; + break; + case SZOMB: + buf->state = GLIBTOP_PROCESS_ZOMBIE; + break; + default: + return; + } +#else + switch (pinfo [0].PROC_STAT) { + case SIDL: + buf->state = 'D'; + break; + case SRUN: + buf->state = 'R'; + break; +#ifdef SSLEEP + case SSLEEP: + buf->state = 'S'; + break; +#endif + case SSTOP: + buf->state = 'T'; + break; + case SZOMB: + buf->state = 'Z'; + break; + default: + return; + } +#endif + + buf->flags |= (1L << GLIBTOP_PROC_STATE_STATE); +} diff --git a/sysdeps/openbsd/proctime.c b/sysdeps/openbsd/proctime.c new file mode 100644 index 0000000..d821289 --- /dev/null +++ b/sysdeps/openbsd/proctime.c @@ -0,0 +1,101 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_time = +(1L << GLIBTOP_PROC_TIME_RTIME) + (1L << GLIBTOP_PROC_TIME_FREQUENCY); + +static const unsigned long _glibtop_sysdeps_proc_time_user = +(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_STIME) + +(1L << GLIBTOP_PROC_TIME_CUTIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) + +(1L << GLIBTOP_PROC_TIME_START_TIME); + +#define tv2sec(tv) (((guint64) tv.tv_sec * 1000000) + (guint64) tv.tv_usec) + +static unsigned int clockrate; +static int mib [] = { CTL_KERN, KERN_CLOCKRATE }; + +/* Init function. */ + +void +_glibtop_init_proc_time_p (glibtop *server) +{ + struct clockinfo ci; + size_t length; + length = sizeof (ci); + if (sysctl (mib, 2, &ci, &length, NULL, 0) == 0) + clockrate = ci.hz; + if (!clockrate) + clockrate = 1; /* XXX avoid div by 0 later */ + + server->sysdeps.proc_time = _glibtop_sysdeps_proc_time | + _glibtop_sysdeps_proc_time_user; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + int count; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_TIME), 0); + + memset (buf, 0, sizeof (glibtop_proc_time)); + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, + sizeof (*pinfo), &count); + if (pinfo == NULL) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + + buf->rtime = pinfo[0].p_rtime_sec * clockrate + + pinfo[0].p_rtime_usec * clockrate / 1000000; + buf->frequency = clockrate; + + buf->flags = _glibtop_sysdeps_proc_time; + + buf->utime = pinfo[0].p_uutime_sec * 1000000 + + pinfo[0].p_uutime_usec; + buf->stime = pinfo[0].p_ustime_sec * 1000000 + + pinfo[0].p_ustime_usec; + buf->cutime = pinfo[0].p_uctime_sec * 1000000 + + pinfo[0].p_uctime_usec; /* XXX is u+s */ + buf->cstime = 0; /* XXX */ + buf->start_time = pinfo[0].p_ustart_sec; + + buf->flags |= _glibtop_sysdeps_proc_time_user; +} + diff --git a/sysdeps/openbsd/procuid.c b/sysdeps/openbsd/procuid.c new file mode 100644 index 0000000..d714353 --- /dev/null +++ b/sysdeps/openbsd/procuid.c @@ -0,0 +1,102 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_uid = +(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) + +(1L << GLIBTOP_PROC_UID_GID) + +(1L << GLIBTOP_PROC_UID_EGID) + (1L << GLIBTOP_PROC_UID_PID) + +(1L << GLIBTOP_PROC_UID_PPID) + (1L << GLIBTOP_PROC_UID_PGRP) + +(1L << GLIBTOP_PROC_UID_TPGID) + (1L << GLIBTOP_PROC_UID_PRIORITY) + +(1L << GLIBTOP_PROC_UID_NICE); + +static const unsigned long _glibtop_sysdeps_proc_uid_groups = +0L; + +/* Init function. */ + +void +_glibtop_init_proc_uid_p (glibtop *server) +{ + server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid | + _glibtop_sysdeps_proc_uid_groups; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, + pid_t pid) +{ + struct kinfo_proc *pinfo; + int count = 0; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_UID), 0); + + memset (buf, 0, sizeof (glibtop_proc_uid)); + + /* It does not work for the swapper task. */ + if (pid == 0) return; + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, + sizeof (*pinfo), &count); + if (pinfo == NULL) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; + } + +#define PROC_RUID p_ruid +#define PROC_SVUID p_svuid +#define PROC_RGID p_rgid +#define PROC_SVGID p_svgid +#define PROC_PID p_pid +#define PROC_PPID p_ppid +#define PROC_PGID p__pgid +#define PROC_TPGID p_tpgid +#define PROC_NICE p_nice +#define PROC_PRIORITY p_priority + + buf->uid = pinfo [0].PROC_RUID; + buf->euid = pinfo [0].PROC_SVUID; + buf->gid = pinfo [0].PROC_RGID; + buf->egid = pinfo [0].PROC_SVGID; + + buf->pid = pinfo [0].PROC_PID; + buf->ppid = pinfo [0].PROC_PPID; + buf->pgrp = pinfo [0].PROC_PGID; + buf->tpgid = pinfo [0].PROC_TPGID; + + buf->nice = pinfo [0].PROC_NICE; + buf->priority = pinfo [0].PROC_PRIORITY; + + /* Set the flags for the data we're about to return*/ + buf->flags = _glibtop_sysdeps_proc_uid; + + /* Use LibGTop conditionals here so we can more easily merge this + * code into the LIBGTOP_STABLE_1_0 branch. */ +} diff --git a/sysdeps/openbsd/procwd.c b/sysdeps/openbsd/procwd.c new file mode 100644 index 0000000..462f8c3 --- /dev/null +++ b/sysdeps/openbsd/procwd.c @@ -0,0 +1,47 @@ +/* Copyright (C) 2007 Joe Marcus Clarke + This file is part of LibGTop 2. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_wd = +(1 << GLIBTOP_PROC_WD_EXE) | +(1 << GLIBTOP_PROC_WD_ROOT) | +(1 << GLIBTOP_PROC_WD_NUMBER); + +void +_glibtop_init_proc_wd_s(glibtop *server) +{ + server->sysdeps.proc_wd = _glibtop_sysdeps_proc_wd; +} + +char** +glibtop_get_proc_wd_s(glibtop *server, glibtop_proc_wd *buf, pid_t pid) +{ + /* TODO */ + return NULL; +} diff --git a/sysdeps/openbsd/sem_limits.c b/sysdeps/openbsd/sem_limits.c new file mode 100644 index 0000000..df1dfc2 --- /dev/null +++ b/sysdeps/openbsd/sem_limits.c @@ -0,0 +1,94 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , August 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +/* #define _KERNEL to get declaration of `struct seminfo'. */ + +#define _KERNEL 1 + +#include +#include + +static unsigned long _glibtop_sysdeps_sem_limits = +(1L << GLIBTOP_IPC_SEMMNI) + +(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) + +(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) + +(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) + +(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM); + +/* The values in this structure never change at runtime, so we only + * read it once during initialization. We have to use the name `_seminfo' + * since `seminfo' is already declared external in . */ +static struct seminfo _seminfo; + +/* nlist structure for kernel access */ +static struct nlist nlst [] = { + { "_seminfo" }, + { 0 } +}; + +/* Init function. */ + +void +_glibtop_init_sem_limits_p (glibtop *server) +{ + if (kvm_nlist (server->machine->kd, nlst) < 0) { + glibtop_warn_io_r (server, "kvm_nlist (sem_limits)"); + return; + } + + if (kvm_read (server->machine->kd, nlst [0].n_value, + &_seminfo, sizeof (_seminfo)) != sizeof (_seminfo)) { + glibtop_warn_io_r (server, "kvm_read (seminfo)"); + return; + } + + server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; +} + +/* Provides information about sysv sem limits. */ + +void +glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) +{ + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SEM_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_sem_limits)); + + if (server->sysdeps.sem_limits == 0) + return; + + buf->semmni = _seminfo.semmni; + buf->semmns = _seminfo.semmns; + buf->semmnu = _seminfo.semmnu; + buf->semmsl = _seminfo.semmsl; + buf->semopm = _seminfo.semopm; + buf->semvmx = _seminfo.semvmx; + buf->semaem = _seminfo.semaem; + + buf->flags = _glibtop_sysdeps_sem_limits; +} diff --git a/sysdeps/openbsd/shm_limits.c b/sysdeps/openbsd/shm_limits.c new file mode 100644 index 0000000..16fc5cf --- /dev/null +++ b/sysdeps/openbsd/shm_limits.c @@ -0,0 +1,86 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , August 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include + +static unsigned long _glibtop_sysdeps_shm_limits = +(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) + +(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) + +(1L << GLIBTOP_IPC_SHMALL); + +/* The values in this structure never change at runtime, so we only + * read it once during initialization. We have to use the name `_shminfo' + * since `shminfo' is already declared external in . */ +static struct shminfo _shminfo; + +/* nlist structure for kernel access */ +static struct nlist nlst [] = { + { "_shminfo" }, + { 0 } +}; + +/* Init function. */ + +void +_glibtop_init_shm_limits_p (glibtop *server) +{ + if (kvm_nlist (server->machine->kd, nlst) < 0) { + glibtop_warn_io_r (server, "kvm_nlist (shm_limits)"); + return; + } + + if (kvm_read (server->machine->kd, nlst [0].n_value, + &_shminfo, sizeof (_shminfo)) != sizeof (_shminfo)) { + glibtop_warn_io_r (server, "kvm_read (shminfo)"); + return; + } + + server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) +{ + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SHM_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_shm_limits)); + + if (server->sysdeps.shm_limits == 0) + return; + + buf->shmmax = _shminfo.shmmax; + buf->shmmin = _shminfo.shmmin; + buf->shmmni = _shminfo.shmmni; + buf->shmseg = _shminfo.shmseg; + buf->shmall = _shminfo.shmall; + + buf->flags = _glibtop_sysdeps_shm_limits; +} diff --git a/sysdeps/openbsd/siglist.c b/sysdeps/openbsd/siglist.c new file mode 100644 index 0000000..48ccad7 --- /dev/null +++ b/sysdeps/openbsd/siglist.c @@ -0,0 +1,60 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 1, "SIGHUP", "Hangup" }, + { 2, "SIGINT", "Interrupt" }, + { 3, "SIGQUIT", "Quit" }, + { 4, "SIGILL", "Illegal Instruction" }, + { 5, "SIGTRAP", "Trace/Breakpoint Trap" }, + { 6, "SIGABRT", "Abort" }, + { 7, "SIGEMT", "Emulation Trap" }, + { 8, "SIGFPE", "Arithmetic Exception" }, + { 9, "SIGKILL", "Killed" }, + { 10, "SIGBUS", "Bus Error" }, + { 11, "SIGSEGV", "Segmentation Fault" }, + { 12, "SIGSYS", "Bad System Call" }, + { 13, "SIGPIPE", "Broken Pipe" }, + { 14, "SIGALRM", "Alarm Clock" }, + { 15, "SIGTERM", "Terminated" }, + { 16, "SIGURG", "Urgent Condition Present On Socket" }, + { 17, "SIGSTOP", "Stop (cannot be caught or ignored)" }, + { 18, "SIGTSTP", "Stop Signal Generated From Keyboard" }, + { 19, "SIGCONT", "Continue After Stop" }, + { 20, "SIGCHLD", "Child Status Has Changed" }, + { 21, "SIGTTIN", "Background Read Attempted From Control Terminal" }, + { 22, "SIGTTOU", "Background Write Attempted To Control Terminal" }, + { 23, "SIGIO", "I/O Is Possible On A Descriptor" }, + { 24, "SIGXCPU", "CPU Time Limit Exceeded" }, + { 25, "SIGXFSZ", "File Size Limit Exceeded" }, + { 26, "SIGVTALRM","Virtual Time Alarm" }, + { 27, "SIGPROF", "Profiling Timer Alarm" }, + { 28, "SIGWINCH","Window Size Change" }, + { 29, "SIGINFO", "Status Request From Keyboard" }, + { 30, "SIGUSR1", "User Defined Signal 1" }, + { 31, "SIGUSR2", "User Defined Signal 2" }, + { 32, "SIGTHR", "Thread Interrupt" }, + { 0, NULL, NULL } +}; diff --git a/sysdeps/openbsd/suid_open.c b/sysdeps/openbsd/suid_open.c new file mode 100644 index 0000000..b6b202f --- /dev/null +++ b/sysdeps/openbsd/suid_open.c @@ -0,0 +1,95 @@ +/* Copyright (C) 1998 Joshua Sled + This file is part of LibGTop 1.0. + + Contributed by Joshua Sled , July 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags) +{ + const _glibtop_init_func_t *init_fkt; + + if (server == NULL) + glibtop_error_r (NULL, "glibtop_init_p (server == NULL)"); + + /* Do the initialization, but only if not already initialized. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_SYSDEPS) == 0) { + glibtop_open_p (server, "glibtop", features, flags); + + for (init_fkt = _glibtop_init_hook_p; *init_fkt; init_fkt++) + (*init_fkt) (server); + + server->flags |= _GLIBTOP_INIT_STATE_SYSDEPS; + } +} + +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags) +{ + char errbuf[_POSIX2_LINE_MAX]; +#ifdef LIBGTOP_ENABLE_DEBUG + fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ()); +#endif + + /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ + server->machine->uid = getuid (); + server->machine->euid = geteuid (); + server->machine->gid = getgid (); + server->machine->egid = getegid (); + /* Setup machine-specific data */ + server->machine->kd = kvm_openfiles (NULL, NULL, NULL, O_RDONLY, errbuf); + + if (server->machine->kd == NULL) + glibtop_error_io_r (server, "kvm_open"); + + /* Drop priviledges. */ + + if (setreuid (server->machine->euid, server->machine->uid)) + _exit (1); + + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); + + /* !!! END OF SUID ROOT PART !!! */ + + /* Our effective uid is now those of the user invoking the server, + * so we do no longer have any priviledges. */ + + /* NOTE: On OpenBSD, we do not need to be suid root, we just need to + * be sgid kmem. + * + * The server will only use setegid() to get back it's priviledges, + * so it will fail if it is suid root and not sgid kmem. */ +} diff --git a/sysdeps/openbsd/swap.c b/sysdeps/openbsd/swap.c new file mode 100644 index 0000000..d4d5c96 --- /dev/null +++ b/sysdeps/openbsd/swap.c @@ -0,0 +1,129 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_swap = +(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) + +(1L << GLIBTOP_SWAP_FREE) + (1L << GLIBTOP_SWAP_PAGEIN) + +(1L << GLIBTOP_SWAP_PAGEOUT); + +#include +#include +#include + +static int mib_uvmexp [] = { CTL_VM, VM_UVMEXP }; + +/* Init function. */ + +void +_glibtop_init_swap_p (glibtop *server) +{ + server->sysdeps.swap = _glibtop_sysdeps_swap; +} + +/* Provides information about swap usage. */ + +/* + * This function is based on a program called swapinfo written + * by Kevin Lahey . + */ + +void +glibtop_get_swap_p (glibtop *server, glibtop_swap *buf) +{ + struct swapent *swaplist; + + int nswap, i; + guint64 avail = 0, inuse = 0; + + int blocksize = 512; /* Default blocksize, use getbize() ? */ + int blockdiv = blocksize / DEV_BSIZE; + + struct uvmexp uvmexp; + size_t length_uvmexp; + static int swappgsin = -1; + static int swappgsout = -1; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SWAP), 0); + + memset (buf, 0, sizeof (glibtop_swap)); + + if (server->sysdeps.swap == 0) + return; + + length_uvmexp = sizeof (uvmexp); + if (sysctl (mib_uvmexp, 2, &uvmexp, &length_uvmexp, NULL, 0)) { + glibtop_warn_io_r (server, "sysctl (vm.uvmexp)"); + return; + } + + if (swappgsin < 0) { + buf->pagein = 0; + buf->pageout = 0; + } else { + buf->pagein = uvmexp.pgswapin - swappgsin; + buf->pageout = uvmexp.pgswapout - swappgsout; + } + + swappgsin = uvmexp.pgswapin; + swappgsout = uvmexp.pgswapout; + + nswap = swapctl (SWAP_NSWAP, 0, 0); + if (nswap < 0) { + glibtop_warn_io_r (server, "swapctl (SWAP_NSWAP)"); + return; + } + + swaplist = g_malloc (nswap * sizeof (struct swapent)); + + if (swapctl (SWAP_STATS, swaplist, nswap) != nswap) { + glibtop_warn_io_r (server, "swapctl (SWAP_STATS)"); + g_free (swaplist); + return; + } + + /* Total things up, returns in 512 bytes blocks! */ + for (i = 0; i < nswap; i++) { + if (swaplist[i].se_flags & SWF_ENABLE) { + avail += (swaplist[i].se_nblks / blockdiv); + inuse += (swaplist[i].se_inuse / blockdiv); + } + } + + /* Convert back to bytes, the libgtop2 is not clear about unites... */ + avail *= 512; + inuse *= 512; + + g_free (swaplist); + + buf->flags = _glibtop_sysdeps_swap; + + buf->used = inuse; + buf->free = avail; + + buf->total = inuse + avail; +} diff --git a/sysdeps/openbsd/sysinfo.c b/sysdeps/openbsd/sysinfo.c new file mode 100644 index 0000000..20bc26d --- /dev/null +++ b/sysdeps/openbsd/sysinfo.c @@ -0,0 +1,114 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_sysinfo = +(1L << GLIBTOP_SYSINFO_CPUINFO); + +static glibtop_sysinfo sysinfo = { .flags = 0 }; + +static void +init_sysinfo (glibtop *server) +{ + char *model = NULL; + int mib[2]; + guint ncpus = 1; + guint mhz = 0; + size_t len; + + if (G_LIKELY (sysinfo.flags)) + return; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0); + + mib[0] = CTL_HW; + + /* Get the number of CPU's present */ + mib[1] = HW_NCPU; + + len = sizeof(ncpus); + if (sysctl(mib, 2, &ncpus, &len, NULL, 0) != 0) + printf("Couldn't determine hw.ncpu.\n"); + + /* Get the CPU model */ + mib[1] = HW_MODEL; + len = 0; + + if (sysctl(mib, 2, NULL, &len, NULL, 0) != -1) { + model = g_malloc (len); + sysctl(mib, 2, model, &len, NULL, 0); + } else { + printf("Couldn't determine hw.model.\n"); + } + + /* Get the clockrate */ + mib[1] = HW_CPUSPEED; + len = sizeof(mhz); + + if (sysctl(mib, 2, &mhz, &len, NULL, 0) != 0) + printf("Couldn't determine hw.cpuspeed.\n"); + + for (sysinfo.ncpu = 0; + sysinfo.ncpu < GLIBTOP_NCPU && sysinfo.ncpu < ncpus; + sysinfo.ncpu++) { + glibtop_entry * const cpuinfo = &sysinfo.cpuinfo[sysinfo.ncpu]; + + cpuinfo->labels = g_ptr_array_new (); + + cpuinfo->values = g_hash_table_new_full(g_str_hash, + g_str_equal, + NULL, g_free); + + g_ptr_array_add (cpuinfo->labels, "processor"); + g_hash_table_insert (cpuinfo->values, "processor", + g_strdup_printf("%u", (guint)sysinfo.ncpu)); + + g_ptr_array_add (cpuinfo->labels, "vendor_id"); + g_hash_table_insert (cpuinfo->values, "vendor_id", + g_strdup(model)); + + g_ptr_array_add (cpuinfo->labels, "model name"); + g_hash_table_insert (cpuinfo->values, "model name", + g_strdup(model)); + + g_ptr_array_add (cpuinfo->labels, "cpu MHz"); + g_hash_table_insert (cpuinfo->values, "cpu MHz", + g_strdup_printf("%d", mhz)); + } + + g_free (model); + + sysinfo.flags = _glibtop_sysdeps_sysinfo; +} + +const glibtop_sysinfo * +glibtop_get_sysinfo_s (glibtop *server) +{ + init_sysinfo (server); + return &sysinfo; +} diff --git a/sysdeps/openbsd/uptime.c b/sysdeps/openbsd/uptime.c new file mode 100644 index 0000000..11a2a99 --- /dev/null +++ b/sysdeps/openbsd/uptime.c @@ -0,0 +1,75 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include + +static const unsigned long _glibtop_sysdeps_uptime = +(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME) + +(1UL << GLIBTOP_UPTIME_BOOT_TIME); + +static const unsigned long _required_cpu_flags = +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_IDLE) + +(1L << GLIBTOP_CPU_FREQUENCY); + +/* Init function. */ + +void +_glibtop_init_uptime_s (glibtop *server) +{ + server->sysdeps.uptime = _glibtop_sysdeps_uptime; +} + +/* Provides uptime and idle time. */ + +void +glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf) +{ + time_t now; + int mib[2]; + struct timeval boottime; + size_t size; + glibtop_cpu cpu; + + mib[0] = CTL_KERN; + mib[1] = KERN_BOOTTIME; + size = sizeof(boottime); + if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && + boottime.tv_sec != 0) { + time(&now); + buf->uptime = now - boottime.tv_sec; + buf->boot_time = boottime.tv_sec; + } + + glibtop_get_cpu_s (server, &cpu); + + /* Put something clever in buf->idletime: CP_IDLE. */ + buf->idletime = (double) cpu.idle / (double) cpu.frequency; + buf->idletime /= (double) (server->ncpu + 1); + + buf->flags = _glibtop_sysdeps_uptime; +} diff --git a/sysdeps/osf1/ChangeLog b/sysdeps/osf1/ChangeLog new file mode 100644 index 0000000..1518b89 --- /dev/null +++ b/sysdeps/osf1/ChangeLog @@ -0,0 +1,51 @@ +2004-06-06 Benoît Dejean + + * procdata.c: (glibtop_get_procdata_r): Removed duplicated memset. + * procstate.c: (glibtop_get_proc_state_p): Replaced strncpy by g_strlcpy. + +2004-05-25 Benoît Dejean + + * sem_limits.c: + * shm_limits.c: + * swap.c: Added missing const qualifiers. + + * uptime.c: (glibtop_get_uptime_s): Cleaned up. Added boot_time. + +2003-10-21 Bastien Nocera + + * Makefile.am: install only one library, libgtop-2.0 + Fix build-time warnings due to the redefinition of guint64 + +2003-10-20 Bastien Nocera + + * glibtop_server.h: + * glibtop_suid.h: + * procargs.c: + * proclist.c: + * procmap.c: fixed compilation + +2003-10-20 Bastien Nocera + + * proclist.c: (glibtop_get_proclist_p): + replace all the xmalloc crap by glib memory management functions + +2001-10-17 Abel Cheung + + * Makefile.am: move header to $(includedir)/libgtop-1.0/glibtop. + +1999-05-11 Martin Baulig + + * procstate.c: Fixed implementation of the `state' field; added + `ruid' and `rgid' fields. + +1999-02-19 Martin Baulig + + * procmap.c, procargs.c, netload.c: Copied from stub_suid. + + * proclist.c, procsegment.c: Make them compile again. + +1998-10-25 Martin Baulig + + * ChangeLog: New file. + * ppp.c: New file. + diff --git a/sysdeps/osf1/Makefile.am b/sysdeps/osf1/Makefile.am new file mode 100644 index 0000000..9b87cc8 --- /dev/null +++ b/sysdeps/osf1/Makefile.am @@ -0,0 +1,22 @@ + +AM_CPPFLAGS = @AM_CPPFLAGS@ + +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la + +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ + uptime.c loadavg.c shm_limits.c msg_limits.c \ + sem_limits.c ppp.c +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_2_0_la_LIBADD = -lmach + +libgtop_sysdeps_suid_2_0_la_SOURCES = open_suid.c close_suid.c proclist.c \ + procstate.c procuid.c proctime.c procmem.c \ + procsignal.c prockernel.c procsegment.c \ + procmap.c procargs.c netload.c +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_suid_2_0_la_LIBADD = -lmach + +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h +libgtopincludedir = $(includedir)/libgtop-2.0 + +noinst_HEADERS = glibtop_suid.h diff --git a/sysdeps/osf1/Makefile.in b/sysdeps/osf1/Makefile.in new file mode 100644 index 0000000..dc69e09 --- /dev/null +++ b/sysdeps/osf1/Makefile.in @@ -0,0 +1,778 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = sysdeps/osf1 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libgtopinclude_HEADERS) \ + $(noinst_HEADERS) $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libgtop_sysdeps_2_0_la_DEPENDENCIES = +am_libgtop_sysdeps_2_0_la_OBJECTS = open.lo close.lo siglist.lo cpu.lo \ + mem.lo swap.lo uptime.lo loadavg.lo shm_limits.lo \ + msg_limits.lo sem_limits.lo ppp.lo +libgtop_sysdeps_2_0_la_OBJECTS = $(am_libgtop_sysdeps_2_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgtop_sysdeps_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +libgtop_sysdeps_suid_2_0_la_DEPENDENCIES = +am_libgtop_sysdeps_suid_2_0_la_OBJECTS = open_suid.lo close_suid.lo \ + proclist.lo procstate.lo procuid.lo proctime.lo procmem.lo \ + procsignal.lo prockernel.lo procsegment.lo procmap.lo \ + procargs.lo netload.lo +libgtop_sysdeps_suid_2_0_la_OBJECTS = \ + $(am_libgtop_sysdeps_suid_2_0_la_OBJECTS) +libgtop_sysdeps_suid_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_suid_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +DIST_SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libgtopincludedir)" +HEADERS = $(libgtopinclude_HEADERS) $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + ChangeLog +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ + uptime.c loadavg.c shm_limits.c msg_limits.c \ + sem_limits.c ppp.c + +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_2_0_la_LIBADD = -lmach +libgtop_sysdeps_suid_2_0_la_SOURCES = open_suid.c close_suid.c proclist.c \ + procstate.c procuid.c proctime.c procmem.c \ + procsignal.c prockernel.c procsegment.c \ + procmap.c procargs.c netload.c + +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_suid_2_0_la_LIBADD = -lmach +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h +libgtopincludedir = $(includedir)/libgtop-2.0 +noinst_HEADERS = glibtop_suid.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sysdeps/osf1/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu sysdeps/osf1/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgtop_sysdeps-2.0.la: $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_2_0_la_LINK) $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_LIBADD) $(LIBS) + +libgtop_sysdeps_suid-2.0.la: $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_suid_2_0_la_LINK) $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close_suid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netload.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_suid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prockernel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsegment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsignal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procstate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siglist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-libgtopincludeHEADERS: $(libgtopinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgtopincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgtopincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgtopincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgtopincludedir)" || exit $$?; \ + done + +uninstall-libgtopincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgtopincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libgtopincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libgtopincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libgtopincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libgtopincludeHEADERS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libgtopincludeHEADERS + +.PRECIOUS: Makefile + + +# 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: diff --git a/sysdeps/osf1/close.c b/sysdeps/osf1/close.c new file mode 100644 index 0000000..bee09f3 --- /dev/null +++ b/sysdeps/osf1/close.c @@ -0,0 +1,29 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +/* Closes pipe to gtop server. */ + +void +glibtop_close_s (glibtop *server) +{ } diff --git a/sysdeps/osf1/close_suid.c b/sysdeps/osf1/close_suid.c new file mode 100644 index 0000000..5679281 --- /dev/null +++ b/sysdeps/osf1/close_suid.c @@ -0,0 +1,29 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +/* Closes pipe to gtop server. */ + +void +glibtop_close_p (glibtop *server) +{ } diff --git a/sysdeps/osf1/cpu.c b/sysdeps/osf1/cpu.c new file mode 100644 index 0000000..d420e2e --- /dev/null +++ b/sysdeps/osf1/cpu.c @@ -0,0 +1,68 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_cpu = +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + +(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) + +(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY); + +/* Init function. */ + +void +_glibtop_init_cpu_s (glibtop *server) +{ + server->sysdeps.cpu = _glibtop_sysdeps_cpu; +} + +/* Provides information about cpu usage. */ + +void +glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf) +{ + struct tbl_sysinfo sysinfo; + int ret; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0); + + memset (buf, 0, sizeof (glibtop_cpu)); + + ret = table (TBL_SYSINFO, 0, (char *) &sysinfo, 1, + sizeof (struct tbl_sysinfo)); + + if (ret != 1) return; + + buf->flags = _glibtop_sysdeps_cpu; + + buf->user = sysinfo.si_user; + buf->nice = sysinfo.si_nice; + buf->sys = sysinfo.si_sys; + buf->idle = sysinfo.si_idle; + + buf->total = sysinfo.si_user + sysinfo.si_nice + + sysinfo.si_sys + sysinfo.si_idle; + + buf->frequency = sysinfo.si_hz; +} diff --git a/sysdeps/osf1/glibtop_machine.h b/sysdeps/osf1/glibtop_machine.h new file mode 100644 index 0000000..ae5cedc --- /dev/null +++ b/sysdeps/osf1/glibtop_machine.h @@ -0,0 +1,46 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_MACHINE_H__ +#define __GLIBTOP_MACHINE_H__ + +#include + +/* The following are defined in . */ + +#undef sys +#undef user +#undef idle + +G_BEGIN_DECLS + +int table (int id, int index, char *addr, int nel, u_int lel); + +struct _glibtop_machine +{ + uid_t uid, euid; /* Real and effective user id */ + gid_t gid, egid; /* Real and effective group id */ + unsigned proctable_entries; /* Max entries in the proctable */ +}; + +G_END_DECLS + +#endif diff --git a/sysdeps/osf1/glibtop_server.h b/sysdeps/osf1/glibtop_server.h new file mode 100644 index 0000000..11b37a4 --- /dev/null +++ b/sysdeps/osf1/glibtop_server.h @@ -0,0 +1,51 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SERVER_H__ +#define __GLIBTOP_SERVER_H__ + +G_BEGIN_DECLS + +#define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_MEM 0 +#define GLIBTOP_SUID_SWAP 0 +#define GLIBTOP_SUID_UPTIME 0 +#define GLIBTOP_SUID_LOADAVG 0 +#define GLIBTOP_SUID_SHM_LIMITS 0 +#define GLIBTOP_SUID_MSG_LIMITS 0 +#define GLIBTOP_SUID_SEM_LIMITS 0 +#define GLIBTOP_SUID_PROCLIST (1 << GLIBTOP_SYSDEPS_PROCLIST) +#define GLIBTOP_SUID_PROC_STATE (1 << GLIBTOP_SYSDEPS_PROC_STATE) +#define GLIBTOP_SUID_PROC_UID (1 << GLIBTOP_SYSDEPS_PROC_UID) +#define GLIBTOP_SUID_PROC_MEM (1 << GLIBTOP_SYSDEPS_PROC_MEM) +#define GLIBTOP_SUID_PROC_TIME (1 << GLIBTOP_SYSDEPS_PROC_TIME) +#define GLIBTOP_SUID_PROC_SIGNAL (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL) +#define GLIBTOP_SUID_PROC_KERNEL (1 << GLIBTOP_SYSDEPS_PROC_KERNEL) +#define GLIBTOP_SUID_PROC_SEGMENT (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT) +#define GLIBTOP_SUID_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP) +#define GLIBTOP_SUID_PROC_ARGS (1 << GLIBTOP_SYSDEPS_PROC_ARGS) +#define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) +#define GLIBTOP_SUID_NETLIST 0 +#define GLIBTOP_SUID_PPP 0 + +G_END_DECLS + +#endif diff --git a/sysdeps/osf1/glibtop_suid.h b/sysdeps/osf1/glibtop_suid.h new file mode 100644 index 0000000..407897d --- /dev/null +++ b/sysdeps/osf1/glibtop_suid.h @@ -0,0 +1,48 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SUID_H__ +#define __GLIBTOP_SUID_H__ + +#include + +G_BEGIN_DECLS + +static inline void glibtop_suid_enter (glibtop *server) { + setreuid (server->machine->uid, server->machine->euid); +}; + +static inline void glibtop_suid_leave (glibtop *server) { + if (setreuid (server->machine->euid, server->machine->uid)) + _exit (1); +}; + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags); +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags); + +G_END_DECLS + +#endif diff --git a/sysdeps/osf1/loadavg.c b/sysdeps/osf1/loadavg.c new file mode 100644 index 0000000..532360e --- /dev/null +++ b/sysdeps/osf1/loadavg.c @@ -0,0 +1,71 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_loadavg = +(1L << GLIBTOP_LOADAVG_LOADAVG); + +/* Init function. */ + +void +_glibtop_init_loadavg_s (glibtop *server) +{ + server->sysdeps.loadavg = _glibtop_sysdeps_loadavg; +} + +/* Provides load averange. */ + +void +glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf) +{ + struct tbl_loadavg loadavg; + int ret; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_LOADAVG, 0); + + memset (buf, 0, sizeof (glibtop_loadavg)); + + ret = table (TBL_LOADAVG, 0, (char *) &loadavg, 1, + sizeof (struct tbl_loadavg)); + + if (ret != 1) return; + + buf->flags = _glibtop_sysdeps_loadavg; + + if (loadavg.tl_lscale == 0) { + buf->loadavg [0] = loadavg.tl_avenrun.d [0]; + buf->loadavg [1] = loadavg.tl_avenrun.d [1]; + buf->loadavg [2] = loadavg.tl_avenrun.d [2]; + } else { + buf->loadavg [0] = + (double) loadavg.tl_avenrun.l [0] / + (double) loadavg.tl_mach_factor [0]; + buf->loadavg [1] = + (double) loadavg.tl_avenrun.l [1] + / (double) loadavg.tl_mach_factor [1]; + buf->loadavg [2] = + (double) loadavg.tl_avenrun.l [2] / + (double) loadavg.tl_mach_factor [2]; + } +} diff --git a/sysdeps/osf1/mem.c b/sysdeps/osf1/mem.c new file mode 100644 index 0000000..2896cdb --- /dev/null +++ b/sysdeps/osf1/mem.c @@ -0,0 +1,68 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_mem = +(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) + +(1L << GLIBTOP_MEM_FREE); + +/* Init function. */ + +void +_glibtop_init_mem_s (glibtop *server) +{ + server->sysdeps.mem = _glibtop_sysdeps_mem; +} + +/* Provides information about memory usage. */ + +void +glibtop_get_mem_s (glibtop *server, glibtop_mem *buf) +{ + vm_statistics_data_t vmstats; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_MEM, 0); + + memset (buf, 0, sizeof (glibtop_mem)); + + buf->flags = _glibtop_sysdeps_mem; + + (void) vm_statistics(task_self(), &vmstats); + + buf->free = vmstats.free_count * vmstats.pagesize; + buf->used = vmstats.active_count * vmstats.pagesize; + + /* [FIXME]: Is this correct? */ + + buf->total = (vmstats.active_count + vmstats.inactive_count + + vmstats.free_count + vmstats.wire_count) * + vmstats.pagesize; +} diff --git a/sysdeps/osf1/msg_limits.c b/sysdeps/osf1/msg_limits.c new file mode 100644 index 0000000..029e14b --- /dev/null +++ b/sysdeps/osf1/msg_limits.c @@ -0,0 +1,86 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_msg_limits = +(1L << GLIBTOP_IPC_MSGMAP) + (1L << GLIBTOP_IPC_MSGMAX) + +(1L << GLIBTOP_IPC_MSGMNB) + (1L << GLIBTOP_IPC_MSGMNI) + +(1L << GLIBTOP_IPC_MSGTQL); + +/* Init function. */ + +void +_glibtop_init_msg_limits_s (glibtop *server) +{ + server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf) +{ + int ret, value; + + glibtop_init_s (&server, 0, 0); + + memset (buf, 0, sizeof (glibtop_msg_limits)); + + ret = table (TBL_MSGINFO, MSGINFO_MAX, (char *) &value, 1, + sizeof (value)); + + if (ret != 1) return; + + buf->flags += (1L << GLIBTOP_IPC_MSGMAX); + + buf->msgmax = value; + + ret = table (TBL_MSGINFO, MSGINFO_MNB, (char *) &value, 1, + sizeof (value)); + + if (ret != 1) return; + + buf->flags += (1L << GLIBTOP_IPC_MSGMNB); + + buf->msgmnb = value; + + ret = table (TBL_MSGINFO, MSGINFO_MNI, (char *) &value, 1, + sizeof (value)); + + if (ret != 1) return; + + buf->flags += (1L << GLIBTOP_IPC_MSGMNI); + + buf->msgmni = value; + + ret = table (TBL_MSGINFO, MSGINFO_TQL, (char *) &value, 1, + sizeof (value)); + + if (ret != 1) return; + + buf->flags += (1L << GLIBTOP_IPC_MSGTQL); + + buf->msgtql = value; +} diff --git a/sysdeps/osf1/netload.c b/sysdeps/osf1/netload.c new file mode 100644 index 0000000..f7b2632 --- /dev/null +++ b/sysdeps/osf1/netload.c @@ -0,0 +1,44 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_netload = 0; + +/* Init function. */ + +void +_glibtop_init_netload_p (glibtop *server) +{ + server->sysdeps.netload = _glibtop_sysdeps_netload; +} + +/* Provides Network statistics. */ + +void +glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, + const char *interface) +{ + memset (buf, 0, sizeof (glibtop_netload)); +} diff --git a/sysdeps/osf1/open.c b/sysdeps/osf1/open.c new file mode 100644 index 0000000..4bf85c6 --- /dev/null +++ b/sysdeps/osf1/open.c @@ -0,0 +1,34 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include +#include + +/* Opens pipe to gtop server. Returns 0 on success and -1 on error. */ + +void +glibtop_open_s (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags) +{ } diff --git a/sysdeps/osf1/open_suid.c b/sysdeps/osf1/open_suid.c new file mode 100644 index 0000000..83a1933 --- /dev/null +++ b/sysdeps/osf1/open_suid.c @@ -0,0 +1,90 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +#include +#include + +/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags) +{ + const _glibtop_init_func_t *init_fkt; + + if (server == NULL) + glibtop_error_r (NULL, "glibtop_init_p (server == NULL)"); + + /* Do the initialization, but only if not already initialized. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_INIT) == 0) { + glibtop_open_p (server, "glibtop", features, flags); + + for (init_fkt = _glibtop_init_hook_p; *init_fkt; init_fkt++) + (*init_fkt) (server); + + server->flags |= _GLIBTOP_INIT_STATE_INIT; + } +} + +/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags) +{ + /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ + + server->name = program_name; + + server->machine->uid = getuid (); + server->machine->euid = geteuid (); + server->machine->gid = getgid (); + server->machine->egid = getegid (); + + server->machine->proctable_entries = table + (TBL_PROCINFO, 0, NULL, INT_MAX, 0); + + /* Drop priviledges; we only become root when necessary. + + setreuid (ruid, euid) - set real and effective user id; + setregid (rgid, egid) - set real and effective group id; + + */ + + if (setreuid (server->machine->euid, server->machine->uid)) + _exit (1); + + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); + + /* !!! END OF SUID ROOT PART !!! */ + + /* Our effective uid is now those of the user invoking the server, + so we do no longer have any priviledges. + */ +} diff --git a/sysdeps/osf1/ppp.c b/sysdeps/osf1/ppp.c new file mode 100644 index 0000000..0801643 --- /dev/null +++ b/sysdeps/osf1/ppp.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_ppp = 0; + +/* Init function. */ + +void +_glibtop_init_ppp_s (glibtop *server) +{ + server->sysdeps.ppp = _glibtop_sysdeps_ppp; +} + +/* Provides PPP/ISDN information. */ + +void +glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device) +{ + memset (buf, 0, sizeof (glibtop_ppp)); +} diff --git a/sysdeps/osf1/procargs.c b/sysdeps/osf1/procargs.c new file mode 100644 index 0000000..e071b90 --- /dev/null +++ b/sysdeps/osf1/procargs.c @@ -0,0 +1,45 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_args = 0; + +/* Init function. */ + +void +_glibtop_init_proc_args_p (glibtop *server) +{ + server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; +} + +/* Provides detailed information about a process. */ + +char * +glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len) +{ + memset (buf, 0, sizeof (glibtop_proc_args)); + return NULL; +} diff --git a/sysdeps/osf1/prockernel.c b/sysdeps/osf1/prockernel.c new file mode 100644 index 0000000..ba7613c --- /dev/null +++ b/sysdeps/osf1/prockernel.c @@ -0,0 +1,48 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_kernel = 0; + +/* Init function. */ + +void +_glibtop_init_proc_kernel_p (glibtop *server) +{ + server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_kernel_p (glibtop *server, glibtop_proc_kernel *buf, + pid_t pid) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_KERNEL, 0); + + memset (buf, 0, sizeof (glibtop_proc_kernel)); +} diff --git a/sysdeps/osf1/proclist.c b/sysdeps/osf1/proclist.c new file mode 100644 index 0000000..a27643b --- /dev/null +++ b/sysdeps/osf1/proclist.c @@ -0,0 +1,170 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proclist = +(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) + +(1L << GLIBTOP_PROCLIST_SIZE); + +/* Init function. */ + +void +_glibtop_init_proclist_p (glibtop *server) +{ + server->sysdeps.proclist = _glibtop_sysdeps_proclist; +} + +/* How many elements are there per proctable entry? */ + +#define ELEMENTS_PER_ENTRY 8 + +/* We have a buffer for BLOCK_COUNT pids; when it's full, it is copied + * to a newly realloc()ed area. */ + +#define BLOCK_COUNT 256 +#define BLOCK_SIZE (BLOCK_COUNT * sizeof (unsigned)) + +/* Fetch list of currently running processes. + * + * The interface of this function is a little bit different from the others: + * buf->flags is only set if the call succeeded, in this case pids_chain, + * a list of the pids of all currently running processes is returned, + * buf->number is the number of elements of this list and buf->size is + * the size of one single element (sizeof (unsigned)). The total size is + * stored in buf->total. + * + * The calling function has to free the memory to which a pointer is returned. + * + * On error, NULL is returned and buf->flags is zero. */ + +/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + +unsigned * +glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg) +{ + unsigned count = 0, total = 0; + unsigned pids [BLOCK_COUNT], *pids_chain = NULL; + unsigned pids_size = 0, pids_offset = 0, new_size; + struct tbl_procinfo procinfo [8]; + int entry, max_elements, k; + + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROCLIST, 0); + + memset (buf, 0, sizeof (glibtop_proclist)); + + for (entry = 0; entry < server->machine->proctable_entries; + entry += ELEMENTS_PER_ENTRY) + { + /* !!! THE FOLLOWING CODE RUNS SUID ROOT - + * CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + + max_elements = table + (TBL_PROCINFO, entry, (char *) &procinfo, + ELEMENTS_PER_ENTRY, sizeof (struct tbl_procinfo)); + + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + + for (k = 0; k < max_elements; k++) + { + /* Does this entry contain a real process? */ + + if (procinfo [k].pi_status == 0) + continue; + + /* Fine. Now we first try to store it in pids. + * If this buffer is full, we copy it to the + * pids_chain. */ + + if (count >= BLOCK_COUNT) { + + /* The following call to g_realloc () + * will be equivalent to g_malloc () + * if `pids_chain' is NULL. We just calculate + * the new size and copy `pids' to the + * beginning of the newly allocated block. */ + + new_size = pids_size + BLOCK_SIZE; + + pids_chain = g_realloc + (server, pids_chain, new_size); + + memcpy (pids_chain + pids_offset, + pids, BLOCK_SIZE); + + pids_size = new_size; + + pids_offset += BLOCK_COUNT; + + count = 0; + } + + /* pids is now big enough to hold at least + * one single pid. */ + + pids [count++] = procinfo [k].pi_pid; + + total++; + } + } + + /* count is only zero if an error occured + * (eg. the server is not suid root). */ + + if (!count) return NULL; + + /* The following call to g_realloc () will be equivalent to + * g_malloc () if `pids_chain' is NULL. We just calculate the + * new size and copy `pids' to the beginning of the newly allocated + * block. */ + + new_size = pids_size + count * sizeof (unsigned); + + pids_chain = g_realloc (server, pids_chain, new_size); + + memcpy (pids_chain + pids_offset, pids, count * sizeof (unsigned)); + + pids_size = new_size; + + pids_offset += BLOCK_COUNT; + + /* Since everything is ok now, we can set buf->flags, fill in the + * remaining fields and return `pids_chain'. */ + + buf->flags = _glibtop_sysdeps_proclist; + + buf->size = sizeof (unsigned); + buf->number = total; + + buf->total = total * sizeof (unsigned); + + return pids_chain; +} diff --git a/sysdeps/osf1/procmap.c b/sysdeps/osf1/procmap.c new file mode 100644 index 0000000..8203b87 --- /dev/null +++ b/sysdeps/osf1/procmap.c @@ -0,0 +1,44 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_map = 0; + +/* Init function. */ + +void +_glibtop_init_proc_map_p (glibtop *server) +{ + server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; +} + +/* Provides detailed information about a process. */ + +glibtop_map_entry * +glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_map)); + return NULL; +} diff --git a/sysdeps/osf1/procmem.c b/sysdeps/osf1/procmem.c new file mode 100644 index 0000000..0d42531 --- /dev/null +++ b/sysdeps/osf1/procmem.c @@ -0,0 +1,102 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_mem = +(1L << GLIBTOP_PROC_MEM_VSIZE) + (1L << GLIBTOP_PROC_MEM_RESIDENT) + +(1L << GLIBTOP_PROC_MEM_RSS); + +/* Init function. */ + +void +_glibtop_init_proc_mem_p (glibtop *server) +{ + server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, + pid_t pid) +{ + task_basic_info_data_t taskinfo; + int ret, info_count; + task_t thistask; + struct user u; + + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_MEM, 0); + + memset (buf, 0, sizeof (glibtop_proc_mem)); + + /* Get task structure. */ + + ret = task_by_unix_pid (task_self(), pid, &thistask); + + if (ret != KERN_SUCCESS) return; + + /* Get taskinfo about this task. */ + + info_count = TASK_BASIC_INFO_COUNT; + + ret = task_info (thistask, TASK_BASIC_INFO, + (task_info_t) &taskinfo, &info_count); + + if (ret != KERN_SUCCESS) return; + + buf->resident = taskinfo.resident_size; + buf->rss = taskinfo.resident_size; + buf->vsize = taskinfo.virtual_size; + + /* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + + ret = table (TBL_UAREA, pid, (char *) &u, 1, + sizeof (struct user)); + + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + + if (ret != 1) return; + + buf->rss_rlim = u.u_rlimit [RLIMIT_RSS].rlim_cur; + + buf->share = u.u_ru.ru_ixrss; + + buf->flags |= (1L << GLIBTOP_PROC_MEM_RSS_RLIM) | + (1L << GLIBTOP_PROC_MEM_SHARE); +} diff --git a/sysdeps/osf1/procsegment.c b/sysdeps/osf1/procsegment.c new file mode 100644 index 0000000..9b5e71d --- /dev/null +++ b/sysdeps/osf1/procsegment.c @@ -0,0 +1,79 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_segment = +(1L << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_DATA_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_START_CODE) + +(1L << GLIBTOP_PROC_SEGMENT_END_CODE) + +(1L << GLIBTOP_PROC_SEGMENT_START_STACK); + +/* Init function. */ + +void +_glibtop_init_proc_segment_p (glibtop *server) +{ + server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf, + pid_t pid) +{ + int ret; + struct user u; + + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_SEGMENT, 0); + + memset (buf, 0, sizeof (glibtop_proc_segment)); + + /* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + + ret = table (TBL_UAREA, pid, (char *) &u, 1, + sizeof (struct user)); + + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + + if (ret != 1) return; + + buf->start_code = (unsigned long) u.u_text_start; + buf->end_code = (unsigned long) u.u_data_start; + buf->start_stack = (unsigned long) u.u_stack_start; + + buf->text_rss = u.u_tsize; + buf->data_rss = u.u_dsize; + + buf->flags = _glibtop_sysdeps_proc_segment; +} diff --git a/sysdeps/osf1/procsignal.c b/sysdeps/osf1/procsignal.c new file mode 100644 index 0000000..691b699 --- /dev/null +++ b/sysdeps/osf1/procsignal.c @@ -0,0 +1,73 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_signal = +(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1L << GLIBTOP_PROC_SIGNAL_BLOCKED) + +(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1L << GLIBTOP_PROC_SIGNAL_SIGCATCH); + +/* Init function. */ + +void +_glibtop_init_proc_signal_p (glibtop *server) +{ + server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_signal_p (glibtop *server, glibtop_proc_signal *buf, + pid_t pid) +{ + struct tbl_procinfo procinfo; + int ret; + + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_SIGNAL, 0); + + memset (buf, 0, sizeof (glibtop_proc_signal)); + + /* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + + ret = table (TBL_PROCINFO, pid, (char *) &procinfo, 1, + sizeof (struct tbl_procinfo)); + + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + + if (ret != 1) return; + + buf->signal [0] = procinfo.pi_sig; + buf->blocked [0] = procinfo.pi_sigmask; + buf->sigignore [0] = procinfo.pi_sigignore; + buf->sigcatch [0] = procinfo.pi_sigcatch; + + buf->flags = _glibtop_sysdeps_proc_signal; +} diff --git a/sysdeps/osf1/procstate.c b/sysdeps/osf1/procstate.c new file mode 100644 index 0000000..2e459f4 --- /dev/null +++ b/sysdeps/osf1/procstate.c @@ -0,0 +1,152 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_state = +(1L << GLIBTOP_PROC_STATE_CMD) + +(1L << GLIBTOP_PROC_STATE_UID) + (1L << GLIBTOP_PROC_STATE_GID) + +(1L << GLIBTOP_PROC_STATE_RUID) + (1L << GLIBTOP_PROC_STATE_RGID); + +/* Init function. */ + +void +_glibtop_init_proc_state_p (glibtop *server) +{ + server->sysdeps.proc_state = _glibtop_sysdeps_proc_state; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_state_p (glibtop *server, glibtop_proc_state *buf, + pid_t pid) +{ + struct tbl_procinfo procinfo; + int minim_state = 99, ret; + task_t thistask; + + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_STATE, 0); + + memset (buf, 0, sizeof (glibtop_proc_state)); + + /* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + + ret = table (TBL_PROCINFO, pid, (char *) &procinfo, 1, + sizeof (struct tbl_procinfo)); + + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + + if (ret != 1) return; + + /* Check whether the process actually exists. */ + if (procinfo.pi_status == PI_EMPTY) return; + + /* Check whether it is not a zombie. */ + if (procinfo.pi_status == PI_ZOMBIE) { + buf->state = GLIBTOP_PROCESS_ZOMBIE; + buf->flags = (1L << GLIBTOP_PROC_STATE_STATE); + return; + } + + g_strlcpy (buf->cmd, procinfo.pi_comm, sizeof buf->cmd); + + buf->uid = procinfo.pi_svuid; + buf->gid = procinfo.pi_svgid; + buf->ruid = procinfo.pi_ruid; + buf->rgid = procinfo.pi_rgid; + + buf->flags = _glibtop_sysdeps_proc_state; + + /* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + + /* Get task structure. */ + ret = task_by_unix_pid (task_self(), procinfo.pi_pid, &thistask); + + if (ret == KERN_SUCCESS) { + thread_array_t threadarr; + unsigned int threadarr_l; + thread_basic_info_t threadinfo; + thread_basic_info_data_t threadinfodata; + int j; + + /* Get thread array. */ + (void) task_threads (thistask, &threadarr, &threadarr_l); + + threadinfo = &threadinfodata; + for (j = 0; j < threadarr_l; j++) { + unsigned int threadinfo_l = THREAD_BASIC_INFO_COUNT; + int tret; + + tret = thread_info (threadarr [j], THREAD_BASIC_INFO, + (thread_info_t) threadinfo, &threadinfo_l); + + if (tret == KERN_SUCCESS) { + if (minim_state > threadinfo->run_state) + minim_state=threadinfo->run_state; + } + } + } + + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + + if (ret != KERN_SUCCESS) return; + + switch (minim_state) { + case TH_STATE_RUNNING: + buf->state = GLIBTOP_PROCESS_RUNNING; + break; + case TH_STATE_UNINTERRUPTIBLE: + buf->state = GLIBTOP_PROCESS_UNINTERRUPTIBLE; + break; + case TH_STATE_WAITING: + buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE; + break; + case TH_STATE_STOPPED: + case TH_STATE_HALTED: + buf->state = GLIBTOP_PROCESS_STOPPED; + break; + default: + if (ret != KERN_SUCCESS) + buf->state = GLIBTOP_PROCESS_ZOMBIE; + break; + } + + if (buf->state) + buf->flags |= (1L << GLIBTOP_PROC_STATE_STATE); +} diff --git a/sysdeps/osf1/proctime.c b/sysdeps/osf1/proctime.c new file mode 100644 index 0000000..e47da93 --- /dev/null +++ b/sysdeps/osf1/proctime.c @@ -0,0 +1,78 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_time = +(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_CUTIME) + +(1L << GLIBTOP_PROC_TIME_STIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) + +(1L << GLIBTOP_PROC_TIME_START_TIME); + +/* Init function. */ + +void +_glibtop_init_proc_time_p (glibtop *server) +{ + server->sysdeps.proc_time = _glibtop_sysdeps_proc_time; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, + pid_t pid) +{ + struct user u; + int ret; + + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_TIME, 0); + + memset (buf, 0, sizeof (glibtop_proc_time)); + + /* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + + ret = table (TBL_UAREA, pid, (char *) &u, 1, + sizeof (struct user)); + + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + + if (ret != 1) return; + + buf->start_time = u.u_start.tv_sec; + + buf->utime = u.u_ru.ru_utime.tv_sec; + buf->stime = u.u_ru.ru_stime.tv_sec; + buf->cutime = u.u_cru.ru_utime.tv_sec; + buf->cstime = u.u_cru.ru_stime.tv_sec; + + buf->flags = _glibtop_sysdeps_proc_time; +} diff --git a/sysdeps/osf1/procuid.c b/sysdeps/osf1/procuid.c new file mode 100644 index 0000000..53685c9 --- /dev/null +++ b/sysdeps/osf1/procuid.c @@ -0,0 +1,131 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +/* Provides detailed information about a process. */ + +static const unsigned long _glibtop_sysdeps_proc_uid = +(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) + +(1L << GLIBTOP_PROC_UID_GID) + (1L << GLIBTOP_PROC_UID_EGID) + +(1L << GLIBTOP_PROC_UID_PID) + (1L << GLIBTOP_PROC_UID_PPID) + +(1L << GLIBTOP_PROC_UID_PGRP) + (1L << GLIBTOP_PROC_UID_SESSION) + +(1L << GLIBTOP_PROC_UID_TTY) + (1L << GLIBTOP_PROC_UID_TPGID); + +/* Init function. */ + +void +_glibtop_init_proc_uid_p (glibtop *server) +{ + server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid; +} + +void +glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, + pid_t pid) +{ + struct tbl_procinfo procinfo; + task_basic_info_data_t taskinfo; + int ret, info_count; + task_t thistask; + + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_UID, 0); + + memset (buf, 0, sizeof (glibtop_proc_uid)); + + /* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + + ret = table (TBL_PROCINFO, pid, (char *) &procinfo, 1, + sizeof (struct tbl_procinfo)); + + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + + if (ret != 1) return; + + buf->uid = procinfo.pi_ruid; + buf->euid = procinfo.pi_svuid; + buf->gid = procinfo.pi_rgid; + buf->egid = procinfo.pi_svgid; + + buf->pid = procinfo.pi_pid; + buf->ppid = procinfo.pi_ppid; + buf->pgrp = procinfo.pi_pgrp; + buf->tty = procinfo.pi_ttyd; + buf->session = procinfo.pi_session; + buf->tpgid = procinfo.pi_tpgrp; + + buf->flags = _glibtop_sysdeps_proc_uid; + + /* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + + /* Get task structure. */ + + ret = task_by_unix_pid (task_self(), procinfo.pi_pid, &thistask); + + if (ret == KERN_SUCCESS) { + + /* Get taskinfo about this task. */ + + info_count = TASK_BASIC_INFO_COUNT; + + ret = task_info (thistask, TASK_BASIC_INFO, + (task_info_t) &taskinfo, &info_count); + + /* `ret' is evaluated outside the `if' clause. */ + } + + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + + if (ret != KERN_SUCCESS) return; + + buf->priority = taskinfo.base_priority; + + buf->flags += (1L << GLIBTOP_PROC_UID_PRIORITY); + + errno = 0; + + ret = getpriority (PRIO_PROCESS, pid); + + if ((ret == -1) && (errno != 0)) return; + + buf->nice = ret; + + buf->flags += (1L << GLIBTOP_PROC_UID_NICE); +} diff --git a/sysdeps/osf1/sem_limits.c b/sysdeps/osf1/sem_limits.c new file mode 100644 index 0000000..e21aae7 --- /dev/null +++ b/sysdeps/osf1/sem_limits.c @@ -0,0 +1,109 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_sem_limits = +(1L << GLIBTOP_IPC_SEMMNI) + (1L << GLIBTOP_IPC_SEMMSL) + +(1L << GLIBTOP_IPC_SEMOPM) + (1L << GLIBTOP_IPC_SEMVMX) + +(1L << GLIBTOP_IPC_SEMAEM); + +/* Init function. */ + +void +_glibtop_init_sem_limits_s (glibtop *server) +{ + server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; +} + +/* Provides information about sysv sem limits. */ + +void +glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf) +{ + int ret, value; + + glibtop_init_s (&server, 0, 0); + + memset (buf, 0, sizeof (glibtop_sem_limits)); + + ret = table (TBL_SEMINFO, SEMINFO_MNI, (char *) &value, 1, + sizeof (value)); + + if (ret != 1) return; + + buf->flags += (1L << GLIBTOP_IPC_SEMMNI); + + buf->semmni = value; + + + ret = table (TBL_SEMINFO, SEMINFO_MSL, (char *) &value, 1, + sizeof (value)); + + if (ret != 1) return; + + buf->flags += (1L << GLIBTOP_IPC_SEMMSL); + + buf->semmsl = value; + + + ret = table (TBL_SEMINFO, SEMINFO_OPM, (char *) &value, 1, + sizeof (value)); + + if (ret != 1) return; + + buf->flags += (1L << GLIBTOP_IPC_SEMOPM); + + buf->semopm = value; + + + ret = table (TBL_SEMINFO, SEMINFO_UME, (char *) &value, 1, + sizeof (value)); + + if (ret != 1) return; + + buf->flags += (1L << GLIBTOP_IPC_SEMUME); + + buf->semume = value; + + + ret = table (TBL_SEMINFO, SEMINFO_VMX, (char *) &value, 1, + sizeof (value)); + + if (ret != 1) return; + + buf->flags += (1L << GLIBTOP_IPC_SEMVMX); + + buf->semvmx = value; + + + ret = table (TBL_SEMINFO, SEMINFO_AEM, (char *) &value, 1, + sizeof (value)); + + if (ret != 1) return; + + buf->flags += (1L << GLIBTOP_IPC_SEMAEM); + + buf->semaem = value; +} diff --git a/sysdeps/osf1/shm_limits.c b/sysdeps/osf1/shm_limits.c new file mode 100644 index 0000000..6336b0d --- /dev/null +++ b/sysdeps/osf1/shm_limits.c @@ -0,0 +1,88 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_shm_limits = +(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) + +(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG); + +/* Init function. */ + +void +_glibtop_init_shm_limits_s (glibtop *server) +{ + server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf) +{ + int ret, value; + + glibtop_init_s (&server, 0, 0); + + memset (buf, 0, sizeof (glibtop_shm_limits)); + + ret = table (TBL_SHMINFO, SHMINFO_MAX, (char *) &value, 1, + sizeof (value)); + + if (ret != 1) return; + + buf->flags += (1L << GLIBTOP_IPC_SHMMAX); + + buf->shmmax = value; + + + ret = table (TBL_SHMINFO, SHMINFO_MIN, (char *) &value, 1, + sizeof (value)); + + if (ret != 1) return; + + buf->flags += (1L << GLIBTOP_IPC_SHMMIN); + + buf->shmmin = value; + + + ret = table (TBL_SHMINFO, SHMINFO_MNI, (char *) &value, 1, + sizeof (value)); + + if (ret != 1) return; + + buf->flags += (1L << GLIBTOP_IPC_SHMMNI); + + buf->shmmni = value; + + + ret = table (TBL_SHMINFO, SHMINFO_SEG, (char *) &value, 1, + sizeof (value)); + + if (ret != 1) return; + + buf->flags += (1L << GLIBTOP_IPC_SHMSEG); + + buf->shmseg = value; +} diff --git a/sysdeps/osf1/siglist.c b/sysdeps/osf1/siglist.c new file mode 100644 index 0000000..ba215cd --- /dev/null +++ b/sysdeps/osf1/siglist.c @@ -0,0 +1,59 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 1, "SIGHUP", N_("Hangup") }, + { 2, "SIGINT", N_("Interrupt") }, + { 3, "SIGQUIT", N_("Quit") }, + { 4, "SIGILL", N_("Illegal instruction") }, + { 5, "SIGTRAP", N_("Trace trap") }, + { 6, "SIGABRT", N_("Abort") }, + { 7, "SIGEMT", N_("EMT error") }, + { 8, "SIGFPE", N_("Floating-point exception") }, + { 9, "SIGKILL", N_("Kill") }, + { 10, "SIGBUS", N_("Bus error") }, + { 11, "SIGSEGV", N_("Segmentation violation") }, + { 12, "SIGSYS", N_("Bad argument to system call") }, + { 13, "SIGPIPE", N_("Broken pipe") }, + { 14, "SIGALRM", N_("Alarm clock") }, + { 15, "SIGTERM", N_("Termination") }, + { 16, "SIGURG", N_("Urgent condition on socket") }, + { 17, "SIGSTOP", N_("Stop") }, + { 18, "SIGTSTP", N_("Keyboard stop") }, + { 19, "SIGCONT", N_("Continue") }, + { 20, "SIGCHLD", N_("Child status has changed") }, + { 21, "SIGTTIN", N_("Background read from tty") }, + { 22, "SIGTTOU", N_("Background write to tty") }, + { 23, "SIGIO", N_("I/O now possible") }, + { 24, "SIGXCPU", N_("CPU limit exceeded") }, + { 25, "SIGXFSZ", N_("File size limit exceeded") }, + { 26, "SIGVTALRM", N_("Virtual alarm clock") }, + { 27, "SIGPROF", N_("Profiling alarm clock") }, + { 28, "SIGWINCH", N_("Window size change") }, + { 29, "SIGINFO", N_("Information request") }, + { 30, "SIGUSR1", N_("User defined signal 1") }, + { 31, "SIGUSR2", N_("User defined signal 2") }, + { 0, NULL, NULL }, +}; diff --git a/sysdeps/osf1/swap.c b/sysdeps/osf1/swap.c new file mode 100644 index 0000000..cf734f9 --- /dev/null +++ b/sysdeps/osf1/swap.c @@ -0,0 +1,63 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_swap = +(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) + +(1L << GLIBTOP_SWAP_FREE); + +/* Init function. */ + +void +_glibtop_init_swap_s (glibtop *server) +{ + server->sysdeps.swap = _glibtop_sysdeps_swap; +} + +/* Provides information about swap usage. */ + +void +glibtop_get_swap_s (glibtop *server, glibtop_swap *buf) +{ + struct tbl_swapinfo swapinfo; + int i; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_SWAP, 0); + + memset (buf, 0, sizeof (glibtop_swap)); + + i = 0; + + while (table (TBL_SWAPINFO, i, (char *) &swapinfo, 1, + sizeof (struct tbl_swapinfo)) > 0) { + buf->total += swapinfo.size * getpagesize (); + buf->free += swapinfo.free * getpagesize (); + i++; + } + + buf->flags = _glibtop_sysdeps_swap; + + buf->used = buf->total - buf->free; +} diff --git a/sysdeps/osf1/uptime.c b/sysdeps/osf1/uptime.c new file mode 100644 index 0000000..64ee0c8 --- /dev/null +++ b/sysdeps/osf1/uptime.c @@ -0,0 +1,59 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_uptime = +(1L << GLIBTOP_UPTIME_UPTIME); + +/* Init function. */ + +void +_glibtop_init_uptime_s (glibtop *server) +{ + server->sysdeps.uptime = _glibtop_sysdeps_uptime; +} + +/* Provides uptime and idle time. */ + +void +glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf) +{ + struct tbl_sysinfo sysinfo; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_UPTIME, 0); + + memset (buf, 0, sizeof (glibtop_uptime)); + + if(table (TBL_SYSINFO, 0, (char *) &sysinfo, 1, + sizeof (struct tbl_sysinfo)) != 1) + return; + + buf->uptime = (double) (time (NULL) - sysinfo.si_boottime); + buf->boot_time = sysinfo.si_boottime; + + buf->flags = _glibtop_sysdeps_uptime; +} diff --git a/sysdeps/solaris/AUTHORS b/sysdeps/solaris/AUTHORS new file mode 100644 index 0000000..37b903a --- /dev/null +++ b/sysdeps/solaris/AUTHORS @@ -0,0 +1,2 @@ +Drazen Kacar (dave@srce.hr) +Martin Baulig (martin@home-of-linux.org) diff --git a/sysdeps/solaris/ChangeLog b/sysdeps/solaris/ChangeLog new file mode 100644 index 0000000..13701dc --- /dev/null +++ b/sysdeps/solaris/ChangeLog @@ -0,0 +1,436 @@ +2007-06-07 Benoît Dejean + + * proclist.c: (glibtop_get_proclist_s): + + Fixed build. + Patch by Damien Carbery . + Closes #444815. + +2006-09-19 Benoît Dejean + + * Makefile.am: + * procopenfiles.c: (glibtop_init_proc_open_files_s), + (glibtop_get_proc_open_files_s): + + Added glibtop_get_proc_open_files implementation by + Henry Zhang . + Closes #346174. + +2006-06-24 Benoît Dejean + + * proctime.c: (glibtop_get_proc_time_s): + + Fixed start time. + + Patch by hua.zhang@sun.com. + Closes #345819. + +2006-06-24 Benoît Dejean + + * procmap.c: (glibtop_get_proc_map_s): + + Fixed writable memory. + + Patch by hua.zhang@sun.com. + Closes #345817. + +2006-06-24 Benoît Dejean + + * open.c: (glibtop_get_kstats), (glibtop_open_s): + + Can't get cpu_stat_kstat, didn't close kstat, this will make other + program used kstat wrong. + Patch by hua.zhang@sun.com. + Closes #345814. + +2006-06-24 Benoît Dejean + + * netlist.c: (glibtop_get_netlist_s): + + Fixed. + Patch by hua.zhang@sun.com. + Closes #345813. + +2006-06-24 Benoît Dejean + + * msg_limits.c: (glibtop_init_msg_limits_p), + (glibtop_get_msg_limits_p): + * open_suid.c: (glibtop_open_p): + * sem_limits.c: (glibtop_init_sem_limits_p), + (glibtop_get_sem_limits_p): + * shm_limits.c: (glibtop_init_shm_limits_p), + (glibtop_get_shm_limits_p): + + Don't use kvm anymore. + Patch by hua.zhang@sun.com. + Closes #345811. + +2005-08-12 Benoît Dejean + + * glibtop_server.h: + * open.c: + * open_suid.c: + * procdata.c: + + Added missing includes. + Added missing GLIBTOP_SUID_NETLIST. + +2004-10-11 Benoît Dejean + + * cpu.c: (glibtop_init_cpu_s), (glibtop_get_cpu_s): + * loadavg.c: (glibtop_get_loadavg_s): + * mem.c: (glibtop_init_mem_s), (glibtop_get_mem_s): + * open.c: (glibtop_get_kstats), (glibtop_open_s): + * procargs.c: (glibtop_get_proc_args_s): + * procdata.c: (glibtop_get_proc_data_psinfo_s), + (glibtop_get_proc_data_usage_s), (glibtop_get_proc_credentials_s), + (glibtop_get_proc_status_s): + * proclist.c: (glibtop_get_proclist_s): + * procmap.c: (glibtop_get_proc_map_s): + * procmem.c: (glibtop_get_proc_mem_s): + * procstate.c: (glibtop_get_proc_state_s): + * safeio.c: + * safeio.h: + * shm_limits.c: (glibtop_init_shm_limits_p), + (glibtop_get_shm_limits_p): + * swap.c: (glibtop_get_swap_s): + * uptime.c: (glibtop_get_uptime_s): Updated. Lots of cleanup. + +2004-06-06 Benoît Dejean + + * proclist.c: (glibtop_get_proclist_s): Removed useless tests. + * procmap.c: (glibtop_get_proc_map_s): Replace g_malloc + memset + by g_malloc0 + * procstate.c: (glibtop_get_proc_state_s): Replace strncpy by g_strlcpy. + +2004-05-25 Benoît Dejean + + * loadavg.c: (glibtop_get_loadavg_s): + * msg_limits.c: + * sem_limits.c: + * shm_limits.c: Added missing const qualifiers. + +2004-03-09 Bastien Nocera + + * procargs.c: (glibtop_get_proc_args_s): + * procmap.c: (glibtop_get_proc_map_s): fix g_malloc usage on non-Linux + platforms (patch by Benoît Dejean ) + +2003-10-21 Bastien Nocera + + * Makefile.am: install only one library, libgtop-2.0 + Fix build-time warnings due to the redefinition of guint64 + +2003-10-20 Bastien Nocera + + * shm_limits.c: (glibtop_get_shm_limits_p): Apply patch by + the_h1ghlander@yahoo.com and Cory Omand for + Solaris support + +2003-10-20 Bastien Nocera + + * mem.c: (glibtop_get_mem_s): + * swap.c: (glibtop_get_swap_s): s/u_int64_t/guint64/ + +2003-10-20 Bastien Nocera + + * glibtop_machine.h: + * glibtop_private.h: + * glibtop_server.h: + * glibtop_suid.h: + * procargs.c: + * proclist.c: + * procmap.c: + * safeio.h: fixed compilation + +2003-10-20 Bastien Nocera + + * procargs.c: (glibtop_get_proc_args_s): + * proclist.c: (glibtop_get_proclist_s): + * procmap.c: (glibtop_get_proc_map_s): + replace all the xmalloc crap by glib memory management functions + +2001-10-17 Abel Cheung + + * Makefile.am: move header to $(includedir)/libgtop-1.0/glibtop. + +2001-02-18 Martin Baulig + + Applied a patch from Laszlo PETER + for Solaris 8. + + * msg_limits.c: `struct msginfo' no longer has msgmap and msgssz. + * sem_limits.c: `struct seminfo' no longer has a semmap field. + +1999-10-17 Martin Baulig + + * Makefile.am (libgtop_sysdeps_la_LIBADD): Added `@DL_LIB@'. + +1999-09-28 Drazen Kacar + + * proclist.c (glibtop_get_proclist_s): Bugfix. It wasn't + excluding system, non-tty or idle processes if that was + requested. + +1999-07-29 Martin Baulig + + * proctime.c (glibtop_get_proc_time_p): Fix bug reported by + Takis Psarogiannakopoulos: `start_time' are seconds since the + epoch as it is stated in the manual. + +1999-07-16 Drazen Kacar + + * proclist.c: Bug fix. All Solaris versions have RUID and + RGID in /proc. + +1999-06-07 Drazen Kacar + + * glibtop_machine.h, open.c, procargs.c, proclist.c, procmap.c: + Solaris 2.5 & 2.5.1 portability fixes, based on patches + from Steve Murphy . + +1999-05-30 Drazen Kacar + + * procargs.c: Fixed bug in calculation of process argument list. + +1999-05-27 Drazen Kacar + + * glibtop_machine.h, open.c, procmap.c: Get the file name + from inode number. + +1999-05-17 Drazen Kacar + + * procargs.c: Implemented what Solaris has to offer cheaply. + It sucks, but digging in process address space would be + too slow. + +1999-05-11 Drazen Kacar + + * proctime.c: Return 0 usage times for scheaduler (PID 0). + +1999-05-10 Drazen Kacar + + * proclist.c: Added process selection mechanism. It's not + included in Solaris 2.5 build, since we first have to decide + what will be dispatched to daemon. + +1999-05-10 Drazen Kacar + + There be some useful documentation now. Syncing... + + * mem.c: Output values in bytes, as the documentation requires. + It was a bit odd when gtop reported 256K of total memory. + +1999-05-09 Drazen Kacar + + * glibtop_machine.h, procdata.c, proclist.c, procmap.c, procmem.c, + procsignal.c, procstate.c, procuid.c, open.c, mem.c: Initial + Solaris 2.5 port. It's far from being complete and hasn't been + tested properly. We'll need setuid root daemon, which is + currently not implemented. #ifdef symbols to check are + HAVE_PROCFS_H and KSTAT_DATA_UINT32. These will be defined on + Solaris 2.6 and later, but not on earlier releases. + +1999-05-08 Drazen Kacar + + * safeio.c, safeio.h: Added s_open(), s_close() etc. with EINTR + wrappers. + + * procdata.c, procmap.c, proclist.c: Use them. + +1999-05-08 Drazen Kacar + + * procmem.c: Use bytes as units for memory consumption. + +1999-05-08 Drazen Kacar + + * procuid.c: Fixed nice value. + +1999-05-08 Martin Baulig + + Use the setgid server for IPC Limits. + + * shm_limits.c, msg_limits.c, sem_limits.c: Moved them into the + setgid server since they need to access kvm data. + + * open_suid.c, close_suid.c: New file. We do the initialization and cleanup + for the setgid server here. + + * glibtop_suid.h: New file. We include this in the setgid files. + + * open.c: Moved kvm opening code into open_suid.c. + +1999-05-07 Drazen Kacar + + * glibtop_machine.h, open.c, mem.c, procmem.c: machine.pagesize + is now number of bits we need for shifting, ie. 2^pagesize + will give pagesize in Kb. + +1999-05-07 Drazen Kacar + + * procmem.c: Implemented size, vsize, resident and rss. + +1999-05-06 Drazen Kacar + + * siglist.c: Fixed, valid for Solaris 2.6 & 7. + +1999-05-06 Drazen Kacar + + * glibtop_private.h, procuid.c, procdata.c: List of supplementary + groups was not correct. Fixed. + +1999-05-04 Drazen Kacar + + * glibtop_machine.h: Changed boot time to unsigned long long. + + * open.c: Added proper type checking for boot value. There's + no point in saving a few nanoseconds in init function. And + one day it will become 64-bit value. + + In glibtop_get_kstats(): Don't reread vminfo_snaptime when + reinitializing kstats. + +1999-05-03 Drazen Kacar + + * glibtop_private.h: Fixed typoo. + + * procmap.c (glibtop_get_proc_map_s): Implemented start, end, + offset and perm for mapped segments. File name and inode + should be accessible from bunyip kstat data. The only + obstacle is that the data format is undocumented and + possibly not the same accross releases. + +1999-05-03 Drazen Kacar + + * glibtop_private.h, procdata.c (glibtop_get_proc_status_s): + Read pstatus info from /proc + + * procsignal.c (glibtop_get_proc_signal_s): Implemented + set of pending and blocked signals. The rest should probably + be read from /proc//sigact, but I'm not sure it's + worth implementing before thread API comes into place. + + * siglist.c: Added Solaris 7 signals. Someone will gettextize + it eventually. Besides, signal list should become a pointer + instead of being fixed field. We need some run time initializations. + The code is written, but commented out. + +1999-05-03 Drazen Kacar + + * glibtop_private.h: Ups, forgot to put prototypes in. + +1999-05-02 Drazen Kacar + + * open.c (glibtop_get_kstats): Yet another kstat_chain_update + check. Added machine.cpu_stat_kstat[x] = NULL when processor + x is not configured. + + * procdata.c (glibtop_get_proc_credentials_s): Read prcred + structure from /proc. + + * procstate.c (glibtop_get_proc_state_s): Added ruid, rgid, + has_cpu, processor and last_processor. + + * procuid.c (glibtop_get_proc_uid_s): Added priority, nice, + suid, sgid, ngroups and groups. The last four will be + filled only if our process has the authority to read prcred + structure of another process. + +1999-05-02 Drazen Kacar + + procdata.c: Use pread() instead of read(). + +1999-05-02 Drazen Kacar + + * glibtop_machine.h: added fields for page size, clock ticks and + boot time. These are constants. Also added three new kstats. + + * open.c (glibtop_get_kstats): Initialize kstats in *server. + We need to call this at init time (obviously) and each time + kstat_chain_update() says that kstat chain has changed. In this + case all kstat pointers and data are invalid, so we need to + reinitialize everything. + + (glibtop_open_s): Made it call glibtop_get_kstats(). Added + initialization for run time constants in struct machine. + + * cpu.c (glibtop_get_cpu_s): Call kstat_chain_update(). + See if processor is on-line and set bits in xcpu_flags. + Added frequency (bad name, should have been ticks). + + * swap.c (glibtop_get_swap_s): Call kstat_chain_update(). + I probably broke vminfo_snaptime consistency. Fix later. + + * uptime.c (glibtop_get_uptime_s): Implemented uptime and boot_time. + Still looking for a sane way to get idletime. + + * mem.c (glibtop_get_mem_s): Implemented. Will use bunyip + module if it's loaded. Or when it gets loaded. kstat_chain_update() + is our friend. And with a friends like that... + + * loadavg.c (glibtop_get_loadavg_s): Solaris 2.6 code brought + into sync with everything else. + + * msg_limits.c (glibtop_init_msg_limits_s): Implemented. + + * sem_limits.c (glibtop_get_sem_limits_s): Implemented. + + Solaris takes kernel modularity too seriously. We can't get + IPC configuration data if the kernel module is not loaded and + it won't be loaded until some process actually asks for a + particular IPC resource. There's no way to tell our applications + about this. Possible API additions? + + All three IPC functions should go into daemon, but I'm keeping + them in the normal library because I can't build daemon yet. All + praise 64 bits! + +1999-04-29 Drazen Kacar + + * glibtop_machine.h: added field for kvm descriptor. + + * open.c: added code for opening kernel name space. + + * shm_limits.c: implemented. + +1999-03-31 Drazen Kacar + + * loadavg.c: make it work with Solaris 2.6 and older. A part + of it should be moved to open.c. + +1999-03-19 Martin Baulig + + Added first kstat based implementation for Solaris 7. + + * open.c (glibtop_open_s): Walk kstat list and save interesting + kstats in the `server->machine'. + + * cpu.c: This can already provide `idle', `user' and `sys' with + full SMP support. + + * swap.c: This can already provide `total', `used' and `free'. + +1999-03-17 Martin Baulig + + Initial import of my Solaris 7 port. + + * loadavg.c: We use getloadavg () to get the `loadavg' field. + + * procdata.c: This file will handle all interaction with the + /proc filesystem. + (glibtop_get_proc_data_psinfo_s): Read `/proc//psinfo' and + return the resulting `struct psinfo'. + (glibtop_get_proc_data_usage_s): Read `/proc//usage' and + return the resulting `struct prusage'. + + * proclist.c: We use readdir () on /proc to get the list of + all pids. + + * procstate.c: Read `uid' and `gid' from the `struct psinfo'. + + * proctime.c: Read `start_time', `rtime', `utime' and `stime' + from the `struct prusage'. + + * procuid.c: Read `euid', `uid', `egid', `gid', `pid', `ppid', + `pgrp', `session' and `tty' from the `struct psinfo'. + diff --git a/sysdeps/solaris/Makefile.am b/sysdeps/solaris/Makefile.am new file mode 100644 index 0000000..8ca9df0 --- /dev/null +++ b/sysdeps/solaris/Makefile.am @@ -0,0 +1,28 @@ + +AM_CPPFLAGS = @AM_CPPFLAGS@ + +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la + +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c \ + safeio.c swap.c uptime.c loadavg.c \ + proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c \ + prockernel.c procsegment.c procargs.c \ + procopenfiles.c \ + procmap.c netload.c ppp.c procdata.c netlist.c + +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + +libgtop_sysdeps_2_0_la_LIBADD = @DL_LIB@ + +libgtop_sysdeps_suid_2_0_la_SOURCES = open_suid.c close_suid.c \ + shm_limits.c msg_limits.c sem_limits.c + +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + + +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h +libgtopincludedir = $(includedir)/libgtop-2.0 + +noinst_HEADERS = glibtop_private.h glibtop_suid.h safeio.h + diff --git a/sysdeps/solaris/Makefile.in b/sysdeps/solaris/Makefile.in new file mode 100644 index 0000000..3adf1c9 --- /dev/null +++ b/sysdeps/solaris/Makefile.in @@ -0,0 +1,783 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = sysdeps/solaris +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libgtopinclude_HEADERS) \ + $(noinst_HEADERS) $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libgtop_sysdeps_2_0_la_DEPENDENCIES = +am_libgtop_sysdeps_2_0_la_OBJECTS = open.lo close.lo siglist.lo cpu.lo \ + mem.lo safeio.lo swap.lo uptime.lo loadavg.lo proclist.lo \ + procstate.lo procuid.lo proctime.lo procmem.lo procsignal.lo \ + prockernel.lo procsegment.lo procargs.lo procopenfiles.lo \ + procmap.lo netload.lo ppp.lo procdata.lo netlist.lo +libgtop_sysdeps_2_0_la_OBJECTS = $(am_libgtop_sysdeps_2_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgtop_sysdeps_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +libgtop_sysdeps_suid_2_0_la_LIBADD = +am_libgtop_sysdeps_suid_2_0_la_OBJECTS = open_suid.lo close_suid.lo \ + shm_limits.lo msg_limits.lo sem_limits.lo +libgtop_sysdeps_suid_2_0_la_OBJECTS = \ + $(am_libgtop_sysdeps_suid_2_0_la_OBJECTS) +libgtop_sysdeps_suid_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_suid_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +DIST_SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libgtopincludedir)" +HEADERS = $(libgtopinclude_HEADERS) $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp AUTHORS \ + ChangeLog +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c \ + safeio.c swap.c uptime.c loadavg.c \ + proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c \ + prockernel.c procsegment.c procargs.c \ + procopenfiles.c \ + procmap.c netload.c ppp.c procdata.c netlist.c + +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_2_0_la_LIBADD = @DL_LIB@ +libgtop_sysdeps_suid_2_0_la_SOURCES = open_suid.c close_suid.c \ + shm_limits.c msg_limits.c sem_limits.c + +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h +libgtopincludedir = $(includedir)/libgtop-2.0 +noinst_HEADERS = glibtop_private.h glibtop_suid.h safeio.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sysdeps/solaris/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu sysdeps/solaris/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgtop_sysdeps-2.0.la: $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_2_0_la_LINK) $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_LIBADD) $(LIBS) + +libgtop_sysdeps_suid-2.0.la: $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_suid_2_0_la_LINK) $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close_suid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netload.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_suid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procdata.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prockernel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procopenfiles.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsegment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsignal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procstate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/safeio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siglist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-libgtopincludeHEADERS: $(libgtopinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgtopincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgtopincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgtopincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgtopincludedir)" || exit $$?; \ + done + +uninstall-libgtopincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgtopincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libgtopincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libgtopincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libgtopincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libgtopincludeHEADERS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libgtopincludeHEADERS + +.PRECIOUS: Makefile + + +# 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: diff --git a/sysdeps/solaris/close.c b/sysdeps/solaris/close.c new file mode 100644 index 0000000..bee09f3 --- /dev/null +++ b/sysdeps/solaris/close.c @@ -0,0 +1,29 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +/* Closes pipe to gtop server. */ + +void +glibtop_close_s (glibtop *server) +{ } diff --git a/sysdeps/solaris/close_suid.c b/sysdeps/solaris/close_suid.c new file mode 100644 index 0000000..5679281 --- /dev/null +++ b/sysdeps/solaris/close_suid.c @@ -0,0 +1,29 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +/* Closes pipe to gtop server. */ + +void +glibtop_close_p (glibtop *server) +{ } diff --git a/sysdeps/solaris/cpu.c b/sysdeps/solaris/cpu.c new file mode 100644 index 0000000..46de3cd --- /dev/null +++ b/sysdeps/solaris/cpu.c @@ -0,0 +1,111 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_cpu_freq = +(1L << GLIBTOP_CPU_FREQUENCY); + +static const unsigned long _glibtop_sysdeps_cpu_all = +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + +(1L << GLIBTOP_CPU_SYS) + (1L << GLIBTOP_CPU_IDLE) + +(1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) + +(1L << GLIBTOP_XCPU_SYS) + (1L << GLIBTOP_XCPU_IDLE) + +(1L << GLIBTOP_XCPU_FLAGS) + +(1L << GLIBTOP_CPU_FREQUENCY); + +/* Init function. */ + +void +_glibtop_init_cpu_s (glibtop *server) +{ + server->sysdeps.cpu = _glibtop_sysdeps_cpu_all; +} + +/* Provides information about cpu usage. */ + +void +glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf) +{ + kstat_ctl_t * const kc = server->machine->kc; + cpu_stat_t cpu_stat; + processorid_t cpu; + int ncpu, found; + + memset (buf, 0, sizeof (glibtop_cpu)); + + buf->frequency = server->machine->ticks; + buf->flags = _glibtop_sysdeps_cpu_freq; + + if(!kc) + return; + + switch(kstat_chain_update(kc)) + { + case -1: assert(0); /* Debugging purposes, shouldn't happen */ + case 0: break; + default: glibtop_get_kstats(server); + } + + ncpu = MIN(GLIBTOP_NCPU, server->ncpu); + + for (cpu = 0, found = 0; cpu < GLIBTOP_NCPU && found != ncpu; cpu++) + { + kstat_t * const ksp = server->machine->cpu_stat_kstat [cpu]; + if (!ksp) continue;; + + ++found; + + if(p_online(cpu, P_STATUS) == P_ONLINE) + buf->xcpu_flags |= (1L << cpu); + else + continue; + + if (kstat_read (kc, ksp, &cpu_stat) == -1) { + glibtop_warn_io_r (server, "kstat_read (cpu_stat%d)", cpu); + continue; + } + + buf->xcpu_idle [cpu] = cpu_stat.cpu_sysinfo.cpu [CPU_IDLE]; + buf->xcpu_user [cpu] = cpu_stat.cpu_sysinfo.cpu [CPU_USER]; + buf->xcpu_sys [cpu] = cpu_stat.cpu_sysinfo.cpu [CPU_KERNEL]; + buf->xcpu_total [cpu] = buf->xcpu_idle [cpu] + buf->xcpu_user [cpu] + + buf->xcpu_sys [cpu]; + + buf->idle += cpu_stat.cpu_sysinfo.cpu [CPU_IDLE]; + buf->user += cpu_stat.cpu_sysinfo.cpu [CPU_USER]; + buf->sys += cpu_stat.cpu_sysinfo.cpu [CPU_KERNEL]; + } + + if(!found) + return; + + buf->total = buf->idle + buf->user + buf->sys; + buf->flags = _glibtop_sysdeps_cpu_all; +} diff --git a/sysdeps/solaris/glibtop_machine.h b/sysdeps/solaris/glibtop_machine.h new file mode 100644 index 0000000..f45ea9e --- /dev/null +++ b/sysdeps/solaris/glibtop_machine.h @@ -0,0 +1,74 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , March 1999. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_MACHINE_H__ +#define __GLIBTOP_MACHINE_H__ + +#include +#ifdef HAVE_PROCFS_H +#include +#else +#include +#endif +#include + +#include +#include +#include + +G_BEGIN_DECLS + +struct _glibtop_machine +{ + uid_t uid, euid; + gid_t gid, egid; + pid_t me; /* Don't ask why we need this */ + + kvm_t *kd; + + kstat_ctl_t *kc; + + kstat_t *vminfo_kstat; + hrtime_t vminfo_snaptime; + vminfo_t vminfo; + + kstat_t *cpu_stat_kstat [64]; + + kstat_t *system; /* boot_time & avenrun* where needed */ + kstat_t *syspages; /* memory usage */ + kstat_t *bunyip; /* more memory usage */ + + int pagesize; /* in bits to shift, ie. 2^pagesize gives Kb */ + int ticks; /* clock ticks, as returned by sysconf() */ + unsigned long long boot; /* boot time, although it's ui32 in kstat */ + void *libproc; /* libproc handle */ +#if GLIBTOP_SOLARIS_RELEASE >= 50600 + void (*objname)(void *, uintptr_t, const char *, size_t); + struct ps_prochandle *(*pgrab)(pid_t, int, int *); + void (*pfree)(void *); +#else + void *filler[3]; +#endif +}; + +G_END_DECLS + +#endif /* __GLIBTOP_MACHINE_H__ */ diff --git a/sysdeps/solaris/glibtop_private.h b/sysdeps/solaris/glibtop_private.h new file mode 100644 index 0000000..697bb5c --- /dev/null +++ b/sysdeps/solaris/glibtop_private.h @@ -0,0 +1,65 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , March 1999. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_PRIVATE_H__ +#define __GLIBTOP_PRIVATE_H__ + +#include + +#include +#include +#include +#if defined(HAVE_PROCFS_H) +# include +#elif defined(HAVE_SYS_PROCFS_H) +# include +#else +# error Cannot compile without or +#endif + +G_BEGIN_DECLS + +#ifdef HAVE_PROCFS_H + +/* Read /proc//psinfo */ +int glibtop_get_proc_data_psinfo_s(glibtop *, struct psinfo *, pid_t pid); + +/* Read /proc//status */ +int glibtop_get_proc_status_s(glibtop *, struct pstatus *, pid_t); +#else +int glibtop_get_proc_data_psinfo_s(glibtop *, struct prpsinfo *, pid_t); +int glibtop_get_proc_status_s(glibtop *, struct prstatus *, pid_t); +#endif + +/* Read /proc//usage */ +int glibtop_get_proc_data_usage_s(glibtop *, struct prusage *, pid_t); + +#if LIBGTOP_VERSION_CODE >= 1001002 +/* Read /proc//cred */ +int glibtop_get_proc_credentials_s(glibtop *, struct prcred *, gid_t *, pid_t); +#endif + +/* Reread kstat chains */ +void glibtop_get_kstats(glibtop *); + +G_END_DECLS + +#endif /* __GLIBTOP_PRIVATE_H__ */ diff --git a/sysdeps/solaris/glibtop_server.h b/sysdeps/solaris/glibtop_server.h new file mode 100644 index 0000000..e57057e --- /dev/null +++ b/sysdeps/solaris/glibtop_server.h @@ -0,0 +1,51 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SERVER_H__ +#define __GLIBTOP_SERVER_H__ + +G_BEGIN_DECLS + +#define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_MEM 0 +#define GLIBTOP_SUID_SWAP 0 +#define GLIBTOP_SUID_UPTIME 0 +#define GLIBTOP_SUID_LOADAVG 0 +#define GLIBTOP_SUID_SHM_LIMITS (1L << GLIBTOP_SYSDEPS_SHM_LIMITS) +#define GLIBTOP_SUID_MSG_LIMITS (1L << GLIBTOP_SYSDEPS_MSG_LIMITS) +#define GLIBTOP_SUID_SEM_LIMITS (1L << GLIBTOP_SYSDEPS_SEM_LIMITS) +#define GLIBTOP_SUID_PROCLIST 0 +#define GLIBTOP_SUID_PROC_STATE 0 +#define GLIBTOP_SUID_PROC_UID 0 +#define GLIBTOP_SUID_PROC_MEM 0 +#define GLIBTOP_SUID_PROC_TIME 0 +#define GLIBTOP_SUID_PROC_SIGNAL 0 +#define GLIBTOP_SUID_PROC_KERNEL 0 +#define GLIBTOP_SUID_PROC_SEGMENT 0 +#define GLIBTOP_SUID_PROC_ARGS 0 +#define GLIBTOP_SUID_PROC_MAP 0 +#define GLIBTOP_SUID_NETLOAD 0 +#define GLIBTOP_SUID_NETLIST 0 +#define GLIBTOP_SUID_PPP 0 + +G_END_DECLS + +#endif diff --git a/sysdeps/solaris/glibtop_suid.h b/sysdeps/solaris/glibtop_suid.h new file mode 100644 index 0000000..d6528a7 --- /dev/null +++ b/sysdeps/solaris/glibtop_suid.h @@ -0,0 +1,46 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SUID_H__ +#define __GLIBTOP_SUID_H__ + +G_BEGIN_DECLS + +static inline void glibtop_suid_enter (glibtop *server) { + setreuid (server->machine->uid, server->machine->euid); +}; + +static inline void glibtop_suid_leave (glibtop *server) { + if (setreuid (server->machine->euid, server->machine->uid)) + _exit (1); +}; + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags); +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags); + +G_END_DECLS + +#endif diff --git a/sysdeps/solaris/loadavg.c b/sysdeps/solaris/loadavg.c new file mode 100644 index 0000000..a4f82d6 --- /dev/null +++ b/sysdeps/solaris/loadavg.c @@ -0,0 +1,92 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , March 1999. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#ifdef HAVE_GETLOADAVG +#include +#else +#include +#include +#include +#endif + +static const unsigned long _glibtop_sysdeps_loadavg = +(1L << GLIBTOP_LOADAVG_LOADAVG); + +/* Init function. */ + +void +_glibtop_init_loadavg_s (glibtop *server) +{ + server->sysdeps.loadavg = _glibtop_sysdeps_loadavg; +} + +/* Provides load average. */ + +void +glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf) +{ +#ifndef HAVE_GETLOADAVG + kstat_ctl_t *kc; + kstat_t *ksp; + size_t i; + static const char avestrings[][14] = { "avenrun_1min", + "avenrun_5min", + "avenrun_15min" }; +#endif + memset (buf, 0, sizeof (glibtop_loadavg)); + +#ifdef HAVE_GETLOADAVG + if (getloadavg (buf->loadavg, 3) != 3) + return; + +#else + if(!(kc = server->machine->kc)) + return; + + switch(kstat_chain_update(kc)) + { + case -1: assert(0); /* Debugging, shouldn't happen */ + case 0: break; + default: glibtop_get_kstats(server); + } + + if(!(ksp = server->machine->system)) + return; + + if(kstat_read(kc, ksp, NULL) < 0) + return; + + for(i = 0; i < 3; ++i) /* Do we have a countof macro? */ + { + kstat_named_t *kn; + + kn = (kstat_named_t *)kstat_data_lookup(ksp, avestrings[i]); + if(kn) + buf->loadavg[i] = (double)kn->value.ul / FSCALE; + } +#endif /* HAVE_GETLOADAVG */ + + buf->flags = _glibtop_sysdeps_loadavg; +} diff --git a/sysdeps/solaris/mem.c b/sysdeps/solaris/mem.c new file mode 100644 index 0000000..4ec8bec --- /dev/null +++ b/sysdeps/solaris/mem.c @@ -0,0 +1,133 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include +#include + +#include + +/* Init function. */ + +void +_glibtop_init_mem_s (glibtop *server) +{ + server->sysdeps.mem = (1L << GLIBTOP_MEM_TOTAL) + | (1L << GLIBTOP_MEM_FREE) + | (1L << GLIBTOP_MEM_USED) + | (1L << GLIBTOP_MEM_LOCKED) + | (1L << GLIBTOP_MEM_SHARED) + | (1L << GLIBTOP_MEM_BUFFER) + | (1L << GLIBTOP_MEM_USER); +} + +/* Provides information about memory usage. */ + +void +glibtop_get_mem_s (glibtop *server, glibtop_mem *buf) +{ + kstat_ctl_t * const kc = server->machine->kc; + kstat_t *ksp; + kstat_named_t *kn; + +#undef PAGESIZE +#define PAGESIZE (server->machine->pagesize) +#define PAGESHIFT (PAGESIZE + 10) + +#ifdef _LP64 +#define KN_VALUE kn->value.ui64 +#elif !defined(KSTAT_DATA_UINT32) +#define KN_VALUE kn->value.ul +#else +#define KN_VALUE kn->value.ui32 +#endif + + memset (buf, 0, sizeof (glibtop_mem)); + + buf->total = (guint64) sysconf(_SC_PHYS_PAGES) << PAGESHIFT; + buf->flags = (1 << GLIBTOP_MEM_TOTAL); + + if(!kc) + return; + + switch(kstat_chain_update(kc)) + { + case -1: assert(0); /* Debugging purposes, shouldn't happen */ + case 0: break; + default: glibtop_get_kstats(server); + } + + if((ksp = server->machine->syspages) && kstat_read(kc, ksp, NULL) >= 0) + { + kn = kstat_data_lookup(ksp, "pagesfree"); + if(kn) + { + buf->free = (KN_VALUE << PAGESHIFT); + buf->used = buf->total - buf->free; + buf->flags |= (1 << GLIBTOP_MEM_FREE); + buf->flags |= (1 << GLIBTOP_MEM_USED); + } + + kn = kstat_data_lookup(ksp, "pageslocked"); + if(kn) + { + buf->locked = (KN_VALUE << PAGESIZE); + buf->flags |= (1 << GLIBTOP_MEM_LOCKED); + } + } + + /* Bunyip module provides data in multiples of system page size */ + + if((ksp = server->machine->bunyip) && kstat_read(kc, ksp, NULL) >= 0) + { + kn = kstat_data_lookup(ksp, "pages_exec"); + if(kn) + { + buf->shared = (KN_VALUE << PAGESHIFT); + buf->flags |= (1 << GLIBTOP_MEM_SHARED); + } + + kn = kstat_data_lookup(ksp, "pages_vnode"); + if(kn) + { + buf->buffer = (KN_VALUE << PAGESHIFT); + buf->flags |= (1 << GLIBTOP_MEM_BUFFER); + } + + kn = kstat_data_lookup(ksp, "pages_anon"); + if(kn) + { + buf->user = (KN_VALUE << PAGESHIFT); + buf->flags |= (1 << GLIBTOP_MEM_USER); + } + else + goto user_old_way; + } + else /* Bunyip is not available, let's compute buf->user the old way */ + { + user_old_way: + buf->user = buf->total - buf->free - buf->cached - buf->buffer; + buf->flags |= (1 << GLIBTOP_MEM_USER); + } +} diff --git a/sysdeps/solaris/msg_limits.c b/sysdeps/solaris/msg_limits.c new file mode 100644 index 0000000..e9c8a14 --- /dev/null +++ b/sysdeps/solaris/msg_limits.c @@ -0,0 +1,119 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include +#include +#include + +static const struct nlist nlst[] = { {"glibtop_msg_limits"}, {NULL} }; +#if GLIBTOP_SOLARIS_RELEASE < 51000 +static const unsigned long _glibtop_sysdeps_msg_limits = +#if GLIBTOP_SOLARIS_RELEASE <= 50700 +(1L << GLIBTOP_IPC_MSGMAP) + (1L << GLIBTOP_IPC_MSGSSZ) + +#endif +(1L << GLIBTOP_IPC_MSGPOOL) + (1L << GLIBTOP_IPC_MSGMAX) + +(1L << GLIBTOP_IPC_MSGMNB) + (1L << GLIBTOP_IPC_MSGMNI) + +(1L << GLIBTOP_IPC_MSGTQL); +#else +static const unsigned long _glibtop_sysdeps_msg_limits = 0; +#endif + + +/* Init function. */ + +void +_glibtop_init_msg_limits_p (glibtop *server) +{ +#if GLIBTOP_SOLARIS_RELEASE < 51000 + + kvm_t *kd = server->machine->kd; + + if(kd && !kvm_nlist(kd, nlst)) + server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; + else + server->sysdeps.msg_limits = 0; +#endif +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf) +{ +#if GLIBTOP_SOLARIS_RELEASE < 51000 + + kvm_t *kd = server->machine->kd; + glibtop_msg_limits minfo; + + + memset (buf, 0, sizeof (glibtop_msg_limits)); + + if(!(server->sysdeps.msg_limits)) + return; + if(kvm_read(kd, nlst[0].n_value, (void *)&minfo, + sizeof(glibtop_msg_limits)) != sizeof(glibtop_msg_limits)) + + return; + +#if GLIBTOP_SOLARIS_RELEASE <= 50700 + /* These fields don't exist anymore in Solaris 8. + * Thanks to Laszlo PETER . */ + buf->msgmap = minfo.msgmap; + buf->msgssz = minfo.msgssz; +#endif + buf->msgmax = minfo.msgmax; + buf->msgmnb = minfo.msgmnb; + buf->msgmni = minfo.msgmni; + buf->msgtql = minfo.msgtql; +#endif +#if GLIBTOP_SOLARIS_RELEASE >= 51000 + rctlblk_t *rblk; + if ((rblk = malloc(rctlblk_size())) == NULL) + return; + + if (getrctl("project.max-msg-qbytes", NULL, rblk, RCTL_FIRST) == -1) + return; + else + buf->msgmnb = rctlblk_get_value(rblk); + + if (getrctl("project.max-msg-ids", NULL, rblk, RCTL_FIRST) == -1) + return; + else + buf->msgmni = rctlblk_get_value(rblk); + + if (getrctl("project.max-msg-messages", NULL, rblk, RCTL_FIRST) == -1) + return; + else + buf->msgtql = rctlblk_get_value(rblk); + /* this is the maximum size of a system V message, which has been obsoleted as a kernel tunable value now */ + /* and it should always be 65535 instead, so I list it here, if needed, can be removed */ + buf->msgmax = 65535; + +#endif + + buf->msgpool = buf->msgmni * buf->msgmnb >> 10; + buf->flags = _glibtop_sysdeps_msg_limits; + +} diff --git a/sysdeps/solaris/netlist.c b/sysdeps/solaris/netlist.c new file mode 100644 index 0000000..17d00d4 --- /dev/null +++ b/sysdeps/solaris/netlist.c @@ -0,0 +1,74 @@ +/* Copyright (C) 1998-99 Benoît Dejean + This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + + + +static const unsigned long _glibtop_sysdeps_netlist = (1 << GLIBTOP_NETLIST_NUMBER); + +/* Init function. */ + +void +_glibtop_init_netlist_s (glibtop *server) +{ + server->sysdeps.netlist = _glibtop_sysdeps_netlist; +} + + +char** +glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf) +{ + GPtrArray *devices; + kstat_t *ksp; + kstat_ctl_t *kc; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_NETLIST, 0); + + memset (buf, 0, sizeof (glibtop_netlist)); + + devices = g_ptr_array_new(); + + kc = kstat_open(); + if (kc == NULL) { + glibtop_warn_io_r(server, "kstat_open()"); + return NULL; + } + + for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next) + { + if (strcmp(ksp->ks_class, "net") != 0) + continue; + + g_ptr_array_add(devices, g_strdup(ksp->ks_name)); + buf->number++; + } + + kstat_close(kc); + + buf->flags = _glibtop_sysdeps_netlist; + + g_ptr_array_add(devices, NULL); + + return (char**) g_ptr_array_free(devices, FALSE); +} diff --git a/sysdeps/solaris/netload.c b/sysdeps/solaris/netload.c new file mode 100644 index 0000000..8ad8dbf --- /dev/null +++ b/sysdeps/solaris/netload.c @@ -0,0 +1,257 @@ +/* Copyright (C) 2007 Henry Zhang + This file is part of LibGTop 2.20. + + Contributed by Henry Zhang , October 2007. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "glibtop_private.h" + +#include +#include +#include + +#include +#include +#include +#include + +#include + + +static const unsigned long _glibtop_sysdeps_netload = +(1L << GLIBTOP_NETLOAD_ERRORS_IN) + +(1L << GLIBTOP_NETLOAD_ERRORS_OUT) + +(1L << GLIBTOP_NETLOAD_COLLISIONS); + +static const unsigned long _glibtop_sysdeps_netload_data = +(1L << GLIBTOP_NETLOAD_ADDRESS) + +(1L << GLIBTOP_NETLOAD_SUBNET) + +(1L << GLIBTOP_NETLOAD_MTU); + +static const unsigned long _glibtop_sysdeps_netload_bytes = +(1L << GLIBTOP_NETLOAD_BYTES_IN) + +(1L << GLIBTOP_NETLOAD_BYTES_OUT) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL); + +static const unsigned long _glibtop_sysdeps_netload_packets = +(1L << GLIBTOP_NETLOAD_PACKETS_IN) + +(1L << GLIBTOP_NETLOAD_PACKETS_OUT) + +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL); + +static const unsigned long _glibtop_sysdeps_netload_total = +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL); + +static const unsigned long _glibtop_sysdeps_netload_in = +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) + +(1L << GLIBTOP_NETLOAD_PACKETS_IN) + +(1L << GLIBTOP_NETLOAD_BYTES_IN); + +static const unsigned long _glibtop_sysdeps_netload_out = +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) + +(1L << GLIBTOP_NETLOAD_PACKETS_OUT) + +(1L << GLIBTOP_NETLOAD_BYTES_OUT); + +static const unsigned long _glibtop_sysdeps_netload_6 = +(1L << GLIBTOP_NETLOAD_ADDRESS6) + +(1L << GLIBTOP_NETLOAD_PREFIX6) + +(1L << GLIBTOP_NETLOAD_SCOPE6); + +/* Init function. */ + +void +_glibtop_init_netload_s (glibtop *server) +{ + server->sysdeps.netload = _glibtop_sysdeps_netload | + _glibtop_sysdeps_netload_bytes | + _glibtop_sysdeps_netload_packets; +} + +static int +solaris_stats(glibtop *server, + glibtop_netload *buf, + const char *interface) +{ + char *name = interface; + char *module; + char *ptr; + kstat_ctl_t * const kctl = server->machine->kc; + kstat_t *ksp; + kstat_named_t *kdata; + int have_bytes = 1; + + /* + * chop off the trailing interface + */ + module = strdup( name ); + ptr = module + strlen( module ) - 1; + while( (ptr > module) && isdigit( (int) *ptr ) ) { + *ptr = '\0'; + ptr--; + } + + /* + * get a kstat handle and update the user's kstat chain + */ + if( kctl == NULL ){ + glibtop_warn_io_r (server, "kstat_open ()"); + free( module ); + return( 0 ); + } + while( kstat_chain_update( kctl ) != 0 ) + ; + + /* + * traverse the kstat chain + * to find the appropriate statistics + */ + if( (ksp = kstat_lookup( kctl, + module, 0, name )) == NULL ) { + free( module ); + return( 0 ); + } + if( kstat_read( kctl, ksp, NULL ) == -1 ) { + free( module ); + return( 0 ); + } + free( module ); + + /* + * lookup & store the data + */ + kdata = (kstat_named_t *) kstat_data_lookup( ksp, "ipackets" ); + if( kdata != NULL ) { + buf->packets_in= kdata->value.ul; + } + kdata = (kstat_named_t *) kstat_data_lookup( ksp, "opackets" ); + if( kdata != NULL ) { + buf->packets_out = kdata->value.ul; + } + kdata = (kstat_named_t *) kstat_data_lookup( ksp, "rbytes" ); + if( kdata != NULL ) { + buf->bytes_in =kdata->value.ul; + } + kdata = (kstat_named_t *) kstat_data_lookup( ksp, "obytes" ); + if( kdata != NULL ) { + buf->bytes_out =kdata->value.ul; + } + kdata = (kstat_named_t *) kstat_data_lookup( ksp, "ierrors" ); + if( kdata != NULL ) { + buf->errors_in = kdata->value.ul; + } + kdata = (kstat_named_t *) kstat_data_lookup( ksp, "oerrors" ); + if( kdata != NULL ) { + buf->errors_out = kdata->value.ul; + } + kdata = (kstat_named_t *) kstat_data_lookup( ksp, "collisions" ); + if( kdata != NULL ) { + buf->collisions = kdata->value.ul; + } + + /* Compute total valules. */ + + buf->bytes_total = buf->bytes_in + buf->bytes_out; + buf->packets_total = buf->packets_in + buf->packets_out; + buf->errors_total = buf->errors_in + buf->errors_out; + /* And now the flags. */ + buf->flags |= _glibtop_sysdeps_netload; + buf->flags |= _glibtop_sysdeps_netload_bytes; + buf->flags |= _glibtop_sysdeps_netload_packets; + + /* finished */ +} + +/* Provides network statistics. */ + +void +glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, + const char *interface) +{ + int skfd; + memset (buf, 0, sizeof (glibtop_netload)); + + /* set flag */ + skfd = socket (PF_INET, SOCK_DGRAM, 0); + if (skfd) { + struct ifreq ifr; + + g_strlcpy (ifr.ifr_name, interface, sizeof ifr.ifr_name); + if (ioctl (skfd, SIOCGIFFLAGS, &ifr) >= 0) { + const unsigned long long flags = ifr.ifr_flags; + + buf->flags |= (1L << GLIBTOP_NETLOAD_IF_FLAGS); + + if (flags & IFF_UP) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP); + + if (flags & IFF_BROADCAST) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST); + + if (flags & IFF_DEBUG) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG); + + if (flags & IFF_LOOPBACK) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK); + + if (flags & IFF_POINTOPOINT) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT); + + if (flags & IFF_RUNNING) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING); + + if (flags & IFF_NOARP) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP); + + if (flags & IFF_PROMISC) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC); + + if (flags & IFF_ALLMULTI) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI); + + if (flags & IFF_MULTICAST) + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST); + } + + g_strlcpy (ifr.ifr_name, interface, sizeof ifr.ifr_name); + if (!ioctl (skfd, SIOCGIFADDR, &ifr)) { + buf->address = ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr; + buf->flags |= (1L << GLIBTOP_NETLOAD_ADDRESS); + } + + g_strlcpy (ifr.ifr_name, interface, sizeof ifr.ifr_name); + if (!ioctl (skfd, SIOCGIFNETMASK, &ifr)) { + buf->subnet = ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr; + buf->flags |= (1L << GLIBTOP_NETLOAD_SUBNET); + } + close (skfd); + } + + /* + * Statistics + */ + + solaris_stats(server, buf, interface); + +} diff --git a/sysdeps/solaris/open.c b/sysdeps/solaris/open.c new file mode 100644 index 0000000..d48a2ae --- /dev/null +++ b/sysdeps/solaris/open.c @@ -0,0 +1,242 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +/* We need to call this when kstat_chain_update() returns new KID. + * In that case all kstat pointers and data are invalid, so we + * need to reread everything. The condition shouldn't happen very + * often. + */ + +void +glibtop_get_kstats(glibtop *server) +{ + kstat_ctl_t *kc = server->machine->kc; + kstat_t *ksp; + int nproc_same, new_ncpu; + + server->ncpu = new_ncpu = sysconf(_SC_NPROCESSORS_CONF); + + + if(!kc) + { + server->ncpu = new_ncpu; + server->machine->vminfo_kstat = NULL; + server->machine->system = NULL; + server->machine->syspages = NULL; + server->machine->bunyip = NULL; + return; + } + + do { + + ksp = kstat_lookup(kc, "unix", -1, "vminfo"); + server->machine->vminfo_kstat = ksp; + if(ksp) + { + kstat_read(kc, ksp, &server->machine->vminfo); + /* Don't change snaptime if we only need to reinitialize kstats */ + if(!(server->machine->vminfo_snaptime)) + server->machine->vminfo_snaptime = ksp->ks_snaptime; + } + + /* We don't know why was kstat chain invalidated. It could have + been because the number of processors changed. The sysconf() + man page says that values returned won't change during the + life time of a process, but let's hope that's just an error in + the documentation. */ + + if((nproc_same = new_ncpu) == server->ncpu) + { + int checked, i; + char cpu[20]; + + for(i = 0, checked = 0; i < GLIBTOP_NCPU || checked == new_ncpu; ++i) + if(!server->machine->cpu_stat_kstat[i]) + + { + sprintf(cpu, "cpu_stat%d", i); + if(!(server->machine->cpu_stat_kstat[i] = + kstat_lookup(kc, "cpu_stat", -1, cpu))) + { + nproc_same = 0; + break; + } + ++checked; + } + } + + if(!nproc_same) + { + processorid_t p; + int found; + char cpu[20]; + + server->ncpu = new_ncpu = MIN(new_ncpu, GLIBTOP_NCPU); + + for(p = 0, found = 0; p < GLIBTOP_NCPU && found != new_ncpu; ++p) + { + if(p_online(p, P_STATUS) < 0) + { + server->machine->cpu_stat_kstat[p] = NULL; + continue; + } + sprintf(cpu, "cpu_stat%d", (int)p); + server->machine->cpu_stat_kstat[p] = + kstat_lookup(kc, "cpu_stat", -1, cpu); + ++found; + } + } + + server->machine->system = kstat_lookup(kc, "unix", -1, "system_misc"); + server->machine->syspages = kstat_lookup(kc, "unix", -1, "system_pages"); + server->machine->bunyip = kstat_lookup(kc, "bunyip", -1, "mempages"); + + } while(kstat_chain_update(kc) > 0 && + (new_ncpu = sysconf(_SC_NPROCESSORS_CONF))); + + /* We'll ignore -1 from kstat_chain_update here, since it really + shouldn't happen */ +} + +void +glibtop_open_s (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags) +{ + kstat_ctl_t *kc; + kstat_t *ksp; + kstat_named_t *kn; + int i, page; + void *dl; + + server->name = program_name; + + page = sysconf(_SC_PAGESIZE) >> 10; + for(i = 0; page; ++i, page >>= 1); + server->machine->pagesize = i - 1; + server->machine->ticks = sysconf(_SC_CLK_TCK); + if(server->machine->kc) + kstat_close(server->machine->kc); + server->machine->kc = kc = kstat_open (); + +#if 0 + for (ksp = server->machine->kc->kc_chain; ksp != NULL; ksp = ksp->ks_next) { + if (!strcmp (ksp->ks_class, "vm") && !strcmp (ksp->ks_name, "vminfo")) { + server->machine->vminfo_kstat = ksp; + kstat_read (server->machine->kc, ksp, &server->machine->vminfo); + server->machine->vminfo_snaptime = ksp->ks_snaptime; + continue; + } + + if (!strcmp (ksp->ks_class, "misc") && !strncmp (ksp->ks_name, "cpu_stat", 8)) { + int cpu; + + if ((sscanf (ksp->ks_name+8, "%d", &cpu) != 1) || (cpu > 63)) + continue; + + if (cpu >= server->ncpu) + server->ncpu = cpu+1; + + server->machine->cpu_stat_kstat [cpu] = ksp; + continue; + } + } + +#endif + + if (!kc) + glibtop_warn_io_r (server, "kstat_open ()"); + + server->ncpu = -1; /* Force processor detection */ + server->machine->vminfo_snaptime = 0; /* Force snaptime read */ + glibtop_get_kstats(server); + + server->machine->boot = 0; + if((ksp = server->machine->system) && kstat_read(kc, ksp, NULL) >= 0) + { + kn = (kstat_named_t *)kstat_data_lookup(ksp, "boot_time"); + if(kn) + switch(kn->data_type) + { +#ifdef KSTAT_DATA_INT32 + case KSTAT_DATA_INT32: server->machine->boot = kn->value.i32; + break; + case KSTAT_DATA_UINT32: server->machine->boot = kn->value.ui32; + break; + case KSTAT_DATA_INT64: server->machine->boot = kn->value.i64; + break; + case KSTAT_DATA_UINT64: server->machine->boot = kn->value.ui64; + break; +#else + case KSTAT_DATA_LONG: server->machine->boot = kn->value.l; + break; + case KSTAT_DATA_ULONG: server->machine->boot = kn->value.ul; + break; + case KSTAT_DATA_LONGLONG: server->machine->boot = kn->value.ll; + break; + case KSTAT_DATA_ULONGLONG: server->machine->boot = kn->value.ull; + break; +#endif + } + } + + /* Now let's have a bit of magic dust... */ + +#if GLIBTOP_SOLARIS_RELEASE >= 50600 + + dl = dlopen("/usr/lib/libproc.so", RTLD_LAZY); + if(server->machine->libproc) + dlclose(server->machine->libproc); + server->machine->libproc = dl; + if(dl) + { + void *func; + + func = dlsym(dl, "Pobjname"); /* Solaris 8 */ + if(!func) + func = dlsym(dl, "proc_objname"); /* Solaris 7 */ + server->machine->objname = (void (*) + (void *, uintptr_t, const char *, size_t))func; + server->machine->pgrab = (struct ps_prochandle *(*)(pid_t, int, int *)) + dlsym(dl, "Pgrab"); + server->machine->pfree = (void (*)(void *))dlsym(dl, "Pfree"); + + } + else + { + server->machine->objname = NULL; + server->machine->pgrab = NULL; + server->machine->pfree = NULL; + } +#endif + server->machine->me = getpid(); +} diff --git a/sysdeps/solaris/open_suid.c b/sysdeps/solaris/open_suid.c new file mode 100644 index 0000000..928b43f --- /dev/null +++ b/sysdeps/solaris/open_suid.c @@ -0,0 +1,96 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include + +#include +#include + +/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags) +{ + const _glibtop_init_func_t *init_fkt; + + if (server == NULL) + glibtop_error_r (NULL, "glibtop_init_p (server == NULL)"); + + /* Do the initialization, but only if not already initialized. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_INIT) == 0) { + glibtop_open_p (server, "glibtop", features, flags); + + for (init_fkt = _glibtop_init_hook_p; *init_fkt; init_fkt++) + (*init_fkt) (server); + + server->flags |= _GLIBTOP_INIT_STATE_INIT; + } +} + +/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags) +{ + /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ + + server->name = program_name; + + server->machine->uid = getuid (); + server->machine->euid = geteuid (); + server->machine->gid = getgid (); + server->machine->egid = getegid (); + +#if GLIBTOP_SOLARIS_RELEASE < 51000 + + server->machine->kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL); + if(!server->machine->kd) + glibtop_warn_io_r(server, "kvm_open()"); + +#endif + + /* Drop priviledges; we only become root when necessary. + + setreuid (ruid, euid) - set real and effective user id; + setregid (rgid, egid) - set real and effective group id; + + */ + + if (setreuid (server->machine->euid, server->machine->uid)) + _exit (1); + + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); + + /* !!! END OF SUID ROOT PART !!! */ + + /* Our effective uid is now those of the user invoking the server, + so we do no longer have any priviledges. + */ +} diff --git a/sysdeps/solaris/ppp.c b/sysdeps/solaris/ppp.c new file mode 100644 index 0000000..0801643 --- /dev/null +++ b/sysdeps/solaris/ppp.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_ppp = 0; + +/* Init function. */ + +void +_glibtop_init_ppp_s (glibtop *server) +{ + server->sysdeps.ppp = _glibtop_sysdeps_ppp; +} + +/* Provides PPP/ISDN information. */ + +void +glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device) +{ + memset (buf, 0, sizeof (glibtop_ppp)); +} diff --git a/sysdeps/solaris/procargs.c b/sysdeps/solaris/procargs.c new file mode 100644 index 0000000..82d2f4a --- /dev/null +++ b/sysdeps/solaris/procargs.c @@ -0,0 +1,83 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_args = +(1L << GLIBTOP_PROC_ARGS_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_args_s (glibtop *server) +{ + server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; +} + +/* Provides detailed information about a process. */ + +char * +glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len) +{ +#ifdef HAVE_PROCFS_H + struct psinfo pinfo; +#else + struct prpsinfo pinfo; +#endif + unsigned len; + char *ret, *p; + + memset (buf, 0, sizeof (glibtop_proc_args)); + + if(glibtop_get_proc_data_psinfo_s(server, &pinfo, pid)) + return NULL; + + /* strnlen */ + for(len = 0; len < PRARGSZ; ++len) + if(!(pinfo.pr_psargs[len])) + break; + + + if(max_len && max_len < len) + { + len = max_len; + } + + ret = g_malloc(len + 1); + memcpy(ret, pinfo.pr_psargs, len); + ret[len] = 0; + + for(p = ret; *p; ++p) + { + if(*p == ' ') *p = 0; + } + + buf->size = len; + buf->flags = _glibtop_sysdeps_proc_args; + + return ret; +} diff --git a/sysdeps/solaris/procdata.c b/sysdeps/solaris/procdata.c new file mode 100644 index 0000000..714e34c --- /dev/null +++ b/sysdeps/solaris/procdata.c @@ -0,0 +1,274 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +#include + +#include "safeio.h" + +/* + * The differences between old and new procfs API are: + * - old has /proc/ file and ioctl() is used to obtain the data. + * - new has /proc//* files and read() & friends are used to + * obtain the data. + * - names of structures and members are different. It's mostly the + * prefix. Old uses `pr' and new uses `ps'. + * + * Since almost every line would be in #ifdef, I think it would + * be more readable to just copy everything twice. This is not a big + * file, after all. + */ + +#ifdef HAVE_PROCFS_H + +/* Read /proc//psinfo. */ + +int +glibtop_get_proc_data_psinfo_s (glibtop *server, struct psinfo *psinfo, pid_t pid) +{ + int fd; + char buffer [BUFSIZ]; + + sprintf (buffer, "/proc/%d/psinfo", (int) pid); + + fd = s_open (buffer, O_RDONLY); + + if (fd < 0) { + glibtop_warn_io_r (server, "open (%s)", buffer); + return -1; + } + + if (s_pread (fd, psinfo, sizeof (struct psinfo), 0) + != sizeof (struct psinfo)) + { + s_close (fd); + glibtop_warn_io_r (server, "pread (%s)", buffer); + return -1; + } + + s_close (fd); + return 0; +} + +int +glibtop_get_proc_data_usage_s (glibtop *server, struct prusage *prusage, pid_t pid) +{ + int fd; + char buffer [BUFSIZ]; + + sprintf (buffer, "/proc/%d/usage", (int) pid); + + fd = s_open (buffer, O_RDONLY); + + if (fd < 0) { + glibtop_warn_io_r (server, "open (%s)", buffer); + return -1; + } + + if (s_pread (fd, prusage, sizeof (struct prusage), 0) + != sizeof (struct prusage)) + { + s_close (fd); + glibtop_warn_io_r (server, "pread (%s)", buffer); + return -1; + } + + s_close (fd); + return 0; +} + +#if LIBGTOP_VERSION_CODE >= 1001002 +int +glibtop_get_proc_credentials_s(glibtop *server, + struct prcred *prcred, + gid_t *groups, + pid_t pid) +{ + int fd; + size_t toread; + char buffer[BUFSIZ]; + + sprintf(buffer, "/proc/%d/cred", (int)pid); + + if((fd = s_open(buffer, O_RDONLY)) < 0) + { + if(errno != EPERM && errno != EACCES) + glibtop_warn_io_r(server, "open (%s)", buffer); + return -1; + } + + if(s_pread(fd, prcred, sizeof(struct prcred), 0) + != sizeof(struct prcred)) + { + s_close(fd); + glibtop_warn_io_r(server, "pread (%s)", buffer); + return -1; + } + + if(prcred->pr_ngroups >= 0) + { + toread = MIN(prcred->pr_ngroups, GLIBTOP_MAX_GROUPS) * sizeof(gid_t); + + if((size_t) s_pread(fd,groups, toread, + G_STRUCT_OFFSET(struct prcred, pr_groups)) + != toread) + prcred->pr_ngroups = 0; + } + s_close(fd); + return 0; +} +#endif /* LIBGTOP_VERSION_CODE >= 1001002 */ + +int +glibtop_get_proc_status_s(glibtop *server, struct pstatus *pstatus, pid_t pid) +{ + int fd; + char buffer[BUFSIZ]; + + sprintf(buffer, "/proc/%d/status", (int)pid); + if((fd = s_open(buffer, O_RDONLY)) < 0) + { + if(errno != EPERM && errno != EACCES) + glibtop_warn_io_r(server, "open (%s)", buffer); + return -1; + } + if(s_pread(fd, pstatus, sizeof(struct pstatus), 0) + != sizeof(struct pstatus)) + { + s_close(fd); + glibtop_warn_io_r(server, "pread (%s)", buffer); + return -1; + } + s_close(fd); + return 0; +} + +#else /* old API */ + +int +glibtop_get_proc_data_psinfo_s (glibtop *server, + struct prpsinfo *psinfo, + pid_t pid) +{ + int fd; + char buffer [BUFSIZ]; + + sprintf (buffer, "/proc/%d", (int) pid); + fd = s_open (buffer, O_RDONLY); + if (fd < 0) { + if(errno != EPERM && errno != EACCES) + glibtop_warn_io_r (server, "open (%s)", buffer); + return -1; + } + + if(ioctl(fd, PIOCPSINFO, psinfo) < 0) + { + s_close (fd); + glibtop_warn_io_r (server, "ioctl(%s, PIOCPSINFO)", buffer); + return -1; + } + + s_close (fd); + return 0; +} + +int +glibtop_get_proc_data_usage_s (glibtop *server, + struct prusage *prusage, + pid_t pid) +{ + int fd; + char buffer [BUFSIZ]; + + sprintf (buffer, "/proc/%d", (int) pid); + fd = s_open (buffer, O_RDONLY); + if (fd < 0) { + if(errno != EPERM && errno != EACCES) + glibtop_warn_io_r (server, "open (%s)", buffer); + return -1; + } + + if(ioctl(fd, PIOCUSAGE, prusage) < 0) + { + s_close (fd); + glibtop_warn_io_r (server, "ioctl(%s, PIOCUSAGE)", buffer); + return -1; + } + + s_close (fd); + return 0; +} + +int +glibtop_get_proc_credentials_s(glibtop *server, + struct prcred *prcred, + gid_t *groups, + pid_t pid) +{ + int fd; + size_t toread; + char buffer[BUFSIZ]; + + sprintf(buffer, "/proc/%d", (int)pid); + if((fd = s_open(buffer, O_RDONLY)) < 0) + { + if(errno != EPERM && errno != EACCES) + glibtop_warn_io_r(server, "open (%s)", buffer); + return -1; + } + if(ioctl(fd, PIOCCRED, prcred) < 0) + { + s_close(fd); + glibtop_warn_io_r(server, "ioctl(%s, PIOCCRED)", buffer); + return -1; + } + s_close(fd); + return 0; +} + +int +glibtop_get_proc_status_s(glibtop *server, struct prstatus *pstatus, pid_t pid) +{ + int fd; + char buffer[BUFSIZ]; + + sprintf(buffer, "/proc/%d", (int)pid); + if((fd = s_open(buffer, O_RDONLY)) < 0) + { + if(errno != EPERM && errno != EACCES) + glibtop_warn_io_r(server, "open (%s)", buffer); + return -1; + } + if(ioctl(fd, PIOCSTATUS, pstatus) < 0) + { + s_close(fd); + glibtop_warn_io_r(server, "ioctl(%s, PIOCSTATUS)", buffer); + return -1; + } + s_close(fd); + return 0; +} +#endif diff --git a/sysdeps/solaris/prockernel.c b/sysdeps/solaris/prockernel.c new file mode 100644 index 0000000..8c1e548 --- /dev/null +++ b/sysdeps/solaris/prockernel.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_kernel = 0; + +/* Init function. */ + +void +_glibtop_init_proc_kernel_s (glibtop *server) +{ + server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_kernel)); +} diff --git a/sysdeps/solaris/proclist.c b/sysdeps/solaris/proclist.c new file mode 100644 index 0000000..b495c5f --- /dev/null +++ b/sysdeps/solaris/proclist.c @@ -0,0 +1,240 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "safeio.h" +#include "glibtop_private.h" + +#include +#include +#include +#include + +#define GLIBTOP_PROCLIST_FLAGS 3 + +static const unsigned long _glibtop_sysdeps_proclist = +(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) + +(1L << GLIBTOP_PROCLIST_SIZE); + +/* Init function. */ + +void +_glibtop_init_proclist_s (glibtop *server) +{ + server->sysdeps.proclist = _glibtop_sysdeps_proclist; +} + +#define BLOCK_COUNT 256 +#define BLOCK_SIZE (BLOCK_COUNT * sizeof (pid_t)) + +/* Fetch list of currently running processes. + * + * IMPORTANT NOTE: + * On error, this function MUST return NULL and set buf->flags to zero ! + * On success, it returnes a pointer to a list of buf->number elements + * each buf->size big. The total size is stored in buf->total. */ + +pid_t* +glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg) +{ + DIR *proc; + struct dirent *entry; + char buffer [BUFSIZ]; + unsigned count, total, pid = 0, mask; + pid_t pids [BLOCK_COUNT], *pids_chain = NULL; + unsigned pids_size = 0, pids_offset = 0, new_size; + struct stat statb; + int len, ok; + + memset (buf, 0, sizeof (glibtop_proclist)); + mask = which & ~GLIBTOP_KERN_PROC_MASK; + which &= GLIBTOP_KERN_PROC_MASK; + + /* Check if the user wanted only one process */ + + if(which == GLIBTOP_KERN_PROC_PID) + { + if(mask) + { +#ifdef HAVE_PROCFS_H + struct psinfo psinfo; +#else + struct prpsinfo psinfo; +#endif + if(glibtop_get_proc_data_psinfo_s(server, &psinfo, pid)) + return NULL; + if(mask & GLIBTOP_EXCLUDE_IDLE && !psinfo.pr_pctcpu) + return NULL; + if(mask & GLIBTOP_EXCLUDE_SYSTEM && psinfo.pr_flag & SSYS) + return NULL; + if(mask & GLIBTOP_EXCLUDE_NOTTY && psinfo.pr_ttydev == PRNODEV) + return NULL; + } + else + { + sprintf(buffer, "/proc/%lld", arg); + if(s_stat(buffer, &statb) < 0) + return NULL; + } + pids_chain = g_malloc(sizeof(pid_t)); + *pids_chain = pid; + return pids_chain; + } + + proc = opendir ("/proc"); + if (!proc) return NULL; + + /* read every every entry in /proc */ + + for (count = total = 0, entry = readdir (proc); + entry; entry = readdir (proc)) { + ok = 1; len = strlen (entry->d_name); + + /* does it consist entirely of digits? */ + /* It does, except for "." and "..". Let's speed up */ + + if(entry->d_name[0] == '.') + continue; + + /* convert it in a number */ + pid = (unsigned)atol(entry->d_name); + +#ifdef HAVE_PROCFS_H + + /* Can we skip it based on the request? We have + RUID and RGID in struct stat. But we can't do it + like this for LP64 process, because stat() will fail. + XXX Unimplemented for now */ + + if(!mask && which == GLIBTOP_KERN_PROC_RUID) + { + sprintf (buffer, "/proc/%d", pid); + if (s_stat (buffer, &statb)) continue; + + if (!S_ISDIR (statb.st_mode)) continue; + + if(statb.st_uid != arg) continue; + } + + if(mask || which != GLIBTOP_KERN_PROC_ALL) + { + struct psinfo psinfo; + + if(glibtop_get_proc_data_psinfo_s(server, &psinfo, pid)) + continue; + if(mask) + { + if(mask & GLIBTOP_EXCLUDE_IDLE && !psinfo.pr_pctcpu) + continue; + if(mask & GLIBTOP_EXCLUDE_SYSTEM && psinfo.pr_flag & SSYS) + continue; + if(mask & GLIBTOP_EXCLUDE_NOTTY + && psinfo.pr_ttydev == PRNODEV) + continue; + } + switch(which) + { + case GLIBTOP_KERN_PROC_PGRP: if(psinfo.pr_pgid != arg) + continue; + break; + case GLIBTOP_KERN_PROC_SESSION: if(psinfo.pr_sid != arg) + continue; + break; + case GLIBTOP_KERN_PROC_TTY: if(psinfo.pr_ttydev != arg) + continue; + break; + case GLIBTOP_KERN_PROC_UID: if(psinfo.pr_euid != arg) + continue; + break; + case GLIBTOP_KERN_PROC_RUID: if(psinfo.pr_uid != arg) + continue; + break; + default: break; + } + } +#endif + /* Fine. Now we first try to store it in pids. If this buffer is + * full, we copy it to the pids_chain. */ + + if (count >= BLOCK_COUNT) { + /* The following call to g_realloc will be + * equivalent to g_malloc () if `pids_chain' is + * NULL. We just calculate the new size and copy `pids' + * to the beginning of the newly allocated block. */ + + new_size = pids_size + BLOCK_SIZE; + + pids_chain = g_realloc (pids_chain, new_size); + + memcpy (pids_chain + pids_offset, pids, BLOCK_SIZE); + + pids_size = new_size; + + pids_offset += BLOCK_COUNT; + + count = 0; + } + + /* pids is now big enough to hold at least one single pid. */ + + pids [count++] = pid; + + total++; + } + + s_closedir (proc); + + /* count is only zero if an error occured (one a running Linux system, + * we have at least one single process). */ + + if (!count) return NULL; + + /* The following call to g_realloc will be equivalent to + * g_malloc if pids_chain is NULL. We just calculate the + * new size and copy pids to the beginning of the newly allocated + * block. */ + + new_size = pids_size + count * sizeof (pid_t); + + pids_chain = g_realloc (pids_chain, new_size); + + memcpy (pids_chain + pids_offset, pids, count * sizeof (pid_t)); + + pids_size = new_size; + + pids_offset += BLOCK_COUNT; + + /* Since everything is ok now, we can set buf->flags, fill in the + * remaining fields and return the `pids_chain'. */ + + buf->flags = _glibtop_sysdeps_proclist; + + buf->size = sizeof (pid_t); + buf->number = total; + + buf->total = buf->number * buf->size; + + return pids_chain; +} diff --git a/sysdeps/solaris/procmap.c b/sysdeps/solaris/procmap.c new file mode 100644 index 0000000..e45160d --- /dev/null +++ b/sysdeps/solaris/procmap.c @@ -0,0 +1,202 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include +#include +#include +#include + +#include + +#include "safeio.h" + + +static const unsigned long _glibtop_sysdeps_proc_map = +(1L << GLIBTOP_PROC_MAP_NUMBER) + (1L << GLIBTOP_PROC_MAP_TOTAL) + +(1L << GLIBTOP_PROC_MAP_SIZE); +static const unsigned long _glibtop_sysdeps_map_entry = +(1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) + +(1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM); +static const unsigned long _glibtop_sysdeps_map_device = +(1L << GLIBTOP_MAP_ENTRY_DEVICE) + (1L << GLIBTOP_MAP_ENTRY_INODE); + + +/* Init function. */ + +void +_glibtop_init_proc_map_s (glibtop *server) +{ + server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; +} + +/* Provides detailed information about a process. */ + +glibtop_map_entry * +glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid) +{ + int fd, i, nmaps, pr_err, heap; +#if GLIBTOP_SOLARIS_RELEASE >= 50600 + prxmap_t *maps; + struct ps_prochandle *Pr = NULL; +#else + prmap_t *maps; +#endif + + /* A few defines, to make it shorter down there */ + +#ifdef HAVE_PROCFS_H +# define OFFSET pr_offset +#else +# define OFFSET pr_off +#endif + + glibtop_map_entry *entry; + struct stat inode; + char buffer[BUFSIZ]; + + memset (buf, 0, sizeof (glibtop_proc_map)); + +#ifdef HAVE_PROCFS_H + sprintf(buffer, "/proc/%d/xmap", (int)pid); +#else + sprintf(buffer, "/proc/%d", (int)pid); +#endif + if((fd = s_open(buffer, O_RDONLY)) < 0) + { + if (errno != EPERM && errno != EACCES) + glibtop_warn_io_r(server, "open (%s)", buffer); + return NULL; + } +#ifdef HAVE_PROCFS_H + if(fstat(fd, &inode) < 0) + { + if(errno != EOVERFLOW) + glibtop_warn_io_r(server, "fstat (%s)", buffer); + /* else call daemon for 64-bit support */ + s_close(fd); + return NULL; + } + maps = g_alloca(inode.st_size); + nmaps = inode.st_size / sizeof(prxmap_t); + if(s_pread(fd, maps, inode.st_size, 0) != inode.st_size) + { + glibtop_warn_io_r(server, "pread (%s)", buffer); + s_close(fd); + return NULL; + } +#else + if(ioctl(fd, PIOCNMAP, &nmaps) < 0) + { + glibtop_warn_io_r(server, "ioctl(%s, PIOCNMAP)", buffer); + s_close(fd); + return NULL; + } + maps = g_alloca((nmaps + 1) * sizeof(prmap_t)); + if(ioctl(fd, PIOCMAP, maps) < 0) + { + glibtop_warn_io_r(server, "ioctl(%s, PIOCMAP)", buffer); + s_close(fd); + return NULL; + } +#endif + buf->number = nmaps; + buf->size = sizeof(glibtop_map_entry); + buf->total = nmaps * sizeof(glibtop_map_entry); + entry = g_malloc0(buf->total); + +#if GLIBTOP_SOLARIS_RELEASE >= 50600 + + if(server->machine->objname && server->machine->pgrab && + server->machine->pfree) + Pr = (server->machine->pgrab)(pid, 1, &pr_err); +#endif + for(heap = 0,i = 0; i < nmaps; ++i) + { + int len; + + entry[i].start = maps[i].pr_vaddr; + entry[i].end = maps[i].pr_vaddr + maps[i].pr_size; + +#if GLIBTOP_SOLARIS_RELEASE >= 50600 + + if(maps[i].pr_dev != PRNODEV) + { + entry[i].device = maps[i].pr_dev; + entry[i].inode = maps[i].pr_ino; + entry[i].flags |= _glibtop_sysdeps_map_device; + } +#endif + entry[i].offset = maps[i].OFFSET; + if(maps[i].pr_mflags & MA_READ) + entry[i].perm |= GLIBTOP_MAP_PERM_READ; + if(maps[i].pr_mflags & MA_WRITE){ + entry[i].perm |= GLIBTOP_MAP_PERM_WRITE; + entry[i].size = maps[i].pr_size; + } + if(maps[i].pr_mflags & MA_EXEC) + entry[i].perm |= GLIBTOP_MAP_PERM_EXECUTE; + if(maps[i].pr_mflags & MA_SHARED) + entry[i].perm |= GLIBTOP_MAP_PERM_SHARED; + else + entry[i].perm |= GLIBTOP_MAP_PERM_PRIVATE; + entry[i].flags = _glibtop_sysdeps_map_entry; + +#if GLIBTOP_SOLARIS_RELEASE >= 50600 + + if(maps[i].pr_mflags & MA_ANON) + { + if(!heap) + { + ++heap; + strcpy(entry[i].filename, "[ heap ]"); + } + else + if(i == nmaps - 1) + strcpy(entry[i].filename, "[ stack ]"); + else + strcpy(entry[i].filename, "[ anon ]"); + entry[i].flags |= (1L << GLIBTOP_MAP_ENTRY_FILENAME); + } + else + if(Pr) + { + server->machine->objname(Pr, maps[i].pr_vaddr, buffer, + BUFSIZ); + if((len = resolvepath(buffer, entry[i].filename, + GLIBTOP_MAP_FILENAME_LEN)) > 0) + { + entry[i].filename[len] = 0; + entry[i].flags |= (1L << GLIBTOP_MAP_ENTRY_FILENAME); + } + } +#endif + } + +#if GLIBTOP_SOLARIS_RELEASE >= 50600 + + if(Pr) + server->machine->pfree(Pr); +#endif + buf->flags = _glibtop_sysdeps_proc_map; + s_close(fd); + return entry; +} diff --git a/sysdeps/solaris/procmem.c b/sysdeps/solaris/procmem.c new file mode 100644 index 0000000..9405bf1 --- /dev/null +++ b/sysdeps/solaris/procmem.c @@ -0,0 +1,65 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_mem = +(1L << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_VSIZE) + +(1L << GLIBTOP_PROC_MEM_RESIDENT) + (1L << GLIBTOP_PROC_MEM_RSS); + +/* Init function. */ + +void +_glibtop_init_proc_mem_s (glibtop *server) +{ + server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid) +{ +#ifdef HAVE_PROCFS_H + struct psinfo psinfo; +#else + struct prpsinfo psinfo; + int pagesize = server->machine->pagesize; +#endif + + memset (buf, 0, sizeof (glibtop_proc_mem)); + + if(glibtop_get_proc_data_psinfo_s(server, &psinfo, pid)) + return; + +#ifdef HAVE_PROCFS_H + buf->size = buf->vsize = psinfo.pr_size << 10; + buf->resident = buf->rss = psinfo.pr_rssize << 10; +#else + buf->size = buf->vsize = psinfo.pr_size << pagesize << 10; + buf->resident = buf->rss = psinfo.pr_rssize << pagesize << 10; +#endif + buf->flags = _glibtop_sysdeps_proc_mem; +} diff --git a/sysdeps/solaris/procopenfiles.c b/sysdeps/solaris/procopenfiles.c new file mode 100644 index 0000000..fb0c401 --- /dev/null +++ b/sysdeps/solaris/procopenfiles.c @@ -0,0 +1,128 @@ +/* Copyright (C) 2006 Henry Zhang + This file is part of LibGTop 2.14. + + Contributed by Henry Zhang , July 2006. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_proc_open_files = +(1L << GLIBTOP_PROC_OPEN_FILES_NUMBER)| +(1L << GLIBTOP_PROC_OPEN_FILES_TOTAL)| +(1L << GLIBTOP_PROC_OPEN_FILES_SIZE); + +/* Init function. */ + +void +_glibtop_init_proc_open_files_s (glibtop *server) +{ + server->sysdeps.proc_open_files = _glibtop_sysdeps_proc_open_files; +} + + + +/* Provides detailed information about a process' open files */ + +glibtop_open_files_entry * +glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pid_t pid) +{ + char filename [BUFSIZ]; + GArray *entries; + struct dirent *direntry; + DIR *dir; + int errno; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_OPEN_FILES, 0); + + memset (buf, 0, sizeof (glibtop_proc_open_files)); + + sprintf (filename, "/proc/%d/fd", pid); + + dir = opendir (filename); + if (!dir) return NULL; + + entries = g_array_new(FALSE, FALSE, sizeof(glibtop_open_files_entry)); + + while((direntry = readdir(dir))) { + char tgt [BUFSIZ]; + int rv; + glibtop_open_files_entry entry = {0}; + struct stat statbuf; + + if(direntry->d_name[0] == '.') + continue; + + if ((entry.fd = (int) g_ascii_strtoull(direntry->d_name, NULL, 10)) == 0) + continue; + + /* from /path get object name */ + g_snprintf(filename, sizeof filename, "/proc/%d/path/%s", + pid, direntry->d_name); + + rv = readlink(filename, tgt, sizeof(tgt) - 1); + /* read object, if not have, set it as NULL, but this fd still need to insert into the array */ + if(rv < 0) + rv = 0; + tgt[rv] = '\0'; + + /* from /fd get the stat data */ + g_snprintf(filename, sizeof filename, "/proc/%d/fd/%s", + pid, direntry->d_name); + + if(stat (filename, &statbuf)) + statbuf.st_mode = 0; + + switch (statbuf.st_mode & S_IFMT) { + case S_IFIFO: /* pipe */ + entry.type = GLIBTOP_FILE_TYPE_PIPE; + break; + case S_IFSOCK: /* socket */ + /* at solaris, now a little difficult to tell the Socket type, so here I + give the type 0, it will not impact the existed code. Later will provide + a patch to tell the type, and get the object name */ + entry.type = 0; + break; + default: + entry.type = GLIBTOP_FILE_TYPE_FILE; + } + + g_strlcpy(entry.info.file.name, tgt, sizeof entry.info.file.name); + + g_array_append_val(entries, entry); + } + + closedir (dir); + + buf->flags = _glibtop_sysdeps_proc_open_files; + buf->number = entries->len; + buf->size = sizeof(glibtop_open_files_entry); + buf->total = buf->number * buf->size; + + return (glibtop_open_files_entry*)g_array_free(entries, FALSE); +} diff --git a/sysdeps/solaris/procsegment.c b/sysdeps/solaris/procsegment.c new file mode 100644 index 0000000..ca06c4d --- /dev/null +++ b/sysdeps/solaris/procsegment.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_segment = 0; + +/* Init function. */ + +void +_glibtop_init_proc_segment_s (glibtop *server) +{ + server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_segment)); +} diff --git a/sysdeps/solaris/procsignal.c b/sysdeps/solaris/procsignal.c new file mode 100644 index 0000000..8465e45 --- /dev/null +++ b/sysdeps/solaris/procsignal.c @@ -0,0 +1,73 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_signal = +(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1L << GLIBTOP_PROC_SIGNAL_BLOCKED); + +/* Init function. */ + +void +_glibtop_init_proc_signal_s (glibtop *server) +{ + server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, + pid_t pid) +{ +#ifdef HAVE_PROCFS_H + struct pstatus pstatus; +#else + struct prstatus pstatus; +#endif + int size; + + memset (buf, 0, sizeof (glibtop_proc_signal)); + + if(glibtop_get_proc_status_s(server, &pstatus, pid)) + return; + + if(sizeof(buf->signal) < sizeof(sigset_t)) + size = sizeof(buf->signal); + else + size = sizeof(sigset_t); + + memcpy(buf->signal, &pstatus.pr_sigpend, size); +#ifdef HAVE_PROCFS_H + memcpy(buf->blocked, &pstatus.pr_lwp.pr_lwphold, size); +#else + memcpy(buf->blocked, &pstatus.pr_lwppend, size); +#endif + + /* Technically, most of this is meaningless on a process level, + but this should be a good enough approximation. */ + + buf->flags = _glibtop_sysdeps_proc_signal; +} diff --git a/sysdeps/solaris/procstate.c b/sysdeps/solaris/procstate.c new file mode 100644 index 0000000..ce10db0 --- /dev/null +++ b/sysdeps/solaris/procstate.c @@ -0,0 +1,101 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_state = +#ifdef HAVE_PROCFS_H +(1L << GLIBTOP_PROC_STATE_HAS_CPU) + (1L << GLIBTOP_PROC_STATE_PROCESSOR) + +(1L << GLIBTOP_PROC_STATE_LAST_PROCESSOR) + +#endif +(1L << GLIBTOP_PROC_STATE_RUID) + (1L << GLIBTOP_PROC_STATE_RGID) + +(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_STATE) + +(1L << GLIBTOP_PROC_STATE_UID) + (1L << GLIBTOP_PROC_STATE_GID); + +/* Init function. */ + +void +_glibtop_init_proc_state_s (glibtop *server) +{ + server->sysdeps.proc_state = _glibtop_sysdeps_proc_state; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid) +{ +#ifdef HAVE_PROCFS_H + struct psinfo psinfo; +#else + struct prpsinfo psinfo; +#endif + + memset (buf, 0, sizeof (glibtop_proc_state)); + + if (glibtop_get_proc_data_psinfo_s (server, &psinfo, pid)) + return; + + buf->uid = psinfo.pr_euid; + buf->gid = psinfo.pr_egid; + buf->ruid = psinfo.pr_uid; + buf->rgid = psinfo.pr_gid; + +#ifdef HAVE_PROCFS_H + switch(psinfo.pr_lwp.pr_state) +#else + switch(psinfo.pr_state) +#endif + { + case SONPROC: +#ifdef HAVE_PROCFS_H + buf->has_cpu = 1; + buf->processor = psinfo.pr_lwp.pr_onpro; + /* FIXME: fallthrough ? */ +#endif + case SRUN: + buf->state = GLIBTOP_PROCESS_RUNNING; + break; + case SZOMB: + buf->state = GLIBTOP_PROCESS_ZOMBIE; + break; + case SSLEEP: + buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE; + break; + case SSTOP: + buf->state = GLIBTOP_PROCESS_STOPPED; + break; + case SIDL: + buf->state = GLIBTOP_PROCESS_UNINTERRUPTIBLE; + break; + } + +#ifdef HAVE_PROCFS_H + buf->last_processor = psinfo.pr_lwp.pr_onpro; +#endif + g_strlcpy (buf->cmd, psinfo.pr_fname, sizeof buf->cmd); + + buf->flags = _glibtop_sysdeps_proc_state; +} diff --git a/sysdeps/solaris/proctime.c b/sysdeps/solaris/proctime.c new file mode 100644 index 0000000..3b7501d --- /dev/null +++ b/sysdeps/solaris/proctime.c @@ -0,0 +1,71 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_time = +(1L << GLIBTOP_PROC_TIME_START_TIME) + (1L << GLIBTOP_PROC_TIME_RTIME) + +(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_STIME); + +/* Init function. */ + +void +_glibtop_init_proc_time_s (glibtop *server) +{ + server->sysdeps.proc_time = _glibtop_sysdeps_proc_time; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, + pid_t pid) +{ + struct prusage prusage; + GTimeVal time; + + memset (buf, 0, sizeof (glibtop_proc_time)); + + /* Don't do it for scheduler, we don't want to frighten our users */ + + if(pid) + { + if (glibtop_get_proc_data_usage_s (server, &prusage, pid)) + return; + + g_get_current_time (&time); + /* prusage.pr_rtime.tv_sec is the during that the process existed */ + buf->start_time = time.tv_sec - prusage.pr_rtime.tv_sec; + + buf->rtime = prusage.pr_rtime.tv_sec * 1E+6 + + prusage.pr_rtime.tv_nsec / 1E+3; + buf->utime = prusage.pr_utime.tv_sec * 1E+6 + + prusage.pr_utime.tv_nsec / 1E+3; + buf->stime = prusage.pr_stime.tv_sec * 1E+6 + + prusage.pr_stime.tv_nsec / 1E+3; + } + + buf->flags = _glibtop_sysdeps_proc_time; +} diff --git a/sysdeps/solaris/procuid.c b/sysdeps/solaris/procuid.c new file mode 100644 index 0000000..05cbd0f --- /dev/null +++ b/sysdeps/solaris/procuid.c @@ -0,0 +1,126 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_uid_psinfo = +(1L << GLIBTOP_PROC_UID_EUID) + (1L << GLIBTOP_PROC_UID_UID) + +(1L << GLIBTOP_PROC_UID_EGID) + (1L << GLIBTOP_PROC_UID_GID) + +(1L << GLIBTOP_PROC_UID_PID) + (1L << GLIBTOP_PROC_UID_PPID) + +(1L << GLIBTOP_PROC_UID_PGRP) + (1L << GLIBTOP_PROC_UID_SESSION) + +(1L << GLIBTOP_PROC_UID_TTY) + (1L << GLIBTOP_PROC_UID_PRIORITY) + +(1L << GLIBTOP_PROC_UID_NICE); +static const unsigned long _glibtop_sysdeps_proc_uid_prcred = +#if LIBGTOP_VERSION_CODE >= 1001002 +#ifdef HAVE_PROCFS_H +(1L << GLIBTOP_PROC_UID_GROUPS) + +#endif +(1L << GLIBTOP_PROC_UID_SUID) + (1L << GLIBTOP_PROC_UID_SGID) + +(1L << GLIBTOP_PROC_UID_NGROUPS); +#else +0; +#endif +/* Init function. */ + +void +_glibtop_init_proc_uid_s (glibtop *server) +{ + server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid_psinfo + + _glibtop_sysdeps_proc_uid_prcred; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid) +{ +#if LIBGTOP_VERSION_CODE >= 1001002 + struct prcred prcred; +#endif +#ifdef HAVE_PROCFS_H + struct psinfo psinfo; +#if LIBGTOP_VERSION_CODE >= 1001002 + gid_t groups[GLIBTOP_MAX_GROUPS]; +#endif +#else + struct prpsinfo psinfo; + gid_t groups[1]; /* dummy for consistent function prototype */ +#endif + + memset (buf, 0, sizeof (glibtop_proc_uid)); + + if (glibtop_get_proc_data_psinfo_s (server, &psinfo, pid)) + return; + + buf->euid = psinfo.pr_euid; + buf->uid = psinfo.pr_uid; + buf->egid = psinfo.pr_egid; + buf->gid = psinfo.pr_gid; + + buf->pid = psinfo.pr_pid; + buf->ppid = psinfo.pr_ppid; +#ifdef HAVE_PROCFS_H + buf->pgrp = psinfo.pr_pgid; +#else + buf->pgrp = psinfo.pr_pgrp; +#endif + + buf->session = psinfo.pr_sid; + buf->tty = psinfo.pr_ttydev; + +#ifdef HAVE_PROCFS_H + buf->priority = psinfo.pr_lwp.pr_pri; + buf->nice = psinfo.pr_lwp.pr_nice - NZERO; +#else + buf->priority = psinfo.pr_pri; + buf->nice = psinfo.pr_nice - NZERO; +#endif + + buf->flags = _glibtop_sysdeps_proc_uid_psinfo; + +#if LIBGTOP_VERSION_CODE >= 1001002 + if(glibtop_get_proc_credentials_s(server, &prcred, groups, pid)) + return; + + buf->suid = prcred.pr_suid; + buf->sgid = prcred.pr_sgid; + buf->ngroups = (prcred.pr_ngroups <= GLIBTOP_MAX_GROUPS) ? + prcred.pr_ngroups : GLIBTOP_MAX_GROUPS; + +#ifdef HAVE_PROCFS_H + if(sizeof(int) == sizeof(gid_t)) + memcpy(buf->groups, &groups, buf->ngroups * sizeof(gid_t)); + else + { + int i; + + for(i = 0; i < buf->ngroups; ++i) + buf->groups[i] = groups[i]; + } +#endif +#endif + + buf->flags += _glibtop_sysdeps_proc_uid_prcred; +} diff --git a/sysdeps/solaris/safeio.c b/sysdeps/solaris/safeio.c new file mode 100644 index 0000000..96aa557 --- /dev/null +++ b/sysdeps/solaris/safeio.c @@ -0,0 +1,87 @@ +/* Copyright (C) 1999 Drazen Kacar + This file is part of LibGTop 1.0. + + Contributed by Drazen Kacar , May 1999. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "safeio.h" + +int +s_open(const char *file, int mode) +{ + int fd; + + do { + fd = open(file, mode); + } while(fd < 0 && errno == EINTR); + return fd; +} + +int +s_stat(const char *path, struct stat *buf) +{ + int status; + + do { + status = stat(path, buf); + } while(status < 0 && errno == EINTR); + return status; +} + +int +s_close(int fd) +{ + int status; + + do { + status = close(fd); + } while(status < 0 && errno == EINTR); + return status; +} + +ssize_t +s_pread(int fd, void *buf, size_t nbytes, off_t offset) +{ + ssize_t len; + + /* Now, why doesn't the pread(2) man page say anything about pread() + return values? Can it read less bytes than requested? */ + + do { + len = pread(fd, buf, nbytes, offset); + } while(len < 0 && errno == EINTR); + return len; +} + +int s_closedir(DIR *dirp) +{ + int status; + + do { + status = closedir(dirp); + } while(status < 0 && errno == EINTR); + return status; +} diff --git a/sysdeps/solaris/safeio.h b/sysdeps/solaris/safeio.h new file mode 100644 index 0000000..540708c --- /dev/null +++ b/sysdeps/solaris/safeio.h @@ -0,0 +1,50 @@ +/* Copyright (C) 1999 Drazen Kacar + This file is part of LibGTop 1.0. + + Contributed by Drazen Kacar , May 1999. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SAFEIO_H__ +#define __GLIBTOP_SAFEIO_H__ + +#include + +#include +#include +#include + +G_BEGIN_DECLS + +int +s_open(const char *, int); + +int +s_stat(const char *, struct stat *); + +int +s_close(int); + +ssize_t +s_pread(int, void *, size_t, off_t); + +int +s_closedir(DIR *); + +G_END_DECLS + +#endif /* __GLIBTOP_SAFEIO_H__ */ diff --git a/sysdeps/solaris/sem_limits.c b/sysdeps/solaris/sem_limits.c new file mode 100644 index 0000000..eb93af1 --- /dev/null +++ b/sysdeps/solaris/sem_limits.c @@ -0,0 +1,120 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include +#include +#include + +static const struct nlist nlst[] = { {"glibtop_sem_limits"}, {NULL} }; +#if GLIBTOP_SOLARIS_RELEASE < 51000 +static const unsigned long _glibtop_sysdeps_sem_limits = +#if GLIBTOP_SOLARIS_RELEASE <= 50700 +(1L << GLIBTOP_IPC_SEMMAP) + +#endif +(1L << GLIBTOP_IPC_SEMMNI) + (1L << GLIBTOP_IPC_SEMMNS) + +(1L << GLIBTOP_IPC_SEMMNU) + (1L << GLIBTOP_IPC_SEMMSL) + +(1L << GLIBTOP_IPC_SEMOPM) + (1L << GLIBTOP_IPC_SEMUME) + +(1L << GLIBTOP_IPC_SEMUSZ) + (1L << GLIBTOP_IPC_SEMVMX) + +(1L << GLIBTOP_IPC_SEMAEM); +#else +static const unsigned long _glibtop_sysdeps_sem_limits = 0; +#endif + + +/* Init function. */ + +void +_glibtop_init_sem_limits_p (glibtop *server) +{ +#if GLIBTOP_SOLARIS_RELEASE < 51000 + + kvm_t *kd = server->machine->kd; + + if(kd && !kvm_nlist(kd, nlst)) + server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; + else + server->sysdeps.sem_limits = 0; +#endif +} + +/* Provides information about sysv sem limits. */ + +void +glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) +{ +#if GLIBTOP_SOLARIS_RELEASE < 51000 + kvm_t *kd = server->machine->kd; + glibtop_sem_limits sinfo; + + memset (buf, 0, sizeof (glibtop_sem_limits)); + + if(!(server->sysdeps.sem_limits)) + return; + if(kvm_read(kd, nlst[0].n_value, (void *)&sinfo, + sizeof(glibtop_sem_limits)) != sizeof(glibtop_sem_limits)) + + return; + +#if GLIBTOP_SOLARIS_RELEASE <= 50700 + /* This field don't exist anymore in Solaris 8. + * Thanks to Laszlo PETER . */ + buf->semmap = sinfo.semmap; +#endif + buf->semmni = sinfo.semmni; + buf->semmns = sinfo.semmns; + buf->semmnu = sinfo.semmnu; + buf->semmsl = sinfo.semmsl; + buf->semopm = sinfo.semopm; + buf->semume = sinfo.semume; + buf->semusz = sinfo.semusz; + buf->semvmx = sinfo.semvmx; + buf->semaem = sinfo.semaem; +#endif + +#if GLIBTOP_SOLARIS_RELEASE >= 51000 + rctlblk_t *rblk; + if ((rblk = malloc(rctlblk_size())) == NULL) + return; + + if (getrctl("process.max-sem-ops", NULL, rblk, RCTL_FIRST) == -1) + return; + else + buf->semopm = rctlblk_get_value(rblk); + + if (getrctl("process.max-sem-nsems", NULL, rblk, RCTL_FIRST) == -1) + return; + else + buf->semmsl = rctlblk_get_value(rblk); + + if (getrctl("project.max-sem-ids", NULL, rblk, RCTL_FIRST) == -1) + return; + else + buf->semmni = rctlblk_get_value(rblk); + /* there are only 3 fields, the remaining ones have been obsoleted in S10 + and no longer have system-wide limits */ +#endif + buf->flags = _glibtop_sysdeps_sem_limits; + +} diff --git a/sysdeps/solaris/shm_limits.c b/sysdeps/solaris/shm_limits.c new file mode 100644 index 0000000..9b65232 --- /dev/null +++ b/sysdeps/solaris/shm_limits.c @@ -0,0 +1,107 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include +#include +#include + +static const struct nlist nlst[] = { {"glibtop_shm_limits"}, {NULL} }; + +#if GLIBTOP_SOLARIS_RELEASE >=51000 +static const unsigned long _glibtop_sysdeps_shm_limits = 0; +#else +# if GLIBTOP_SOLARIS_RELEASE < 50900 +static const unsigned long _glibtop_sysdeps_shm_limits = +(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN); + +# else +static const unsigned long _glibtop_sysdeps_shm_limits = +(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) + +(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG); +# endif +#endif + +/* Init function. */ + +void +_glibtop_init_shm_limits_p (glibtop *server) +{ +#if GLIBTOP_SOLARIS_RELEASE < 51000 + + kvm_t * const kd = server->machine->kd; + + if(kd && !kvm_nlist(kd, nlst)) + server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; + else + server->sysdeps.shm_limits = 0; +#endif +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) +{ +#if GLIBTOP_SOLARIS_RELEASE < 51000 + + kvm_t * const kd = server->machine->kd; + glibtop_shm_limits sinfo; + + + memset (buf, 0, sizeof (glibtop_shm_limits)); + + if(!(server->sysdeps.shm_limits)) + return; + + if(kvm_read(kd, nlst[0].n_value, (void *)&sinfo, + sizeof(glibtop_shm_limits)) != sizeof(glibtop_shm_limits)) + + return; + + buf->shmmax = sinfo.shmmax; + buf->shmmni = sinfo.shmmni; +#if GLIBTOP_SOLARIS_RELEASE < 50900 + buf->shmmin = sinfo.shmmin; + buf->shmseg = sinfo.shmseg; +# endif +#endif +#if GLIBTOP_SOLARIS_RELEASE >= 51000 + rctlblk_t *rblk; + if ((rblk = malloc(rctlblk_size())) == NULL) + return; + + if (getrctl("project.max-shm-memory", NULL, rblk, RCTL_FIRST) == -1) + return; + else + buf->shmmax = rctlblk_get_value(rblk); + + if (getrctl("project.max-shm-ids", NULL, rblk, RCTL_FIRST) == -1) + return; + else + buf->shmmni = rctlblk_get_value(rblk); + +#endif + buf->flags = _glibtop_sysdeps_shm_limits; +} diff --git a/sysdeps/solaris/siglist.c b/sysdeps/solaris/siglist.c new file mode 100644 index 0000000..d92301d --- /dev/null +++ b/sysdeps/solaris/siglist.c @@ -0,0 +1,73 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 1, "SIGHUP", "Hangup" }, + { 2, "SIGINT", "Interrupt" }, + { 3, "SIGQUIT", "Quit" }, + { 4, "SIGILL", "Illegal Instruction" }, + { 5, "SIGTRAP", "Trace/Breakpoint Trap" }, + { 6, "SIGABRT", "Abort" }, + { 7, "SIGEMT", "Emulation Trap" }, + { 8, "SIGFPE", "Arithmetic Exception" }, + { 9, "SIGKILL", "Killed" }, + { 10, "SIGBUS", "Bus Error" }, + { 11, "SIGSEGV", "Segmentation Fault" }, + { 12, "SIGSYS", "Bad System Call" }, + { 13, "SIGPIPE", "Broken Pipe" }, + { 14, "SIGALRM", "Alarm Clock" }, + { 15, "SIGTERM", "Terminated" }, + { 16, "SIGUSR1", "User Signal 1" }, + { 17, "SIGUSR2", "User Signal 2" }, + { 18, "SIGCHLD", "Child Status Changed" }, + { 19, "SIGPWR", "Power-Fail/Restart" }, + { 20, "SIGWINCH","Window Size Change" }, + { 21, "SIGURG", "Urgent Socket Condition" }, + { 22, "SIGPOLL", "Pollable Event" }, + { 23, "SIGSTOP", "Stoped (signal)" }, + { 24, "SIGTSTP", "Stopped (user)" }, + { 25, "SIGCONT", "Continued" }, + { 26, "SIGTTIN", "Stopped (tty input)" }, + { 27, "SIGTTOU", "Stopped (tty output)" }, + { 28, "SIGVTALRM","Virtual Timer Expired" }, + { 29, "SIGPROF", "Profiling Timer Expired" }, + { 30, "SIGXCPU", "Cpu Limit Exceeded" }, + { 31, "SIGXFSZ", "File Size Limit Exceeded" }, + { 32, "SIGWAITING","No runnable lwp" }, + { 33, "SIGLWP", "Inter-lwp signal" }, + { 34, "SIGFREEZE","Checkpoint Freeze" }, + { 35, "SIGTHAW", "Checkpoint Thaw" }, + { 36, "SIGCANCEL","Thread Cancelation" }, + { 37, "SIGLOST", "Resource Lost" }, + { 38, "SIGRTMIN","First Realtime Signal" }, + { 39, "SIGRTMIN+1", "Second Realtime Signal" }, + { 40, "SIGRTMIN+2", "Third Realtime Signal" }, + { 41, "SIGRTMIN+3", "Fourth Realtime Signal" }, + { 42, "SIGRTMAX-3", "Fourth Last Realtime Signal" }, + { 43, "SIGRTMAX-2", "Third Last Realtime Signal" }, + { 44, "SIGRTMAX-1", "Second Last Realtime Signal" }, + { 45, "SIGRTMAX", "Last Realtime Signal" }, + { 0, NULL, NULL } +}; diff --git a/sysdeps/solaris/swap.c b/sysdeps/solaris/swap.c new file mode 100644 index 0000000..d23ec16 --- /dev/null +++ b/sysdeps/solaris/swap.c @@ -0,0 +1,109 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_swap = +(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) + +(1L << GLIBTOP_SWAP_FREE); + +/* Init function. */ + +void +_glibtop_init_swap_s (glibtop *server) +{ + server->sysdeps.swap = _glibtop_sysdeps_swap; +} + +/* Provides information about swap usage. */ + +void +glibtop_get_swap_s (glibtop *server, glibtop_swap *buf) +{ + swaptbl_t *s = NULL; + int i, n1, n2; + + /* we don't care about ste_path, and we're lazy */ + char shared_path[BUFSIZ]; /* hope this is large enough */ + + const int pagesize = getpagesize(); + + memset(buf, 0, sizeof *buf); + + switch( (n1 = swapctl(SC_GETNSWP, NULL)) ) + { + case -1: + glibtop_warn_r(server, "swapctl: GETNSWP"); + return; + + case 0: + /* no swapfile */ + goto out_no_swap; + + default: + break; + } + + /* RTFM */ + s = g_malloc(sizeof(swaptbl_t) + + n1 * sizeof(swapent_t)); + + s->swt_n = n1; + + /* initialize string pointers */ + for (i = 0; i < n1; i++) + { + s->swt_ent[i].ste_path = shared_path; + } + + if ((n2 = swapctl(SC_LIST, s)) < 0) + { + glibtop_warn_r(server, "swapctl: SC_LIST"); + goto out_free; + } + + + /* #swapfile may have changed between the 2 swapctl() calls + * we don't care, we just use the smallest #swapfile */ + for (i = 0; i < MIN(n1, n2); i++) + { + buf->total += s->swt_ent[i].ste_pages; + buf->free += s->swt_ent[i].ste_free; + } + + buf->total *= pagesize; + buf->free *= pagesize; + buf->used = buf->total - buf->free; + + out_no_swap: + buf->flags = _glibtop_sysdeps_swap; + + out_free: + g_free(s); +} diff --git a/sysdeps/solaris/uptime.c b/sysdeps/solaris/uptime.c new file mode 100644 index 0000000..e69388e --- /dev/null +++ b/sysdeps/solaris/uptime.c @@ -0,0 +1,54 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_uptime = +(1L <sysdeps.uptime = _glibtop_sysdeps_uptime; +} + +/* Provides uptime and idle time. */ + +void +glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf) +{ + memset (buf, 0, sizeof (glibtop_uptime)); + + if(!(server->machine->boot)) + return; + + buf->boot_time = server->machine->boot; + buf->uptime = time(NULL) - server->machine->boot; + + buf->flags = _glibtop_sysdeps_uptime; +} diff --git a/sysdeps/stub/ChangeLog b/sysdeps/stub/ChangeLog new file mode 100644 index 0000000..fef8b03 --- /dev/null +++ b/sysdeps/stub/ChangeLog @@ -0,0 +1,47 @@ +2005-02-02 Benoît Dejean + + * procopenfiles.c: Fixed typo. Closes #166090 + +2004-12-23 Benoît Dejean + + * netlist.c: (glibtop_get_netlist_s): Fixed. + +2004-11-13 Benoît Dejean + + * Makefile.am: + * netlist.c: (glibtop_init_netlist_s), (glibtop_get_netlist_s): Added + stub for glibtop_get_netlist. + +2003-10-21 Bastien Nocera + + * Makefile.am: install only one library, libgtop-2.0 + Fix build-time warnings due to the redefinition of guint64 + +2003-10-20 Bastien Nocera + + * glibtop_server.h: + * procargs.c: + * procmap.c: fixed compilation + +2001-10-17 Abel Cheung + + * Makefile.am: move header to $(includedir)/libgtop-1.0/glibtop. + +1998-10-26 Martin Baulig + + * netload.c: New file. + +1998-10-26 Martin Baulig + + * procargs.c: New file. + +1998-10-25 Martin Baulig + + * ppp.c: New file. + +1998-08-24 Martin Baulig + + * *.c: Added initialization functions `glibtop_init__s'. + + * ChangeLog: New file. + diff --git a/sysdeps/stub/Makefile.am b/sysdeps/stub/Makefile.am new file mode 100644 index 0000000..f4219ed --- /dev/null +++ b/sysdeps/stub/Makefile.am @@ -0,0 +1,17 @@ + +AM_CPPFLAGS = @AM_CPPFLAGS@ + +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la + +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ + uptime.c loadavg.c shm_limits.c msg_limits.c \ + sem_limits.c proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c prockernel.c \ + procsegment.c procargs.c procmap.c netload.c \ + ppp.c netlist.c procopenfiles.c procaffinity.c \ + procwd.c sysinfo.c + +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + +libgtopinclude_HEADERS = glibtop_server.h +libgtopincludedir = $(includedir)/libgtop-2.0 diff --git a/sysdeps/stub/Makefile.in b/sysdeps/stub/Makefile.in new file mode 100644 index 0000000..40b2764 --- /dev/null +++ b/sysdeps/stub/Makefile.in @@ -0,0 +1,764 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = sysdeps/stub +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libgtopinclude_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libgtop_sysdeps_2_0_la_LIBADD = +am_libgtop_sysdeps_2_0_la_OBJECTS = open.lo close.lo siglist.lo cpu.lo \ + mem.lo swap.lo uptime.lo loadavg.lo shm_limits.lo \ + msg_limits.lo sem_limits.lo proclist.lo procstate.lo \ + procuid.lo proctime.lo procmem.lo procsignal.lo prockernel.lo \ + procsegment.lo procargs.lo procmap.lo netload.lo ppp.lo \ + netlist.lo procopenfiles.lo procaffinity.lo procwd.lo \ + sysinfo.lo +libgtop_sysdeps_2_0_la_OBJECTS = $(am_libgtop_sysdeps_2_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgtop_sysdeps_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) +DIST_SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libgtopincludedir)" +HEADERS = $(libgtopinclude_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + ChangeLog +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ + uptime.c loadavg.c shm_limits.c msg_limits.c \ + sem_limits.c proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c prockernel.c \ + procsegment.c procargs.c procmap.c netload.c \ + ppp.c netlist.c procopenfiles.c procaffinity.c \ + procwd.c sysinfo.c + +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtopinclude_HEADERS = glibtop_server.h +libgtopincludedir = $(includedir)/libgtop-2.0 +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sysdeps/stub/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu sysdeps/stub/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgtop_sysdeps-2.0.la: $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_2_0_la_LINK) $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netload.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procaffinity.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prockernel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procopenfiles.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsegment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsignal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procstate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procwd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siglist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-libgtopincludeHEADERS: $(libgtopinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgtopincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgtopincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgtopincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgtopincludedir)" || exit $$?; \ + done + +uninstall-libgtopincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgtopincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libgtopincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libgtopincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libgtopincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libgtopincludeHEADERS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libgtopincludeHEADERS + +.PRECIOUS: Makefile + + +# 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: diff --git a/sysdeps/stub/close.c b/sysdeps/stub/close.c new file mode 100644 index 0000000..bee09f3 --- /dev/null +++ b/sysdeps/stub/close.c @@ -0,0 +1,29 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +/* Closes pipe to gtop server. */ + +void +glibtop_close_s (glibtop *server) +{ } diff --git a/sysdeps/stub/cpu.c b/sysdeps/stub/cpu.c new file mode 100644 index 0000000..ab1dfce --- /dev/null +++ b/sysdeps/stub/cpu.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_cpu = 0; + +/* Init function. */ + +void +_glibtop_init_cpu_s (glibtop *server) +{ + server->sysdeps.cpu = _glibtop_sysdeps_cpu; +} + +/* Provides information about cpu usage. */ + +void +glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf) +{ + memset (buf, 0, sizeof (glibtop_cpu)); +} diff --git a/sysdeps/stub/glibtop_server.h b/sysdeps/stub/glibtop_server.h new file mode 100644 index 0000000..1dd18bf --- /dev/null +++ b/sysdeps/stub/glibtop_server.h @@ -0,0 +1,53 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SERVER_H__ +#define __GLIBTOP_SERVER_H__ + +G_BEGIN_DECLS + +#define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_MEM 0 +#define GLIBTOP_SUID_SWAP 0 +#define GLIBTOP_SUID_UPTIME 0 +#define GLIBTOP_SUID_LOADAVG 0 +#define GLIBTOP_SUID_SHM_LIMITS 0 +#define GLIBTOP_SUID_MSG_LIMITS 0 +#define GLIBTOP_SUID_SEM_LIMITS 0 +#define GLIBTOP_SUID_PROCLIST 0 +#define GLIBTOP_SUID_PROC_STATE 0 +#define GLIBTOP_SUID_PROC_UID 0 +#define GLIBTOP_SUID_PROC_MEM 0 +#define GLIBTOP_SUID_PROC_TIME 0 +#define GLIBTOP_SUID_PROC_SIGNAL 0 +#define GLIBTOP_SUID_PROC_KERNEL 0 +#define GLIBTOP_SUID_PROC_SEGMENT 0 +#define GLIBTOP_SUID_PROC_ARGS 0 +#define GLIBTOP_SUID_PROC_MAP 0 +#define GLIBTOP_SUID_NETLOAD 0 +#define GLIBTOP_SUID_NETLIST 0 +#define GLIBTOP_SUID_PPP 0 +#define GLIBTOP_SUID_PROC_WD 0 +#define GLIBTOP_SUID_PROC_AFFINITY 0 + +G_END_DECLS + +#endif diff --git a/sysdeps/stub/loadavg.c b/sysdeps/stub/loadavg.c new file mode 100644 index 0000000..33b574e --- /dev/null +++ b/sysdeps/stub/loadavg.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_loadavg = 0; + +/* Init function. */ + +void +_glibtop_init_loadavg_s (glibtop *server) +{ + server->sysdeps.loadavg = _glibtop_sysdeps_loadavg; +} + +/* Provides load averange. */ + +void +glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf) +{ + memset (buf, 0, sizeof (glibtop_loadavg)); +} diff --git a/sysdeps/stub/mem.c b/sysdeps/stub/mem.c new file mode 100644 index 0000000..66169b8 --- /dev/null +++ b/sysdeps/stub/mem.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_mem = 0; + +/* Init function. */ + +void +_glibtop_init_mem_s (glibtop *server) +{ + server->sysdeps.mem = _glibtop_sysdeps_mem; +} + +/* Provides information about memory usage. */ + +void +glibtop_get_mem_s (glibtop *server, glibtop_mem *buf) +{ + memset (buf, 0, sizeof (glibtop_mem)); +} diff --git a/sysdeps/stub/msg_limits.c b/sysdeps/stub/msg_limits.c new file mode 100644 index 0000000..65921c7 --- /dev/null +++ b/sysdeps/stub/msg_limits.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_msg_limits = 0; + +/* Init function. */ + +void +_glibtop_init_msg_limits_s (glibtop *server) +{ + server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf) +{ + memset (buf, 0, sizeof (glibtop_msg_limits)); +} diff --git a/sysdeps/stub/netlist.c b/sysdeps/stub/netlist.c new file mode 100644 index 0000000..30fde7e --- /dev/null +++ b/sysdeps/stub/netlist.c @@ -0,0 +1,39 @@ +/* This file is part of LibGTop 2.0. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_netlist = 0; + +/* Init function. */ + +void +_glibtop_init_netlist_s (glibtop *server) +{ + server->sysdeps.netlist = _glibtop_sysdeps_netlist; +} + +char** +glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf) +{ + memset (buf, 0, sizeof (glibtop_netlist)); + + return NULL; +} diff --git a/sysdeps/stub/netload.c b/sysdeps/stub/netload.c new file mode 100644 index 0000000..5b3d3cf --- /dev/null +++ b/sysdeps/stub/netload.c @@ -0,0 +1,44 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_netload = 0; + +/* Init function. */ + +void +_glibtop_init_netload_s (glibtop *server) +{ + server->sysdeps.netload = _glibtop_sysdeps_netload; +} + +/* Provides network statistics. */ + +void +glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, + const char *interface) +{ + memset (buf, 0, sizeof (glibtop_netload)); +} diff --git a/sysdeps/stub/open.c b/sysdeps/stub/open.c new file mode 100644 index 0000000..92534db --- /dev/null +++ b/sysdeps/stub/open.c @@ -0,0 +1,32 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +/* Opens pipe to gtop server. Returns 0 on success and -1 on error. */ + +void +glibtop_open_s (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags) +{ + server->name = program_name; +} diff --git a/sysdeps/stub/ppp.c b/sysdeps/stub/ppp.c new file mode 100644 index 0000000..0801643 --- /dev/null +++ b/sysdeps/stub/ppp.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_ppp = 0; + +/* Init function. */ + +void +_glibtop_init_ppp_s (glibtop *server) +{ + server->sysdeps.ppp = _glibtop_sysdeps_ppp; +} + +/* Provides PPP/ISDN information. */ + +void +glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device) +{ + memset (buf, 0, sizeof (glibtop_ppp)); +} diff --git a/sysdeps/stub/procaffinity.c b/sysdeps/stub/procaffinity.c new file mode 100644 index 0000000..2bcdd6c --- /dev/null +++ b/sysdeps/stub/procaffinity.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2014 Ryan Lortie + This file is part of LibGTop 2. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include +#include + +void +_glibtop_init_proc_affinity_s(glibtop *server) +{ +} + +guint16 * +glibtop_get_proc_affinity_s(glibtop *server, glibtop_proc_affinity *buf, pid_t pid) +{ + memset(buf, 0, sizeof *buf); + + return NULL; +} + diff --git a/sysdeps/stub/procargs.c b/sysdeps/stub/procargs.c new file mode 100644 index 0000000..65958f3 --- /dev/null +++ b/sysdeps/stub/procargs.c @@ -0,0 +1,45 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_args = 0; + +/* Init function. */ + +void +_glibtop_init_proc_args_s (glibtop *server) +{ + server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; +} + +/* Provides detailed information about a process. */ + +char * +glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len) +{ + memset (buf, 0, sizeof (glibtop_proc_args)); + return NULL; +} diff --git a/sysdeps/stub/prockernel.c b/sysdeps/stub/prockernel.c new file mode 100644 index 0000000..8c1e548 --- /dev/null +++ b/sysdeps/stub/prockernel.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_kernel = 0; + +/* Init function. */ + +void +_glibtop_init_proc_kernel_s (glibtop *server) +{ + server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_kernel)); +} diff --git a/sysdeps/stub/proclist.c b/sysdeps/stub/proclist.c new file mode 100644 index 0000000..e857dc0 --- /dev/null +++ b/sysdeps/stub/proclist.c @@ -0,0 +1,51 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#define GLIBTOP_PROCLIST_FLAGS 3 + +static const unsigned long _glibtop_sysdeps_proclist = 0; + +/* Init function. */ + +void +_glibtop_init_proclist_s (glibtop *server) +{ + server->sysdeps.proclist = _glibtop_sysdeps_proclist; +} + +/* Fetch list of currently running processes. + * + * IMPORTANT NOTE: + * On error, this function MUST return NULL and set buf->flags to zero ! + * On success, it returnes a pointer to a list of buf->number elements + * each buf->size big. The total size is stored in buf->total. */ + +pid_t * +glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg) +{ + memset (buf, 0, sizeof (glibtop_proclist)); + return NULL; +} diff --git a/sysdeps/stub/procmap.c b/sysdeps/stub/procmap.c new file mode 100644 index 0000000..c2a244f --- /dev/null +++ b/sysdeps/stub/procmap.c @@ -0,0 +1,48 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_map = 0; + +/* Init function. */ + +void +_glibtop_init_proc_map_s (glibtop *server) +{ + server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; +} + +/* Provides detailed information about a process. */ + +glibtop_map_entry * +glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid) +{ + glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_MAP, 0); + + memset (buf, 0, sizeof (glibtop_proc_map)); + + return NULL; +} diff --git a/sysdeps/stub/procmem.c b/sysdeps/stub/procmem.c new file mode 100644 index 0000000..8e95dd0 --- /dev/null +++ b/sysdeps/stub/procmem.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_mem = 0; + +/* Init function. */ + +void +_glibtop_init_proc_mem_s (glibtop *server) +{ + server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_mem)); +} diff --git a/sysdeps/stub/procopenfiles.c b/sysdeps/stub/procopenfiles.c new file mode 100644 index 0000000..86cd515 --- /dev/null +++ b/sysdeps/stub/procopenfiles.c @@ -0,0 +1,47 @@ +/* Copyright (C) 1998-99 Martin Baulig + Copyright (C) 2004 Nicolás Lichtmaier + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include +#include +#include +#include + +/* Init function. */ + +void +_glibtop_init_proc_open_files_s (glibtop *server) +{ + server->sysdeps.proc_open_files = 0; +} + +/* Provides detailed information about a process. */ + +glibtop_open_files_entry * +glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pid_t pid) +{ + glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_MAP, 0); + + memset (buf, 0, sizeof (glibtop_proc_open_files)); + + return NULL; +} diff --git a/sysdeps/stub/procsegment.c b/sysdeps/stub/procsegment.c new file mode 100644 index 0000000..ca06c4d --- /dev/null +++ b/sysdeps/stub/procsegment.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_segment = 0; + +/* Init function. */ + +void +_glibtop_init_proc_segment_s (glibtop *server) +{ + server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_segment)); +} diff --git a/sysdeps/stub/procsignal.c b/sysdeps/stub/procsignal.c new file mode 100644 index 0000000..02af68d --- /dev/null +++ b/sysdeps/stub/procsignal.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_signal = 0; + +/* Init function. */ + +void +_glibtop_init_proc_signal_s (glibtop *server) +{ + server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_signal)); +} diff --git a/sysdeps/stub/procstate.c b/sysdeps/stub/procstate.c new file mode 100644 index 0000000..48a5f95 --- /dev/null +++ b/sysdeps/stub/procstate.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_state = 0; + +/* Init function. */ + +void +_glibtop_init_proc_state_s (glibtop *server) +{ + server->sysdeps.proc_state = _glibtop_sysdeps_proc_state; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_state)); +} diff --git a/sysdeps/stub/proctime.c b/sysdeps/stub/proctime.c new file mode 100644 index 0000000..338d6af --- /dev/null +++ b/sysdeps/stub/proctime.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_time = 0; + +/* Init function. */ + +void +_glibtop_init_proc_time_s (glibtop *server) +{ + server->sysdeps.proc_time = _glibtop_sysdeps_proc_time; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_time)); +} diff --git a/sysdeps/stub/procuid.c b/sysdeps/stub/procuid.c new file mode 100644 index 0000000..fa0948e --- /dev/null +++ b/sysdeps/stub/procuid.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_uid = 0; + +/* Init function. */ + +void +_glibtop_init_proc_uid_s (glibtop *server) +{ + server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_uid)); +} diff --git a/sysdeps/stub/procwd.c b/sysdeps/stub/procwd.c new file mode 100644 index 0000000..664a0fb --- /dev/null +++ b/sysdeps/stub/procwd.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2014 Ryan Lortie + This file is part of LibGTop 2. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include +#include + +void +_glibtop_init_proc_wd_s(glibtop *server) +{ +} + +char** +glibtop_get_proc_wd_s(glibtop *server, glibtop_proc_wd *buf, pid_t pid) +{ + return NULL; +} diff --git a/sysdeps/stub/sem_limits.c b/sysdeps/stub/sem_limits.c new file mode 100644 index 0000000..c0d45df --- /dev/null +++ b/sysdeps/stub/sem_limits.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_sem_limits = 0; + +/* Init function. */ + +void +_glibtop_init_sem_limits_s (glibtop *server) +{ + server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; +} + +/* Provides information about sysv sem limits. */ + +void +glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf) +{ + memset (buf, 0, sizeof (glibtop_sem_limits)); +} diff --git a/sysdeps/stub/shm_limits.c b/sysdeps/stub/shm_limits.c new file mode 100644 index 0000000..d8d7d94 --- /dev/null +++ b/sysdeps/stub/shm_limits.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_shm_limits = 0; + +/* Init function. */ + +void +_glibtop_init_shm_limits_s (glibtop *server) +{ + server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf) +{ + memset (buf, 0, sizeof (glibtop_shm_limits)); +} diff --git a/sysdeps/stub/siglist.c b/sysdeps/stub/siglist.c new file mode 100644 index 0000000..4ed6f7e --- /dev/null +++ b/sysdeps/stub/siglist.c @@ -0,0 +1,27 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 0, NULL, NULL } }; diff --git a/sysdeps/stub/swap.c b/sysdeps/stub/swap.c new file mode 100644 index 0000000..95cc401 --- /dev/null +++ b/sysdeps/stub/swap.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_swap = 0; + +/* Init function. */ + +void +_glibtop_init_swap_s (glibtop *server) +{ + server->sysdeps.swap = _glibtop_sysdeps_swap; +} + +/* Provides information about swap usage. */ + +void +glibtop_get_swap_s (glibtop *server, glibtop_swap *buf) +{ + memset (buf, 0, sizeof (glibtop_swap)); +} diff --git a/sysdeps/stub/sysinfo.c b/sysdeps/stub/sysinfo.c new file mode 100644 index 0000000..909e6a0 --- /dev/null +++ b/sysdeps/stub/sysinfo.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2014 Ryan Lortie + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include +#include + +static glibtop_sysinfo sysinfo = { .flags = 0 }; + +const glibtop_sysinfo * +glibtop_get_sysinfo_s (glibtop *server) +{ + return &sysinfo; +} diff --git a/sysdeps/stub/uptime.c b/sysdeps/stub/uptime.c new file mode 100644 index 0000000..b136d3d --- /dev/null +++ b/sysdeps/stub/uptime.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_uptime = 0; + +/* Init function. */ + +void +_glibtop_init_uptime_s (glibtop *server) +{ + server->sysdeps.uptime = _glibtop_sysdeps_uptime; +} + +/* Provides uptime and idle time. */ + +void +glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf) +{ + memset (buf, 0, sizeof (glibtop_uptime)); +} diff --git a/sysdeps/stub_suid/ChangeLog b/sysdeps/stub_suid/ChangeLog new file mode 100644 index 0000000..2c4199e --- /dev/null +++ b/sysdeps/stub_suid/ChangeLog @@ -0,0 +1,32 @@ +2003-10-21 Bastien Nocera + + * Makefile.am: install only one library, libgtop-2.0 + Fix build-time warnings due to the redefinition of guint64 + +2003-10-20 Bastien Nocera + + * glibtop_machine.h: + * glibtop_server.h: + * glibtop_suid.h: + * open.c: + * procargs.c: + * procmap.c: fixed compilation + +2001-10-17 Abel Cheung + + * Makefile.am: move header to $(includedir)/libgtop-1.0/glibtop. + +1998-10-26 Martin Baulig + + * netload.c: New file. + +1998-10-26 Martin Baulig + + * procargs.c: New file. + * procmap.c: New file. + +1998-10-25 Martin Baulig + + * ChangeLog: New file. + * ppp.c: New file. + diff --git a/sysdeps/stub_suid/Makefile.am b/sysdeps/stub_suid/Makefile.am new file mode 100644 index 0000000..fcc7daf --- /dev/null +++ b/sysdeps/stub_suid/Makefile.am @@ -0,0 +1,22 @@ + +AM_CPPFLAGS = @AM_CPPFLAGS@ + +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la + +libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c + +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + +libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ + uptime.c loadavg.c shm_limits.c msg_limits.c \ + sem_limits.c proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c prockernel.c \ + procsegment.c procargs.c procmap.c netload.c \ + ppp.c + +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) + +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h +libgtopincludedir = $(includedir)/libgtop-2.0 + +noinst_HEADERS = glibtop_suid.h diff --git a/sysdeps/stub_suid/Makefile.in b/sysdeps/stub_suid/Makefile.in new file mode 100644 index 0000000..90f7a80 --- /dev/null +++ b/sysdeps/stub_suid/Makefile.in @@ -0,0 +1,773 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = sysdeps/stub_suid +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libgtopinclude_HEADERS) \ + $(noinst_HEADERS) $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libgtop_sysdeps_2_0_la_LIBADD = +am_libgtop_sysdeps_2_0_la_OBJECTS = nosuid.lo siglist.lo +libgtop_sysdeps_2_0_la_OBJECTS = $(am_libgtop_sysdeps_2_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgtop_sysdeps_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +libgtop_sysdeps_suid_2_0_la_LIBADD = +am_libgtop_sysdeps_suid_2_0_la_OBJECTS = open.lo close.lo siglist.lo \ + cpu.lo mem.lo swap.lo uptime.lo loadavg.lo shm_limits.lo \ + msg_limits.lo sem_limits.lo proclist.lo procstate.lo \ + procuid.lo proctime.lo procmem.lo procsignal.lo prockernel.lo \ + procsegment.lo procargs.lo procmap.lo netload.lo ppp.lo +libgtop_sysdeps_suid_2_0_la_OBJECTS = \ + $(am_libgtop_sysdeps_suid_2_0_la_OBJECTS) +libgtop_sysdeps_suid_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_suid_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +DIST_SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libgtopincludedir)" +HEADERS = $(libgtopinclude_HEADERS) $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + ChangeLog +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la +libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ + uptime.c loadavg.c shm_limits.c msg_limits.c \ + sem_limits.c proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c prockernel.c \ + procsegment.c procargs.c procmap.c netload.c \ + ppp.c + +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h +libgtopincludedir = $(includedir)/libgtop-2.0 +noinst_HEADERS = glibtop_suid.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sysdeps/stub_suid/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu sysdeps/stub_suid/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgtop_sysdeps-2.0.la: $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_2_0_la_LINK) $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_LIBADD) $(LIBS) + +libgtop_sysdeps_suid-2.0.la: $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_suid_2_0_la_LINK) $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netload.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nosuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prockernel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsegment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsignal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procstate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siglist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-libgtopincludeHEADERS: $(libgtopinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgtopincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgtopincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgtopincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgtopincludedir)" || exit $$?; \ + done + +uninstall-libgtopincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgtopincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libgtopincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libgtopincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libgtopincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libgtopincludeHEADERS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libgtopincludeHEADERS + +.PRECIOUS: Makefile + + +# 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: diff --git a/sysdeps/stub_suid/close.c b/sysdeps/stub_suid/close.c new file mode 100644 index 0000000..bee09f3 --- /dev/null +++ b/sysdeps/stub_suid/close.c @@ -0,0 +1,29 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +/* Closes pipe to gtop server. */ + +void +glibtop_close_s (glibtop *server) +{ } diff --git a/sysdeps/stub_suid/cpu.c b/sysdeps/stub_suid/cpu.c new file mode 100644 index 0000000..5e9f952 --- /dev/null +++ b/sysdeps/stub_suid/cpu.c @@ -0,0 +1,47 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_cpu = 0; + +/* Init function. */ + +void +_glibtop_init_cpu_p (glibtop *server) +{ + server->sysdeps.cpu = _glibtop_sysdeps_cpu; +} + +/* Provides information about cpu usage. */ + +void +glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_CPU, 0); + + memset (buf, 0, sizeof (glibtop_cpu)); +} diff --git a/sysdeps/stub_suid/glibtop_machine.h b/sysdeps/stub_suid/glibtop_machine.h new file mode 100644 index 0000000..3254a60 --- /dev/null +++ b/sysdeps/stub_suid/glibtop_machine.h @@ -0,0 +1,35 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_MACHINE_H__ +#define __GLIBTOP_MACHINE_H__ + +G_BEGIN_DECLS + +struct _glibtop_machine +{ + uid_t uid, euid; /* Real and effective user id */ + gid_t gid, egid; /* Real and effective group id */ +}; + +G_END_DECLS + +#endif diff --git a/sysdeps/stub_suid/glibtop_server.h b/sysdeps/stub_suid/glibtop_server.h new file mode 100644 index 0000000..15fe2e1 --- /dev/null +++ b/sysdeps/stub_suid/glibtop_server.h @@ -0,0 +1,52 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SERVER_H__ +#define __GLIBTOP_SERVER_H__ + +G_BEGIN_DECLS + +#define GLIBTOP_SUID_CPU (1 << GLIBTOP_SYSDEPS_CPU) +#define GLIBTOP_SUID_MEM (1 << GLIBTOP_SYSDEPS_MEM) +#define GLIBTOP_SUID_SWAP (1 << GLIBTOP_SYSDEPS_SWAP) +#define GLIBTOP_SUID_UPTIME (1 << GLIBTOP_SYSDEPS_UPTIME) +#define GLIBTOP_SUID_LOADAVG (1 << GLIBTOP_SYSDEPS_LOADAVG) +#define GLIBTOP_SUID_SHM_LIMITS (1 << GLIBTOP_SYSDEPS_SHM_LIMITS) +#define GLIBTOP_SUID_MSG_LIMITS (1 << GLIBTOP_SYSDEPS_MSG_LIMITS) +#define GLIBTOP_SUID_SEM_LIMITS (1 << GLIBTOP_SYSDEPS_SEM_LIMITS) +#define GLIBTOP_SUID_PROCLIST (1 << GLIBTOP_SYSDEPS_PROCLIST) +#define GLIBTOP_SUID_PROC_STATE (1 << GLIBTOP_SYSDEPS_PROC_STATE) +#define GLIBTOP_SUID_PROC_UID (1 << GLIBTOP_SYSDEPS_PROC_UID) +#define GLIBTOP_SUID_PROC_MEM (1 << GLIBTOP_SYSDEPS_PROC_MEM) +#define GLIBTOP_SUID_PROC_TIME (1 << GLIBTOP_SYSDEPS_PROC_TIME) +#define GLIBTOP_SUID_PROC_SIGNAL (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL) +#define GLIBTOP_SUID_PROC_KERNEL (1 << GLIBTOP_SYSDEPS_PROC_KERNEL) +#define GLIBTOP_SUID_PROC_SEGMENT (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT) +#define GLIBTOP_SUID_PROC_ARGS (1 << GLIBTOP_SYSDEPS_PROC_ARGS) +#define GLIBTOP_SUID_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP) +#define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) +#define GLIBTOP_SUID_NETLIST 0 +#define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) +#define GLIBTOP_SUID_PROC_IO (1 << GLIBTOP_SYSDEPS_PROC_IO) + +G_END_DECLS + +#endif diff --git a/sysdeps/stub_suid/glibtop_suid.h b/sysdeps/stub_suid/glibtop_suid.h new file mode 100644 index 0000000..d6528a7 --- /dev/null +++ b/sysdeps/stub_suid/glibtop_suid.h @@ -0,0 +1,46 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SUID_H__ +#define __GLIBTOP_SUID_H__ + +G_BEGIN_DECLS + +static inline void glibtop_suid_enter (glibtop *server) { + setreuid (server->machine->uid, server->machine->euid); +}; + +static inline void glibtop_suid_leave (glibtop *server) { + if (setreuid (server->machine->euid, server->machine->uid)) + _exit (1); +}; + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags); +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags); + +G_END_DECLS + +#endif diff --git a/sysdeps/stub_suid/loadavg.c b/sysdeps/stub_suid/loadavg.c new file mode 100644 index 0000000..6e0b84f --- /dev/null +++ b/sysdeps/stub_suid/loadavg.c @@ -0,0 +1,47 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_loadavg = 0; + +/* Init function. */ + +void +_glibtop_init_loadavg_p (glibtop *server) +{ + server->sysdeps.loadavg = _glibtop_sysdeps_loadavg; +} + +/* Provides load averange. */ + +void +glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_LOADAVG, 0); + + memset (buf, 0, sizeof (glibtop_loadavg)); +} diff --git a/sysdeps/stub_suid/mem.c b/sysdeps/stub_suid/mem.c new file mode 100644 index 0000000..7fc2666 --- /dev/null +++ b/sysdeps/stub_suid/mem.c @@ -0,0 +1,47 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_mem = 0; + +/* Init function. */ + +void +_glibtop_init_mem_p (glibtop *server) +{ + server->sysdeps.mem = _glibtop_sysdeps_mem; +} + +/* Provides information about memory usage. */ + +void +glibtop_get_mem_p (glibtop *server, glibtop_mem *buf) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_MEM, 0); + + memset (buf, 0, sizeof (glibtop_mem)); +} diff --git a/sysdeps/stub_suid/msg_limits.c b/sysdeps/stub_suid/msg_limits.c new file mode 100644 index 0000000..4ead84d --- /dev/null +++ b/sysdeps/stub_suid/msg_limits.c @@ -0,0 +1,47 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_msg_limits = 0; + +/* Init function. */ + +void +_glibtop_init_msg_limits_p (glibtop *server) +{ + server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_MSG_LIMITS, 0); + + memset (buf, 0, sizeof (glibtop_msg_limits)); +} diff --git a/sysdeps/stub_suid/netload.c b/sysdeps/stub_suid/netload.c new file mode 100644 index 0000000..f7b2632 --- /dev/null +++ b/sysdeps/stub_suid/netload.c @@ -0,0 +1,44 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_netload = 0; + +/* Init function. */ + +void +_glibtop_init_netload_p (glibtop *server) +{ + server->sysdeps.netload = _glibtop_sysdeps_netload; +} + +/* Provides Network statistics. */ + +void +glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, + const char *interface) +{ + memset (buf, 0, sizeof (glibtop_netload)); +} diff --git a/sysdeps/stub_suid/nosuid.c b/sysdeps/stub_suid/nosuid.c new file mode 100644 index 0000000..9496371 --- /dev/null +++ b/sysdeps/stub_suid/nosuid.c @@ -0,0 +1,33 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +void +glibtop_open_s (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags) +{ } + +void +glibtop_close_s (glibtop *server) +{ } diff --git a/sysdeps/stub_suid/open.c b/sysdeps/stub_suid/open.c new file mode 100644 index 0000000..aad1e20 --- /dev/null +++ b/sysdeps/stub_suid/open.c @@ -0,0 +1,76 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags) +{ + const _glibtop_init_func_t *init_fkt; + + if (server == NULL) + glibtop_error_r (NULL, "glibtop_init_p (server == NULL)"); + + /* Do the initialization, but only if not already initialized. */ + + if ((server->flags & _GLIBTOP_INIT_STATE_INIT) == 0) { + glibtop_open_p (server, "glibtop", features, flags); + + for (init_fkt = _glibtop_init_hook_p; *init_fkt; init_fkt++) + (*init_fkt) (server); + + server->flags |= _GLIBTOP_INIT_STATE_INIT; + } +} + +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags) +{ + /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ + + server->name = program_name; + + server->machine->uid = getuid (); + server->machine->euid = geteuid (); + server->machine->gid = getgid (); + server->machine->egid = getegid (); + + /* Drop priviledges. */ + + if (setreuid (server->machine->euid, server->machine->uid)) + _exit (1); + + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); + + /* !!! END OF SUID ROOT PART !!! */ + + /* Our effective uid is now those of the user invoking the server, + * so we do no longer have any priviledges. */ +} + diff --git a/sysdeps/stub_suid/ppp.c b/sysdeps/stub_suid/ppp.c new file mode 100644 index 0000000..15cac4c --- /dev/null +++ b/sysdeps/stub_suid/ppp.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_ppp = 0; + +/* Init function. */ + +void +_glibtop_init_ppp_p (glibtop *server) +{ + server->sysdeps.ppp = _glibtop_sysdeps_ppp; +} + +/* Provides PPP/ISDN information. */ + +void +glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device) +{ + memset (buf, 0, sizeof (glibtop_ppp)); +} diff --git a/sysdeps/stub_suid/procargs.c b/sysdeps/stub_suid/procargs.c new file mode 100644 index 0000000..e071b90 --- /dev/null +++ b/sysdeps/stub_suid/procargs.c @@ -0,0 +1,45 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_args = 0; + +/* Init function. */ + +void +_glibtop_init_proc_args_p (glibtop *server) +{ + server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; +} + +/* Provides detailed information about a process. */ + +char * +glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len) +{ + memset (buf, 0, sizeof (glibtop_proc_args)); + return NULL; +} diff --git a/sysdeps/stub_suid/prockernel.c b/sysdeps/stub_suid/prockernel.c new file mode 100644 index 0000000..ba7613c --- /dev/null +++ b/sysdeps/stub_suid/prockernel.c @@ -0,0 +1,48 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_kernel = 0; + +/* Init function. */ + +void +_glibtop_init_proc_kernel_p (glibtop *server) +{ + server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_kernel_p (glibtop *server, glibtop_proc_kernel *buf, + pid_t pid) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_KERNEL, 0); + + memset (buf, 0, sizeof (glibtop_proc_kernel)); +} diff --git a/sysdeps/stub_suid/proclist.c b/sysdeps/stub_suid/proclist.c new file mode 100644 index 0000000..dd3682c --- /dev/null +++ b/sysdeps/stub_suid/proclist.c @@ -0,0 +1,48 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proclist = 0; + +/* Init function. */ + +void +_glibtop_init_proclist_p (glibtop *server) +{ + server->sysdeps.proclist = _glibtop_sysdeps_proclist; +} + +unsigned * +glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROCLIST, 0); + + memset (buf, 0, sizeof (glibtop_proclist)); + + return NULL; +} diff --git a/sysdeps/stub_suid/procmap.c b/sysdeps/stub_suid/procmap.c new file mode 100644 index 0000000..8203b87 --- /dev/null +++ b/sysdeps/stub_suid/procmap.c @@ -0,0 +1,44 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_map = 0; + +/* Init function. */ + +void +_glibtop_init_proc_map_p (glibtop *server) +{ + server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; +} + +/* Provides detailed information about a process. */ + +glibtop_map_entry * +glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_map)); + return NULL; +} diff --git a/sysdeps/stub_suid/procmem.c b/sysdeps/stub_suid/procmem.c new file mode 100644 index 0000000..f23dff6 --- /dev/null +++ b/sysdeps/stub_suid/procmem.c @@ -0,0 +1,48 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_mem = 0; + +/* Init function. */ + +void +_glibtop_init_proc_mem_p (glibtop *server) +{ + server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, + pid_t pid) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_MEM, 0); + + memset (buf, 0, sizeof (glibtop_proc_mem)); +} diff --git a/sysdeps/stub_suid/procsegment.c b/sysdeps/stub_suid/procsegment.c new file mode 100644 index 0000000..0d71c68 --- /dev/null +++ b/sysdeps/stub_suid/procsegment.c @@ -0,0 +1,48 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_segment = 0; + +/* Init function. */ + +void +_glibtop_init_proc_segment_p (glibtop *server) +{ + server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf, + pid_t pid) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_SEGMENT, 0); + + memset (buf, 0, sizeof (glibtop_proc_segment)); +} diff --git a/sysdeps/stub_suid/procsignal.c b/sysdeps/stub_suid/procsignal.c new file mode 100644 index 0000000..4d64dee --- /dev/null +++ b/sysdeps/stub_suid/procsignal.c @@ -0,0 +1,48 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_signal = 0; + +/* Init function. */ + +void +_glibtop_init_proc_signal_p (glibtop *server) +{ + server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_signal_p (glibtop *server, glibtop_proc_signal *buf, + pid_t pid) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_SIGNAL, 0); + + memset (buf, 0, sizeof (glibtop_proc_signal)); +} diff --git a/sysdeps/stub_suid/procstate.c b/sysdeps/stub_suid/procstate.c new file mode 100644 index 0000000..792c3c9 --- /dev/null +++ b/sysdeps/stub_suid/procstate.c @@ -0,0 +1,48 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_state = 0; + +/* Init function. */ + +void +_glibtop_init_proc_state_p (glibtop *server) +{ + server->sysdeps.proc_state = _glibtop_sysdeps_proc_state; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_state_p (glibtop *server, glibtop_proc_state *buf, + pid_t pid) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_STATE, 0); + + memset (buf, 0, sizeof (glibtop_proc_state)); +} diff --git a/sysdeps/stub_suid/proctime.c b/sysdeps/stub_suid/proctime.c new file mode 100644 index 0000000..8b124e0 --- /dev/null +++ b/sysdeps/stub_suid/proctime.c @@ -0,0 +1,48 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_time = 0; + +/* Init function. */ + +void +_glibtop_init_proc_time_p (glibtop *server) +{ + server->sysdeps.proc_time = _glibtop_sysdeps_proc_time; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, + pid_t pid) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_TIME, 0); + + memset (buf, 0, sizeof (glibtop_proc_time)); +} diff --git a/sysdeps/stub_suid/procuid.c b/sysdeps/stub_suid/procuid.c new file mode 100644 index 0000000..27e58aa --- /dev/null +++ b/sysdeps/stub_suid/procuid.c @@ -0,0 +1,48 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_uid = 0; + +/* Init function. */ + +void +_glibtop_init_proc_uid_p (glibtop *server) +{ + server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, + pid_t pid) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_UID, 0); + + memset (buf, 0, sizeof (glibtop_proc_uid)); +} diff --git a/sysdeps/stub_suid/sem_limits.c b/sysdeps/stub_suid/sem_limits.c new file mode 100644 index 0000000..035d523 --- /dev/null +++ b/sysdeps/stub_suid/sem_limits.c @@ -0,0 +1,47 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_sem_limits = 0; + +/* Init function. */ + +void +_glibtop_init_sem_limits_p (glibtop *server) +{ + server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; +} + +/* Provides information about sysv sem limits. */ + +void +glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_SEM_LIMITS, 0); + + memset (buf, 0, sizeof (glibtop_sem_limits)); +} diff --git a/sysdeps/stub_suid/shm_limits.c b/sysdeps/stub_suid/shm_limits.c new file mode 100644 index 0000000..6fe303e --- /dev/null +++ b/sysdeps/stub_suid/shm_limits.c @@ -0,0 +1,47 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_shm_limits = 0; + +/* Init function. */ + +void +_glibtop_init_shm_limits_p (glibtop *server) +{ + server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; +} + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_SHM_LIMITS, 0); + + memset (buf, 0, sizeof (glibtop_shm_limits)); +} diff --git a/sysdeps/stub_suid/siglist.c b/sysdeps/stub_suid/siglist.c new file mode 100644 index 0000000..4ed6f7e --- /dev/null +++ b/sysdeps/stub_suid/siglist.c @@ -0,0 +1,27 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 0, NULL, NULL } }; diff --git a/sysdeps/stub_suid/swap.c b/sysdeps/stub_suid/swap.c new file mode 100644 index 0000000..117bdfe --- /dev/null +++ b/sysdeps/stub_suid/swap.c @@ -0,0 +1,47 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_swap = 0; + +/* Init function. */ + +void +_glibtop_init_swap_p (glibtop *server) +{ + server->sysdeps.swap = _glibtop_sysdeps_swap; +} + +/* Provides information about swap usage. */ + +void +glibtop_get_swap_p (glibtop *server, glibtop_swap *buf) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_SWAP, 0); + + memset (buf, 0, sizeof (glibtop_swap)); +} diff --git a/sysdeps/stub_suid/uptime.c b/sysdeps/stub_suid/uptime.c new file mode 100644 index 0000000..f30133a --- /dev/null +++ b/sysdeps/stub_suid/uptime.c @@ -0,0 +1,47 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_uptime = 0; + +/* Init function. */ + +void +_glibtop_init_uptime_p (glibtop *server) +{ + server->sysdeps.uptime = _glibtop_sysdeps_uptime; +} + +/* Provides uptime and idle time. */ + +void +glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_UPTIME, 0); + + memset (buf, 0, sizeof (glibtop_uptime)); +} diff --git a/sysdeps/sun4/ChangeLog b/sysdeps/sun4/ChangeLog new file mode 100644 index 0000000..19be1a0 --- /dev/null +++ b/sysdeps/sun4/ChangeLog @@ -0,0 +1,51 @@ +2005-03-25 Benoît Dejean + + * open.c: (_glibtop_getkval): s/strerror/g_strerror/. + +2004-05-25 Benoît Dejean + + * uptime.c: (glibtop_get_uptime_p): Added boot_time. + Added missing #include. + +2004-03-09 Bastien Nocera + + * open.c: (glibtop_open_p): + * proclist.c: (glibtop_get_proclist_p): fix g_malloc usage on non-Linux + platforms (patch by Benoît Dejean ) + +2003-10-21 Bastien Nocera + + * Makefile.am: install only one library, libgtop-2.0 + Fix build-time warnings due to the redefinition of guint64 + +2003-10-20 Bastien Nocera + + * glibtop_machine.h: + * glibtop_server.h: + * glibtop_suid.h: + * open.c: + * proclist.c: fixed compilation + +2003-10-20 Bastien Nocera + + * open.c: (glibtop_open_p): + * proclist.c: (glibtop_get_proclist_p): + replace all the xmalloc crap by glib memory management functions + +2001-10-17 Abel Cheung + + * Makefile.am: move header to $(includedir)/libgtop-1.0/glibtop. + +1998-10-25 Martin Baulig + + * ppp.c: New file. + +1998-08-25 Martin Baulig + + * *.c (glibtop_init_p): Using correct `(1 << GLIBTOP_SYSDPES_*)'. + (): Include. + + * glibtop_suid.h: New file. + + * ChangeLog: New file. + diff --git a/sysdeps/sun4/Makefile.am b/sysdeps/sun4/Makefile.am new file mode 100644 index 0000000..ec8fc43 --- /dev/null +++ b/sysdeps/sun4/Makefile.am @@ -0,0 +1,21 @@ + +AM_CPPFLAGS = @AM_CPPFLAGS@ + +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la + +libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_2_0_la_LIBADD = -lkvm + +libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ + uptime.c loadavg.c shm_limits.c msg_limits.c \ + sem_limits.c proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c prockernel.c \ + procsegment.c ppp.c +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_suid_2_0_la_LIBADD = -lkvm + +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h +libgtopincludedir = $(includedir)/libgtop-2.0 + +noinst_HEADERS = glibtop_suid.h diff --git a/sysdeps/sun4/Makefile.in b/sysdeps/sun4/Makefile.in new file mode 100644 index 0000000..320830f --- /dev/null +++ b/sysdeps/sun4/Makefile.in @@ -0,0 +1,771 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = sysdeps/sun4 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/libgtop-sysdeps.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libgtopinclude_HEADERS) \ + $(noinst_HEADERS) $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libgtop_sysdeps_2_0_la_DEPENDENCIES = +am_libgtop_sysdeps_2_0_la_OBJECTS = nosuid.lo siglist.lo +libgtop_sysdeps_2_0_la_OBJECTS = $(am_libgtop_sysdeps_2_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgtop_sysdeps_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +libgtop_sysdeps_suid_2_0_la_DEPENDENCIES = +am_libgtop_sysdeps_suid_2_0_la_OBJECTS = open.lo close.lo cpu.lo \ + mem.lo swap.lo uptime.lo loadavg.lo shm_limits.lo \ + msg_limits.lo sem_limits.lo proclist.lo procstate.lo \ + procuid.lo proctime.lo procmem.lo procsignal.lo prockernel.lo \ + procsegment.lo ppp.lo +libgtop_sysdeps_suid_2_0_la_OBJECTS = \ + $(am_libgtop_sysdeps_suid_2_0_la_OBJECTS) +libgtop_sysdeps_suid_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgtop_sysdeps_suid_2_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +DIST_SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \ + $(libgtop_sysdeps_suid_2_0_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libgtopincludedir)" +HEADERS = $(libgtopinclude_HEADERS) $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + ChangeLog +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DL_LIB = @DL_LIB@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +KVM_LIBS = @KVM_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGTOP_BINDIR = @LIBGTOP_BINDIR@ +LIBGTOP_EXTRA_LIBS = @LIBGTOP_EXTRA_LIBS@ +LIBGTOP_INCS = @LIBGTOP_INCS@ +LIBGTOP_LIBS = @LIBGTOP_LIBS@ +LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ +LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ +LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ +LIBGTOP_SERVER = @LIBGTOP_SERVER@ +LIBGTOP_SERVER_VERSION = @LIBGTOP_SERVER_VERSION@ +LIBGTOP_VERSION = @LIBGTOP_VERSION@ +LIBGTOP_VERSION_CODE = @LIBGTOP_VERSION_CODE@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgtop_have_sysinfo = @libgtop_have_sysinfo@ +libgtop_need_server = @libgtop_need_server@ +libgtop_postinstall = @libgtop_postinstall@ +libgtop_sysdeps_dir = @libgtop_sysdeps_dir@ +libgtop_top_builddir = @libgtop_top_builddir@ +libs_xauth = @libs_xauth@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +server_programs = @server_programs@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +sysdeps_dir = @sysdeps_dir@ +sysdeps_suid_lib = @sysdeps_suid_lib@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la +libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c +libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_2_0_la_LIBADD = -lkvm +libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ + uptime.c loadavg.c shm_limits.c msg_limits.c \ + sem_limits.c proclist.c procstate.c procuid.c \ + proctime.c procmem.c procsignal.c prockernel.c \ + procsegment.c ppp.c + +libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_sysdeps_suid_2_0_la_LIBADD = -lkvm +libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h +libgtopincludedir = $(includedir)/libgtop-2.0 +noinst_HEADERS = glibtop_suid.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sysdeps/sun4/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu sysdeps/sun4/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgtop_sysdeps-2.0.la: $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_2_0_la_LINK) $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_LIBADD) $(LIBS) + +libgtop_sysdeps_suid-2.0.la: $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgtop_sysdeps_suid_2_0_la_LINK) $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nosuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prockernel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsegment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsignal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procstate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm_limits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siglist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-libgtopincludeHEADERS: $(libgtopinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgtopincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgtopincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgtopincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgtopincludedir)" || exit $$?; \ + done + +uninstall-libgtopincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgtopinclude_HEADERS)'; test -n "$(libgtopincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgtopincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libgtopincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libgtopincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libgtopincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libgtopincludeHEADERS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libgtopincludeHEADERS + +.PRECIOUS: Makefile + + +# 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: diff --git a/sysdeps/sun4/close.c b/sysdeps/sun4/close.c new file mode 100644 index 0000000..5679281 --- /dev/null +++ b/sysdeps/sun4/close.c @@ -0,0 +1,29 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +/* Closes pipe to gtop server. */ + +void +glibtop_close_p (glibtop *server) +{ } diff --git a/sysdeps/sun4/cpu.c b/sysdeps/sun4/cpu.c new file mode 100644 index 0000000..eed84e6 --- /dev/null +++ b/sysdeps/sun4/cpu.c @@ -0,0 +1,106 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_cpu = +(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) + +(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) + +(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY); + +/* Provides information about cpu usage. */ + +void +glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf) +{ + long cp_time [CPUSTATES], mp_time [NCPU][CPUSTATES]; + int i; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_CPU), 0); + + memset (buf, 0, sizeof (glibtop_cpu)); + + /* !!! THE FOLLOWING CODE RUNS SGID KMEM - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + + /* get the cp_time array */ + + (void) _glibtop_getkval (server, _glibtop_nlist [X_CP_TIME].n_value, + (int *) cp_time, sizeof (cp_time), + _glibtop_nlist [X_CP_TIME].n_name); + +#ifdef MULTIPROCESSOR + /* get the mp_time array as well */ + + if (server->machine->ncpu > 1) { + (void) _glibtop_getkval (server, _glibtop_nlist [X_MP_TIME].n_value, + (int *) mp_time, sizeof (mp_time), + _glibtop_nlist [X_MP_TIME].n_name); + } +#endif + + glibtop_suid_leave (server); + + /* !!! END OF SUID ROOT PART !!! */ + +#ifdef MULTIPROCESSOR + /* If we have multiple processors, we add the times for each of them + * and set frequency to 100 times the number of the processors. */ + + /* [FIXME]: I had no machine with more than one processor to test + * this code !!! */ + + if (server->machine->ncpu > 1) { + for (i = 0; i < server->machine->ncpu; i++) { + buf->user += mp_time [i][CP_USER]; + buf->nice += mp_time [i][CP_NICE]; + buf->sys += mp_time [i][CP_SYS]; + buf->idle += mp_time [i][CP_IDLE]; + buf->frequency += 100; + } + } else { + buf->user = cp_time [CP_USER]; + buf->nice = cp_time [CP_NICE]; + buf->sys = cp_time [CP_SYS]; + buf->idle = cp_time [CP_IDLE]; + buf->frequency = 100; + } +#else + buf->user = cp_time [CP_USER]; + buf->nice = cp_time [CP_NICE]; + buf->sys = cp_time [CP_SYS]; + buf->idle = cp_time [CP_IDLE]; + buf->frequency = 100; +#endif + + /* Calculate total time. */ + + buf->total = buf->user + buf->nice + buf->sys + buf->idle; + + /* Now we can set the flags. */ + + buf->flags = _glibtop_sysdeps_cpu; +} diff --git a/sysdeps/sun4/glibtop_machine.h b/sysdeps/sun4/glibtop_machine.h new file mode 100644 index 0000000..8004c93 --- /dev/null +++ b/sysdeps/sun4/glibtop_machine.h @@ -0,0 +1,115 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_MACHINE_H__ +#define __GLIBTOP_MACHINE_H__ + +/* make sure param.h gets loaded with KERNEL defined to get PZERO & NZERO */ +#define KERNEL +#include +#undef KERNEL + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef solbourne +#include +#endif + +#include "loadavg.h" + +G_BEGIN_DECLS + +/* Older versions of SunOS don't have a typedef for pid_t. + Hopefully this will catch all those cases without causing other problems. + */ +#ifndef __sys_stdtypes_h +typedef int pid_t; +#endif + +/* definitions for indices in the nlist array */ +#define X_AVENRUN 0 +#define X_CCPU 1 +#define X_MPID 2 +#define X_NPROC 3 +#define X_PROC 4 +#define X_TOTAL 5 +#define X_CP_TIME 6 +#define X_PAGES 7 +#define X_EPAGES 8 +#define X_SHMINFO 9 +#define X_MSGINFO 10 +#define X_SEMINFO 11 + +#ifdef MULTIPROCESSOR +#define X_NCPU 12 +#define X_MP_TIME 13 +#endif + +/* Log base 2 of 1024 is 10 (2^10 == 1024) */ +#define LOG1024 10 + +typedef struct _glibtop_machine glibtop_machine; + +struct _glibtop_machine +{ + uid_t uid, euid; /* Real and effective user id */ + gid_t gid, egid; /* Real and effective group id */ + int nlist_count; /* Number of symbols in the nlist */ + int ncpu; /* Number of CPUs we have */ + int nproc; /* Number of entries in the process array */ + size_t ptable_size; /* Size of process array. */ + unsigned long ptable_offset; /* Offset of process array in kernel. */ + struct proc *proc_table; /* Process array. */ + unsigned long pages, epages; + struct page *physpage; + int bytesize, count; + int pageshift; /* log base 2 of the pagesize */ + kvm_t *kd; +}; + +/* Those functions are used internally in libgtop */ + +#ifdef _IN_LIBGTOP + +extern struct nlist _glibtop_nlist[]; + +int _glibtop_check_nlist (void *server, register struct nlist *nlst); +int _glibtop_getkval (void *void_server, unsigned long offset, int *ptr, + int size, char *refstr); +void _glibtop_read_proc_table (void *void_server); +struct proc *_glibtop_find_pid (void *void_server, pid_t pid); + +#endif + +G_END_DECLS + +#endif diff --git a/sysdeps/sun4/glibtop_server.h b/sysdeps/sun4/glibtop_server.h new file mode 100644 index 0000000..fa4439a --- /dev/null +++ b/sysdeps/sun4/glibtop_server.h @@ -0,0 +1,51 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SERVER_H__ +#define __GLIBTOP_SERVER_H__ + +G_BEGIN_DECLS + +#define GLIBTOP_SUID_CPU (1 << GLIBTOP_SYSDEPS_CPU) +#define GLIBTOP_SUID_MEM (1 << GLIBTOP_SYSDEPS_MEM) +#define GLIBTOP_SUID_SWAP (1 << GLIBTOP_SYSDEPS_SWAP) +#define GLIBTOP_SUID_UPTIME (1 << GLIBTOP_SYSDEPS_UPTIME) +#define GLIBTOP_SUID_LOADAVG (1 << GLIBTOP_SYSDEPS_LOADAVG) +#define GLIBTOP_SUID_SHM_LIMITS (1 << GLIBTOP_SYSDEPS_SHM_LIMITS) +#define GLIBTOP_SUID_MSG_LIMITS (1 << GLIBTOP_SYSDEPS_MSG_LIMITS) +#define GLIBTOP_SUID_SEM_LIMITS (1 << GLIBTOP_SYSDEPS_SEM_LIMITS) +#define GLIBTOP_SUID_PROCLIST (1 << GLIBTOP_SYSDEPS_PROCLIST) +#define GLIBTOP_SUID_PROC_STATE (1 << GLIBTOP_SYSDEPS_PROC_STATE) +#define GLIBTOP_SUID_PROC_UID (1 << GLIBTOP_SYSDEPS_PROC_UID) +#define GLIBTOP_SUID_PROC_MEM (1 << GLIBTOP_SYSDEPS_PROC_MEM) +#define GLIBTOP_SUID_PROC_TIME (1 << GLIBTOP_SYSDEPS_PROC_TIME) +#define GLIBTOP_SUID_PROC_SIGNAL (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL) +#define GLIBTOP_SUID_PROC_KERNEL (1 << GLIBTOP_SYSDEPS_PROC_KERNEL) +#define GLIBTOP_SUID_PROC_SEGMENT (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT) +#define GLIBTOP_SUID_PROC_ARGS 0 +#define GLIBTOP_SUID_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP) +#define GLIBTOP_SUID_NETLOAD 0 +#define GLIBTOP_SUID_NETLIST 0 +#define GLIBTOP_SUID_PPP 0 + +G_END_DECLS + +#endif diff --git a/sysdeps/sun4/glibtop_suid.h b/sysdeps/sun4/glibtop_suid.h new file mode 100644 index 0000000..85e2f3d --- /dev/null +++ b/sysdeps/sun4/glibtop_suid.h @@ -0,0 +1,46 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_SUID_H__ +#define __GLIBTOP_SUID_H__ + +G_BEGIN_DECLS + +static inline void glibtop_suid_enter (glibtop *server) { + setregid (server->machine->gid, server->machine->egid); +}; + +static inline void glibtop_suid_leave (glibtop *server) { + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); +}; + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags); +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, + const unsigned flags); + +G_END_DECLS + +#endif diff --git a/sysdeps/sun4/loadavg.c b/sysdeps/sun4/loadavg.c new file mode 100644 index 0000000..b49947d --- /dev/null +++ b/sysdeps/sun4/loadavg.c @@ -0,0 +1,66 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_loadavg = +(1 << GLIBTOP_LOADAVG_LOADAVG); + +/* Provides load averange. */ + +void +glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf) +{ + load_avg avenrun [3]; + int i; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_LOADAVG), 0); + + memset (buf, 0, sizeof (glibtop_loadavg)); + + /* !!! THE FOLLOWING CODE RUNS SGID KMEM - CHANGE WITH CAUTION !!! */ + + setregid (server->machine->gid, server->machine->egid); + + /* get the load average array */ + + (void) _glibtop_getkval (server, _glibtop_nlist [X_AVENRUN].n_value, + (int *) avenrun, sizeof (avenrun), + _glibtop_nlist [X_AVENRUN].n_name); + + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); + + /* !!! END OF SGID KMEM PART !!! */ + + for (i = 0; i < 3; i++) { + /* Calculate loadavg values from avenrun. */ + buf->loadavg [i] = loaddouble (avenrun [i]); + } + + /* Now we can set the flags. */ + + buf->flags = _glibtop_sysdeps_loadavg; +} diff --git a/sysdeps/sun4/mem.c b/sysdeps/sun4/mem.c new file mode 100644 index 0000000..a34654b --- /dev/null +++ b/sysdeps/sun4/mem.c @@ -0,0 +1,90 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_mem = +(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) + +(1 << GLIBTOP_MEM_FREE) + (1 << GLIBTOP_MEM_LOCKED); + +/* define pagetok in terms of pageshift */ + +#define pagetok(size) ((size) << server->machine->pageshift) + +/* Provides information about memory usage. */ + +void +glibtop_get_mem_p (glibtop *server, glibtop_mem *buf) +{ + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MEM), 0); + + memset (buf, 0, sizeof (glibtop_mem)); + + /* !!! THE FOLLOWING CODE RUNS SGID KMEM - CHANGE WITH CAUTION !!! */ + + glibtop_suid_enter (server); + + /* get the array of physpage descriptors */ + + (void) _glibtop_getkval (server, server->machine->pages, + (int *) server->machine->physpage, + server->machine->bytesize, + "array _page"); + + glibtop_suid_leave (server); + + /* !!! END OF SGID KMEM PART !!! */ + + + { /* sum memory statistics */ + register struct page *pp; + register int cnt; + register int inuse; + register int free; + register int locked; + + /* bop thru the array counting page types */ + + pp = server->machine->physpage; + inuse = free = locked = 0; + for (cnt = server->machine->count; --cnt >= 0; pp++) { + if (pp->p_free) + free++; + else if (pp->p_lock || pp->p_keepcnt > 0) + locked++; + else + inuse++; + } + + /* convert memory stats to Kbytes */ + + buf->total = pagetok (inuse + free); + buf->used = pagetok (inuse); + buf->free = pagetok (free); + buf->locked = pagetok (locked); + + buf->flags = _glibtop_sysdeps_mem; + } +} diff --git a/sysdeps/sun4/msg_limits.c b/sysdeps/sun4/msg_limits.c new file mode 100644 index 0000000..204b4e3 --- /dev/null +++ b/sysdeps/sun4/msg_limits.c @@ -0,0 +1,74 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +/* #define KERNEL to get declaration of `struct msginfo'. */ + +#define KERNEL + +#include +#include + +static const unsigned long _glibtop_sysdeps_msg_limits = +(1 << GLIBTOP_IPC_MSGMAP) + (1 << GLIBTOP_IPC_MSGMAX) + +(1 << GLIBTOP_IPC_MSGMNB) + (1 << GLIBTOP_IPC_MSGMNI) + +(1 << GLIBTOP_IPC_MSGSSZ) + (1 << GLIBTOP_IPC_MSGTQL); + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf) +{ + struct msginfo msginfo; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MSG_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_msg_limits)); + + /* !!! THE FOLLOWING CODE RUNS SGID KMEM - CHANGE WITH CAUTION !!! */ + + setregid (server->machine->gid, server->machine->egid); + + /* get the load average array */ + + (void) _glibtop_getkval (server, _glibtop_nlist [X_MSGINFO].n_value, + (int *) &msginfo, sizeof (msginfo), + _glibtop_nlist [X_MSGINFO].n_name); + + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); + + /* !!! END OF SGID KMEM PART !!! */ + + buf->msgmap = msginfo.msgmap; + buf->msgmax = msginfo.msgmax; + buf->msgmnb = msginfo.msgmnb; + buf->msgmni = msginfo.msgmni; + buf->msgssz = msginfo.msgssz; + buf->msgtql = msginfo.msgtql; + + buf->flags = _glibtop_sysdeps_msg_limits; +} diff --git a/sysdeps/sun4/nosuid.c b/sysdeps/sun4/nosuid.c new file mode 100644 index 0000000..4105d42 --- /dev/null +++ b/sysdeps/sun4/nosuid.c @@ -0,0 +1,34 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +void +glibtop_open_s (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags) +{ } + +void +glibtop_close_s (glibtop *server) +{ } diff --git a/sysdeps/sun4/open.c b/sysdeps/sun4/open.c new file mode 100644 index 0000000..6ed6b76 --- /dev/null +++ b/sysdeps/sun4/open.c @@ -0,0 +1,309 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include +#include + +struct nlist _glibtop_nlist[] = { +#ifdef i386 + { "avenrun" }, /* 0 */ + { "ccpu" }, /* 1 */ + { "mpid" }, /* 2 */ + { "nproc" }, /* 3 */ + { "proc" }, /* 4 */ + { "total" }, /* 5 */ + { "cp_time" }, /* 6 */ + { "pages" }, /* 7 */ + { "epages" }, /* 8 */ + { "shminfo" }, /* 9 */ + { "msginfo" }, /* 10 */ + { "seminfo" }, /* 11 */ +#else + { "_avenrun" }, /* 0 */ + { "_ccpu" }, /* 1 */ + { "_mpid" }, /* 2 */ + { "_nproc" }, /* 3 */ + { "_proc" }, /* 4 */ + { "_total" }, /* 5 */ + { "_cp_time" }, /* 6 */ + { "_pages" }, /* 7 */ + { "_epages" }, /* 8 */ + { "_shminfo" }, /* 9 */ + { "_msginfo" }, /* 10 */ + { "_seminfo" }, /* 11 */ +#ifdef MULTIPROCESSOR + { "_ncpu" }, + { "_mp_time" }, +#endif +#endif + { 0 } +}; + +/* Opens pipe to gtop server. Returns 0 on success and -1 on error. */ + +/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ + +void +glibtop_init_p (glibtop *server, const unsigned long features, + const unsigned flags) +{ + if (server == NULL) + glibtop_error_r (NULL, "glibtop_init_p (server == NULL)"); + + glibtop_open_p (server, "glibtop", features, flags); +} + +void +glibtop_open_p (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags) +{ + register int pagesize; + + /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ + + server->name = program_name; + + server->machine->uid = getuid (); + server->machine->euid = geteuid (); + server->machine->gid = getgid (); + server->machine->egid = getegid (); + + /* initialize the kernel interface */ + + server->machine->kd = kvm_open (NULL, NULL, NULL, O_RDONLY, "libgtop"); + + if (server->machine->kd == NULL) + glibtop_error_io_r (server, "kvm_open"); + + /* get the list of symbols we want to access in the kernel */ + + server->machine->nlist_count = kvm_nlist + (server->machine->kd, _glibtop_nlist); + + if (server->machine->nlist_count < 0) + glibtop_error_io_r (server, "nlist"); + +#ifdef MULTIPROCESSOR + /* were ncpu and xp_time not found in the nlist? */ + + if ((server->machine->nlist_count > 0) && + (_glibtop_nlist[X_NCPU].n_type == 0) && + (_glibtop_nlist[X_MP_TIME].n_type == 0)) { + /* we were compiled on an MP system but we are not running + * on one, so we will pretend this didn't happen and set + * ncpu = 1 */ + server->machine->nlist_count -= 2; + server->machine->ncpu = 1; + } +#endif + +#ifdef solbourne + { + unsigned int status, type; + + /* Get the number of CPUs on this system. */ + syscall(SYS_getcpustatus, &status, + &server->machine->ncpu, &type); + } +#endif + + /* Make sure all of the symbols were found. */ + + if ((server->machine->nlist_count > 0) && + (_glibtop_check_nlist (server, _glibtop_nlist) > 0)) + _exit (1); + + /* Get process array stuff. */ + + (void) _glibtop_getkval (server, _glibtop_nlist[X_NPROC].n_value, + (int *)(&server->machine->nproc), + sizeof (server->machine->nproc), + _glibtop_nlist[X_NPROC].n_name); + + (void) _glibtop_getkval (server, _glibtop_nlist[X_PROC].n_value, + (int *)(&server->machine->ptable_offset), + sizeof (server->machine->ptable_offset), + _glibtop_nlist[X_PROC].n_name); + + server->machine->ptable_size = (unsigned long) server->machine->nproc * + (unsigned long) sizeof (struct proc); + + server->machine->proc_table = g_malloc + (server, server->machine->ptable_size); + + /* This are for the memory statistics. */ + + (void) _glibtop_getkval (server, _glibtop_nlist[X_PAGES].n_value, + (int *)(&server->machine->pages), + sizeof (server->machine->pages), + _glibtop_nlist[X_PAGES].n_name); + + (void) _glibtop_getkval (server, _glibtop_nlist[X_EPAGES].n_value, + (int *)(&server->machine->epages), + sizeof (server->machine->epages), + _glibtop_nlist[X_EPAGES].n_name); + + server->machine->bytesize = server->machine->epages - + server->machine->pages; + server->machine->count = server->machine->bytesize / + sizeof (struct page); + + server->machine->physpage = (struct page *) + g_malloc (server->machine->bytesize); + + /* get the page size with "getpagesize" and + * calculate pageshift from it */ + + pagesize = getpagesize(); + + server->machine->pageshift = 0; + + while (pagesize > 1) { + server->machine->pageshift++; + pagesize >>= 1; + } + + /* we only need the amount of log(2)1024 for our conversion */ + + server->machine->pageshift -= LOG1024; + + /* Drop priviledges. */ + + if (setreuid (server->machine->euid, server->machine->uid)) + _exit (1); + + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); + + /* !!! END OF SUID ROOT PART !!! */ + + /* Our effective uid is now those of the user invoking the server, + * so we do no longer have any priviledges. */ + + /* NOTE: On SunOS, we do not need to be suid root, we just need to + * be sgid kmem. + * + * The server will only use setegid() to get back it's priviledges, + * so it will fail if it is suid root and not sgid kmem. */ +} + +/* Used internally. Returns number of symbols that cannot be found in + * the nlist. */ + +int +_glibtop_check_nlist (void *server, register struct nlist *nlst) +{ + register int not_found; + + /* check to see if we got ALL the symbols we requested */ + /* this will write one line to stderr for every symbol not found */ + + not_found = 0; + + while (nlst->n_name != NULL) { + +#ifdef i386 + if (nlst->n_value == 0) { + glibtop_error_r (server, + "kernel: no symbol named `%s'", + nlst->n_name); + not_found++; + } +#else + if (nlst->n_type == 0) { + glibtop_error_r (server, + "kernel: no symbol named `%s'", + nlst->n_name); + not_found++; + } +#endif + + nlst++; + } + + return not_found; +} + +/* Used internally. Fetches value from kernel. */ + +int +_glibtop_getkval (void *void_server, unsigned long offset, int *ptr, + int size, char *refstr) +{ + glibtop *server = (glibtop *) void_server; + + if (kvm_read (server->machine->kd, offset, ptr, size) != size) + { + if (*refstr == '!') return 0; + + glibtop_error_r (server, "kvm_read(%s): %s", + refstr, g_strerror (errno)); + } + + return 1; +} + +/* Used internally. Reads process table from kernel. */ + +void +_glibtop_read_proc_table (void *void_server) +{ + glibtop *server = (glibtop *) void_server; + + /* !!! THE FOLLOWING CODE RUNS SGID KMEM - CHANGE WITH CAUTION !!! */ + + setregid (server->machine->gid, server->machine->egid); + + /* Read process table from kernel. */ + + (void) _glibtop_getkval (server, server->machine->ptable_offset, + (int *) server->machine->proc_table, + (size_t) server->machine->ptable_size, + _glibtop_nlist[X_PROC].n_name); + + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); + + /* !!! END OF SGID KMEM PART !!! */ +} + +/* Used internally. Finds pid in process table. */ + +struct proc * +_glibtop_find_pid (void *void_server, pid_t pid) +{ + register struct proc *pp; + register int i; + + glibtop *server = (glibtop *) void_server; + + for (pp = server->machine->proc_table, i = 0; + i < server->machine->nproc; pp++, i++) { + if ((pp->p_stat != 0) && (pp->p_pid == pid)) + return pp; + } + + return NULL; +} diff --git a/sysdeps/sun4/ppp.c b/sysdeps/sun4/ppp.c new file mode 100644 index 0000000..0801643 --- /dev/null +++ b/sysdeps/sun4/ppp.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_ppp = 0; + +/* Init function. */ + +void +_glibtop_init_ppp_s (glibtop *server) +{ + server->sysdeps.ppp = _glibtop_sysdeps_ppp; +} + +/* Provides PPP/ISDN information. */ + +void +glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device) +{ + memset (buf, 0, sizeof (glibtop_ppp)); +} diff --git a/sysdeps/sun4/prockernel.c b/sysdeps/sun4/prockernel.c new file mode 100644 index 0000000..18153a1 --- /dev/null +++ b/sysdeps/sun4/prockernel.c @@ -0,0 +1,59 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_kernel = +(1 << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1 << GLIBTOP_PROC_KERNEL_WCHAN); + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_kernel_p (glibtop *server, glibtop_proc_kernel *buf, + pid_t pid) +{ + struct proc *pp; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_KERNEL), 0); + + memset (buf, 0, sizeof (glibtop_proc_kernel)); + + /* Read process table from kernel. */ + + _glibtop_read_proc_table (server); + + /* Find the pid in the process table. */ + + pp = _glibtop_find_pid (server, pid); + + if (pp == NULL) return; + + /* Fill in data fields. */ + + buf->k_flags = pp->p_flag; + buf->nwchan = (unsigned long) pp->p_wchan; + + buf->flags = _glibtop_sysdeps_proc_kernel; +} diff --git a/sysdeps/sun4/proclist.c b/sysdeps/sun4/proclist.c new file mode 100644 index 0000000..d14e82f --- /dev/null +++ b/sysdeps/sun4/proclist.c @@ -0,0 +1,95 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proclist = +(1 << GLIBTOP_PROCLIST_TOTAL) + (1 << GLIBTOP_PROCLIST_NUMBER) + +(1 << GLIBTOP_PROCLIST_SIZE); + +/* Fetch list of currently running processes. + * + * IMPORTANT NOTE: + * On error, this function MUST return NULL and set buf->flags to zero ! + * On success, it returnes a pointer to a list of buf->number elements + * each buf->size big. The total size is stored in buf->total. */ + +unsigned * +glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf, + gint64 which, gint64 arg) +{ + register struct proc *pp; + register int i, nproc = 0; + unsigned *proc_list = NULL; + size_t proc_size; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROCLIST), 0); + + memset (buf, 0, sizeof (glibtop_proclist)); + + /* Read process table from kernel. */ + + _glibtop_read_proc_table (server); + + /* Count number of processes. */ + + for (pp = server->machine->proc_table, i = 0; + i < server->machine->nproc; pp++, i++) { + if (pp->p_stat == 0) + continue; + else + nproc++; + } + + if (nproc == 0) /* Should never happen. */ + return NULL; + + /* Allocate space for process list. */ + + proc_size = nproc * sizeof (unsigned); + + proc_list = g_malloc (proc_size); + + /* Write process list. */ + + for (pp = server->machine->proc_table, i = 0, nproc = 0; + i < server->machine->nproc; pp++, i++) { + if (pp->p_stat == 0) + continue; + proc_list [nproc++] = pp->p_pid; + } + + /* Since everything is ok now, we can set buf->flags, fill in the remaining fields + and return proc_list. */ + + buf->flags = _glibtop_sysdeps_proclist; + + buf->size = sizeof (unsigned); + buf->number = nproc; + + buf->total = nproc * sizeof (unsigned); + + return proc_list; +} diff --git a/sysdeps/sun4/procmem.c b/sysdeps/sun4/procmem.c new file mode 100644 index 0000000..9874d61 --- /dev/null +++ b/sysdeps/sun4/procmem.c @@ -0,0 +1,61 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_mem = +(1 << GLIBTOP_PROC_MEM_SIZE) + (1 << GLIBTOP_PROC_MEM_RSS) + +(1 << GLIBTOP_PROC_MEM_RSS_RLIM); + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, + pid_t pid) +{ + struct proc *pp; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_MEM), 0); + + memset (buf, 0, sizeof (glibtop_proc_mem)); + + /* Read process table from kernel. */ + + _glibtop_read_proc_table (server); + + /* Find the pid in the process table. */ + + pp = _glibtop_find_pid (server, pid); + + if (pp == NULL) return; + + /* Fill in data fields. */ + + buf->size = (pp)->p_tsize + (pp)->p_dsize + (pp)->p_ssize; + + buf->rss = pp->p_rssize; + buf->rss_rlim = pp->p_maxrss; + + buf->flags = _glibtop_sysdeps_proc_mem; +} diff --git a/sysdeps/sun4/procsegment.c b/sysdeps/sun4/procsegment.c new file mode 100644 index 0000000..e7ac28e --- /dev/null +++ b/sysdeps/sun4/procsegment.c @@ -0,0 +1,60 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_segment = +(1 << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + +(1 << GLIBTOP_PROC_SEGMENT_DATA_RSS); + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf, + pid_t pid) +{ + struct proc *pp; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0); + + memset (buf, 0, sizeof (glibtop_proc_segment)); + + /* Read process table from kernel. */ + + _glibtop_read_proc_table (server); + + /* Find the pid in the process table. */ + + pp = _glibtop_find_pid (server, pid); + + if (pp == NULL) return; + + /* Fill in data fields. */ + + buf->text_rss = pp->p_tsize; + buf->data_rss = pp->p_dsize; + + buf->flags = _glibtop_sysdeps_proc_segment; +} diff --git a/sysdeps/sun4/procsignal.c b/sysdeps/sun4/procsignal.c new file mode 100644 index 0000000..e6ad28a --- /dev/null +++ b/sysdeps/sun4/procsignal.c @@ -0,0 +1,62 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_signal = +(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1 << GLIBTOP_PROC_SIGNAL_BLOCKED) + +(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1 << GLIBTOP_PROC_SIGNAL_SIGCATCH); + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_signal_p (glibtop *server, glibtop_proc_signal *buf, + pid_t pid) +{ + struct proc *pp; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0); + + memset (buf, 0, sizeof (glibtop_proc_signal)); + + /* Read process table from kernel. */ + + _glibtop_read_proc_table (server); + + /* Find the pid in the process table. */ + + pp = _glibtop_find_pid (server, pid); + + if (pp == NULL) return; + + /* Fill in data fields. */ + + buf->signal [0] = pp->p_sig; + buf->blocked [0] = pp->p_sigmask; + buf->sigignore [0] = pp->p_sigignore; + buf->sigcatch [0] = pp->p_sigcatch; + + buf->flags = _glibtop_sysdeps_proc_signal; +} diff --git a/sysdeps/sun4/procstate.c b/sysdeps/sun4/procstate.c new file mode 100644 index 0000000..83709cd --- /dev/null +++ b/sysdeps/sun4/procstate.c @@ -0,0 +1,59 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_state = +(1 << GLIBTOP_PROC_STATE_STATE) + (1 << GLIBTOP_PROC_STATE_UID); + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_state_p (glibtop *server, glibtop_proc_state *buf, + pid_t pid) +{ + struct proc *pp; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_STATE), 0); + + memset (buf, 0, sizeof (glibtop_proc_state)); + + /* Read process table from kernel. */ + + _glibtop_read_proc_table (server); + + /* Find the pid in the process table. */ + + pp = _glibtop_find_pid (server, pid); + + if (pp == NULL) return; + + /* Fill in data fields. */ + + buf->state = pp->p_stat; + buf->uid = pp->p_uid; + + buf->flags = _glibtop_sysdeps_proc_state; +} diff --git a/sysdeps/sun4/proctime.c b/sysdeps/sun4/proctime.c new file mode 100644 index 0000000..330392a --- /dev/null +++ b/sysdeps/sun4/proctime.c @@ -0,0 +1,59 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_time = +(1 << GLIBTOP_PROC_TIME_START_TIME) + (1 << GLIBTOP_PROC_TIME_UTIME); + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, + pid_t pid) +{ + struct proc *pp; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_TIME), 0); + + memset (buf, 0, sizeof (glibtop_proc_time)); + + /* Read process table from kernel. */ + + _glibtop_read_proc_table (server); + + /* Find the pid in the process table. */ + + pp = _glibtop_find_pid (server, pid); + + if (pp == NULL) return; + + /* Fill in data fields. */ + + buf->start_time = pp->p_time; + buf->utime = pp->p_cpticks; + + buf->flags = _glibtop_sysdeps_proc_time; +} diff --git a/sysdeps/sun4/procuid.c b/sysdeps/sun4/procuid.c new file mode 100644 index 0000000..6694c1b --- /dev/null +++ b/sysdeps/sun4/procuid.c @@ -0,0 +1,70 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_proc_uid = +(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) + +(1 << GLIBTOP_PROC_UID_EGID) + (1 << GLIBTOP_PROC_UID_PID) + +(1 << GLIBTOP_PROC_UID_PPID) + (1 << GLIBTOP_PROC_UID_PGRP) + +(1 << GLIBTOP_PROC_UID_TPGID) + (1 << GLIBTOP_PROC_UID_PRIORITY) + +(1 << GLIBTOP_PROC_UID_NICE); + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, + pid_t pid) +{ + struct proc *pp; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_UID), 0); + + memset (buf, 0, sizeof (glibtop_proc_uid)); + + /* Read process table from kernel. */ + + _glibtop_read_proc_table (server); + + /* Find the pid in the process table. */ + + pp = _glibtop_find_pid (server, pid); + + if (pp == NULL) return; + + /* Fill in data fields. */ + + buf->uid = pp->p_uid; + buf->euid = pp->p_suid; + buf->egid = pp->p_sgid; + buf->pid = pp->p_pid; + buf->ppid = pp->p_ppid; + buf->pgrp = pp->p_pgrp; + buf->tpgid = pp->p_pgrp; + buf->priority = pp->p_pri; + buf->nice = pp->p_nice; + + buf->flags = _glibtop_sysdeps_proc_uid; +} diff --git a/sysdeps/sun4/sem_limits.c b/sysdeps/sun4/sem_limits.c new file mode 100644 index 0000000..807b2dc --- /dev/null +++ b/sysdeps/sun4/sem_limits.c @@ -0,0 +1,80 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +/* #define KERNEL to get declaration of `struct seminfo'. */ + +#define KERNEL + +#include +#include + +static unsigned long _glibtop_sysdeps_sem_limits = +(1 << GLIBTOP_IPC_SEMMAP) + (1 << GLIBTOP_IPC_SEMMNI) + +(1 << GLIBTOP_IPC_SEMMNS) + (1 << GLIBTOP_IPC_SEMMNU) + +(1 << GLIBTOP_IPC_SEMMSL) + (1 << GLIBTOP_IPC_SEMOPM) + +(1 << GLIBTOP_IPC_SEMUME) + (1 << GLIBTOP_IPC_SEMUSZ) + +(1 << GLIBTOP_IPC_SEMVMX) + (1 << GLIBTOP_IPC_SEMAEM); + +/* Provides information about sysv sem limits. */ + +void +glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) +{ + struct seminfo seminfo; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SEM_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_sem_limits)); + + /* !!! THE FOLLOWING CODE RUNS SGID KMEM - CHANGE WITH CAUTION !!! */ + + setregid (server->machine->gid, server->machine->egid); + + /* get the load average array */ + + (void) _glibtop_getkval (server, _glibtop_nlist [X_SEMINFO].n_value, + (int *) &seminfo, sizeof (seminfo), + _glibtop_nlist [X_SEMINFO].n_name); + + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); + + /* !!! END OF SGID KMEM PART !!! */ + + buf->semmap = seminfo.semmap; + buf->semmni = seminfo.semmni; + buf->semmns = seminfo.semmns; + buf->semmnu = seminfo.semmnu; + buf->semmsl = seminfo.semmsl; + buf->semopm = seminfo.semopm; + buf->semume = seminfo.semume; + buf->semusz = seminfo.semusz; + buf->semvmx = seminfo.semvmx; + buf->semaem = seminfo.semaem; + + buf->flags = _glibtop_sysdeps_sem_limits; +} diff --git a/sysdeps/sun4/shm_limits.c b/sysdeps/sun4/shm_limits.c new file mode 100644 index 0000000..b84cb46 --- /dev/null +++ b/sysdeps/sun4/shm_limits.c @@ -0,0 +1,73 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +/* #define KERNEL to get declaration of `struct shminfo'. */ + +#define KERNEL + +#include +#include + +static unsigned long _glibtop_sysdeps_shm_limits = +(1 << GLIBTOP_IPC_SHMMAX) + (1 << GLIBTOP_IPC_SHMMIN) + +(1 << GLIBTOP_IPC_SHMMNI) + (1 << GLIBTOP_IPC_SHMSEG) + +(1 << GLIBTOP_IPC_SHMALL); + +/* Provides information about sysv ipc limits. */ + +void +glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) +{ + struct shminfo shminfo; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SHM_LIMITS), 0); + + memset (buf, 0, sizeof (glibtop_shm_limits)); + + /* !!! THE FOLLOWING CODE RUNS SGID KMEM - CHANGE WITH CAUTION !!! */ + + setregid (server->machine->gid, server->machine->egid); + + /* get the load average array */ + + (void) _glibtop_getkval (server, _glibtop_nlist [X_SHMINFO].n_value, + (int *) &shminfo, sizeof (shminfo), + _glibtop_nlist [X_SHMINFO].n_name); + + if (setregid (server->machine->egid, server->machine->gid)) + _exit (1); + + /* !!! END OF SGID KMEM PART !!! */ + + buf->shmmax = shminfo.shmmax; + buf->shmmin = shminfo.shmmin; + buf->shmmni = shminfo.shmmni; + buf->shmseg = shminfo.shmseg; + buf->shmall = shminfo.shmall; + + buf->flags = _glibtop_sysdeps_shm_limits; +} diff --git a/sysdeps/sun4/siglist.c b/sysdeps/sun4/siglist.c new file mode 100644 index 0000000..ba215cd --- /dev/null +++ b/sysdeps/sun4/siglist.c @@ -0,0 +1,59 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 1, "SIGHUP", N_("Hangup") }, + { 2, "SIGINT", N_("Interrupt") }, + { 3, "SIGQUIT", N_("Quit") }, + { 4, "SIGILL", N_("Illegal instruction") }, + { 5, "SIGTRAP", N_("Trace trap") }, + { 6, "SIGABRT", N_("Abort") }, + { 7, "SIGEMT", N_("EMT error") }, + { 8, "SIGFPE", N_("Floating-point exception") }, + { 9, "SIGKILL", N_("Kill") }, + { 10, "SIGBUS", N_("Bus error") }, + { 11, "SIGSEGV", N_("Segmentation violation") }, + { 12, "SIGSYS", N_("Bad argument to system call") }, + { 13, "SIGPIPE", N_("Broken pipe") }, + { 14, "SIGALRM", N_("Alarm clock") }, + { 15, "SIGTERM", N_("Termination") }, + { 16, "SIGURG", N_("Urgent condition on socket") }, + { 17, "SIGSTOP", N_("Stop") }, + { 18, "SIGTSTP", N_("Keyboard stop") }, + { 19, "SIGCONT", N_("Continue") }, + { 20, "SIGCHLD", N_("Child status has changed") }, + { 21, "SIGTTIN", N_("Background read from tty") }, + { 22, "SIGTTOU", N_("Background write to tty") }, + { 23, "SIGIO", N_("I/O now possible") }, + { 24, "SIGXCPU", N_("CPU limit exceeded") }, + { 25, "SIGXFSZ", N_("File size limit exceeded") }, + { 26, "SIGVTALRM", N_("Virtual alarm clock") }, + { 27, "SIGPROF", N_("Profiling alarm clock") }, + { 28, "SIGWINCH", N_("Window size change") }, + { 29, "SIGINFO", N_("Information request") }, + { 30, "SIGUSR1", N_("User defined signal 1") }, + { 31, "SIGUSR2", N_("User defined signal 2") }, + { 0, NULL, NULL }, +}; diff --git a/sysdeps/sun4/swap.c b/sysdeps/sun4/swap.c new file mode 100644 index 0000000..672afde --- /dev/null +++ b/sysdeps/sun4/swap.c @@ -0,0 +1,36 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +/* Provides information about swap usage. */ + +void +glibtop_get_swap_p (glibtop *server, glibtop_swap *buf) +{ + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SWAP), 0); + + memset (buf, 0, sizeof (glibtop_swap)); +} diff --git a/sysdeps/sun4/uptime.c b/sysdeps/sun4/uptime.c new file mode 100644 index 0000000..aa230fe --- /dev/null +++ b/sysdeps/sun4/uptime.c @@ -0,0 +1,63 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop 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. + + LibGTop 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 LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +#include + +static const unsigned long _glibtop_sysdeps_uptime = +(1 << GLIBTOP_UPTIME_UPTIME) + (1 << GLIBTOP_UPTIME_IDLETIME); + +/* Provides uptime and idle time. */ + +void +glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf) +{ + glibtop_cpu cpu; + + glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_UPTIME), 0); + + /* Get currect cpu usage. */ + + glibtop_get_cpu_p (server, &cpu); + + /* Make sure all required fields are present. */ + + if (((cpu.flags & (1 << GLIBTOP_CPU_TOTAL)) == 0) || + ((cpu.flags & (1 << GLIBTOP_CPU_IDLE)) == 0) || + ((cpu.flags & (1 << GLIBTOP_CPU_FREQUENCY)) == 0) || + (cpu.frequency == 0)) + return; + + /* Simply calculate uptime and idle time from + * cpu usage. */ + + buf->uptime = (double) cpu.total / (double) cpu.frequency; + buf->idletime = (double) cpu.idle / (double) cpu.frequency; + buf->boot_time = (guint64) time(NULL) - (guint64) buf->uptime; + + buf->flags = _glibtop_sysdeps_uptime; +}