From e3be059d4da38aa36f1aee1d56f8ceb943d92f1c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 22:34:44 +0200 Subject: Adding upstream version 2:4.0.4. Signed-off-by: Daniel Baumann --- .tarball-version | 1 + .version | 1 + ABOUT-NLS | 768 ++ AUTHORS | 59 + COPYING | 339 + COPYING.LIB | 481 + ChangeLog | 3 + INSTALL.md | 25 + Makefile.am | 418 + Makefile.in | 3106 +++++ NEWS | 882 ++ README.md | 52 + aclocal.m4 | 1507 +++ autogen.sh | 75 + compile | 348 + config.guess | 1754 +++ config.h.in | 499 + config.rpath | 548 + config.sub | 1890 +++ configure | 21818 ++++++++++++++++++++++++++++++++ configure.ac | 428 + depcomp | 791 ++ doc/CodingStyle.md | 27 + doc/FAQ | 97 + doc/TODO | 145 + doc/bugs.md | 92 + doc/libproc.supp | 78 + install-sh | 541 + library/devname.c | 364 + library/diskstats.c | 1027 ++ library/escape.c | 157 + library/include/devname.h | 10 + library/include/diskstats.h | 135 + library/include/escape.h | 35 + library/include/meminfo.h | 216 + library/include/misc.h | 90 + library/include/numa.h | 30 + library/include/pids.h | 287 + library/include/procps-private.h | 28 + library/include/pwcache.h | 38 + library/include/readproc.h | 303 + library/include/slabinfo.h | 140 + library/include/stat.h | 175 + library/include/vmstat.h | 382 + library/include/wchan.h | 27 + library/include/xtra-procps-debug.h | 208 + library/libproc2.pc.in | 11 + library/libproc2.sym | 67 + library/meminfo.c | 1016 ++ library/namespace.c | 116 + library/numa.c | 114 + library/pids.c | 1700 +++ library/pwcache.c | 99 + library/readproc.c | 1627 +++ library/slabinfo.c | 1044 ++ library/stat.c | 1443 +++ library/sysinfo.c | 167 + library/tests/test_Itemtables.c | 91 + library/tests/test_namespace.c | 76 + library/tests/test_pids.c | 75 + library/tests/test_sysinfo.c | 64 + library/tests/test_uptime.c | 97 + library/tests/test_version.c | 72 + library/uptime.c | 268 + library/version.c | 71 + library/vmstat.c | 1513 +++ library/wchan.c | 54 + local/Makefile.am | 10 + local/Makefile.in | 553 + local/c.h | 162 + local/fileutils.c | 45 + local/fileutils.h | 7 + local/git-version-gen | 181 + local/nls.h | 114 + local/procio.c | 292 + local/procio.h | 6 + local/rpmatch.h | 9 + local/signals.c | 316 + local/signals.h | 33 + local/strutils.c | 123 + local/strutils.h | 12 + local/strverscmp.c | 158 + local/tests.h | 29 + local/xalloc.h | 60 + ltmain.sh | 11448 +++++++++++++++++ m4/gettext.m4 | 487 + m4/iconv.m4 | 103 + m4/lib-ld.m4 | 112 + m4/lib-link.m4 | 551 + m4/lib-prefix.m4 | 155 + m4/libtool.m4 | 8427 ++++++++++++ m4/ltoptions.m4 | 437 + m4/ltsugar.m4 | 124 + m4/ltversion.m4 | 24 + m4/lt~obsolete.m4 | 99 + m4/nls.m4 | 49 + m4/po.m4 | 426 + m4/progtest.m4 | 91 + man/free.1 | 169 + man/kill.1 | 110 + man/pgrep.1 | 334 + man/pidof.1 | 82 + man/pidwait.1 | 1 + man/pkill.1 | 1 + man/pmap.1 | 100 + man/procps.3 | 185 + man/procps_misc.3 | 156 + man/procps_pids.3 | 210 + man/ps.1 | 2124 ++++ man/pwdx.1 | 40 + man/skill.1 | 128 + man/slabtop.1 | 123 + man/snice.1 | 1 + man/sysctl.8 | 196 + man/sysctl.conf.5 | 92 + man/tload.1 | 69 + man/top.1 | 2810 ++++ man/uptime.1 | 74 + man/vmstat.8 | 202 + man/w.1 | 115 + man/watch.1 | 232 + missing | 215 + mkinstalldirs | 111 + po-man/Makefile.am | 101 + po-man/Makefile.in | 575 + po-man/de.po | 16179 +++++++++++++++++++++++ po-man/de/free.1 | 170 + po-man/de/kill.1 | 94 + po-man/de/pgrep.1 | 263 + po-man/de/pidof.1 | 76 + po-man/de/pmap.1 | 99 + po-man/de/ps.1 | 1660 +++ po-man/de/pwdx.1 | 42 + po-man/de/skill.1 | 119 + po-man/de/slabtop.1 | 113 + po-man/de/sysctl.8 | 181 + po-man/de/sysctl.conf.5 | 89 + po-man/de/tload.1 | 62 + po-man/de/uptime.1 | 79 + po-man/de/vmstat.8 | 191 + po-man/de/w.1 | 107 + po-man/de/watch.1 | 213 + po-man/fr.po | 21039 ++++++++++++++++++++++++++++++ po-man/fr/free.1 | 170 + po-man/fr/kill.1 | 91 + po-man/fr/pmap.1 | 96 + po-man/fr/ps.1 | 1938 +++ po-man/fr/pwdx.1 | 37 + po-man/fr/skill.1 | 116 + po-man/fr/slabtop.1 | 108 + po-man/fr/sysctl.8 | 171 + po-man/fr/sysctl.conf.5 | 86 + po-man/fr/tload.1 | 54 + po-man/fr/uptime.1 | 68 + po-man/fr/vmstat.8 | 185 + po-man/fr/w.1 | 105 + po-man/fr/watch.1 | 198 + po-man/man.stamp | 0 po-man/pl.po | 17397 +++++++++++++++++++++++++ po-man/pl/free.1 | 164 + po-man/pl/pgrep.1 | 256 + po-man/pl/pmap.1 | 97 + po-man/pl/procps.3 | 175 + po-man/pl/procps_misc.3 | 151 + po-man/pl/procps_pids.3 | 201 + po-man/pl/uptime.1 | 74 + po-man/pl/vmstat.8 | 186 + po-man/po4a.cfg | 64 + po-man/procps-man.pot | 16211 ++++++++++++++++++++++++ po-man/pt_BR.po | 17397 +++++++++++++++++++++++++ po-man/pt_BR/free.1 | 166 + po-man/pt_BR/kill.1 | 91 + po-man/pt_BR/pmap.1 | 96 + po-man/pt_BR/pwdx.1 | 42 + po-man/pt_BR/skill.1 | 116 + po-man/pt_BR/slabtop.1 | 110 + po-man/pt_BR/sysctl.8 | 177 + po-man/pt_BR/sysctl.conf.5 | 89 + po-man/pt_BR/tload.1 | 60 + po-man/pt_BR/uptime.1 | 75 + po-man/pt_BR/vmstat.8 | 184 + po-man/pt_BR/w.1 | 104 + po-man/pt_BR/watch.1 | 201 + po-man/ro.po | 16914 +++++++++++++++++++++++++ po-man/ro/free.1 | 177 + po-man/ro/kill.1 | 94 + po-man/ro/pgrep.1 | 260 + po-man/ro/pidof.1 | 77 + po-man/ro/pmap.1 | 98 + po-man/ro/procps.3 | 183 + po-man/ro/procps_misc.3 | 157 + po-man/ro/procps_pids.3 | 208 + po-man/ro/ps.1 | 1831 +++ po-man/ro/pwdx.1 | 42 + po-man/ro/skill.1 | 116 + po-man/ro/slabtop.1 | 116 + po-man/ro/sysctl.8 | 182 + po-man/ro/sysctl.conf.5 | 90 + po-man/ro/tload.1 | 62 + po-man/ro/top.1 | 2957 +++++ po-man/ro/uptime.1 | 76 + po-man/ro/vmstat.8 | 188 + po-man/ro/w.1 | 103 + po-man/ro/watch.1 | 206 + po-man/sv.po | 15049 ++++++++++++++++++++++ po-man/sv/free.1 | 170 + po-man/sv/kill.1 | 95 + po-man/sv/pgrep.1 | 251 + po-man/sv/pidof.1 | 72 + po-man/sv/pmap.1 | 99 + po-man/sv/procps.3 | 176 + po-man/sv/procps_misc.3 | 153 + po-man/sv/procps_pids.3 | 199 + po-man/sv/ps.1 | 1854 +++ po-man/sv/pwdx.1 | 45 + po-man/sv/skill.1 | 119 + po-man/sv/slabtop.1 | 113 + po-man/sv/sysctl.8 | 180 + po-man/sv/sysctl.conf.5 | 92 + po-man/sv/tload.1 | 63 + po-man/sv/top.1 | 2752 ++++ po-man/sv/uptime.1 | 75 + po-man/sv/vmstat.8 | 185 + po-man/sv/w.1 | 108 + po-man/sv/watch.1 | 201 + po-man/uk.po | 16724 ++++++++++++++++++++++++ po-man/uk/free.1 | 170 + po-man/uk/kill.1 | 94 + po-man/uk/pgrep.1 | 266 + po-man/uk/pidof.1 | 78 + po-man/uk/pmap.1 | 97 + po-man/uk/procps.3 | 179 + po-man/uk/procps_misc.3 | 155 + po-man/uk/procps_pids.3 | 204 + po-man/uk/ps.1 | 1655 +++ po-man/uk/pwdx.1 | 41 + po-man/uk/skill.1 | 118 + po-man/uk/slabtop.1 | 117 + po-man/uk/sysctl.8 | 182 + po-man/uk/sysctl.conf.5 | 90 + po-man/uk/tload.1 | 62 + po-man/uk/top.1 | 2878 +++++ po-man/uk/uptime.1 | 76 + po-man/uk/vmstat.8 | 189 + po-man/uk/w.1 | 111 + po-man/uk/watch.1 | 207 + po-man/zh_CN.po | 16178 +++++++++++++++++++++++ po/ChangeLog | 5 + po/Makefile.in.in | 367 + po/Makevars | 41 + po/POTFILES.in | 59 + po/Rules-quot | 47 + po/boldquot.sed | 10 + po/de.gmo | Bin 0 -> 78634 bytes po/de.po | 4917 +++++++ po/en@boldquot.header | 25 + po/en@quot.header | 22 + po/es.gmo | Bin 0 -> 98460 bytes po/es.po | 5197 ++++++++ po/fr.gmo | Bin 0 -> 101461 bytes po/fr.po | 5121 ++++++++ po/insert-header.sin | 23 + po/ka.gmo | Bin 0 -> 51544 bytes po/ka.po | 4631 +++++++ po/ko.gmo | Bin 0 -> 102426 bytes po/ko.po | 4846 +++++++ po/pl.gmo | Bin 0 -> 99983 bytes po/pl.po | 4889 +++++++ po/procps-ng.pot | 4456 +++++++ po/pt_BR.gmo | Bin 0 -> 78613 bytes po/pt_BR.po | 5139 ++++++++ po/quot.sed | 6 + po/remove-potcdate.sin | 19 + po/ro.gmo | Bin 0 -> 105584 bytes po/ro.po | 5348 ++++++++ po/stamp-po | 1 + po/sv.gmo | Bin 0 -> 97284 bytes po/sv.po | 4871 +++++++ po/uk.gmo | Bin 0 -> 128374 bytes po/uk.po | 5095 ++++++++ po/vi.gmo | Bin 0 -> 73989 bytes po/vi.po | 5067 ++++++++ po/zh_CN.gmo | Bin 0 -> 12985 bytes po/zh_CN.po | 4918 +++++++ src/free.c | 479 + src/kill.c | 167 + src/pgrep.c | 1212 ++ src/pidof.c | 420 + src/pmap.c | 1217 ++ src/ps/HACKING | 46 + src/ps/common.h | 512 + src/ps/display.c | 681 + src/ps/global.c | 651 + src/ps/help.c | 223 + src/ps/output.c | 2370 ++++ src/ps/parser.c | 1268 ++ src/ps/regression | 26 + src/ps/select.c | 162 + src/ps/signames.c | 170 + src/ps/sortformat.c | 949 ++ src/ps/stacktrace.c | 191 + src/pwdx.c | 153 + src/skill.c | 600 + src/slabtop.c | 388 + src/sysctl.c | 1070 ++ src/tests/test_fileutils.c | 10 + src/tests/test_process.c | 115 + src/tests/test_shm.c | 69 + src/tests/test_strtod_nol.c | 51 + src/tests/test_strutils.c | 38 + src/tload.c | 232 + src/top/top.c | 7404 +++++++++++ src/top/top.h | 792 ++ src/top/top_nls.c | 867 ++ src/top/top_nls.h | 108 + src/uptime.c | 127 + src/vmstat.c | 1092 ++ src/w.c | 896 ++ src/watch.c | 1045 ++ sysctl.conf | 64 + test-driver | 153 + testsuite/Makefile.am | 63 + testsuite/Makefile.in | 733 ++ testsuite/README | 33 + testsuite/config/unix.exp | 244 + testsuite/free.test/free.exp | 61 + testsuite/kill.test/kill.exp | 65 + testsuite/lib.test/fileutils.exp | 19 + testsuite/lib.test/fileutils_badfd.sh | 3 + testsuite/lib.test/fileutils_full.sh | 3 + testsuite/lib.test/strutils.exp | 25 + testsuite/pgrep.test/pgrep.exp | 131 + testsuite/pkill.test/pkill.exp | 51 + testsuite/pmap.test/pmap.exp | 106 + testsuite/ps.test/ps_output.exp | 63 + testsuite/ps.test/ps_personality.exp | 18 + testsuite/ps.test/ps_sched_batch.exp | 11 + testsuite/ps.test/test-schedbatch.c | 46 + testsuite/pwdx.test/pwdx.exp | 22 + testsuite/slabtop.test/slabtop.exp | 45 + testsuite/sysctl.test/sysctl_read.exp | 29 + testsuite/uptime.test/uptime.exp | 17 + testsuite/vmstat.test/vmstat.exp | 57 + testsuite/w.test/w.exp | 59 + 344 files changed, 360593 insertions(+) create mode 100644 .tarball-version create mode 100644 .version create mode 100644 ABOUT-NLS create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 COPYING.LIB create mode 100644 ChangeLog create mode 100644 INSTALL.md create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 README.md create mode 100644 aclocal.m4 create mode 100755 autogen.sh create mode 100755 compile create mode 100755 config.guess create mode 100644 config.h.in create mode 100755 config.rpath create mode 100755 config.sub create mode 100755 configure create mode 100644 configure.ac create mode 100755 depcomp create mode 100644 doc/CodingStyle.md create mode 100644 doc/FAQ create mode 100644 doc/TODO create mode 100644 doc/bugs.md create mode 100644 doc/libproc.supp create mode 100755 install-sh create mode 100644 library/devname.c create mode 100644 library/diskstats.c create mode 100644 library/escape.c create mode 100644 library/include/devname.h create mode 100644 library/include/diskstats.h create mode 100644 library/include/escape.h create mode 100644 library/include/meminfo.h create mode 100644 library/include/misc.h create mode 100644 library/include/numa.h create mode 100644 library/include/pids.h create mode 100644 library/include/procps-private.h create mode 100644 library/include/pwcache.h create mode 100644 library/include/readproc.h create mode 100644 library/include/slabinfo.h create mode 100644 library/include/stat.h create mode 100644 library/include/vmstat.h create mode 100644 library/include/wchan.h create mode 100644 library/include/xtra-procps-debug.h create mode 100644 library/libproc2.pc.in create mode 100644 library/libproc2.sym create mode 100644 library/meminfo.c create mode 100644 library/namespace.c create mode 100644 library/numa.c create mode 100644 library/pids.c create mode 100644 library/pwcache.c create mode 100644 library/readproc.c create mode 100644 library/slabinfo.c create mode 100644 library/stat.c create mode 100644 library/sysinfo.c create mode 100644 library/tests/test_Itemtables.c create mode 100644 library/tests/test_namespace.c create mode 100644 library/tests/test_pids.c create mode 100644 library/tests/test_sysinfo.c create mode 100644 library/tests/test_uptime.c create mode 100644 library/tests/test_version.c create mode 100644 library/uptime.c create mode 100644 library/version.c create mode 100644 library/vmstat.c create mode 100644 library/wchan.c create mode 100644 local/Makefile.am create mode 100644 local/Makefile.in create mode 100644 local/c.h create mode 100644 local/fileutils.c create mode 100644 local/fileutils.h create mode 100755 local/git-version-gen create mode 100644 local/nls.h create mode 100644 local/procio.c create mode 100644 local/procio.h create mode 100644 local/rpmatch.h create mode 100644 local/signals.c create mode 100644 local/signals.h create mode 100644 local/strutils.c create mode 100644 local/strutils.h create mode 100644 local/strverscmp.c create mode 100644 local/tests.h create mode 100644 local/xalloc.h create mode 100755 ltmain.sh create mode 100644 m4/gettext.m4 create mode 100644 m4/iconv.m4 create mode 100644 m4/lib-ld.m4 create mode 100644 m4/lib-link.m4 create mode 100644 m4/lib-prefix.m4 create mode 100644 m4/libtool.m4 create mode 100644 m4/ltoptions.m4 create mode 100644 m4/ltsugar.m4 create mode 100644 m4/ltversion.m4 create mode 100644 m4/lt~obsolete.m4 create mode 100644 m4/nls.m4 create mode 100644 m4/po.m4 create mode 100644 m4/progtest.m4 create mode 100644 man/free.1 create mode 100644 man/kill.1 create mode 100644 man/pgrep.1 create mode 100644 man/pidof.1 create mode 100644 man/pidwait.1 create mode 100644 man/pkill.1 create mode 100644 man/pmap.1 create mode 100644 man/procps.3 create mode 100644 man/procps_misc.3 create mode 100644 man/procps_pids.3 create mode 100644 man/ps.1 create mode 100644 man/pwdx.1 create mode 100644 man/skill.1 create mode 100644 man/slabtop.1 create mode 100644 man/snice.1 create mode 100644 man/sysctl.8 create mode 100644 man/sysctl.conf.5 create mode 100644 man/tload.1 create mode 100644 man/top.1 create mode 100644 man/uptime.1 create mode 100644 man/vmstat.8 create mode 100644 man/w.1 create mode 100644 man/watch.1 create mode 100755 missing create mode 100755 mkinstalldirs create mode 100644 po-man/Makefile.am create mode 100644 po-man/Makefile.in create mode 100644 po-man/de.po create mode 100644 po-man/de/free.1 create mode 100644 po-man/de/kill.1 create mode 100644 po-man/de/pgrep.1 create mode 100644 po-man/de/pidof.1 create mode 100644 po-man/de/pmap.1 create mode 100644 po-man/de/ps.1 create mode 100644 po-man/de/pwdx.1 create mode 100644 po-man/de/skill.1 create mode 100644 po-man/de/slabtop.1 create mode 100644 po-man/de/sysctl.8 create mode 100644 po-man/de/sysctl.conf.5 create mode 100644 po-man/de/tload.1 create mode 100644 po-man/de/uptime.1 create mode 100644 po-man/de/vmstat.8 create mode 100644 po-man/de/w.1 create mode 100644 po-man/de/watch.1 create mode 100644 po-man/fr.po create mode 100644 po-man/fr/free.1 create mode 100644 po-man/fr/kill.1 create mode 100644 po-man/fr/pmap.1 create mode 100644 po-man/fr/ps.1 create mode 100644 po-man/fr/pwdx.1 create mode 100644 po-man/fr/skill.1 create mode 100644 po-man/fr/slabtop.1 create mode 100644 po-man/fr/sysctl.8 create mode 100644 po-man/fr/sysctl.conf.5 create mode 100644 po-man/fr/tload.1 create mode 100644 po-man/fr/uptime.1 create mode 100644 po-man/fr/vmstat.8 create mode 100644 po-man/fr/w.1 create mode 100644 po-man/fr/watch.1 create mode 100644 po-man/man.stamp create mode 100644 po-man/pl.po create mode 100644 po-man/pl/free.1 create mode 100644 po-man/pl/pgrep.1 create mode 100644 po-man/pl/pmap.1 create mode 100644 po-man/pl/procps.3 create mode 100644 po-man/pl/procps_misc.3 create mode 100644 po-man/pl/procps_pids.3 create mode 100644 po-man/pl/uptime.1 create mode 100644 po-man/pl/vmstat.8 create mode 100644 po-man/po4a.cfg create mode 100644 po-man/procps-man.pot create mode 100644 po-man/pt_BR.po create mode 100644 po-man/pt_BR/free.1 create mode 100644 po-man/pt_BR/kill.1 create mode 100644 po-man/pt_BR/pmap.1 create mode 100644 po-man/pt_BR/pwdx.1 create mode 100644 po-man/pt_BR/skill.1 create mode 100644 po-man/pt_BR/slabtop.1 create mode 100644 po-man/pt_BR/sysctl.8 create mode 100644 po-man/pt_BR/sysctl.conf.5 create mode 100644 po-man/pt_BR/tload.1 create mode 100644 po-man/pt_BR/uptime.1 create mode 100644 po-man/pt_BR/vmstat.8 create mode 100644 po-man/pt_BR/w.1 create mode 100644 po-man/pt_BR/watch.1 create mode 100644 po-man/ro.po create mode 100644 po-man/ro/free.1 create mode 100644 po-man/ro/kill.1 create mode 100644 po-man/ro/pgrep.1 create mode 100644 po-man/ro/pidof.1 create mode 100644 po-man/ro/pmap.1 create mode 100644 po-man/ro/procps.3 create mode 100644 po-man/ro/procps_misc.3 create mode 100644 po-man/ro/procps_pids.3 create mode 100644 po-man/ro/ps.1 create mode 100644 po-man/ro/pwdx.1 create mode 100644 po-man/ro/skill.1 create mode 100644 po-man/ro/slabtop.1 create mode 100644 po-man/ro/sysctl.8 create mode 100644 po-man/ro/sysctl.conf.5 create mode 100644 po-man/ro/tload.1 create mode 100644 po-man/ro/top.1 create mode 100644 po-man/ro/uptime.1 create mode 100644 po-man/ro/vmstat.8 create mode 100644 po-man/ro/w.1 create mode 100644 po-man/ro/watch.1 create mode 100644 po-man/sv.po create mode 100644 po-man/sv/free.1 create mode 100644 po-man/sv/kill.1 create mode 100644 po-man/sv/pgrep.1 create mode 100644 po-man/sv/pidof.1 create mode 100644 po-man/sv/pmap.1 create mode 100644 po-man/sv/procps.3 create mode 100644 po-man/sv/procps_misc.3 create mode 100644 po-man/sv/procps_pids.3 create mode 100644 po-man/sv/ps.1 create mode 100644 po-man/sv/pwdx.1 create mode 100644 po-man/sv/skill.1 create mode 100644 po-man/sv/slabtop.1 create mode 100644 po-man/sv/sysctl.8 create mode 100644 po-man/sv/sysctl.conf.5 create mode 100644 po-man/sv/tload.1 create mode 100644 po-man/sv/top.1 create mode 100644 po-man/sv/uptime.1 create mode 100644 po-man/sv/vmstat.8 create mode 100644 po-man/sv/w.1 create mode 100644 po-man/sv/watch.1 create mode 100644 po-man/uk.po create mode 100644 po-man/uk/free.1 create mode 100644 po-man/uk/kill.1 create mode 100644 po-man/uk/pgrep.1 create mode 100644 po-man/uk/pidof.1 create mode 100644 po-man/uk/pmap.1 create mode 100644 po-man/uk/procps.3 create mode 100644 po-man/uk/procps_misc.3 create mode 100644 po-man/uk/procps_pids.3 create mode 100644 po-man/uk/ps.1 create mode 100644 po-man/uk/pwdx.1 create mode 100644 po-man/uk/skill.1 create mode 100644 po-man/uk/slabtop.1 create mode 100644 po-man/uk/sysctl.8 create mode 100644 po-man/uk/sysctl.conf.5 create mode 100644 po-man/uk/tload.1 create mode 100644 po-man/uk/top.1 create mode 100644 po-man/uk/uptime.1 create mode 100644 po-man/uk/vmstat.8 create mode 100644 po-man/uk/w.1 create mode 100644 po-man/uk/watch.1 create mode 100644 po-man/zh_CN.po create mode 100644 po/ChangeLog create mode 100644 po/Makefile.in.in create mode 100644 po/Makevars create mode 100644 po/POTFILES.in create mode 100644 po/Rules-quot create mode 100644 po/boldquot.sed create mode 100644 po/de.gmo create mode 100644 po/de.po create mode 100644 po/en@boldquot.header create mode 100644 po/en@quot.header create mode 100644 po/es.gmo create mode 100644 po/es.po create mode 100644 po/fr.gmo create mode 100644 po/fr.po create mode 100644 po/insert-header.sin create mode 100644 po/ka.gmo create mode 100644 po/ka.po create mode 100644 po/ko.gmo create mode 100644 po/ko.po create mode 100644 po/pl.gmo create mode 100644 po/pl.po create mode 100644 po/procps-ng.pot create mode 100644 po/pt_BR.gmo create mode 100644 po/pt_BR.po create mode 100644 po/quot.sed create mode 100644 po/remove-potcdate.sin create mode 100644 po/ro.gmo create mode 100644 po/ro.po create mode 100644 po/stamp-po create mode 100644 po/sv.gmo create mode 100644 po/sv.po create mode 100644 po/uk.gmo create mode 100644 po/uk.po create mode 100644 po/vi.gmo create mode 100644 po/vi.po create mode 100644 po/zh_CN.gmo create mode 100644 po/zh_CN.po create mode 100644 src/free.c create mode 100644 src/kill.c create mode 100644 src/pgrep.c create mode 100644 src/pidof.c create mode 100644 src/pmap.c create mode 100644 src/ps/HACKING create mode 100644 src/ps/common.h create mode 100644 src/ps/display.c create mode 100644 src/ps/global.c create mode 100644 src/ps/help.c create mode 100644 src/ps/output.c create mode 100644 src/ps/parser.c create mode 100644 src/ps/regression create mode 100644 src/ps/select.c create mode 100644 src/ps/signames.c create mode 100644 src/ps/sortformat.c create mode 100644 src/ps/stacktrace.c create mode 100644 src/pwdx.c create mode 100644 src/skill.c create mode 100644 src/slabtop.c create mode 100644 src/sysctl.c create mode 100644 src/tests/test_fileutils.c create mode 100644 src/tests/test_process.c create mode 100644 src/tests/test_shm.c create mode 100644 src/tests/test_strtod_nol.c create mode 100644 src/tests/test_strutils.c create mode 100644 src/tload.c create mode 100644 src/top/top.c create mode 100644 src/top/top.h create mode 100644 src/top/top_nls.c create mode 100644 src/top/top_nls.h create mode 100644 src/uptime.c create mode 100644 src/vmstat.c create mode 100644 src/w.c create mode 100644 src/watch.c create mode 100644 sysctl.conf create mode 100755 test-driver create mode 100644 testsuite/Makefile.am create mode 100644 testsuite/Makefile.in create mode 100644 testsuite/README create mode 100644 testsuite/config/unix.exp create mode 100644 testsuite/free.test/free.exp create mode 100644 testsuite/kill.test/kill.exp create mode 100644 testsuite/lib.test/fileutils.exp create mode 100755 testsuite/lib.test/fileutils_badfd.sh create mode 100755 testsuite/lib.test/fileutils_full.sh create mode 100644 testsuite/lib.test/strutils.exp create mode 100644 testsuite/pgrep.test/pgrep.exp create mode 100644 testsuite/pkill.test/pkill.exp create mode 100644 testsuite/pmap.test/pmap.exp create mode 100644 testsuite/ps.test/ps_output.exp create mode 100644 testsuite/ps.test/ps_personality.exp create mode 100644 testsuite/ps.test/ps_sched_batch.exp create mode 100644 testsuite/ps.test/test-schedbatch.c create mode 100644 testsuite/pwdx.test/pwdx.exp create mode 100644 testsuite/slabtop.test/slabtop.exp create mode 100644 testsuite/sysctl.test/sysctl_read.exp create mode 100644 testsuite/uptime.test/uptime.exp create mode 100644 testsuite/vmstat.test/vmstat.exp create mode 100644 testsuite/w.test/w.exp diff --git a/.tarball-version b/.tarball-version new file mode 100644 index 0000000..c5106e6 --- /dev/null +++ b/.tarball-version @@ -0,0 +1 @@ +4.0.4 diff --git a/.version b/.version new file mode 100644 index 0000000..c5106e6 --- /dev/null +++ b/.version @@ -0,0 +1 @@ +4.0.4 diff --git a/ABOUT-NLS b/ABOUT-NLS new file mode 100644 index 0000000..2f50c66 --- /dev/null +++ b/ABOUT-NLS @@ -0,0 +1,768 @@ +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 will gradually become able to speak many languages. +A few packages already provide translations for their messages. + + If you found this `ABOUT-NLS' file inside a distribution, you may +assume that the distributed package does use GNU `gettext' internally, +itself available at your nearest GNU archive site. But you do _not_ +need to install GNU `gettext' prior to configuring, installing or using +this package with messages translated. + + Installers will find here some useful hints. These notes also +explain how users should proceed for getting the programs to use the +available translations. They tell how people wanting to contribute and +work at translations should contact the appropriate team. + + When reporting bugs in the `intl/' directory or bugs which may be +related to internationalization, you should tell about the version of +`gettext' which is used. The information can be found in the +`intl/VERSION' file, in internationalized packages. + +Quick configuration advice +========================== + +If you want to exploit the full power of internationalization, you +should configure it using + + ./configure --with-included-gettext + +to force usage of internationalizing routines provided within this +package, despite the existence of internationalizing capabilities in the +operating system where this package is being installed. So far, only +the `gettext' implementation in the GNU C library version 2 provides as +many features (such as locale alias, message inheritance, automatic +charset conversion or plural form handling) as the implementation here. +It is also not possible to offer this additional functionality on top +of a `catgets' implementation. Future versions of GNU `gettext' will +very likely convey even more functionality. So it might be a good idea +to change to GNU `gettext' as soon as possible. + + So you need _not_ provide this option if you are using GNU libc 2 or +you have installed a recent copy of the GNU gettext package with the +included `libintl'. + +INSTALL Matters +=============== + +Some packages are "localizable" when properly installed; the programs +they contain can be made to speak your own native language. Most such +packages use GNU `gettext'. Other packages have their own ways to +internationalization, predating GNU `gettext'. + + By default, this package will be installed to allow translation of +messages. It will automatically detect whether the system already +provides the GNU `gettext' functions. If not, the GNU `gettext' own +library will be used. This library is wholly contained within this +package, usually in the `intl/' subdirectory, so prior installation of +the GNU `gettext' package is _not_ required. Installers may use +special options at configuration time for changing the default +behaviour. The commands: + + ./configure --with-included-gettext + ./configure --disable-nls + +will respectively bypass any pre-existing `gettext' to use the +internationalizing routines provided within this package, or else, +_totally_ disable translation of messages. + + When you already have GNU `gettext' installed on your system and run +configure without an option for your new package, `configure' will +probably detect the previously built and installed `libintl.a' file and +will decide to use this. This might be not what is desirable. You +should use the more recent version of the GNU `gettext' library. I.e. +if the file `intl/VERSION' shows that the library which comes with this +package is more recent, you should use + + ./configure --with-included-gettext + +to prevent auto-detection. + + The configuration process will not test for the `catgets' function +and therefore it will not be used. The reason is that even an +emulation of `gettext' on top of `catgets' could not provide all the +extensions of the GNU `gettext' library. + + Internationalized packages have usually many `po/LL.po' files, where +LL gives an ISO 639 two-letter code identifying the language. Unless +translations have been forbidden at `configure' time by using the +`--disable-nls' switch, all available translations are installed +together with the package. However, the environment variable `LINGUAS' +may be set, prior to configuration, to limit the installed set. +`LINGUAS' should then contain a space separated list of two-letter +codes, stating which languages are allowed. + +Using This Package +================== + +As a user, if your language has been installed for this package, you +only have to set the `LANG' environment variable to the appropriate +`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, +and `CC' is an ISO 3166 two-letter country code. For example, let's +suppose that you speak German and live in Germany. At the shell +prompt, merely execute `setenv LANG de_DE' (in `csh'), +`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). +This can be done from your `.login' or `.profile' file, once and for +all. + + You might think that the country code specification is redundant. +But in fact, some languages have dialects in different countries. For +example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The +country code serves to distinguish the dialects. + + The locale naming convention of `LL_CC', with `LL' denoting the +language and `CC' denoting the country, is the one use on systems based +on GNU libc. On other systems, some variations of this scheme are +used, such as `LL' or `LL_CC.ENCODING'. You can get the list of +locales supported by your system for your country by running the command +`locale -a | grep '^LL''. + + Not all programs have translations for all languages. By default, an +English message is shown in place of a nonexistent translation. If you +understand other languages, you can set up a priority list of languages. +This is done through a different environment variable, called +`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' +for the purpose of message handling, but you still need to have `LANG' +set to the primary language; this is required by other parts of the +system libraries. For example, some Swedish users who would rather +read translations in German than English for when Swedish is not +available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + + 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. + +Translating Teams +================= + +For the Free Translation Project to be a success, we need interested +people who like their own language and write it well, and who are also +able to synergize with other translators speaking the same language. +Each translation team has its own mailing list. The up-to-date list of +teams can be found at the Free Translation Project's homepage, +`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" +area. + + If you'd like to volunteer to _work_ at translating messages, you +should become a member of the translating team for your own language. +The subscribing address is _not_ the same as the list itself, it has +`-request' appended. For example, speakers of Swedish can send a +message to `sv-request@li.org', having this message body: + + subscribe + + Keep in mind that team members are expected to participate +_actively_ in translations, or at solving translational difficulties, +rather than merely lurking around. If your team does not exist yet and +you want to start one, or if you are unsure about what to do or how to +get started, please write to `translation@iro.umontreal.ca' to reach the +coordinator for all translator teams. + + The English team is special. It works at improving and uniformizing +the terminology in use. Proven linguistic skill are praised more than +programming skill, here. + +Available Packages +================== + +Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of January +2004. 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 ar az be bg bs ca cs da de el en en_GB eo es + +----------------------------------------------------+ + a2ps | [] [] [] [] | + aegis | () | + ant-phone | () | + anubis | | + ap-utils | | + aspell | [] | + bash | [] [] [] [] | + batchelor | | + bfd | [] [] | + binutils | [] [] | + bison | [] [] [] | + bluez-pin | [] [] [] | + clisp | | + clisp | [] [] [] | + console-tools | [] [] | + coreutils | [] [] [] [] | + cpio | [] [] [] | + darkstat | [] () [] | + diffutils | [] [] [] [] [] [] [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] [] | + error | [] [] [] [] [] | + fetchmail | [] () [] [] [] [] | + fileutils | [] [] [] | + findutils | [] [] [] [] [] [] [] | + flex | [] [] [] [] | + fslint | | + gas | [] | + gawk | [] [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] [] | + gettext | [] [] [] [] [] | + gettext-examples | [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] [] | + gimp-print | [] [] [] [] [] | + gliv | | + glunarclock | [] [] | + gnubiff | [] | + gnucash | [] () [] [] | + gnucash-glossary | [] () [] | + gnupg | [] () [] [] [] [] | + gpe-aerial | [] | + gpe-beam | [] [] | + gpe-calendar | [] [] | + gpe-clock | [] [] | + gpe-conf | [] [] | + gpe-contacts | [] [] | + gpe-edit | [] | + gpe-go | [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] | + gpe-taskmanager | [] [] | + gpe-timesheet | [] | + gpe-today | [] [] | + gpe-todo | [] [] | + gphoto2 | [] [] [] [] | + gprof | [] [] [] | + gpsdrive | () () () | + gramadoir | [] | + grep | [] [] [] [] [] [] | + gretl | [] | + gtick | [] () | + hello | [] [] [] [] [] [] | + id-utils | [] [] | + indent | [] [] [] [] | + iso_3166 | [] [] [] [] [] [] [] [] [] [] | + iso_3166_1 | [] [] [] [] [] [] | + iso_3166_2 | | + iso_3166_3 | [] | + iso_4217 | [] [] [] [] | + iso_639 | | + jpilot | [] [] [] | + jtag | | + jwhois | [] | + kbd | [] [] [] [] [] | + latrine | () | + ld | [] [] | + libc | [] [] [] [] [] [] | + libgpewidget | [] [] | + libiconv | [] [] [] [] [] | + lifelines | [] () | + lilypond | [] | + lingoteach | | + lingoteach_lessons | () () | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | [] [] | + make | [] [] [] | + man-db | [] () [] [] () | + minicom | [] [] [] | + mysecretdiary | [] [] [] | + nano | [] () [] [] [] | + nano_1_0 | [] () [] [] [] | + opcodes | [] | + parted | [] [] [] [] [] | + ptx | [] [] [] [] [] | + python | | + radius | [] | + recode | [] [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] [] [] [] | + sed | [] [] [] [] [] [] | + sh-utils | [] [] [] | + shared-mime-info | | + sharutils | [] [] [] [] [] [] | + silky | () | + skencil | [] () [] | + sketch | [] () [] | + soundtracker | [] [] [] | + sp | [] | + tar | [] [] [] [] | + texinfo | [] [] [] | + textutils | [] [] [] [] | + tin | () () | + tp-robot | | + tuxpaint | [] [] [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] [] [] | + vorbis-tools | [] [] [] [] | + wastesedge | () | + wdiff | [] [] [] [] | + wget | [] [] [] [] [] [] | + xchat | [] [] [] [] | + xfree86_xkb_xml | [] [] | + xpad | [] | + +----------------------------------------------------+ + af am ar az be bg bs ca cs da de el en en_GB eo es + 4 0 0 1 9 4 1 40 41 60 78 17 1 5 13 68 + + et eu fa fi fr ga gl he hr hu id is it ja ko lg + +-------------------------------------------------+ + a2ps | [] [] [] () () | + aegis | | + ant-phone | [] | + anubis | [] | + ap-utils | [] | + aspell | [] [] | + bash | [] [] | + batchelor | [] [] | + bfd | [] | + binutils | [] [] | + bison | [] [] [] [] | + bluez-pin | [] [] [] [] [] | + clisp | | + clisp | [] | + console-tools | | + coreutils | [] [] [] [] [] [] | + cpio | [] [] [] [] | + darkstat | () [] [] [] | + diffutils | [] [] [] [] [] [] [] | + e2fsprogs | | + enscript | [] [] | + error | [] [] [] [] | + fetchmail | [] | + fileutils | [] [] [] [] [] [] | + findutils | [] [] [] [] [] [] [] [] [] [] [] | + flex | [] [] [] | + fslint | [] | + gas | [] | + gawk | [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] | + gettext | [] [] [] | + gettext-examples | [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] [] | + gimp-print | [] [] | + gliv | () | + glunarclock | [] [] [] [] | + gnubiff | [] | + gnucash | () [] | + gnucash-glossary | [] | + gnupg | [] [] [] [] [] [] [] | + gpe-aerial | [] | + gpe-beam | [] | + gpe-calendar | [] [] [] | + gpe-clock | [] | + gpe-conf | [] | + gpe-contacts | [] [] | + gpe-edit | [] [] | + gpe-go | [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] [] | + gpe-sketchbook | [] | + gpe-su | [] | + gpe-taskmanager | [] | + gpe-timesheet | [] [] [] | + gpe-today | [] [] | + gpe-todo | [] [] | + gphoto2 | [] [] [] | + gprof | [] [] | + gpsdrive | () () () | + gramadoir | [] [] | + grep | [] [] [] [] [] [] [] [] [] [] [] | + gretl | [] [] | + gtick | [] [] [] | + hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] | + indent | [] [] [] [] [] [] [] [] [] | + iso_3166 | [] [] [] [] [] [] [] | + iso_3166_1 | [] [] [] [] [] | + iso_3166_2 | | + iso_3166_3 | | + iso_4217 | [] [] [] [] [] [] | + iso_639 | | + jpilot | [] () | + jtag | [] | + jwhois | [] [] [] [] | + kbd | [] | + latrine | [] | + ld | [] | + libc | [] [] [] [] [] [] | + libgpewidget | [] [] [] [] | + libiconv | [] [] [] [] [] [] [] [] [] | + lifelines | () | + lilypond | [] | + lingoteach | [] [] | + lingoteach_lessons | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | | + make | [] [] [] [] [] [] | + man-db | () () | + minicom | [] [] [] [] | + mysecretdiary | [] [] | + nano | [] [] [] [] | + nano_1_0 | [] [] [] [] | + opcodes | [] | + parted | [] [] [] | + ptx | [] [] [] [] [] [] [] | + python | | + radius | [] | + recode | [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] | + sed | [] [] [] [] [] [] [] [] [] | + sh-utils | [] [] [] [] [] [] [] | + shared-mime-info | [] [] [] | + sharutils | [] [] [] [] [] | + silky | () [] () () | + skencil | [] | + sketch | [] | + soundtracker | [] [] | + sp | [] () | + tar | [] [] [] [] [] [] [] [] [] | + texinfo | [] [] [] [] | + textutils | [] [] [] [] [] [] | + tin | [] () | + tp-robot | [] | + tuxpaint | [] [] [] [] [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | [] [] | + util-linux | [] [] [] [] () [] | + vorbis-tools | [] | + wastesedge | () | + wdiff | [] [] [] [] [] [] | + wget | [] [] [] [] [] [] [] | + xchat | [] [] [] | + xfree86_xkb_xml | [] [] | + xpad | [] [] | + +-------------------------------------------------+ + et eu fa fi fr ga gl he hr hu id is it ja ko lg + 22 2 1 26 106 28 24 8 10 41 33 1 26 33 12 0 + + lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru + +-----------------------------------------------------+ + a2ps | [] [] () () [] [] [] | + aegis | () () () | + ant-phone | [] [] | + anubis | [] [] [] [] [] [] | + ap-utils | [] () [] | + aspell | [] | + bash | [] [] [] | + batchelor | [] | + bfd | [] | + binutils | [] | + bison | [] [] [] [] [] | + bluez-pin | [] [] [] | + clisp | | + clisp | [] | + console-tools | [] | + coreutils | [] [] | + cpio | [] [] [] [] [] | + darkstat | [] [] [] [] | + diffutils | [] [] [] [] [] [] | + e2fsprogs | [] | + enscript | [] [] [] [] | + error | [] [] [] | + fetchmail | [] [] () [] | + fileutils | [] [] [] | + findutils | [] [] [] [] [] | + flex | [] [] [] [] | + fslint | [] [] | + gas | | + gawk | [] [] [] | + gbiff | [] [] | + gcal | | + gcc | | + gettext | [] [] [] | + gettext-examples | [] [] [] | + gettext-runtime | [] [] [] [] | + gettext-tools | [] [] | + gimp-print | [] | + gliv | [] [] [] | + glunarclock | [] [] [] [] | + gnubiff | [] | + gnucash | [] [] () [] | + gnucash-glossary | [] [] | + gnupg | [] | + gpe-aerial | [] [] [] [] | + gpe-beam | [] [] [] [] | + gpe-calendar | [] [] [] [] | + gpe-clock | [] [] [] [] | + gpe-conf | [] [] [] [] | + gpe-contacts | [] [] [] [] | + gpe-edit | [] [] [] [] | + gpe-go | [] [] [] | + gpe-login | [] [] [] [] | + gpe-ownerinfo | [] [] [] [] | + gpe-sketchbook | [] [] [] [] | + gpe-su | [] [] [] [] | + gpe-taskmanager | [] [] [] [] | + gpe-timesheet | [] [] [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] [] [] [] | + gphoto2 | [] | + gprof | [] [] | + gpsdrive | () () [] | + gramadoir | () [] | + grep | [] [] [] [] [] | + gretl | | + gtick | [] [] [] | + hello | [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] | + indent | [] [] [] [] | + iso_3166 | [] [] [] | + iso_3166_1 | [] [] | + iso_3166_2 | | + iso_3166_3 | [] | + iso_4217 | [] [] [] [] [] [] [] [] | + iso_639 | [] | + jpilot | () () | + jtag | | + jwhois | [] [] [] [] () | + kbd | [] [] [] | + latrine | [] | + ld | | + libc | [] [] [] [] | + libgpewidget | [] [] [] | + libiconv | [] [] [] [] [] | + lifelines | | + lilypond | | + lingoteach | | + lingoteach_lessons | | + lynx | [] [] [] | + m4 | [] [] [] [] [] | + mailutils | [] [] [] | + make | [] [] [] [] | + man-db | [] | + minicom | [] [] [] [] | + mysecretdiary | [] [] [] | + nano | [] [] [] [] [] | + nano_1_0 | [] [] [] [] [] [] | + opcodes | [] [] | + parted | [] [] [] [] | + ptx | [] [] [] [] [] [] [] [] | + python | | + radius | [] [] | + recode | [] [] [] [] | + rpm | [] [] [] | + screem | | + scrollkeeper | [] [] [] [] [] | + sed | [] [] [] | + sh-utils | [] [] | + shared-mime-info | [] [] | + sharutils | [] [] | + silky | () | + skencil | [] [] | + sketch | [] [] | + soundtracker | | + sp | | + tar | [] [] [] [] [] [] | + texinfo | [] [] [] [] | + textutils | [] [] | + tin | | + tp-robot | [] | + tuxpaint | [] [] [] [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] | + vorbis-tools | [] [] [] | + wastesedge | | + wdiff | [] [] [] [] [] | + wget | [] [] [] | + xchat | [] [] [] | + xfree86_xkb_xml | [] [] | + xpad | [] [] | + +-----------------------------------------------------+ + lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru + 1 2 0 3 12 0 10 69 6 7 1 40 26 36 76 63 + + sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu + +-----------------------------------------------------+ + a2ps | [] [] [] [] | 16 + aegis | | 0 + ant-phone | | 3 + anubis | [] [] | 9 + ap-utils | () | 3 + aspell | | 4 + bash | | 9 + batchelor | | 3 + bfd | [] [] | 6 + binutils | [] [] [] | 8 + bison | [] [] | 14 + bluez-pin | [] [] [] | 14 + clisp | | 0 + clisp | | 5 + console-tools | | 3 + coreutils | [] [] [] [] | 16 + cpio | [] [] | 14 + darkstat | [] [] [] () () | 12 + diffutils | [] [] [] | 23 + e2fsprogs | [] [] | 6 + enscript | [] [] | 12 + error | [] [] [] | 15 + fetchmail | [] [] | 11 + fileutils | [] [] [] [] [] | 17 + findutils | [] [] [] [] [] [] | 29 + flex | [] [] | 13 + fslint | | 3 + gas | [] | 3 + gawk | [] [] | 12 + gbiff | | 4 + gcal | [] [] | 4 + gcc | [] | 4 + gettext | [] [] [] [] [] | 16 + gettext-examples | [] [] [] [] [] | 14 + gettext-runtime | [] [] [] [] [] [] [] [] | 22 + gettext-tools | [] [] [] [] [] [] | 14 + gimp-print | [] [] | 10 + gliv | | 3 + glunarclock | [] [] [] | 13 + gnubiff | | 3 + gnucash | [] [] | 9 + gnucash-glossary | [] [] [] | 8 + gnupg | [] [] [] [] | 17 + gpe-aerial | [] | 7 + gpe-beam | [] | 8 + gpe-calendar | [] [] [] [] | 13 + gpe-clock | [] [] [] | 10 + gpe-conf | [] [] | 9 + gpe-contacts | [] [] [] | 11 + gpe-edit | [] [] [] [] [] | 12 + gpe-go | | 5 + gpe-login | [] [] [] [] [] | 13 + gpe-ownerinfo | [] [] [] [] | 13 + gpe-sketchbook | [] [] | 9 + gpe-su | [] [] [] | 10 + gpe-taskmanager | [] [] [] | 10 + gpe-timesheet | [] [] [] [] | 12 + gpe-today | [] [] [] [] [] | 13 + gpe-todo | [] [] [] [] | 12 + gphoto2 | [] [] [] | 11 + gprof | [] [] | 9 + gpsdrive | [] [] | 3 + gramadoir | [] | 5 + grep | [] [] [] [] | 26 + gretl | | 3 + gtick | | 7 + hello | [] [] [] [] [] | 34 + id-utils | [] [] | 12 + indent | [] [] [] [] | 21 + iso_3166 | [] [] [] [] [] [] [] | 27 + iso_3166_1 | [] [] [] | 16 + iso_3166_2 | | 0 + iso_3166_3 | | 2 + iso_4217 | [] [] [] [] [] [] | 24 + iso_639 | | 1 + jpilot | [] [] [] [] [] | 9 + jtag | [] | 2 + jwhois | () [] [] | 11 + kbd | [] [] | 11 + latrine | | 2 + ld | [] [] | 5 + libc | [] [] [] [] | 20 + libgpewidget | [] [] [] [] | 13 + libiconv | [] [] [] [] [] [] [] [] | 27 + lifelines | [] | 2 + lilypond | [] | 3 + lingoteach | | 2 + lingoteach_lessons | () | 0 + lynx | [] [] [] | 14 + m4 | [] [] | 15 + mailutils | | 5 + make | [] [] [] | 16 + man-db | [] | 5 + minicom | | 11 + mysecretdiary | [] [] | 10 + nano | [] [] [] [] | 17 + nano_1_0 | [] [] [] | 17 + opcodes | [] [] | 6 + parted | [] [] [] | 15 + ptx | [] [] | 22 + python | | 0 + radius | | 4 + recode | [] [] [] | 20 + rpm | [] [] | 9 + screem | [] [] | 2 + scrollkeeper | [] [] [] | 15 + sed | [] [] [] [] [] [] | 24 + sh-utils | [] [] | 14 + shared-mime-info | [] [] | 7 + sharutils | [] [] [] [] | 17 + silky | () | 3 + skencil | [] | 6 + sketch | [] | 6 + soundtracker | [] [] | 7 + sp | [] | 3 + tar | [] [] [] [] [] | 24 + texinfo | [] [] [] | 14 + textutils | [] [] [] [] | 16 + tin | | 1 + tp-robot | | 2 + tuxpaint | [] [] [] [] [] | 29 + unicode-han-tra... | | 0 + unicode-transla... | | 2 + util-linux | [] [] | 15 + vorbis-tools | | 8 + wastesedge | | 0 + wdiff | [] [] [] | 18 + wget | [] [] [] [] [] [] [] [] | 24 + xchat | [] [] [] [] [] | 15 + xfree86_xkb_xml | [] [] [] [] [] | 11 + xpad | | 5 + +-----------------------------------------------------+ + 63 teams sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu + 131 domains 47 19 28 83 0 0 59 13 1 1 11 0 22 22 0 1373 + + 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 January 2004 seems to be old, you may fetch a more recent copy of +this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date +matrix with full percentage details can be found at +`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. + +Using `gettext' in new packages +=============================== + +If you are writing a freely available program and want to +internationalize it you are welcome to use GNU `gettext' in your +package. Of course you have to respect the GNU Library General Public +License which covers the use of the GNU `gettext' library. This means +in particular that even non-free programs can use `libintl' as a shared +library, whereas only free software can use `libintl' as a static +library or use modified versions of `libintl'. + + Once the sources are changed appropriately and the setup can handle +the use of `gettext' the only thing missing are the translations. The +Free Translation Project is also available for packages which are not +developed inside the GNU project. Therefore the information given above +applies also for every other Free Software Project. Contact +`translation@iro.umontreal.ca' to make the `.pot' files available to +the translation teams. + diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..6152d89 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,59 @@ +This file is no longer maintained. Please see git log for the most +up to date list about contributions. + +$ git clone git@gitlab.com:procps-ng/procps.git +# cd procps +$ git shortlog --no-merges -sne + +-- Old credits --- +free: +Brian Edmonds + +oldps: +Branko Lankester +Michael K. Johnson +Michael Shields +Charles Blake +David Mossberger-Tang + +ps: +Albert Cahalan + +skill/kill/snice: +Albert Cahalan + +tload: +Branko Lankester +David Engel +Michael K. Johnson + +top: +Jim Warner + +oldtop: +Branko Lankester +Roger Binns +Robert Nation +Michael K. Johnson +Michael Shields +Tim Janik +Helmut Geyer +George Bonser + +uptime: +Larry Greenfield +Michael K. Johnson +David Cantrell + +vmstat: +Henry Ware . + +w: +Larry Greenfield +Michael K. Johnson +Charles Blake + +watch: +Tony Rems +Mike Coleman +Jarrod Lowe diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + 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 Lesser 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 Lesser General +Public License instead of this License. diff --git a/COPYING.LIB b/COPYING.LIB new file mode 100644 index 0000000..12735e6 --- /dev/null +++ b/COPYING.LIB @@ -0,0 +1,481 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 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. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, 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 library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, 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 companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, 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 library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete 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 distribute a copy of this License along with the +Library. + + 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 Library or any portion +of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +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 Library, 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 Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you 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. + + If distribution of 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 satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. 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. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library 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. + + 9. 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 Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +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. + + 11. 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 Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library 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 Library. + +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. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library 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. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library 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 Library +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 Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +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 + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "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 +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. 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 LIBRARY 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 +LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. 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 library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; 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. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..19063d6 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,3 @@ +See git log. + +https://gitlab.com/procps-ng/procps/commits/master diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..958b834 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,25 @@ +Installation Instructions for procps +==================================== +Depending on what format you are using to get these files, you +might need to run the `autogen.sh` program to create the +configure script. If you have a configure script already then +you might not need it. + +A typical installation would go something like + + ./autogen.sh + ./configure + make + make install + +The configure script has a lot of options, so please have a read +of `configure --help` to see what they are and what they are used +for. + +Testing +------- +procps has a series of test scripts (and more are welcome if they +are repeatable). You will need to install DejaGNU to run it and +it is simply: + + make check diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..f70c8fb --- /dev/null +++ b/Makefile.am @@ -0,0 +1,418 @@ + +CYGWINFLAGS = $(LTLIBINTL) +if CYGWIN +usrbin_exec_PROGRAMS = +endif + +AM_CPPFLAGS = \ + -include $(top_builddir)/config.h \ + -I$(top_srcdir)/local \ + -I$(top_srcdir)/library/include \ + -Wno-unused-result \ + -DLOCALEDIR=\"$(localedir)\" \ + @HARDEN_CFLAGS@ + +AM_LDFLAGS = @HARDEN_LDFLAGS@ + +PACKAGE_VERSION = @PACKAGE_VERSION@ + +ACLOCAL_AMFLAGS = -I m4 +SUBDIRS = \ + local \ + po-man \ + po \ + testsuite + +AM_CFLAGS = -Ilibrary/include +LDADD = ./library/libproc2.la $(CYGWINFLAGS) + +if CYGWIN +AM_LDFLAGS += ./library/libproc2.la $(CYGWINFLAGS) +endif + +transform = + +if !CYGWIN +transform += s/pscommand/ps/; $(program_transform_name) +sbin_PROGRAMS = \ + src/sysctl +else +transform += s/pscommand/procps/; $(program_transform_name) +endif + +if !CYGWIN +bin_PROGRAMS = \ + src/ps/pscommand \ + src/free \ + src/pgrep \ + src/pkill \ + src/pmap \ + src/pwdx \ + src/tload \ + src/uptime \ + src/vmstat +if BUILD_PIDWAIT +bin_PROGRAMS += src/pidwait +endif +else +usrbin_exec_PROGRAMS += \ + src/ps/pscommand \ + src/free \ + src/pgrep \ + src/pkill \ + src/pmap \ + src/uptime \ + src/vmstat +endif + +lib_LTLIBRARIES = \ + library/libproc2.la + +dist_man_MANS = \ + man/free.1 \ + man/pgrep.1 \ + man/pkill.1 \ + man/pmap.1 \ + man/uptime.1 \ + man/vmstat.8 \ + man/procps.3 \ + man/procps_pids.3 \ + man/procps_misc.3 + +if !CYGWIN +dist_man_MANS += \ + man/pwdx.1 \ + man/tload.1 \ + man/sysctl.8 \ + man/sysctl.conf.5 \ + man/ps.1 + +if BUILD_PIDWAIT +dist_man_MANS += man/pidwait.1 +endif +endif + +EXTRA_DIST = \ + .version \ + autogen.sh \ + COPYING.LIB \ + local/git-version-gen \ + doc/CodingStyle.md \ + doc/TODO \ + src/ps/HACKING \ + src/ps/regression \ + $(DIST_MAN_POTS) + +if !CYGWIN +EXTRA_DIST += \ + sysctl.conf +endif + +procpsngdir = $(docdir) +dist_procpsng_DATA = \ + doc/bugs.md \ + doc/FAQ \ + doc/libproc.supp + +if BUILD_PIDOF +if !CYGWIN +bin_PROGRAMS += src/pidof +else +usrbin_exec_PROGRAMS += src/pidof +endif +dist_man_MANS += man/pidof.1 +src_pidof_SOURCES = src/pidof.c local/fileutils.c +else + EXTRA_DIST += man/pidof.1 +endif + +if BUILD_KILL +if CYGWIN +transform += ;s/^kill/prockill/; $(program_transform_name) +usrbin_exec_PROGRAMS += src/kill +else +bin_PROGRAMS += src/kill +endif +dist_man_MANS += man/kill.1 +src_kill_SOURCES = src/kill.c local/strutils.c local/fileutils.c local/signals.c +src_kill_LDADD = $(LTLIBINTL) +else + EXTRA_DIST += man/kill.1 +endif + +if BUILD_W +if CYGWIN +usrbin_exec_PROGRAMS += src/w +else +bin_PROGRAMS += src/w +endif + +dist_man_MANS += man/w.1 +src_w_SOURCES = src/w.c local/fileutils.c +else + EXTRA_DIST += man/w.1 +endif + +if WITH_NCURSES +if !CYGWIN +bin_PROGRAMS += \ + src/watch \ + src/top/top +else +usrbin_exec_PROGRAMS += \ + src/watch \ + src/top/top +endif + +dist_man_MANS += \ + man/watch.1 \ + man/top.1 +if !CYGWIN +bin_PROGRAMS += \ + src/slabtop +dist_man_MANS += \ + man/slabtop.1 +src_slabtop_SOURCES = src/slabtop.c local/strutils.c local/fileutils.c +src_slabtop_CFLAGS = @NCURSES_CFLAGS@ +src_slabtop_LDADD = $(LDADD) @NCURSES_LIBS@ +endif +src_watch_SOURCES = src/watch.c local/strutils.c local/fileutils.c +src_watch_CFLAGS = @NCURSES_CFLAGS@ +src_watch_LDADD = @NCURSES_LIBS@ $(CYGWINFLAGS) +src_top_top_SOURCES = \ + src/top/top.h \ + src/top/top.c \ + src/top/top_nls.h \ + src/top/top_nls.c \ + local/fileutils.c \ + local/signals.c +if CYGWIN +src_top_top_SOURCES += local/strverscmp.c +endif + +src_top_top_CFLAGS = @NCURSES_CFLAGS@ +src_top_top_LDADD = $(LDADD) @NCURSES_LIBS@ $(DL_LIB) +endif + +if BUILD_SKILL +if !CYGWIN +bin_PROGRAMS += \ + src/skill \ + src/snice +else +usrbin_exec_PROGRAMS += \ + src/skill \ + src/snice +endif +src_skill_SOURCES = src/skill.c local/strutils.c local/fileutils.c local/signals.c +src_snice_SOURCES = src/skill.c local/strutils.c local/fileutils.c local/signals.c +dist_man_MANS += \ + man/skill.1 \ + man/snice.1 +else + EXTRA_DIST += \ + man/skill.1 \ + man/snice.1 +endif + +src_free_SOURCES = src/free.c local/strutils.c local/fileutils.c +src_pgrep_SOURCES = src/pgrep.c local/fileutils.c local/signals.c +src_pkill_SOURCES = src/pgrep.c local/fileutils.c local/signals.c +src_pmap_SOURCES = src/pmap.c local/fileutils.c +if BUILD_PIDWAIT +src_pidwait_SOURCES = src/pgrep.c local/fileutils.c local/signals.c +endif +if !CYGWIN +src_pwdx_SOURCES = src/pwdx.c local/fileutils.c +src_pwdx_LDADD= $(CYGWINFLAGS) +src_sysctl_SOURCES = \ + src/sysctl.c \ + local/fileutils.c \ + local/procio.c +src_sysctl_LDADD= $(LTLIBINTL) +endif +src_tload_SOURCES = src/tload.c local/strutils.c local/fileutils.c +src_uptime_SOURCES = src/uptime.c local/fileutils.c +src_vmstat_SOURCES = src/vmstat.c local/strutils.c local/fileutils.c + + +# See http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +LIBproc2_CURRENT=0 +LIBproc2_REVISION=2 +LIBproc2_AGE=0 + +library_libproc2_la_LIBADD = $(LIB_KPARTS) + +if WITH_SYSTEMD +library_libproc2_la_LIBADD += @SYSTEMD_LIBS@ +endif + +if WITH_ELOGIND +library_libproc2_la_LIBADD += @ELOGIND_LIBS@ +endif + +library_libproc2_la_LDFLAGS = \ + -version-info $(LIBproc2_CURRENT):$(LIBproc2_REVISION):$(LIBproc2_AGE) \ + -no-undefined \ + -Wl,--version-script=$(top_srcdir)/library/libproc2.sym + +library_libproc2_la_SOURCES = \ + library/devname.c \ + library/include/devname.h \ + library/diskstats.c \ + library/include/diskstats.h \ + library/escape.c \ + library/include/escape.h \ + library/include/procps-private.h \ + library/meminfo.c \ + library/include/meminfo.h \ + library/include/misc.h \ + library/namespace.c \ + library/numa.c \ + library/include/numa.h \ + library/pids.c \ + library/include/pids.h \ + library/pwcache.c \ + library/include/pwcache.h \ + library/readproc.c \ + library/include/readproc.h \ + library/slabinfo.c \ + library/include/slabinfo.h \ + library/stat.c \ + library/include/stat.h \ + library/sysinfo.c \ + library/version.c \ + library/vmstat.c \ + library/include/vmstat.h \ + library/wchan.c \ + library/include/wchan.h \ + library/uptime.c \ + library/include/xtra-procps-debug.h + +library_libproc2_la_includedir = $(includedir)/libproc2/ +library_libproc2_la_include_HEADERS = \ + library/include/diskstats.h \ + library/include/meminfo.h \ + library/include/misc.h \ + library/include/pids.h \ + library/include/slabinfo.h \ + library/include/stat.h \ + library/include/vmstat.h \ + library/include/xtra-procps-debug.h + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = \ + library/libproc2.pc + +EXTRA_DIST += library/libproc2.sym + +# ps/pscommand + +src_ps_pscommand_SOURCES = \ + src/ps/common.h \ + src/ps/display.c \ + src/ps/global.c \ + src/ps/help.c \ + src/ps/output.c \ + src/ps/parser.c \ + src/ps/select.c \ + src/ps/signames.c \ + src/ps/sortformat.c \ + src/ps/stacktrace.c \ + local/fileutils.c \ + local/signals.c + + +# Test programs required for dejagnu or standalone testing +check_PROGRAMS = \ + src/tests/test_strutils \ + src/tests/test_fileutils \ + src/tests/test_process \ + src/tests/test_strtod_nol \ + src/tests/test_shm + +src_tests_test_strutils_SOURCES = src/tests/test_strutils.c local/strutils.c +src_tests_test_strutils_LDADD = $(CYGWINFLAGS) +src_tests_test_fileutils_SOURCES = src/tests/test_fileutils.c local/fileutils.c +src_tests_test_fileutils_LDADD = $(CYGWINFLAGS) +src_tests_test_process_SOURCES = src/tests/test_process.c +src_tests_test_process_LDADD = $(CYGWINFLAGS) +src_tests_test_strtod_nol_SOURCES = src/tests/test_strtod_nol.c local/strutils.c +src_tests_test_strtod_nol_LDADD = $(CYGWINFLAGS) +src_tests_test_shm_SOURCES = src/tests/test_shm.c local/strutils.c +src_tests_test_shm_LDADD = $(CYGWINFLAGS) + +check_PROGRAMS += \ + library/tests/test_Itemtables \ + library/tests/test_pids \ + library/tests/test_uptime \ + library/tests/test_sysinfo \ + library/tests/test_version \ + library/tests/test_namespace + +library_tests_test_Itemtables_SOURCES = library/tests/test_Itemtables.c +library_tests_test_Itemtables_LDADD = library/libproc2.la +library_tests_test_pids_SOURCES = library/tests/test_pids.c +library_tests_test_pids_LDADD = library/libproc2.la +library_tests_test_uptime_SOURCES = library/tests/test_uptime.c +library_tests_test_uptime_LDADD = library/libproc2.la +library_tests_test_sysinfo_SOURCES = library/tests/test_sysinfo.c +library_tests_test_sysinfo_LDADD = library/libproc2.la +library_tests_test_version_SOURCES = library/tests/test_version.c +library_tests_test_version_LDADD = library/libproc2.la +library_tests_test_namespace_SOURCES = library/tests/test_namespace.c +library_tests_test_namespace_LDADD = library/libproc2.la + +if CYGWIN + src_skill_LDADD = $(CYGWINFLAGS) + src_kill_LDADD = $(CYGWINFLAGS) + src_free_LDADD = $(CYGWINFLAGS) + src_pgrep_LDADD = $(CYGWINFLAGS) + src_pkill_LDADD = $(CYGWINFLAGS) + src_pidof_LDADD = $(CYGWINFLAGS) + src_pmap_LDADD = $(CYGWINFLAGS) + src_snice_LDADD = $(CYGWINFLAGS) + src_tload_LDADD = $(CYGWINFLAGS) + src_uptime_LDADD = $(CYGWINFLAGS) + src_w_LDADD = $(CYGWINFLAGS) + src_vmstat_LDADD = $(CYGWINFLAGS) +endif + +if EXAMPLE_FILES +if !CYGWIN +sysconf_DATA = sysctl.conf +endif +endif + +BUILT_SOURCES = $(top_srcdir)/.version + +check-lib: clean + $(MAKE) CFLAGS=-DITEMTABLE_DEBUG library/tests/test_Itemtables + $(top_builddir)/library/tests/test_Itemtables + $(MAKE) clean &>/dev/null + +# Test programs not used by dejagnu but run directly +TESTS = \ + library/tests/test_pids \ + library/tests/test_uptime \ + library/tests/test_sysinfo \ + library/tests/test_version \ + library/tests/test_namespace \ + src/tests/test_fileutils \ + src/tests/test_strtod_nol + +# Automake should do this, but it doesn't +check: $(check_PROGRAMS) $(PROGRAMS) + +$(top_srcdir)/.version: + touch $(top_srcdir)/.version + echo $(VERSION) > $@-t && mv $@-t $@ +dist-hook: + echo $(VERSION) > $(distdir)/.tarball-version + +get-trans: + echo "Getting the latest translations from translationproject.org..." + rsync -Lrtvz translationproject.org::tp/latest/procps-ng/ po + rsync -Lrtvz translationproject.org::tp/latest/procps-ng-man/ po-man + rm -f po-man/man.stamp + make -C po-man man.stamp diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..24540aa --- /dev/null +++ b/Makefile.in @@ -0,0 +1,3106 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@CYGWIN_TRUE@usrbin_exec_PROGRAMS = src/ps/pscommand$(EXEEXT) \ +@CYGWIN_TRUE@ src/free$(EXEEXT) src/pgrep$(EXEEXT) \ +@CYGWIN_TRUE@ src/pkill$(EXEEXT) src/pmap$(EXEEXT) \ +@CYGWIN_TRUE@ src/uptime$(EXEEXT) src/vmstat$(EXEEXT) \ +@CYGWIN_TRUE@ $(am__EXEEXT_7) $(am__EXEEXT_8) $(am__EXEEXT_9) \ +@CYGWIN_TRUE@ $(am__EXEEXT_10) $(am__EXEEXT_11) +@CYGWIN_TRUE@am__append_1 = ./library/libproc2.la $(CYGWINFLAGS) +@CYGWIN_FALSE@am__append_2 = s/pscommand/ps/; $(program_transform_name) +@CYGWIN_FALSE@sbin_PROGRAMS = src/sysctl$(EXEEXT) +@CYGWIN_TRUE@am__append_3 = s/pscommand/procps/; $(program_transform_name) +@CYGWIN_FALSE@bin_PROGRAMS = src/ps/pscommand$(EXEEXT) \ +@CYGWIN_FALSE@ src/free$(EXEEXT) src/pgrep$(EXEEXT) \ +@CYGWIN_FALSE@ src/pkill$(EXEEXT) src/pmap$(EXEEXT) \ +@CYGWIN_FALSE@ src/pwdx$(EXEEXT) src/tload$(EXEEXT) \ +@CYGWIN_FALSE@ src/uptime$(EXEEXT) src/vmstat$(EXEEXT) \ +@CYGWIN_FALSE@ $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ +@CYGWIN_FALSE@ $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) +@BUILD_PIDWAIT_TRUE@@CYGWIN_FALSE@am__append_4 = src/pidwait +@CYGWIN_FALSE@am__append_5 = \ +@CYGWIN_FALSE@ man/pwdx.1 \ +@CYGWIN_FALSE@ man/tload.1 \ +@CYGWIN_FALSE@ man/sysctl.8 \ +@CYGWIN_FALSE@ man/sysctl.conf.5 \ +@CYGWIN_FALSE@ man/ps.1 + +@BUILD_PIDWAIT_TRUE@@CYGWIN_FALSE@am__append_6 = man/pidwait.1 +@CYGWIN_FALSE@am__append_7 = \ +@CYGWIN_FALSE@ sysctl.conf + +@BUILD_PIDOF_TRUE@@CYGWIN_FALSE@am__append_8 = src/pidof +@BUILD_PIDOF_TRUE@@CYGWIN_TRUE@am__append_9 = src/pidof +@BUILD_PIDOF_TRUE@am__append_10 = man/pidof.1 +@BUILD_PIDOF_FALSE@am__append_11 = man/pidof.1 +@BUILD_KILL_TRUE@@CYGWIN_TRUE@am__append_12 = ;s/^kill/prockill/; $(program_transform_name) +@BUILD_KILL_TRUE@@CYGWIN_TRUE@am__append_13 = src/kill +@BUILD_KILL_TRUE@@CYGWIN_FALSE@am__append_14 = src/kill +@BUILD_KILL_TRUE@am__append_15 = man/kill.1 +@BUILD_KILL_FALSE@am__append_16 = man/kill.1 +@BUILD_W_TRUE@@CYGWIN_TRUE@am__append_17 = src/w +@BUILD_W_TRUE@@CYGWIN_FALSE@am__append_18 = src/w +@BUILD_W_TRUE@am__append_19 = man/w.1 +@BUILD_W_FALSE@am__append_20 = man/w.1 +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@am__append_21 = src/watch src/top/top \ +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@ src/slabtop +@CYGWIN_TRUE@@WITH_NCURSES_TRUE@am__append_22 = \ +@CYGWIN_TRUE@@WITH_NCURSES_TRUE@ src/watch \ +@CYGWIN_TRUE@@WITH_NCURSES_TRUE@ src/top/top + +@WITH_NCURSES_TRUE@am__append_23 = \ +@WITH_NCURSES_TRUE@ man/watch.1 \ +@WITH_NCURSES_TRUE@ man/top.1 + +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@am__append_24 = \ +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@ man/slabtop.1 + +@CYGWIN_TRUE@@WITH_NCURSES_TRUE@am__append_25 = local/strverscmp.c +@BUILD_SKILL_TRUE@@CYGWIN_FALSE@am__append_26 = \ +@BUILD_SKILL_TRUE@@CYGWIN_FALSE@ src/skill \ +@BUILD_SKILL_TRUE@@CYGWIN_FALSE@ src/snice + +@BUILD_SKILL_TRUE@@CYGWIN_TRUE@am__append_27 = \ +@BUILD_SKILL_TRUE@@CYGWIN_TRUE@ src/skill \ +@BUILD_SKILL_TRUE@@CYGWIN_TRUE@ src/snice + +@BUILD_SKILL_TRUE@am__append_28 = \ +@BUILD_SKILL_TRUE@ man/skill.1 \ +@BUILD_SKILL_TRUE@ man/snice.1 + +@BUILD_SKILL_FALSE@am__append_29 = \ +@BUILD_SKILL_FALSE@ man/skill.1 \ +@BUILD_SKILL_FALSE@ man/snice.1 + +@WITH_SYSTEMD_TRUE@am__append_30 = @SYSTEMD_LIBS@ +@WITH_ELOGIND_TRUE@am__append_31 = @ELOGIND_LIBS@ +check_PROGRAMS = src/tests/test_strutils$(EXEEXT) \ + src/tests/test_fileutils$(EXEEXT) \ + src/tests/test_process$(EXEEXT) \ + src/tests/test_strtod_nol$(EXEEXT) src/tests/test_shm$(EXEEXT) \ + library/tests/test_Itemtables$(EXEEXT) \ + library/tests/test_pids$(EXEEXT) \ + library/tests/test_uptime$(EXEEXT) \ + library/tests/test_sysinfo$(EXEEXT) \ + library/tests/test_version$(EXEEXT) \ + library/tests/test_namespace$(EXEEXT) +TESTS = library/tests/test_pids$(EXEEXT) \ + library/tests/test_uptime$(EXEEXT) \ + library/tests/test_sysinfo$(EXEEXT) \ + library/tests/test_version$(EXEEXT) \ + library/tests/test_namespace$(EXEEXT) \ + src/tests/test_fileutils$(EXEEXT) \ + src/tests/test_strtod_nol$(EXEEXT) +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(dist_procpsng_DATA) \ + $(library_libproc2_la_include_HEADERS) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = library/libproc2.pc +CONFIG_CLEAN_VPATH_FILES = +@BUILD_PIDWAIT_TRUE@@CYGWIN_FALSE@am__EXEEXT_1 = src/pidwait$(EXEEXT) +@BUILD_PIDOF_TRUE@@CYGWIN_FALSE@am__EXEEXT_2 = src/pidof$(EXEEXT) +@BUILD_KILL_TRUE@@CYGWIN_FALSE@am__EXEEXT_3 = src/kill$(EXEEXT) +@BUILD_W_TRUE@@CYGWIN_FALSE@am__EXEEXT_4 = src/w$(EXEEXT) +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@am__EXEEXT_5 = src/watch$(EXEEXT) \ +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@ src/top/top$(EXEEXT) \ +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@ src/slabtop$(EXEEXT) +@BUILD_SKILL_TRUE@@CYGWIN_FALSE@am__EXEEXT_6 = src/skill$(EXEEXT) \ +@BUILD_SKILL_TRUE@@CYGWIN_FALSE@ src/snice$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \ + "$(DESTDIR)$(usrbin_execdir)" "$(DESTDIR)$(libdir)" \ + "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \ + "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" \ + "$(DESTDIR)$(procpsngdir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(sysconfdir)" \ + "$(DESTDIR)$(library_libproc2_la_includedir)" +@BUILD_PIDOF_TRUE@@CYGWIN_TRUE@am__EXEEXT_7 = src/pidof$(EXEEXT) +@BUILD_KILL_TRUE@@CYGWIN_TRUE@am__EXEEXT_8 = src/kill$(EXEEXT) +@BUILD_W_TRUE@@CYGWIN_TRUE@am__EXEEXT_9 = src/w$(EXEEXT) +@CYGWIN_TRUE@@WITH_NCURSES_TRUE@am__EXEEXT_10 = src/watch$(EXEEXT) \ +@CYGWIN_TRUE@@WITH_NCURSES_TRUE@ src/top/top$(EXEEXT) +@BUILD_SKILL_TRUE@@CYGWIN_TRUE@am__EXEEXT_11 = src/skill$(EXEEXT) \ +@BUILD_SKILL_TRUE@@CYGWIN_TRUE@ src/snice$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) $(usrbin_exec_PROGRAMS) +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; }; \ + } +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +library_libproc2_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am__dirstamp = $(am__leading_dot)dirstamp +am_library_libproc2_la_OBJECTS = library/devname.lo \ + library/diskstats.lo library/escape.lo library/meminfo.lo \ + library/namespace.lo library/numa.lo library/pids.lo \ + library/pwcache.lo library/readproc.lo library/slabinfo.lo \ + library/stat.lo library/sysinfo.lo library/version.lo \ + library/vmstat.lo library/wchan.lo library/uptime.lo +library_libproc2_la_OBJECTS = $(am_library_libproc2_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 = +library_libproc2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(library_libproc2_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_library_tests_test_Itemtables_OBJECTS = \ + library/tests/test_Itemtables.$(OBJEXT) +library_tests_test_Itemtables_OBJECTS = \ + $(am_library_tests_test_Itemtables_OBJECTS) +library_tests_test_Itemtables_DEPENDENCIES = library/libproc2.la +am_library_tests_test_namespace_OBJECTS = \ + library/tests/test_namespace.$(OBJEXT) +library_tests_test_namespace_OBJECTS = \ + $(am_library_tests_test_namespace_OBJECTS) +library_tests_test_namespace_DEPENDENCIES = library/libproc2.la +am_library_tests_test_pids_OBJECTS = \ + library/tests/test_pids.$(OBJEXT) +library_tests_test_pids_OBJECTS = \ + $(am_library_tests_test_pids_OBJECTS) +library_tests_test_pids_DEPENDENCIES = library/libproc2.la +am_library_tests_test_sysinfo_OBJECTS = \ + library/tests/test_sysinfo.$(OBJEXT) +library_tests_test_sysinfo_OBJECTS = \ + $(am_library_tests_test_sysinfo_OBJECTS) +library_tests_test_sysinfo_DEPENDENCIES = library/libproc2.la +am_library_tests_test_uptime_OBJECTS = \ + library/tests/test_uptime.$(OBJEXT) +library_tests_test_uptime_OBJECTS = \ + $(am_library_tests_test_uptime_OBJECTS) +library_tests_test_uptime_DEPENDENCIES = library/libproc2.la +am_library_tests_test_version_OBJECTS = \ + library/tests/test_version.$(OBJEXT) +library_tests_test_version_OBJECTS = \ + $(am_library_tests_test_version_OBJECTS) +library_tests_test_version_DEPENDENCIES = library/libproc2.la +am_src_free_OBJECTS = src/free.$(OBJEXT) local/strutils.$(OBJEXT) \ + local/fileutils.$(OBJEXT) +src_free_OBJECTS = $(am_src_free_OBJECTS) +src_free_LDADD = $(LDADD) +am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +src_free_DEPENDENCIES = ./library/libproc2.la $(am__DEPENDENCIES_2) +am__src_kill_SOURCES_DIST = src/kill.c local/strutils.c \ + local/fileutils.c local/signals.c +@BUILD_KILL_TRUE@am_src_kill_OBJECTS = src/kill.$(OBJEXT) \ +@BUILD_KILL_TRUE@ local/strutils.$(OBJEXT) \ +@BUILD_KILL_TRUE@ local/fileutils.$(OBJEXT) \ +@BUILD_KILL_TRUE@ local/signals.$(OBJEXT) +src_kill_OBJECTS = $(am_src_kill_OBJECTS) +@BUILD_KILL_TRUE@src_kill_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_src_pgrep_OBJECTS = src/pgrep.$(OBJEXT) local/fileutils.$(OBJEXT) \ + local/signals.$(OBJEXT) +src_pgrep_OBJECTS = $(am_src_pgrep_OBJECTS) +src_pgrep_LDADD = $(LDADD) +src_pgrep_DEPENDENCIES = ./library/libproc2.la $(am__DEPENDENCIES_2) +am__src_pidof_SOURCES_DIST = src/pidof.c local/fileutils.c +@BUILD_PIDOF_TRUE@am_src_pidof_OBJECTS = src/pidof.$(OBJEXT) \ +@BUILD_PIDOF_TRUE@ local/fileutils.$(OBJEXT) +src_pidof_OBJECTS = $(am_src_pidof_OBJECTS) +src_pidof_LDADD = $(LDADD) +src_pidof_DEPENDENCIES = ./library/libproc2.la $(am__DEPENDENCIES_2) +am__src_pidwait_SOURCES_DIST = src/pgrep.c local/fileutils.c \ + local/signals.c +@BUILD_PIDWAIT_TRUE@am_src_pidwait_OBJECTS = src/pgrep.$(OBJEXT) \ +@BUILD_PIDWAIT_TRUE@ local/fileutils.$(OBJEXT) \ +@BUILD_PIDWAIT_TRUE@ local/signals.$(OBJEXT) +src_pidwait_OBJECTS = $(am_src_pidwait_OBJECTS) +src_pidwait_LDADD = $(LDADD) +src_pidwait_DEPENDENCIES = ./library/libproc2.la $(am__DEPENDENCIES_2) +am_src_pkill_OBJECTS = src/pgrep.$(OBJEXT) local/fileutils.$(OBJEXT) \ + local/signals.$(OBJEXT) +src_pkill_OBJECTS = $(am_src_pkill_OBJECTS) +src_pkill_LDADD = $(LDADD) +src_pkill_DEPENDENCIES = ./library/libproc2.la $(am__DEPENDENCIES_2) +am_src_pmap_OBJECTS = src/pmap.$(OBJEXT) local/fileutils.$(OBJEXT) +src_pmap_OBJECTS = $(am_src_pmap_OBJECTS) +src_pmap_LDADD = $(LDADD) +src_pmap_DEPENDENCIES = ./library/libproc2.la $(am__DEPENDENCIES_2) +am_src_ps_pscommand_OBJECTS = src/ps/display.$(OBJEXT) \ + src/ps/global.$(OBJEXT) src/ps/help.$(OBJEXT) \ + src/ps/output.$(OBJEXT) src/ps/parser.$(OBJEXT) \ + src/ps/select.$(OBJEXT) src/ps/signames.$(OBJEXT) \ + src/ps/sortformat.$(OBJEXT) src/ps/stacktrace.$(OBJEXT) \ + local/fileutils.$(OBJEXT) local/signals.$(OBJEXT) +src_ps_pscommand_OBJECTS = $(am_src_ps_pscommand_OBJECTS) +src_ps_pscommand_LDADD = $(LDADD) +src_ps_pscommand_DEPENDENCIES = ./library/libproc2.la \ + $(am__DEPENDENCIES_2) +am__src_pwdx_SOURCES_DIST = src/pwdx.c local/fileutils.c +@CYGWIN_FALSE@am_src_pwdx_OBJECTS = src/pwdx.$(OBJEXT) \ +@CYGWIN_FALSE@ local/fileutils.$(OBJEXT) +src_pwdx_OBJECTS = $(am_src_pwdx_OBJECTS) +@CYGWIN_FALSE@src_pwdx_DEPENDENCIES = $(am__DEPENDENCIES_2) +am__src_skill_SOURCES_DIST = src/skill.c local/strutils.c \ + local/fileutils.c local/signals.c +@BUILD_SKILL_TRUE@am_src_skill_OBJECTS = src/skill.$(OBJEXT) \ +@BUILD_SKILL_TRUE@ local/strutils.$(OBJEXT) \ +@BUILD_SKILL_TRUE@ local/fileutils.$(OBJEXT) \ +@BUILD_SKILL_TRUE@ local/signals.$(OBJEXT) +src_skill_OBJECTS = $(am_src_skill_OBJECTS) +src_skill_LDADD = $(LDADD) +src_skill_DEPENDENCIES = ./library/libproc2.la $(am__DEPENDENCIES_2) +am__src_slabtop_SOURCES_DIST = src/slabtop.c local/strutils.c \ + local/fileutils.c +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@am_src_slabtop_OBJECTS = src/slabtop-slabtop.$(OBJEXT) \ +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@ local/src_slabtop-strutils.$(OBJEXT) \ +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@ local/src_slabtop-fileutils.$(OBJEXT) +src_slabtop_OBJECTS = $(am_src_slabtop_OBJECTS) +am__DEPENDENCIES_3 = ./library/libproc2.la $(am__DEPENDENCIES_2) +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@src_slabtop_DEPENDENCIES = \ +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@ $(am__DEPENDENCIES_3) +src_slabtop_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_slabtop_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am__src_snice_SOURCES_DIST = src/skill.c local/strutils.c \ + local/fileutils.c local/signals.c +@BUILD_SKILL_TRUE@am_src_snice_OBJECTS = src/skill.$(OBJEXT) \ +@BUILD_SKILL_TRUE@ local/strutils.$(OBJEXT) \ +@BUILD_SKILL_TRUE@ local/fileutils.$(OBJEXT) \ +@BUILD_SKILL_TRUE@ local/signals.$(OBJEXT) +src_snice_OBJECTS = $(am_src_snice_OBJECTS) +src_snice_LDADD = $(LDADD) +src_snice_DEPENDENCIES = ./library/libproc2.la $(am__DEPENDENCIES_2) +am__src_sysctl_SOURCES_DIST = src/sysctl.c local/fileutils.c \ + local/procio.c +@CYGWIN_FALSE@am_src_sysctl_OBJECTS = src/sysctl.$(OBJEXT) \ +@CYGWIN_FALSE@ local/fileutils.$(OBJEXT) local/procio.$(OBJEXT) +src_sysctl_OBJECTS = $(am_src_sysctl_OBJECTS) +@CYGWIN_FALSE@src_sysctl_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_src_tests_test_fileutils_OBJECTS = \ + src/tests/test_fileutils.$(OBJEXT) local/fileutils.$(OBJEXT) +src_tests_test_fileutils_OBJECTS = \ + $(am_src_tests_test_fileutils_OBJECTS) +src_tests_test_fileutils_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_src_tests_test_process_OBJECTS = src/tests/test_process.$(OBJEXT) +src_tests_test_process_OBJECTS = $(am_src_tests_test_process_OBJECTS) +src_tests_test_process_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_src_tests_test_shm_OBJECTS = src/tests/test_shm.$(OBJEXT) \ + local/strutils.$(OBJEXT) +src_tests_test_shm_OBJECTS = $(am_src_tests_test_shm_OBJECTS) +src_tests_test_shm_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_src_tests_test_strtod_nol_OBJECTS = \ + src/tests/test_strtod_nol.$(OBJEXT) local/strutils.$(OBJEXT) +src_tests_test_strtod_nol_OBJECTS = \ + $(am_src_tests_test_strtod_nol_OBJECTS) +src_tests_test_strtod_nol_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_src_tests_test_strutils_OBJECTS = \ + src/tests/test_strutils.$(OBJEXT) local/strutils.$(OBJEXT) +src_tests_test_strutils_OBJECTS = \ + $(am_src_tests_test_strutils_OBJECTS) +src_tests_test_strutils_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_src_tload_OBJECTS = src/tload.$(OBJEXT) local/strutils.$(OBJEXT) \ + local/fileutils.$(OBJEXT) +src_tload_OBJECTS = $(am_src_tload_OBJECTS) +src_tload_LDADD = $(LDADD) +src_tload_DEPENDENCIES = ./library/libproc2.la $(am__DEPENDENCIES_2) +am__src_top_top_SOURCES_DIST = src/top/top.h src/top/top.c \ + src/top/top_nls.h src/top/top_nls.c local/fileutils.c \ + local/signals.c local/strverscmp.c +@CYGWIN_TRUE@@WITH_NCURSES_TRUE@am__objects_1 = local/src_top_top-strverscmp.$(OBJEXT) +@WITH_NCURSES_TRUE@am_src_top_top_OBJECTS = src/top/top-top.$(OBJEXT) \ +@WITH_NCURSES_TRUE@ src/top/top-top_nls.$(OBJEXT) \ +@WITH_NCURSES_TRUE@ local/src_top_top-fileutils.$(OBJEXT) \ +@WITH_NCURSES_TRUE@ local/src_top_top-signals.$(OBJEXT) \ +@WITH_NCURSES_TRUE@ $(am__objects_1) +src_top_top_OBJECTS = $(am_src_top_top_OBJECTS) +@WITH_NCURSES_TRUE@src_top_top_DEPENDENCIES = $(am__DEPENDENCIES_3) \ +@WITH_NCURSES_TRUE@ $(am__DEPENDENCIES_1) +src_top_top_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_top_top_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_src_uptime_OBJECTS = src/uptime.$(OBJEXT) local/fileutils.$(OBJEXT) +src_uptime_OBJECTS = $(am_src_uptime_OBJECTS) +src_uptime_LDADD = $(LDADD) +src_uptime_DEPENDENCIES = ./library/libproc2.la $(am__DEPENDENCIES_2) +am_src_vmstat_OBJECTS = src/vmstat.$(OBJEXT) local/strutils.$(OBJEXT) \ + local/fileutils.$(OBJEXT) +src_vmstat_OBJECTS = $(am_src_vmstat_OBJECTS) +src_vmstat_LDADD = $(LDADD) +src_vmstat_DEPENDENCIES = ./library/libproc2.la $(am__DEPENDENCIES_2) +am__src_w_SOURCES_DIST = src/w.c local/fileutils.c +@BUILD_W_TRUE@am_src_w_OBJECTS = src/w.$(OBJEXT) \ +@BUILD_W_TRUE@ local/fileutils.$(OBJEXT) +src_w_OBJECTS = $(am_src_w_OBJECTS) +src_w_LDADD = $(LDADD) +src_w_DEPENDENCIES = ./library/libproc2.la $(am__DEPENDENCIES_2) +am__src_watch_SOURCES_DIST = src/watch.c local/strutils.c \ + local/fileutils.c +@WITH_NCURSES_TRUE@am_src_watch_OBJECTS = src/watch-watch.$(OBJEXT) \ +@WITH_NCURSES_TRUE@ local/src_watch-strutils.$(OBJEXT) \ +@WITH_NCURSES_TRUE@ local/src_watch-fileutils.$(OBJEXT) +src_watch_OBJECTS = $(am_src_watch_OBJECTS) +@WITH_NCURSES_TRUE@src_watch_DEPENDENCIES = $(am__DEPENDENCIES_2) +src_watch_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_watch_CFLAGS) \ + $(CFLAGS) $(AM_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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = library/$(DEPDIR)/devname.Plo \ + library/$(DEPDIR)/diskstats.Plo library/$(DEPDIR)/escape.Plo \ + library/$(DEPDIR)/meminfo.Plo library/$(DEPDIR)/namespace.Plo \ + library/$(DEPDIR)/numa.Plo library/$(DEPDIR)/pids.Plo \ + library/$(DEPDIR)/pwcache.Plo library/$(DEPDIR)/readproc.Plo \ + library/$(DEPDIR)/slabinfo.Plo library/$(DEPDIR)/stat.Plo \ + library/$(DEPDIR)/sysinfo.Plo library/$(DEPDIR)/uptime.Plo \ + library/$(DEPDIR)/version.Plo library/$(DEPDIR)/vmstat.Plo \ + library/$(DEPDIR)/wchan.Plo \ + library/tests/$(DEPDIR)/test_Itemtables.Po \ + library/tests/$(DEPDIR)/test_namespace.Po \ + library/tests/$(DEPDIR)/test_pids.Po \ + library/tests/$(DEPDIR)/test_sysinfo.Po \ + library/tests/$(DEPDIR)/test_uptime.Po \ + library/tests/$(DEPDIR)/test_version.Po \ + local/$(DEPDIR)/fileutils.Po local/$(DEPDIR)/procio.Po \ + local/$(DEPDIR)/signals.Po \ + local/$(DEPDIR)/src_slabtop-fileutils.Po \ + local/$(DEPDIR)/src_slabtop-strutils.Po \ + local/$(DEPDIR)/src_top_top-fileutils.Po \ + local/$(DEPDIR)/src_top_top-signals.Po \ + local/$(DEPDIR)/src_top_top-strverscmp.Po \ + local/$(DEPDIR)/src_watch-fileutils.Po \ + local/$(DEPDIR)/src_watch-strutils.Po \ + local/$(DEPDIR)/strutils.Po src/$(DEPDIR)/free.Po \ + src/$(DEPDIR)/kill.Po src/$(DEPDIR)/pgrep.Po \ + src/$(DEPDIR)/pidof.Po src/$(DEPDIR)/pmap.Po \ + src/$(DEPDIR)/pwdx.Po src/$(DEPDIR)/skill.Po \ + src/$(DEPDIR)/slabtop-slabtop.Po src/$(DEPDIR)/sysctl.Po \ + src/$(DEPDIR)/tload.Po src/$(DEPDIR)/uptime.Po \ + src/$(DEPDIR)/vmstat.Po src/$(DEPDIR)/w.Po \ + src/$(DEPDIR)/watch-watch.Po src/ps/$(DEPDIR)/display.Po \ + src/ps/$(DEPDIR)/global.Po src/ps/$(DEPDIR)/help.Po \ + src/ps/$(DEPDIR)/output.Po src/ps/$(DEPDIR)/parser.Po \ + src/ps/$(DEPDIR)/select.Po src/ps/$(DEPDIR)/signames.Po \ + src/ps/$(DEPDIR)/sortformat.Po src/ps/$(DEPDIR)/stacktrace.Po \ + src/tests/$(DEPDIR)/test_fileutils.Po \ + src/tests/$(DEPDIR)/test_process.Po \ + src/tests/$(DEPDIR)/test_shm.Po \ + src/tests/$(DEPDIR)/test_strtod_nol.Po \ + src/tests/$(DEPDIR)/test_strutils.Po \ + src/top/$(DEPDIR)/top-top.Po src/top/$(DEPDIR)/top-top_nls.Po +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 = $(library_libproc2_la_SOURCES) \ + $(library_tests_test_Itemtables_SOURCES) \ + $(library_tests_test_namespace_SOURCES) \ + $(library_tests_test_pids_SOURCES) \ + $(library_tests_test_sysinfo_SOURCES) \ + $(library_tests_test_uptime_SOURCES) \ + $(library_tests_test_version_SOURCES) $(src_free_SOURCES) \ + $(src_kill_SOURCES) $(src_pgrep_SOURCES) $(src_pidof_SOURCES) \ + $(src_pidwait_SOURCES) $(src_pkill_SOURCES) \ + $(src_pmap_SOURCES) $(src_ps_pscommand_SOURCES) \ + $(src_pwdx_SOURCES) $(src_skill_SOURCES) \ + $(src_slabtop_SOURCES) $(src_snice_SOURCES) \ + $(src_sysctl_SOURCES) $(src_tests_test_fileutils_SOURCES) \ + $(src_tests_test_process_SOURCES) \ + $(src_tests_test_shm_SOURCES) \ + $(src_tests_test_strtod_nol_SOURCES) \ + $(src_tests_test_strutils_SOURCES) $(src_tload_SOURCES) \ + $(src_top_top_SOURCES) $(src_uptime_SOURCES) \ + $(src_vmstat_SOURCES) $(src_w_SOURCES) $(src_watch_SOURCES) +DIST_SOURCES = $(library_libproc2_la_SOURCES) \ + $(library_tests_test_Itemtables_SOURCES) \ + $(library_tests_test_namespace_SOURCES) \ + $(library_tests_test_pids_SOURCES) \ + $(library_tests_test_sysinfo_SOURCES) \ + $(library_tests_test_uptime_SOURCES) \ + $(library_tests_test_version_SOURCES) $(src_free_SOURCES) \ + $(am__src_kill_SOURCES_DIST) $(src_pgrep_SOURCES) \ + $(am__src_pidof_SOURCES_DIST) $(am__src_pidwait_SOURCES_DIST) \ + $(src_pkill_SOURCES) $(src_pmap_SOURCES) \ + $(src_ps_pscommand_SOURCES) $(am__src_pwdx_SOURCES_DIST) \ + $(am__src_skill_SOURCES_DIST) $(am__src_slabtop_SOURCES_DIST) \ + $(am__src_snice_SOURCES_DIST) $(am__src_sysctl_SOURCES_DIST) \ + $(src_tests_test_fileutils_SOURCES) \ + $(src_tests_test_process_SOURCES) \ + $(src_tests_test_shm_SOURCES) \ + $(src_tests_test_strtod_nol_SOURCES) \ + $(src_tests_test_strutils_SOURCES) $(src_tload_SOURCES) \ + $(am__src_top_top_SOURCES_DIST) $(src_uptime_SOURCES) \ + $(src_vmstat_SOURCES) $(am__src_w_SOURCES_DIST) \ + $(am__src_watch_SOURCES_DIST) +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 +man1dir = $(mandir)/man1 +man3dir = $(mandir)/man3 +man5dir = $(mandir)/man5 +man8dir = $(mandir)/man8 +NROFF = nroff +MANS = $(dist_man_MANS) +DATA = $(dist_procpsng_DATA) $(pkgconfig_DATA) $(sysconf_DATA) +HEADERS = $(library_libproc2_la_include_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 check recheck distdir distdir-am 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)` +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in $(top_srcdir)/library/libproc2.pc.in \ + ABOUT-NLS AUTHORS COPYING COPYING.LIB ChangeLog INSTALL.md \ + NEWS README.md compile config.guess config.rpath config.sub \ + depcomp install-sh ltmain.sh missing mkinstalldirs test-driver +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 +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +transform = $(am__append_2) $(am__append_3) $(am__append_12) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEJAGNU = @DEJAGNU@ +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@ +ELOGIND_CFLAGS = @ELOGIND_CFLAGS@ +ELOGIND_LIBS = @ELOGIND_LIBS@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +HARDEN_CFLAGS = @HARDEN_CFLAGS@ +HARDEN_LDFLAGS = @HARDEN_LDFLAGS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +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@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NCURSES_CFLAGS = @NCURSES_CFLAGS@ +NCURSES_LIBS = @NCURSES_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PO4A = @PO4A@ +POSUB = @POSUB@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@ +SYSTEMD_LIBS = @SYSTEMD_LIBS@ +USE_NLS = @USE_NLS@ +USE_PO4A = @USE_PO4A@ +VERSION = @VERSION@ +WITH_COLORWATCH = @WITH_COLORWATCH@ +WITH_WATCH8BIT = @WITH_WATCH8BIT@ +XGETTEXT = @XGETTEXT@ +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@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrbin_execdir = @usrbin_execdir@ +CYGWINFLAGS = $(LTLIBINTL) +AM_CPPFLAGS = \ + -include $(top_builddir)/config.h \ + -I$(top_srcdir)/local \ + -I$(top_srcdir)/library/include \ + -Wno-unused-result \ + -DLOCALEDIR=\"$(localedir)\" \ + @HARDEN_CFLAGS@ + +AM_LDFLAGS = @HARDEN_LDFLAGS@ $(am__append_1) +ACLOCAL_AMFLAGS = -I m4 +SUBDIRS = \ + local \ + po-man \ + po \ + testsuite + +AM_CFLAGS = -Ilibrary/include +LDADD = ./library/libproc2.la $(CYGWINFLAGS) +lib_LTLIBRARIES = \ + library/libproc2.la + +dist_man_MANS = man/free.1 man/pgrep.1 man/pkill.1 man/pmap.1 \ + man/uptime.1 man/vmstat.8 man/procps.3 man/procps_pids.3 \ + man/procps_misc.3 $(am__append_5) $(am__append_6) \ + $(am__append_10) $(am__append_15) $(am__append_19) \ + $(am__append_23) $(am__append_24) $(am__append_28) +EXTRA_DIST = .version autogen.sh COPYING.LIB local/git-version-gen \ + doc/CodingStyle.md doc/TODO src/ps/HACKING src/ps/regression \ + $(DIST_MAN_POTS) $(am__append_7) $(am__append_11) \ + $(am__append_16) $(am__append_20) $(am__append_29) \ + library/libproc2.sym +procpsngdir = $(docdir) +dist_procpsng_DATA = \ + doc/bugs.md \ + doc/FAQ \ + doc/libproc.supp + +@BUILD_PIDOF_TRUE@src_pidof_SOURCES = src/pidof.c local/fileutils.c +@BUILD_KILL_TRUE@src_kill_SOURCES = src/kill.c local/strutils.c local/fileutils.c local/signals.c +@BUILD_KILL_TRUE@src_kill_LDADD = $(LTLIBINTL) +@BUILD_W_TRUE@src_w_SOURCES = src/w.c local/fileutils.c +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@src_slabtop_SOURCES = src/slabtop.c local/strutils.c local/fileutils.c +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@src_slabtop_CFLAGS = @NCURSES_CFLAGS@ +@CYGWIN_FALSE@@WITH_NCURSES_TRUE@src_slabtop_LDADD = $(LDADD) @NCURSES_LIBS@ +@WITH_NCURSES_TRUE@src_watch_SOURCES = src/watch.c local/strutils.c local/fileutils.c +@WITH_NCURSES_TRUE@src_watch_CFLAGS = @NCURSES_CFLAGS@ +@WITH_NCURSES_TRUE@src_watch_LDADD = @NCURSES_LIBS@ $(CYGWINFLAGS) +@WITH_NCURSES_TRUE@src_top_top_SOURCES = src/top/top.h src/top/top.c \ +@WITH_NCURSES_TRUE@ src/top/top_nls.h src/top/top_nls.c \ +@WITH_NCURSES_TRUE@ local/fileutils.c local/signals.c \ +@WITH_NCURSES_TRUE@ $(am__append_25) +@WITH_NCURSES_TRUE@src_top_top_CFLAGS = @NCURSES_CFLAGS@ +@WITH_NCURSES_TRUE@src_top_top_LDADD = $(LDADD) @NCURSES_LIBS@ $(DL_LIB) +@BUILD_SKILL_TRUE@src_skill_SOURCES = src/skill.c local/strutils.c local/fileutils.c local/signals.c +@BUILD_SKILL_TRUE@src_snice_SOURCES = src/skill.c local/strutils.c local/fileutils.c local/signals.c +src_free_SOURCES = src/free.c local/strutils.c local/fileutils.c +src_pgrep_SOURCES = src/pgrep.c local/fileutils.c local/signals.c +src_pkill_SOURCES = src/pgrep.c local/fileutils.c local/signals.c +src_pmap_SOURCES = src/pmap.c local/fileutils.c +@BUILD_PIDWAIT_TRUE@src_pidwait_SOURCES = src/pgrep.c local/fileutils.c local/signals.c +@CYGWIN_FALSE@src_pwdx_SOURCES = src/pwdx.c local/fileutils.c +@CYGWIN_FALSE@src_pwdx_LDADD = $(CYGWINFLAGS) +@CYGWIN_FALSE@src_sysctl_SOURCES = \ +@CYGWIN_FALSE@ src/sysctl.c \ +@CYGWIN_FALSE@ local/fileutils.c \ +@CYGWIN_FALSE@ local/procio.c + +@CYGWIN_FALSE@src_sysctl_LDADD = $(LTLIBINTL) +src_tload_SOURCES = src/tload.c local/strutils.c local/fileutils.c +src_uptime_SOURCES = src/uptime.c local/fileutils.c +src_vmstat_SOURCES = src/vmstat.c local/strutils.c local/fileutils.c + +# See http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +LIBproc2_CURRENT = 0 +LIBproc2_REVISION = 2 +LIBproc2_AGE = 0 +library_libproc2_la_LIBADD = $(LIB_KPARTS) $(am__append_30) \ + $(am__append_31) +library_libproc2_la_LDFLAGS = \ + -version-info $(LIBproc2_CURRENT):$(LIBproc2_REVISION):$(LIBproc2_AGE) \ + -no-undefined \ + -Wl,--version-script=$(top_srcdir)/library/libproc2.sym + +library_libproc2_la_SOURCES = \ + library/devname.c \ + library/include/devname.h \ + library/diskstats.c \ + library/include/diskstats.h \ + library/escape.c \ + library/include/escape.h \ + library/include/procps-private.h \ + library/meminfo.c \ + library/include/meminfo.h \ + library/include/misc.h \ + library/namespace.c \ + library/numa.c \ + library/include/numa.h \ + library/pids.c \ + library/include/pids.h \ + library/pwcache.c \ + library/include/pwcache.h \ + library/readproc.c \ + library/include/readproc.h \ + library/slabinfo.c \ + library/include/slabinfo.h \ + library/stat.c \ + library/include/stat.h \ + library/sysinfo.c \ + library/version.c \ + library/vmstat.c \ + library/include/vmstat.h \ + library/wchan.c \ + library/include/wchan.h \ + library/uptime.c \ + library/include/xtra-procps-debug.h + +library_libproc2_la_includedir = $(includedir)/libproc2/ +library_libproc2_la_include_HEADERS = \ + library/include/diskstats.h \ + library/include/meminfo.h \ + library/include/misc.h \ + library/include/pids.h \ + library/include/slabinfo.h \ + library/include/stat.h \ + library/include/vmstat.h \ + library/include/xtra-procps-debug.h + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = \ + library/libproc2.pc + + +# ps/pscommand +src_ps_pscommand_SOURCES = \ + src/ps/common.h \ + src/ps/display.c \ + src/ps/global.c \ + src/ps/help.c \ + src/ps/output.c \ + src/ps/parser.c \ + src/ps/select.c \ + src/ps/signames.c \ + src/ps/sortformat.c \ + src/ps/stacktrace.c \ + local/fileutils.c \ + local/signals.c + +src_tests_test_strutils_SOURCES = src/tests/test_strutils.c local/strutils.c +src_tests_test_strutils_LDADD = $(CYGWINFLAGS) +src_tests_test_fileutils_SOURCES = src/tests/test_fileutils.c local/fileutils.c +src_tests_test_fileutils_LDADD = $(CYGWINFLAGS) +src_tests_test_process_SOURCES = src/tests/test_process.c +src_tests_test_process_LDADD = $(CYGWINFLAGS) +src_tests_test_strtod_nol_SOURCES = src/tests/test_strtod_nol.c local/strutils.c +src_tests_test_strtod_nol_LDADD = $(CYGWINFLAGS) +src_tests_test_shm_SOURCES = src/tests/test_shm.c local/strutils.c +src_tests_test_shm_LDADD = $(CYGWINFLAGS) +library_tests_test_Itemtables_SOURCES = library/tests/test_Itemtables.c +library_tests_test_Itemtables_LDADD = library/libproc2.la +library_tests_test_pids_SOURCES = library/tests/test_pids.c +library_tests_test_pids_LDADD = library/libproc2.la +library_tests_test_uptime_SOURCES = library/tests/test_uptime.c +library_tests_test_uptime_LDADD = library/libproc2.la +library_tests_test_sysinfo_SOURCES = library/tests/test_sysinfo.c +library_tests_test_sysinfo_LDADD = library/libproc2.la +library_tests_test_version_SOURCES = library/tests/test_version.c +library_tests_test_version_LDADD = library/libproc2.la +library_tests_test_namespace_SOURCES = library/tests/test_namespace.c +library_tests_test_namespace_LDADD = library/libproc2.la +@CYGWIN_FALSE@@EXAMPLE_FILES_TRUE@sysconf_DATA = sysctl.conf +BUILT_SOURCES = $(top_srcdir)/.version +all: $(BUILT_SOURCES) config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +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) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign 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__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + 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 +library/libproc2.pc: $(top_builddir)/config.status $(top_srcdir)/library/libproc2.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +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 + +clean-checkPROGRAMS: + @list='$(check_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 +install-sbinPROGRAMS: $(sbin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(sbindir)" || 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)$(sbindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-sbinPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || 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)$(sbindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(sbindir)" && rm -f $$files + +clean-sbinPROGRAMS: + @list='$(sbin_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 +install-usrbin_execPROGRAMS: $(usrbin_exec_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(usrbin_exec_PROGRAMS)'; test -n "$(usrbin_execdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(usrbin_execdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(usrbin_execdir)" || 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)$(usrbin_execdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(usrbin_execdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-usrbin_execPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(usrbin_exec_PROGRAMS)'; test -n "$(usrbin_execdir)" || 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)$(usrbin_execdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(usrbin_execdir)" && rm -f $$files + +clean-usrbin_execPROGRAMS: + @list='$(usrbin_exec_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 + +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}; \ + } +library/$(am__dirstamp): + @$(MKDIR_P) library + @: > library/$(am__dirstamp) +library/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) library/$(DEPDIR) + @: > library/$(DEPDIR)/$(am__dirstamp) +library/devname.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/diskstats.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/escape.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/meminfo.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/namespace.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/numa.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/pids.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/pwcache.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/readproc.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/slabinfo.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/stat.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/sysinfo.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/version.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/vmstat.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/wchan.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) +library/uptime.lo: library/$(am__dirstamp) \ + library/$(DEPDIR)/$(am__dirstamp) + +library/libproc2.la: $(library_libproc2_la_OBJECTS) $(library_libproc2_la_DEPENDENCIES) $(EXTRA_library_libproc2_la_DEPENDENCIES) library/$(am__dirstamp) + $(AM_V_CCLD)$(library_libproc2_la_LINK) -rpath $(libdir) $(library_libproc2_la_OBJECTS) $(library_libproc2_la_LIBADD) $(LIBS) +library/tests/$(am__dirstamp): + @$(MKDIR_P) library/tests + @: > library/tests/$(am__dirstamp) +library/tests/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) library/tests/$(DEPDIR) + @: > library/tests/$(DEPDIR)/$(am__dirstamp) +library/tests/test_Itemtables.$(OBJEXT): \ + library/tests/$(am__dirstamp) \ + library/tests/$(DEPDIR)/$(am__dirstamp) + +library/tests/test_Itemtables$(EXEEXT): $(library_tests_test_Itemtables_OBJECTS) $(library_tests_test_Itemtables_DEPENDENCIES) $(EXTRA_library_tests_test_Itemtables_DEPENDENCIES) library/tests/$(am__dirstamp) + @rm -f library/tests/test_Itemtables$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(library_tests_test_Itemtables_OBJECTS) $(library_tests_test_Itemtables_LDADD) $(LIBS) +library/tests/test_namespace.$(OBJEXT): library/tests/$(am__dirstamp) \ + library/tests/$(DEPDIR)/$(am__dirstamp) + +library/tests/test_namespace$(EXEEXT): $(library_tests_test_namespace_OBJECTS) $(library_tests_test_namespace_DEPENDENCIES) $(EXTRA_library_tests_test_namespace_DEPENDENCIES) library/tests/$(am__dirstamp) + @rm -f library/tests/test_namespace$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(library_tests_test_namespace_OBJECTS) $(library_tests_test_namespace_LDADD) $(LIBS) +library/tests/test_pids.$(OBJEXT): library/tests/$(am__dirstamp) \ + library/tests/$(DEPDIR)/$(am__dirstamp) + +library/tests/test_pids$(EXEEXT): $(library_tests_test_pids_OBJECTS) $(library_tests_test_pids_DEPENDENCIES) $(EXTRA_library_tests_test_pids_DEPENDENCIES) library/tests/$(am__dirstamp) + @rm -f library/tests/test_pids$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(library_tests_test_pids_OBJECTS) $(library_tests_test_pids_LDADD) $(LIBS) +library/tests/test_sysinfo.$(OBJEXT): library/tests/$(am__dirstamp) \ + library/tests/$(DEPDIR)/$(am__dirstamp) + +library/tests/test_sysinfo$(EXEEXT): $(library_tests_test_sysinfo_OBJECTS) $(library_tests_test_sysinfo_DEPENDENCIES) $(EXTRA_library_tests_test_sysinfo_DEPENDENCIES) library/tests/$(am__dirstamp) + @rm -f library/tests/test_sysinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(library_tests_test_sysinfo_OBJECTS) $(library_tests_test_sysinfo_LDADD) $(LIBS) +library/tests/test_uptime.$(OBJEXT): library/tests/$(am__dirstamp) \ + library/tests/$(DEPDIR)/$(am__dirstamp) + +library/tests/test_uptime$(EXEEXT): $(library_tests_test_uptime_OBJECTS) $(library_tests_test_uptime_DEPENDENCIES) $(EXTRA_library_tests_test_uptime_DEPENDENCIES) library/tests/$(am__dirstamp) + @rm -f library/tests/test_uptime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(library_tests_test_uptime_OBJECTS) $(library_tests_test_uptime_LDADD) $(LIBS) +library/tests/test_version.$(OBJEXT): library/tests/$(am__dirstamp) \ + library/tests/$(DEPDIR)/$(am__dirstamp) + +library/tests/test_version$(EXEEXT): $(library_tests_test_version_OBJECTS) $(library_tests_test_version_DEPENDENCIES) $(EXTRA_library_tests_test_version_DEPENDENCIES) library/tests/$(am__dirstamp) + @rm -f library/tests/test_version$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(library_tests_test_version_OBJECTS) $(library_tests_test_version_LDADD) $(LIBS) +src/$(am__dirstamp): + @$(MKDIR_P) src + @: > src/$(am__dirstamp) +src/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/$(DEPDIR) + @: > src/$(DEPDIR)/$(am__dirstamp) +src/free.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +local/$(am__dirstamp): + @$(MKDIR_P) local + @: > local/$(am__dirstamp) +local/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) local/$(DEPDIR) + @: > local/$(DEPDIR)/$(am__dirstamp) +local/strutils.$(OBJEXT): local/$(am__dirstamp) \ + local/$(DEPDIR)/$(am__dirstamp) +local/fileutils.$(OBJEXT): local/$(am__dirstamp) \ + local/$(DEPDIR)/$(am__dirstamp) + +src/free$(EXEEXT): $(src_free_OBJECTS) $(src_free_DEPENDENCIES) $(EXTRA_src_free_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/free$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_free_OBJECTS) $(src_free_LDADD) $(LIBS) +src/kill.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +local/signals.$(OBJEXT): local/$(am__dirstamp) \ + local/$(DEPDIR)/$(am__dirstamp) + +src/kill$(EXEEXT): $(src_kill_OBJECTS) $(src_kill_DEPENDENCIES) $(EXTRA_src_kill_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/kill$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_kill_OBJECTS) $(src_kill_LDADD) $(LIBS) +src/pgrep.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) + +src/pgrep$(EXEEXT): $(src_pgrep_OBJECTS) $(src_pgrep_DEPENDENCIES) $(EXTRA_src_pgrep_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/pgrep$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_pgrep_OBJECTS) $(src_pgrep_LDADD) $(LIBS) +src/pidof.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) + +src/pidof$(EXEEXT): $(src_pidof_OBJECTS) $(src_pidof_DEPENDENCIES) $(EXTRA_src_pidof_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/pidof$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_pidof_OBJECTS) $(src_pidof_LDADD) $(LIBS) + +src/pidwait$(EXEEXT): $(src_pidwait_OBJECTS) $(src_pidwait_DEPENDENCIES) $(EXTRA_src_pidwait_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/pidwait$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_pidwait_OBJECTS) $(src_pidwait_LDADD) $(LIBS) + +src/pkill$(EXEEXT): $(src_pkill_OBJECTS) $(src_pkill_DEPENDENCIES) $(EXTRA_src_pkill_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/pkill$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_pkill_OBJECTS) $(src_pkill_LDADD) $(LIBS) +src/pmap.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) + +src/pmap$(EXEEXT): $(src_pmap_OBJECTS) $(src_pmap_DEPENDENCIES) $(EXTRA_src_pmap_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/pmap$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_pmap_OBJECTS) $(src_pmap_LDADD) $(LIBS) +src/ps/$(am__dirstamp): + @$(MKDIR_P) src/ps + @: > src/ps/$(am__dirstamp) +src/ps/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/ps/$(DEPDIR) + @: > src/ps/$(DEPDIR)/$(am__dirstamp) +src/ps/display.$(OBJEXT): src/ps/$(am__dirstamp) \ + src/ps/$(DEPDIR)/$(am__dirstamp) +src/ps/global.$(OBJEXT): src/ps/$(am__dirstamp) \ + src/ps/$(DEPDIR)/$(am__dirstamp) +src/ps/help.$(OBJEXT): src/ps/$(am__dirstamp) \ + src/ps/$(DEPDIR)/$(am__dirstamp) +src/ps/output.$(OBJEXT): src/ps/$(am__dirstamp) \ + src/ps/$(DEPDIR)/$(am__dirstamp) +src/ps/parser.$(OBJEXT): src/ps/$(am__dirstamp) \ + src/ps/$(DEPDIR)/$(am__dirstamp) +src/ps/select.$(OBJEXT): src/ps/$(am__dirstamp) \ + src/ps/$(DEPDIR)/$(am__dirstamp) +src/ps/signames.$(OBJEXT): src/ps/$(am__dirstamp) \ + src/ps/$(DEPDIR)/$(am__dirstamp) +src/ps/sortformat.$(OBJEXT): src/ps/$(am__dirstamp) \ + src/ps/$(DEPDIR)/$(am__dirstamp) +src/ps/stacktrace.$(OBJEXT): src/ps/$(am__dirstamp) \ + src/ps/$(DEPDIR)/$(am__dirstamp) + +src/ps/pscommand$(EXEEXT): $(src_ps_pscommand_OBJECTS) $(src_ps_pscommand_DEPENDENCIES) $(EXTRA_src_ps_pscommand_DEPENDENCIES) src/ps/$(am__dirstamp) + @rm -f src/ps/pscommand$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_ps_pscommand_OBJECTS) $(src_ps_pscommand_LDADD) $(LIBS) +src/pwdx.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) + +src/pwdx$(EXEEXT): $(src_pwdx_OBJECTS) $(src_pwdx_DEPENDENCIES) $(EXTRA_src_pwdx_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/pwdx$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_pwdx_OBJECTS) $(src_pwdx_LDADD) $(LIBS) +src/skill.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) + +src/skill$(EXEEXT): $(src_skill_OBJECTS) $(src_skill_DEPENDENCIES) $(EXTRA_src_skill_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/skill$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_skill_OBJECTS) $(src_skill_LDADD) $(LIBS) +src/slabtop-slabtop.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +local/src_slabtop-strutils.$(OBJEXT): local/$(am__dirstamp) \ + local/$(DEPDIR)/$(am__dirstamp) +local/src_slabtop-fileutils.$(OBJEXT): local/$(am__dirstamp) \ + local/$(DEPDIR)/$(am__dirstamp) + +src/slabtop$(EXEEXT): $(src_slabtop_OBJECTS) $(src_slabtop_DEPENDENCIES) $(EXTRA_src_slabtop_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/slabtop$(EXEEXT) + $(AM_V_CCLD)$(src_slabtop_LINK) $(src_slabtop_OBJECTS) $(src_slabtop_LDADD) $(LIBS) + +src/snice$(EXEEXT): $(src_snice_OBJECTS) $(src_snice_DEPENDENCIES) $(EXTRA_src_snice_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/snice$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_snice_OBJECTS) $(src_snice_LDADD) $(LIBS) +src/sysctl.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +local/procio.$(OBJEXT): local/$(am__dirstamp) \ + local/$(DEPDIR)/$(am__dirstamp) + +src/sysctl$(EXEEXT): $(src_sysctl_OBJECTS) $(src_sysctl_DEPENDENCIES) $(EXTRA_src_sysctl_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/sysctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_sysctl_OBJECTS) $(src_sysctl_LDADD) $(LIBS) +src/tests/$(am__dirstamp): + @$(MKDIR_P) src/tests + @: > src/tests/$(am__dirstamp) +src/tests/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/tests/$(DEPDIR) + @: > src/tests/$(DEPDIR)/$(am__dirstamp) +src/tests/test_fileutils.$(OBJEXT): src/tests/$(am__dirstamp) \ + src/tests/$(DEPDIR)/$(am__dirstamp) + +src/tests/test_fileutils$(EXEEXT): $(src_tests_test_fileutils_OBJECTS) $(src_tests_test_fileutils_DEPENDENCIES) $(EXTRA_src_tests_test_fileutils_DEPENDENCIES) src/tests/$(am__dirstamp) + @rm -f src/tests/test_fileutils$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_tests_test_fileutils_OBJECTS) $(src_tests_test_fileutils_LDADD) $(LIBS) +src/tests/test_process.$(OBJEXT): src/tests/$(am__dirstamp) \ + src/tests/$(DEPDIR)/$(am__dirstamp) + +src/tests/test_process$(EXEEXT): $(src_tests_test_process_OBJECTS) $(src_tests_test_process_DEPENDENCIES) $(EXTRA_src_tests_test_process_DEPENDENCIES) src/tests/$(am__dirstamp) + @rm -f src/tests/test_process$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_tests_test_process_OBJECTS) $(src_tests_test_process_LDADD) $(LIBS) +src/tests/test_shm.$(OBJEXT): src/tests/$(am__dirstamp) \ + src/tests/$(DEPDIR)/$(am__dirstamp) + +src/tests/test_shm$(EXEEXT): $(src_tests_test_shm_OBJECTS) $(src_tests_test_shm_DEPENDENCIES) $(EXTRA_src_tests_test_shm_DEPENDENCIES) src/tests/$(am__dirstamp) + @rm -f src/tests/test_shm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_tests_test_shm_OBJECTS) $(src_tests_test_shm_LDADD) $(LIBS) +src/tests/test_strtod_nol.$(OBJEXT): src/tests/$(am__dirstamp) \ + src/tests/$(DEPDIR)/$(am__dirstamp) + +src/tests/test_strtod_nol$(EXEEXT): $(src_tests_test_strtod_nol_OBJECTS) $(src_tests_test_strtod_nol_DEPENDENCIES) $(EXTRA_src_tests_test_strtod_nol_DEPENDENCIES) src/tests/$(am__dirstamp) + @rm -f src/tests/test_strtod_nol$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_tests_test_strtod_nol_OBJECTS) $(src_tests_test_strtod_nol_LDADD) $(LIBS) +src/tests/test_strutils.$(OBJEXT): src/tests/$(am__dirstamp) \ + src/tests/$(DEPDIR)/$(am__dirstamp) + +src/tests/test_strutils$(EXEEXT): $(src_tests_test_strutils_OBJECTS) $(src_tests_test_strutils_DEPENDENCIES) $(EXTRA_src_tests_test_strutils_DEPENDENCIES) src/tests/$(am__dirstamp) + @rm -f src/tests/test_strutils$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_tests_test_strutils_OBJECTS) $(src_tests_test_strutils_LDADD) $(LIBS) +src/tload.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) + +src/tload$(EXEEXT): $(src_tload_OBJECTS) $(src_tload_DEPENDENCIES) $(EXTRA_src_tload_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/tload$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_tload_OBJECTS) $(src_tload_LDADD) $(LIBS) +src/top/$(am__dirstamp): + @$(MKDIR_P) src/top + @: > src/top/$(am__dirstamp) +src/top/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/top/$(DEPDIR) + @: > src/top/$(DEPDIR)/$(am__dirstamp) +src/top/top-top.$(OBJEXT): src/top/$(am__dirstamp) \ + src/top/$(DEPDIR)/$(am__dirstamp) +src/top/top-top_nls.$(OBJEXT): src/top/$(am__dirstamp) \ + src/top/$(DEPDIR)/$(am__dirstamp) +local/src_top_top-fileutils.$(OBJEXT): local/$(am__dirstamp) \ + local/$(DEPDIR)/$(am__dirstamp) +local/src_top_top-signals.$(OBJEXT): local/$(am__dirstamp) \ + local/$(DEPDIR)/$(am__dirstamp) +local/src_top_top-strverscmp.$(OBJEXT): local/$(am__dirstamp) \ + local/$(DEPDIR)/$(am__dirstamp) + +src/top/top$(EXEEXT): $(src_top_top_OBJECTS) $(src_top_top_DEPENDENCIES) $(EXTRA_src_top_top_DEPENDENCIES) src/top/$(am__dirstamp) + @rm -f src/top/top$(EXEEXT) + $(AM_V_CCLD)$(src_top_top_LINK) $(src_top_top_OBJECTS) $(src_top_top_LDADD) $(LIBS) +src/uptime.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + +src/uptime$(EXEEXT): $(src_uptime_OBJECTS) $(src_uptime_DEPENDENCIES) $(EXTRA_src_uptime_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/uptime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_uptime_OBJECTS) $(src_uptime_LDADD) $(LIBS) +src/vmstat.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + +src/vmstat$(EXEEXT): $(src_vmstat_OBJECTS) $(src_vmstat_DEPENDENCIES) $(EXTRA_src_vmstat_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/vmstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_vmstat_OBJECTS) $(src_vmstat_LDADD) $(LIBS) +src/w.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) + +src/w$(EXEEXT): $(src_w_OBJECTS) $(src_w_DEPENDENCIES) $(EXTRA_src_w_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/w$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_w_OBJECTS) $(src_w_LDADD) $(LIBS) +src/watch-watch.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +local/src_watch-strutils.$(OBJEXT): local/$(am__dirstamp) \ + local/$(DEPDIR)/$(am__dirstamp) +local/src_watch-fileutils.$(OBJEXT): local/$(am__dirstamp) \ + local/$(DEPDIR)/$(am__dirstamp) + +src/watch$(EXEEXT): $(src_watch_OBJECTS) $(src_watch_DEPENDENCIES) $(EXTRA_src_watch_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/watch$(EXEEXT) + $(AM_V_CCLD)$(src_watch_LINK) $(src_watch_OBJECTS) $(src_watch_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f library/*.$(OBJEXT) + -rm -f library/*.lo + -rm -f library/tests/*.$(OBJEXT) + -rm -f local/*.$(OBJEXT) + -rm -f src/*.$(OBJEXT) + -rm -f src/ps/*.$(OBJEXT) + -rm -f src/tests/*.$(OBJEXT) + -rm -f src/top/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/devname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/diskstats.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/escape.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/meminfo.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/namespace.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/numa.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/pids.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/pwcache.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/readproc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/slabinfo.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/stat.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/sysinfo.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/uptime.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/version.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/vmstat.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/$(DEPDIR)/wchan.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/tests/$(DEPDIR)/test_Itemtables.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/tests/$(DEPDIR)/test_namespace.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/tests/$(DEPDIR)/test_pids.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/tests/$(DEPDIR)/test_sysinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/tests/$(DEPDIR)/test_uptime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@library/tests/$(DEPDIR)/test_version.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/fileutils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/procio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/signals.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/src_slabtop-fileutils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/src_slabtop-strutils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/src_top_top-fileutils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/src_top_top-signals.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/src_top_top-strverscmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/src_watch-fileutils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/src_watch-strutils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/strutils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/free.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/kill.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/pgrep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/pidof.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/pmap.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/pwdx.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/skill.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/slabtop-slabtop.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sysctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/tload.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/uptime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vmstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/w.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/watch-watch.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/ps/$(DEPDIR)/display.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/ps/$(DEPDIR)/global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/ps/$(DEPDIR)/help.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/ps/$(DEPDIR)/output.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/ps/$(DEPDIR)/parser.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/ps/$(DEPDIR)/select.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/ps/$(DEPDIR)/signames.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/ps/$(DEPDIR)/sortformat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/ps/$(DEPDIR)/stacktrace.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/tests/$(DEPDIR)/test_fileutils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/tests/$(DEPDIR)/test_process.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/tests/$(DEPDIR)/test_shm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/tests/$(DEPDIR)/test_strtod_nol.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/tests/$(DEPDIR)/test_strutils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/top/$(DEPDIR)/top-top.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/top/$(DEPDIR)/top-top_nls.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 $@ $< + +src/slabtop-slabtop.o: src/slabtop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_slabtop_CFLAGS) $(CFLAGS) -MT src/slabtop-slabtop.o -MD -MP -MF src/$(DEPDIR)/slabtop-slabtop.Tpo -c -o src/slabtop-slabtop.o `test -f 'src/slabtop.c' || echo '$(srcdir)/'`src/slabtop.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/slabtop-slabtop.Tpo src/$(DEPDIR)/slabtop-slabtop.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/slabtop.c' object='src/slabtop-slabtop.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_slabtop_CFLAGS) $(CFLAGS) -c -o src/slabtop-slabtop.o `test -f 'src/slabtop.c' || echo '$(srcdir)/'`src/slabtop.c + +src/slabtop-slabtop.obj: src/slabtop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_slabtop_CFLAGS) $(CFLAGS) -MT src/slabtop-slabtop.obj -MD -MP -MF src/$(DEPDIR)/slabtop-slabtop.Tpo -c -o src/slabtop-slabtop.obj `if test -f 'src/slabtop.c'; then $(CYGPATH_W) 'src/slabtop.c'; else $(CYGPATH_W) '$(srcdir)/src/slabtop.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/slabtop-slabtop.Tpo src/$(DEPDIR)/slabtop-slabtop.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/slabtop.c' object='src/slabtop-slabtop.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_slabtop_CFLAGS) $(CFLAGS) -c -o src/slabtop-slabtop.obj `if test -f 'src/slabtop.c'; then $(CYGPATH_W) 'src/slabtop.c'; else $(CYGPATH_W) '$(srcdir)/src/slabtop.c'; fi` + +local/src_slabtop-strutils.o: local/strutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_slabtop_CFLAGS) $(CFLAGS) -MT local/src_slabtop-strutils.o -MD -MP -MF local/$(DEPDIR)/src_slabtop-strutils.Tpo -c -o local/src_slabtop-strutils.o `test -f 'local/strutils.c' || echo '$(srcdir)/'`local/strutils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) local/$(DEPDIR)/src_slabtop-strutils.Tpo local/$(DEPDIR)/src_slabtop-strutils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local/strutils.c' object='local/src_slabtop-strutils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_slabtop_CFLAGS) $(CFLAGS) -c -o local/src_slabtop-strutils.o `test -f 'local/strutils.c' || echo '$(srcdir)/'`local/strutils.c + +local/src_slabtop-strutils.obj: local/strutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_slabtop_CFLAGS) $(CFLAGS) -MT local/src_slabtop-strutils.obj -MD -MP -MF local/$(DEPDIR)/src_slabtop-strutils.Tpo -c -o local/src_slabtop-strutils.obj `if test -f 'local/strutils.c'; then $(CYGPATH_W) 'local/strutils.c'; else $(CYGPATH_W) '$(srcdir)/local/strutils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) local/$(DEPDIR)/src_slabtop-strutils.Tpo local/$(DEPDIR)/src_slabtop-strutils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local/strutils.c' object='local/src_slabtop-strutils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_slabtop_CFLAGS) $(CFLAGS) -c -o local/src_slabtop-strutils.obj `if test -f 'local/strutils.c'; then $(CYGPATH_W) 'local/strutils.c'; else $(CYGPATH_W) '$(srcdir)/local/strutils.c'; fi` + +local/src_slabtop-fileutils.o: local/fileutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_slabtop_CFLAGS) $(CFLAGS) -MT local/src_slabtop-fileutils.o -MD -MP -MF local/$(DEPDIR)/src_slabtop-fileutils.Tpo -c -o local/src_slabtop-fileutils.o `test -f 'local/fileutils.c' || echo '$(srcdir)/'`local/fileutils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) local/$(DEPDIR)/src_slabtop-fileutils.Tpo local/$(DEPDIR)/src_slabtop-fileutils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local/fileutils.c' object='local/src_slabtop-fileutils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_slabtop_CFLAGS) $(CFLAGS) -c -o local/src_slabtop-fileutils.o `test -f 'local/fileutils.c' || echo '$(srcdir)/'`local/fileutils.c + +local/src_slabtop-fileutils.obj: local/fileutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_slabtop_CFLAGS) $(CFLAGS) -MT local/src_slabtop-fileutils.obj -MD -MP -MF local/$(DEPDIR)/src_slabtop-fileutils.Tpo -c -o local/src_slabtop-fileutils.obj `if test -f 'local/fileutils.c'; then $(CYGPATH_W) 'local/fileutils.c'; else $(CYGPATH_W) '$(srcdir)/local/fileutils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) local/$(DEPDIR)/src_slabtop-fileutils.Tpo local/$(DEPDIR)/src_slabtop-fileutils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local/fileutils.c' object='local/src_slabtop-fileutils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_slabtop_CFLAGS) $(CFLAGS) -c -o local/src_slabtop-fileutils.obj `if test -f 'local/fileutils.c'; then $(CYGPATH_W) 'local/fileutils.c'; else $(CYGPATH_W) '$(srcdir)/local/fileutils.c'; fi` + +src/top/top-top.o: src/top/top.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -MT src/top/top-top.o -MD -MP -MF src/top/$(DEPDIR)/top-top.Tpo -c -o src/top/top-top.o `test -f 'src/top/top.c' || echo '$(srcdir)/'`src/top/top.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/top/$(DEPDIR)/top-top.Tpo src/top/$(DEPDIR)/top-top.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/top/top.c' object='src/top/top-top.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -c -o src/top/top-top.o `test -f 'src/top/top.c' || echo '$(srcdir)/'`src/top/top.c + +src/top/top-top.obj: src/top/top.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -MT src/top/top-top.obj -MD -MP -MF src/top/$(DEPDIR)/top-top.Tpo -c -o src/top/top-top.obj `if test -f 'src/top/top.c'; then $(CYGPATH_W) 'src/top/top.c'; else $(CYGPATH_W) '$(srcdir)/src/top/top.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/top/$(DEPDIR)/top-top.Tpo src/top/$(DEPDIR)/top-top.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/top/top.c' object='src/top/top-top.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -c -o src/top/top-top.obj `if test -f 'src/top/top.c'; then $(CYGPATH_W) 'src/top/top.c'; else $(CYGPATH_W) '$(srcdir)/src/top/top.c'; fi` + +src/top/top-top_nls.o: src/top/top_nls.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -MT src/top/top-top_nls.o -MD -MP -MF src/top/$(DEPDIR)/top-top_nls.Tpo -c -o src/top/top-top_nls.o `test -f 'src/top/top_nls.c' || echo '$(srcdir)/'`src/top/top_nls.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/top/$(DEPDIR)/top-top_nls.Tpo src/top/$(DEPDIR)/top-top_nls.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/top/top_nls.c' object='src/top/top-top_nls.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -c -o src/top/top-top_nls.o `test -f 'src/top/top_nls.c' || echo '$(srcdir)/'`src/top/top_nls.c + +src/top/top-top_nls.obj: src/top/top_nls.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -MT src/top/top-top_nls.obj -MD -MP -MF src/top/$(DEPDIR)/top-top_nls.Tpo -c -o src/top/top-top_nls.obj `if test -f 'src/top/top_nls.c'; then $(CYGPATH_W) 'src/top/top_nls.c'; else $(CYGPATH_W) '$(srcdir)/src/top/top_nls.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/top/$(DEPDIR)/top-top_nls.Tpo src/top/$(DEPDIR)/top-top_nls.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/top/top_nls.c' object='src/top/top-top_nls.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -c -o src/top/top-top_nls.obj `if test -f 'src/top/top_nls.c'; then $(CYGPATH_W) 'src/top/top_nls.c'; else $(CYGPATH_W) '$(srcdir)/src/top/top_nls.c'; fi` + +local/src_top_top-fileutils.o: local/fileutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -MT local/src_top_top-fileutils.o -MD -MP -MF local/$(DEPDIR)/src_top_top-fileutils.Tpo -c -o local/src_top_top-fileutils.o `test -f 'local/fileutils.c' || echo '$(srcdir)/'`local/fileutils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) local/$(DEPDIR)/src_top_top-fileutils.Tpo local/$(DEPDIR)/src_top_top-fileutils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local/fileutils.c' object='local/src_top_top-fileutils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -c -o local/src_top_top-fileutils.o `test -f 'local/fileutils.c' || echo '$(srcdir)/'`local/fileutils.c + +local/src_top_top-fileutils.obj: local/fileutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -MT local/src_top_top-fileutils.obj -MD -MP -MF local/$(DEPDIR)/src_top_top-fileutils.Tpo -c -o local/src_top_top-fileutils.obj `if test -f 'local/fileutils.c'; then $(CYGPATH_W) 'local/fileutils.c'; else $(CYGPATH_W) '$(srcdir)/local/fileutils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) local/$(DEPDIR)/src_top_top-fileutils.Tpo local/$(DEPDIR)/src_top_top-fileutils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local/fileutils.c' object='local/src_top_top-fileutils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -c -o local/src_top_top-fileutils.obj `if test -f 'local/fileutils.c'; then $(CYGPATH_W) 'local/fileutils.c'; else $(CYGPATH_W) '$(srcdir)/local/fileutils.c'; fi` + +local/src_top_top-signals.o: local/signals.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -MT local/src_top_top-signals.o -MD -MP -MF local/$(DEPDIR)/src_top_top-signals.Tpo -c -o local/src_top_top-signals.o `test -f 'local/signals.c' || echo '$(srcdir)/'`local/signals.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) local/$(DEPDIR)/src_top_top-signals.Tpo local/$(DEPDIR)/src_top_top-signals.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local/signals.c' object='local/src_top_top-signals.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -c -o local/src_top_top-signals.o `test -f 'local/signals.c' || echo '$(srcdir)/'`local/signals.c + +local/src_top_top-signals.obj: local/signals.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -MT local/src_top_top-signals.obj -MD -MP -MF local/$(DEPDIR)/src_top_top-signals.Tpo -c -o local/src_top_top-signals.obj `if test -f 'local/signals.c'; then $(CYGPATH_W) 'local/signals.c'; else $(CYGPATH_W) '$(srcdir)/local/signals.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) local/$(DEPDIR)/src_top_top-signals.Tpo local/$(DEPDIR)/src_top_top-signals.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local/signals.c' object='local/src_top_top-signals.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -c -o local/src_top_top-signals.obj `if test -f 'local/signals.c'; then $(CYGPATH_W) 'local/signals.c'; else $(CYGPATH_W) '$(srcdir)/local/signals.c'; fi` + +local/src_top_top-strverscmp.o: local/strverscmp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -MT local/src_top_top-strverscmp.o -MD -MP -MF local/$(DEPDIR)/src_top_top-strverscmp.Tpo -c -o local/src_top_top-strverscmp.o `test -f 'local/strverscmp.c' || echo '$(srcdir)/'`local/strverscmp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) local/$(DEPDIR)/src_top_top-strverscmp.Tpo local/$(DEPDIR)/src_top_top-strverscmp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local/strverscmp.c' object='local/src_top_top-strverscmp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -c -o local/src_top_top-strverscmp.o `test -f 'local/strverscmp.c' || echo '$(srcdir)/'`local/strverscmp.c + +local/src_top_top-strverscmp.obj: local/strverscmp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -MT local/src_top_top-strverscmp.obj -MD -MP -MF local/$(DEPDIR)/src_top_top-strverscmp.Tpo -c -o local/src_top_top-strverscmp.obj `if test -f 'local/strverscmp.c'; then $(CYGPATH_W) 'local/strverscmp.c'; else $(CYGPATH_W) '$(srcdir)/local/strverscmp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) local/$(DEPDIR)/src_top_top-strverscmp.Tpo local/$(DEPDIR)/src_top_top-strverscmp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local/strverscmp.c' object='local/src_top_top-strverscmp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_top_top_CFLAGS) $(CFLAGS) -c -o local/src_top_top-strverscmp.obj `if test -f 'local/strverscmp.c'; then $(CYGPATH_W) 'local/strverscmp.c'; else $(CYGPATH_W) '$(srcdir)/local/strverscmp.c'; fi` + +src/watch-watch.o: src/watch.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_watch_CFLAGS) $(CFLAGS) -MT src/watch-watch.o -MD -MP -MF src/$(DEPDIR)/watch-watch.Tpo -c -o src/watch-watch.o `test -f 'src/watch.c' || echo '$(srcdir)/'`src/watch.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/watch-watch.Tpo src/$(DEPDIR)/watch-watch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/watch.c' object='src/watch-watch.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_watch_CFLAGS) $(CFLAGS) -c -o src/watch-watch.o `test -f 'src/watch.c' || echo '$(srcdir)/'`src/watch.c + +src/watch-watch.obj: src/watch.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_watch_CFLAGS) $(CFLAGS) -MT src/watch-watch.obj -MD -MP -MF src/$(DEPDIR)/watch-watch.Tpo -c -o src/watch-watch.obj `if test -f 'src/watch.c'; then $(CYGPATH_W) 'src/watch.c'; else $(CYGPATH_W) '$(srcdir)/src/watch.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/watch-watch.Tpo src/$(DEPDIR)/watch-watch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/watch.c' object='src/watch-watch.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_watch_CFLAGS) $(CFLAGS) -c -o src/watch-watch.obj `if test -f 'src/watch.c'; then $(CYGPATH_W) 'src/watch.c'; else $(CYGPATH_W) '$(srcdir)/src/watch.c'; fi` + +local/src_watch-strutils.o: local/strutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_watch_CFLAGS) $(CFLAGS) -MT local/src_watch-strutils.o -MD -MP -MF local/$(DEPDIR)/src_watch-strutils.Tpo -c -o local/src_watch-strutils.o `test -f 'local/strutils.c' || echo '$(srcdir)/'`local/strutils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) local/$(DEPDIR)/src_watch-strutils.Tpo local/$(DEPDIR)/src_watch-strutils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local/strutils.c' object='local/src_watch-strutils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_watch_CFLAGS) $(CFLAGS) -c -o local/src_watch-strutils.o `test -f 'local/strutils.c' || echo '$(srcdir)/'`local/strutils.c + +local/src_watch-strutils.obj: local/strutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_watch_CFLAGS) $(CFLAGS) -MT local/src_watch-strutils.obj -MD -MP -MF local/$(DEPDIR)/src_watch-strutils.Tpo -c -o local/src_watch-strutils.obj `if test -f 'local/strutils.c'; then $(CYGPATH_W) 'local/strutils.c'; else $(CYGPATH_W) '$(srcdir)/local/strutils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) local/$(DEPDIR)/src_watch-strutils.Tpo local/$(DEPDIR)/src_watch-strutils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local/strutils.c' object='local/src_watch-strutils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_watch_CFLAGS) $(CFLAGS) -c -o local/src_watch-strutils.obj `if test -f 'local/strutils.c'; then $(CYGPATH_W) 'local/strutils.c'; else $(CYGPATH_W) '$(srcdir)/local/strutils.c'; fi` + +local/src_watch-fileutils.o: local/fileutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_watch_CFLAGS) $(CFLAGS) -MT local/src_watch-fileutils.o -MD -MP -MF local/$(DEPDIR)/src_watch-fileutils.Tpo -c -o local/src_watch-fileutils.o `test -f 'local/fileutils.c' || echo '$(srcdir)/'`local/fileutils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) local/$(DEPDIR)/src_watch-fileutils.Tpo local/$(DEPDIR)/src_watch-fileutils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local/fileutils.c' object='local/src_watch-fileutils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_watch_CFLAGS) $(CFLAGS) -c -o local/src_watch-fileutils.o `test -f 'local/fileutils.c' || echo '$(srcdir)/'`local/fileutils.c + +local/src_watch-fileutils.obj: local/fileutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_watch_CFLAGS) $(CFLAGS) -MT local/src_watch-fileutils.obj -MD -MP -MF local/$(DEPDIR)/src_watch-fileutils.Tpo -c -o local/src_watch-fileutils.obj `if test -f 'local/fileutils.c'; then $(CYGPATH_W) 'local/fileutils.c'; else $(CYGPATH_W) '$(srcdir)/local/fileutils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) local/$(DEPDIR)/src_watch-fileutils.Tpo local/$(DEPDIR)/src_watch-fileutils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local/fileutils.c' object='local/src_watch-fileutils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_watch_CFLAGS) $(CFLAGS) -c -o local/src_watch-fileutils.obj `if test -f 'local/fileutils.c'; then $(CYGPATH_W) 'local/fileutils.c'; else $(CYGPATH_W) '$(srcdir)/local/fileutils.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf library/.libs library/_libs + -rm -rf library/tests/.libs library/tests/_libs + -rm -rf src/.libs src/_libs + -rm -rf src/ps/.libs src/ps/_libs + -rm -rf src/tests/.libs src/tests/_libs + -rm -rf src/top/.libs src/top/_libs + +distclean-libtool: + -rm -f libtool config.lt +install-man1: $(dist_man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) +install-man3: $(dist_man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS)'; \ + test -n "$(man3dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.3[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ + done; } + +uninstall-man3: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man3dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.3[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) +install-man5: $(dist_man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS)'; \ + test -n "$(man5dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.5[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ + done; } + +uninstall-man5: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man5dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.5[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) +install-man8: $(dist_man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS)'; \ + test -n "$(man8dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.8[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ + done; } + +uninstall-man8: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man8dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.8[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) +install-dist_procpsngDATA: $(dist_procpsng_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_procpsng_DATA)'; test -n "$(procpsngdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(procpsngdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(procpsngdir)" || 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)$(procpsngdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(procpsngdir)" || exit $$?; \ + done + +uninstall-dist_procpsngDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_procpsng_DATA)'; test -n "$(procpsngdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(procpsngdir)'; $(am__uninstall_files_from_dir) +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-sysconfDATA: $(sysconf_DATA) + @$(NORMAL_INSTALL) + @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" || 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)$(sysconfdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \ + done + +uninstall-sysconfDATA: + @$(NORMAL_UNINSTALL) + @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(sysconfdir)'; $(am__uninstall_files_from_dir) +install-library_libproc2_la_includeHEADERS: $(library_libproc2_la_include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(library_libproc2_la_include_HEADERS)'; test -n "$(library_libproc2_la_includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(library_libproc2_la_includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(library_libproc2_la_includedir)" || 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)$(library_libproc2_la_includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(library_libproc2_la_includedir)" || exit $$?; \ + done + +uninstall-library_libproc2_la_includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(library_libproc2_la_include_HEADERS)'; test -n "$(library_libproc2_la_includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(library_libproc2_la_includedir)'; $(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 + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: $(check_PROGRAMS) + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +library/tests/test_pids.log: library/tests/test_pids$(EXEEXT) + @p='library/tests/test_pids$(EXEEXT)'; \ + b='library/tests/test_pids'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +library/tests/test_uptime.log: library/tests/test_uptime$(EXEEXT) + @p='library/tests/test_uptime$(EXEEXT)'; \ + b='library/tests/test_uptime'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +library/tests/test_sysinfo.log: library/tests/test_sysinfo$(EXEEXT) + @p='library/tests/test_sysinfo$(EXEEXT)'; \ + b='library/tests/test_sysinfo'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +library/tests/test_version.log: library/tests/test_version$(EXEEXT) + @p='library/tests/test_version$(EXEEXT)'; \ + b='library/tests/test_version'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +library/tests/test_namespace.log: library/tests/test_namespace$(EXEEXT) + @p='library/tests/test_namespace$(EXEEXT)'; \ + b='library/tests/test_namespace'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +src/tests/test_fileutils.log: src/tests/test_fileutils$(EXEEXT) + @p='src/tests/test_fileutils$(EXEEXT)'; \ + b='src/tests/test_fileutils'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +src/tests/test_strtod_nol.log: src/tests/test_strtod_nol$(EXEEXT) + @p='src/tests/test_strtod_nol$(EXEEXT)'; \ + b='src/tests/test_strtod_nol'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(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-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(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 ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ + 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) $(AM_DISTCHECK_DVI_TARGET) \ + && $(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 + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(MANS) $(DATA) $(HEADERS) \ + config.h +install-binPROGRAMS: install-libLTLIBRARIES + +install-checkPROGRAMS: install-libLTLIBRARIES + +install-sbinPROGRAMS: install-libLTLIBRARIES + +install-usrbinexecPROGRAMS: install-libLTLIBRARIES + +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(usrbin_execdir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(procpsngdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(sysconfdir)" "$(DESTDIR)$(library_libproc2_la_includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) 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: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +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) + -rm -f library/$(DEPDIR)/$(am__dirstamp) + -rm -f library/$(am__dirstamp) + -rm -f library/tests/$(DEPDIR)/$(am__dirstamp) + -rm -f library/tests/$(am__dirstamp) + -rm -f local/$(DEPDIR)/$(am__dirstamp) + -rm -f local/$(am__dirstamp) + -rm -f src/$(DEPDIR)/$(am__dirstamp) + -rm -f src/$(am__dirstamp) + -rm -f src/ps/$(DEPDIR)/$(am__dirstamp) + -rm -f src/ps/$(am__dirstamp) + -rm -f src/tests/$(DEPDIR)/$(am__dirstamp) + -rm -f src/tests/$(am__dirstamp) + -rm -f src/top/$(DEPDIR)/$(am__dirstamp) + -rm -f src/top/$(am__dirstamp) + +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-recursive + +clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-sbinPROGRAMS \ + clean-usrbin_execPROGRAMS mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f library/$(DEPDIR)/devname.Plo + -rm -f library/$(DEPDIR)/diskstats.Plo + -rm -f library/$(DEPDIR)/escape.Plo + -rm -f library/$(DEPDIR)/meminfo.Plo + -rm -f library/$(DEPDIR)/namespace.Plo + -rm -f library/$(DEPDIR)/numa.Plo + -rm -f library/$(DEPDIR)/pids.Plo + -rm -f library/$(DEPDIR)/pwcache.Plo + -rm -f library/$(DEPDIR)/readproc.Plo + -rm -f library/$(DEPDIR)/slabinfo.Plo + -rm -f library/$(DEPDIR)/stat.Plo + -rm -f library/$(DEPDIR)/sysinfo.Plo + -rm -f library/$(DEPDIR)/uptime.Plo + -rm -f library/$(DEPDIR)/version.Plo + -rm -f library/$(DEPDIR)/vmstat.Plo + -rm -f library/$(DEPDIR)/wchan.Plo + -rm -f library/tests/$(DEPDIR)/test_Itemtables.Po + -rm -f library/tests/$(DEPDIR)/test_namespace.Po + -rm -f library/tests/$(DEPDIR)/test_pids.Po + -rm -f library/tests/$(DEPDIR)/test_sysinfo.Po + -rm -f library/tests/$(DEPDIR)/test_uptime.Po + -rm -f library/tests/$(DEPDIR)/test_version.Po + -rm -f local/$(DEPDIR)/fileutils.Po + -rm -f local/$(DEPDIR)/procio.Po + -rm -f local/$(DEPDIR)/signals.Po + -rm -f local/$(DEPDIR)/src_slabtop-fileutils.Po + -rm -f local/$(DEPDIR)/src_slabtop-strutils.Po + -rm -f local/$(DEPDIR)/src_top_top-fileutils.Po + -rm -f local/$(DEPDIR)/src_top_top-signals.Po + -rm -f local/$(DEPDIR)/src_top_top-strverscmp.Po + -rm -f local/$(DEPDIR)/src_watch-fileutils.Po + -rm -f local/$(DEPDIR)/src_watch-strutils.Po + -rm -f local/$(DEPDIR)/strutils.Po + -rm -f src/$(DEPDIR)/free.Po + -rm -f src/$(DEPDIR)/kill.Po + -rm -f src/$(DEPDIR)/pgrep.Po + -rm -f src/$(DEPDIR)/pidof.Po + -rm -f src/$(DEPDIR)/pmap.Po + -rm -f src/$(DEPDIR)/pwdx.Po + -rm -f src/$(DEPDIR)/skill.Po + -rm -f src/$(DEPDIR)/slabtop-slabtop.Po + -rm -f src/$(DEPDIR)/sysctl.Po + -rm -f src/$(DEPDIR)/tload.Po + -rm -f src/$(DEPDIR)/uptime.Po + -rm -f src/$(DEPDIR)/vmstat.Po + -rm -f src/$(DEPDIR)/w.Po + -rm -f src/$(DEPDIR)/watch-watch.Po + -rm -f src/ps/$(DEPDIR)/display.Po + -rm -f src/ps/$(DEPDIR)/global.Po + -rm -f src/ps/$(DEPDIR)/help.Po + -rm -f src/ps/$(DEPDIR)/output.Po + -rm -f src/ps/$(DEPDIR)/parser.Po + -rm -f src/ps/$(DEPDIR)/select.Po + -rm -f src/ps/$(DEPDIR)/signames.Po + -rm -f src/ps/$(DEPDIR)/sortformat.Po + -rm -f src/ps/$(DEPDIR)/stacktrace.Po + -rm -f src/tests/$(DEPDIR)/test_fileutils.Po + -rm -f src/tests/$(DEPDIR)/test_process.Po + -rm -f src/tests/$(DEPDIR)/test_shm.Po + -rm -f src/tests/$(DEPDIR)/test_strtod_nol.Po + -rm -f src/tests/$(DEPDIR)/test_strutils.Po + -rm -f src/top/$(DEPDIR)/top-top.Po + -rm -f src/top/$(DEPDIR)/top-top_nls.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile 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-dist_procpsngDATA \ + install-library_libproc2_la_includeHEADERS install-man \ + install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES \ + install-sbinPROGRAMS install-sysconfDATA \ + install-usrbin_execPROGRAMS + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: install-man1 install-man3 install-man5 install-man8 + +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 library/$(DEPDIR)/devname.Plo + -rm -f library/$(DEPDIR)/diskstats.Plo + -rm -f library/$(DEPDIR)/escape.Plo + -rm -f library/$(DEPDIR)/meminfo.Plo + -rm -f library/$(DEPDIR)/namespace.Plo + -rm -f library/$(DEPDIR)/numa.Plo + -rm -f library/$(DEPDIR)/pids.Plo + -rm -f library/$(DEPDIR)/pwcache.Plo + -rm -f library/$(DEPDIR)/readproc.Plo + -rm -f library/$(DEPDIR)/slabinfo.Plo + -rm -f library/$(DEPDIR)/stat.Plo + -rm -f library/$(DEPDIR)/sysinfo.Plo + -rm -f library/$(DEPDIR)/uptime.Plo + -rm -f library/$(DEPDIR)/version.Plo + -rm -f library/$(DEPDIR)/vmstat.Plo + -rm -f library/$(DEPDIR)/wchan.Plo + -rm -f library/tests/$(DEPDIR)/test_Itemtables.Po + -rm -f library/tests/$(DEPDIR)/test_namespace.Po + -rm -f library/tests/$(DEPDIR)/test_pids.Po + -rm -f library/tests/$(DEPDIR)/test_sysinfo.Po + -rm -f library/tests/$(DEPDIR)/test_uptime.Po + -rm -f library/tests/$(DEPDIR)/test_version.Po + -rm -f local/$(DEPDIR)/fileutils.Po + -rm -f local/$(DEPDIR)/procio.Po + -rm -f local/$(DEPDIR)/signals.Po + -rm -f local/$(DEPDIR)/src_slabtop-fileutils.Po + -rm -f local/$(DEPDIR)/src_slabtop-strutils.Po + -rm -f local/$(DEPDIR)/src_top_top-fileutils.Po + -rm -f local/$(DEPDIR)/src_top_top-signals.Po + -rm -f local/$(DEPDIR)/src_top_top-strverscmp.Po + -rm -f local/$(DEPDIR)/src_watch-fileutils.Po + -rm -f local/$(DEPDIR)/src_watch-strutils.Po + -rm -f local/$(DEPDIR)/strutils.Po + -rm -f src/$(DEPDIR)/free.Po + -rm -f src/$(DEPDIR)/kill.Po + -rm -f src/$(DEPDIR)/pgrep.Po + -rm -f src/$(DEPDIR)/pidof.Po + -rm -f src/$(DEPDIR)/pmap.Po + -rm -f src/$(DEPDIR)/pwdx.Po + -rm -f src/$(DEPDIR)/skill.Po + -rm -f src/$(DEPDIR)/slabtop-slabtop.Po + -rm -f src/$(DEPDIR)/sysctl.Po + -rm -f src/$(DEPDIR)/tload.Po + -rm -f src/$(DEPDIR)/uptime.Po + -rm -f src/$(DEPDIR)/vmstat.Po + -rm -f src/$(DEPDIR)/w.Po + -rm -f src/$(DEPDIR)/watch-watch.Po + -rm -f src/ps/$(DEPDIR)/display.Po + -rm -f src/ps/$(DEPDIR)/global.Po + -rm -f src/ps/$(DEPDIR)/help.Po + -rm -f src/ps/$(DEPDIR)/output.Po + -rm -f src/ps/$(DEPDIR)/parser.Po + -rm -f src/ps/$(DEPDIR)/select.Po + -rm -f src/ps/$(DEPDIR)/signames.Po + -rm -f src/ps/$(DEPDIR)/sortformat.Po + -rm -f src/ps/$(DEPDIR)/stacktrace.Po + -rm -f src/tests/$(DEPDIR)/test_fileutils.Po + -rm -f src/tests/$(DEPDIR)/test_process.Po + -rm -f src/tests/$(DEPDIR)/test_shm.Po + -rm -f src/tests/$(DEPDIR)/test_strtod_nol.Po + -rm -f src/tests/$(DEPDIR)/test_strutils.Po + -rm -f src/top/$(DEPDIR)/top-top.Po + -rm -f src/top/$(DEPDIR)/top-top_nls.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-dist_procpsngDATA \ + uninstall-libLTLIBRARIES \ + uninstall-library_libproc2_la_includeHEADERS uninstall-man \ + uninstall-pkgconfigDATA uninstall-sbinPROGRAMS \ + uninstall-sysconfDATA uninstall-usrbin_execPROGRAMS + +uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5 \ + uninstall-man8 + +.MAKE: $(am__recursive_targets) all check check-am install install-am \ + install-exec install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--depfiles am--refresh check check-TESTS check-am clean \ + clean-binPROGRAMS clean-checkPROGRAMS clean-cscope \ + clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-sbinPROGRAMS clean-usrbin_execPROGRAMS 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 dist-zstd distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am \ + install-dist_procpsngDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-library_libproc2_la_includeHEADERS install-man \ + install-man1 install-man3 install-man5 install-man8 \ + install-pdf install-pdf-am install-pkgconfigDATA install-ps \ + install-ps-am install-sbinPROGRAMS install-strip \ + install-sysconfDATA install-usrbin_execPROGRAMS installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-dist_procpsngDATA \ + uninstall-libLTLIBRARIES \ + uninstall-library_libproc2_la_includeHEADERS uninstall-man \ + uninstall-man1 uninstall-man3 uninstall-man5 uninstall-man8 \ + uninstall-pkgconfigDATA uninstall-sbinPROGRAMS \ + uninstall-sysconfDATA uninstall-usrbin_execPROGRAMS + +.PRECIOUS: Makefile + + +@CYGWIN_TRUE@ src_skill_LDADD = $(CYGWINFLAGS) +@CYGWIN_TRUE@ src_kill_LDADD = $(CYGWINFLAGS) +@CYGWIN_TRUE@ src_free_LDADD = $(CYGWINFLAGS) +@CYGWIN_TRUE@ src_pgrep_LDADD = $(CYGWINFLAGS) +@CYGWIN_TRUE@ src_pkill_LDADD = $(CYGWINFLAGS) +@CYGWIN_TRUE@ src_pidof_LDADD = $(CYGWINFLAGS) +@CYGWIN_TRUE@ src_pmap_LDADD = $(CYGWINFLAGS) +@CYGWIN_TRUE@ src_snice_LDADD = $(CYGWINFLAGS) +@CYGWIN_TRUE@ src_tload_LDADD = $(CYGWINFLAGS) +@CYGWIN_TRUE@ src_uptime_LDADD = $(CYGWINFLAGS) +@CYGWIN_TRUE@ src_w_LDADD = $(CYGWINFLAGS) +@CYGWIN_TRUE@ src_vmstat_LDADD = $(CYGWINFLAGS) + +check-lib: clean + $(MAKE) CFLAGS=-DITEMTABLE_DEBUG library/tests/test_Itemtables + $(top_builddir)/library/tests/test_Itemtables + $(MAKE) clean &>/dev/null + +# Automake should do this, but it doesn't +check: $(check_PROGRAMS) $(PROGRAMS) + +$(top_srcdir)/.version: + touch $(top_srcdir)/.version + echo $(VERSION) > $@-t && mv $@-t $@ +dist-hook: + echo $(VERSION) > $(distdir)/.tarball-version + +get-trans: + echo "Getting the latest translations from translationproject.org..." + rsync -Lrtvz translationproject.org::tp/latest/procps-ng/ po + rsync -Lrtvz translationproject.org::tp/latest/procps-ng-man/ po-man + rm -f po-man/man.stamp + make -C po-man man.stamp + +# 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..3f2158d --- /dev/null +++ b/NEWS @@ -0,0 +1,882 @@ +procps-ng-4.0.4 +--------------- + * library (API & ABI unchanged) + increment revision: 0:2:0 + tolerates all potential 'cpuinfo' formats issue #272 + restore the proper main thread tics valuations issue #280 + Remove myself from proc count merge #193 + Refactor the escape code Debian #1035649 + * free: -L one line output issue #156 + * pgrep: Use only --signal option for signal Debian #1031765 + * pgrep: suppress >15 warning if using regex Debian #1037450 + * pidof: Add -t option to show threads merge #190 + * pmap: Reset totals between processes issue #298 + * ps: fixed missing or corrupted fields with -m option Debian #1036631, issue #279 + * ps: Fix buffer overflow in -C option CVE-2023-4016 Debian #1042887, issue #297 + * ps: Add --signames to show signal names in masks merge #98 + * sysctl: -N show names merge #198, RH #2222056 + * tests: dont compare floats with == issue #271 + * tests: skips tests if maps missing merge #197, Gentoo #583036 + * top: bad command line arguments yield EXIT_FAILURE issue #273 + * top: avoids keystroke induced '%Cpu' distortions + * top: includes VM (guest) tics in 'system' overhead issue #274 + * top: includes VM (guest) tics with '!' toggle merge #179 + * top: lessen summary cpu distortions on first display merge #180 + * top: better backspace handling wtth line edits issue #278 + * vmstat: Print guest time in non-wide mode + * w: Fix musl UT_HOSTSIZE issue + * watch: Add color support at compile time issue #296 + +procps-ng-4.0.3 +--------------- + * library + Only changes were in copyright headers and tests + * docs: Don't install English manpages twice + * pgrep: Add -H match on userspace signal handler merge #165 + * pgrep: make --terminal respect other criteria + * ps: c flag shows command name again Debian #1026326 + * ps.1: Match drs description from top.1 merge #156 + * skill: Match on -p again Debian #1025915 + * top: E/P-core toggle ('5' key) added to help + * vmstat: Referesh memory statistics Debian #1027963 + * vmstat: Fix initial si,so,bi,bo,in & cs values issue #15 + Debian #668580 + * vmstat: Fix conversion errors due to precision merge #75 + * w: Add --pids option merge #159 + * watch: Pass through beep issue #104 + * watch: -r option to not re-exec on SIGWINCH merge #125 + * watch: find eol with --no-linewrap merge #157 + +procps-ng-4.0.2 +--------------- + * library revision - 0:1:0 + Handle absent 'core_id' in /proc/cpuinfo + * w: Show time with D_TIME_BITS=64 on 32bit env issue #256 + +procps-ng-4.0.1 +--------------- + * library + Re-add elogind support merge #151 + Used memory is Total - Available + Renaming, it is now libproc2 + * free: Use --kilo when only specifying --si merge #163 + * pgrep: Add -A to ignore ancestors merge #160 + * pidwait: Better warning if pidfd_open not implemented + * pmap: Dont reuse stdin filehandle issue #231 + * ps: threads again display when -L is used with -q issue #234 + * ps: proper aix format string behavior was restored + * sysctl: print dotted keys again + * top: fix 'smaps' bug preventing build under clang issue #235 + * top: column highlighting allowed under 'L' or 'O' + * top: can alter autogroup nice value (like 'r' renice) + * top: can display the following with no need to scroll + * cmdline, control groups, environment, + supplimentary groups, namespaces + * top: adds a 'message log' recall capability + * top: will accept utf8 multi-byte input with support + for full line editing and previous line recall + * top: can show more than 2 abreast in summary display + * top: can distinguish P-Core and E-core cpus + * top: can filter both P-Core and E-core cpus + * watch: Add equexit no-change and exit option merge #153 + +procps-ng-4.0.0 +--------------- + * Rename pwait to pidwait + * free: Add committed line option merge #25 + * free: Fix -h --si combined options issue #133, #223 + * free: Fix first column justification issue #229, #204, #206, Debian #1001689 + * free: Better spacing for Chinese language issue #213 + * library: renamed to libproc-2 and reset to 0:0:0 + * library: add support for accessing smaps_rollup issue #112, #201 + * library: add support for accessing autogroups + * library: add support for LIBPROC_HIDE_KERNEL env var merge #147 + * library: add support for cpu utilization to pids i/f + * pkill: Check for lt- variants of program name issue #192 + * pgrep: Add newline after regex error message merge #91 + * pgrep: Fix selection where uid/gid > 2^31 merge !146 + * pgrep: Select on cgroup v2 paths issue #168 + * ps: Add OOM and OOMADJ fields issue #198 + * ps: Add IO Accounting fields issue #184 + * ps: Add PSS and USS fields issue #112 + * ps: Add two new autogroup fields + * ps: Ignore SIGURG merge !142 + * slabtop: Don't combine d and o options issue #160 + * sysctl: Add support for systemd glob patterns issue #191 + * sysctl: Check resolved path to be under /proc/sys issue #179 + * sysctl: return non-zero if EINVAL return for write merge #76 + * sysctl.conf.5: Note max line length issue #77 + * top: added LOGID similar to 3.3.13 ps LUID + * top: added EXE identical to 3.3.17 ps EXE + * top: exploit some library smaps_rollup provisions issue #112 + * top: added four new IO accounting fields issue #184 + * top: 'F' key is now a new forest view 'focus' toggle + * top: summary area memory lines can print two abreast + * top: added two new autogroup fields + * top: added long versions of command line options + * top: added cpu utilization & 2 time related fields + * top: the time related fields can now be user scaled + * uptime: print short/pretty format correctly issue #217 + * vmstat: add -y option to remove first line merge !72 + +procps-ng-3.3.17 +--------------- + * library: Incremented to 8:3:0 + (no removals or additions, internal changes only) + * all: properly handle utf8 cmdline translations issue #176 + * kill: Pass int to signalled process merge #32 + * pgrep: Pass int to signalled process merge #32 + * pgrep: Check sanity of SG_ARG_MAX issue #152 + * pgrep: Add older than selection merge #79 + * pidof: Quiet mode merge #83 + * pidof: show worker threads Redhat #1803640 + * ps.1: Mention stime alias issue #164 + * ps: check also match on truncated 16 char comm names + * ps: Add exe output option Redhat #1399206 + * pwait: New command waits for a process merge #97 + * sysctl: Match systemd directory order Debian #950788 + * sysctl: Document directory order Debian #951550 + * top: ensure config file backward compatibility Debian #951335 + * top: add command line 'e' for symmetry with 'E' issue #165 + * top: add '4' toggle for two abreast cpu display issue #172 + * top: add '!' toggle for combining multiple cpus + * top: fix potential SEGV involving -p switch merge #114 + * vmstat: Wide mode gives wider proc columns merge #48 + * watch: Add environment variable for interval merge #62 + * watch: Add no linewrap option issue #182 + * watch: Support more colors merge #106,#109 + * free,uptime,slabtop: complain about extra ops issue #181 + +procps-ng-3.3.16 +---------------- + * docs: Use correct symbols for -h option in free.1 Debian #898774 + * docs: ps.1 now warns about command name length issue #101 + * pgrep: Match on runstate issue #109, Debian #919381 + * top: can now exploit 256-color terminals issue #96 + * top: preserves 'other filters' in configuration file issue #99 + * top: can now collapse/expand forest view children issue #99 + * top: parent %CPU time includes collapsed children + * top: improve xterm support for vim navigation keys issue #135 + * top: avoid segmentation fault at program termination Redhat #1737552 + +procps-ng-3.3.15 +---------------- + * library: Increment to 8:0:1 + No removals, no new functions + Changes: slab and pid structures + * library: Just check for SIGLOST and don't delete it issue #93 + * library: Fix integer overflow and LPE in file2strvec CVE-2018-1124 + * library: Use size_t for alloc functions CVE-2018-1126 + * library: Increase comm size to 64 + * pgrep: Fix stack-based buffer overflow CVE-2018-1125 + * pgrep: Remove >15 warning as comm can be longer issue #92 + * ps: Fix buffer overflow in output buffer, causing DOS CVE-2018-1123 + * ps: Increase command name selection field to 64 + * top: Don't use cwd for location of config CVE-2018-1122 + +procps-ng-3.3.14 +---------------- + * free: Fix scaling on 32-bit systems issue #89 + * pgrep: Don't segfault on non match Debian #894917 + * pgrep/pkill: Revert so matches all namespaces issue #91 + * library: Build on non-glibc systems issue #88 + +procps-ng-3.3.13 +---------------- + * library: Increment to 7:0:1 + No changes, no removals + New fuctions: numa_init, numa_max_node, numa_node_of_cpu, + numa_uninit, xalloc_err_handler + * doc: Document I idle state in ps.1 and top.1 Debian #886967 + * free: fix some of the SI multiples issue #45 + * kill: -l space between name parses correctly Debian #854407 + * library: dont use vm_min_free on non Linux Debian #831396 + * library: dont use SIGPWR on FreeBSD Debian #832148 + * library: don't strip off wchan prefixes (ps & top) Redhat #1322111 + * pgrep: warn about 15+ char name only if -f not used + * pgrep/pkill: only match in same namespace by default merge #41 + * pidof: specify separator between pids merge #58 + * pkill: Return 0 only if we can kill process Debian #852758 + * pmap: fix duplicate output line under '-x' option Redhat #1374061 + * ps: avoid eip/esp address truncations Debian #846361 + * ps: recognizes SCHED_DEADLINE as valid CPU scheduler + * ps: display NUMA node under which a thread ran issue #58 + * ps: Add seconds display for cputime and time merge #43 + * ps: Add LUID field merge #57 Redhat #1518986 + * sysctl: Permit empty string for value issue #74 + * sysctl: Don't segv when file not available issue #76 + * sysctl: Read and write large buffers merge #56 + * top: add config file support for XDG specification + * top: eliminated minor libnuma memory leak + * top: show fewer memory decimal places (configurable) issue #50 + * top: provide command line switch for memory scaling Redhat #1034466, issue #53 + * top: provide command line switch for CPU States issue #55 + * top: provides more accurate cpu usage at startup Redhat #1182327 + * top: display NUMA node under which a thread ran issue #58 + * top: fix argument parsing quirk resulting in SEGV Redhat #1450429 + * top: delay interval accepts non-locale radix point Redhat #1182248 + * top: address a wishlist man page NLS suggestion Debian #865689 + * top: fix potential distortion in 'Mem' graph display issue #64 + * top: provide proper multi-byte string handling issue #68 + * top: startup defaults are fully customizable Redhat #1153049, #1499410, issues #6, #78 + * see man page 6c. SYSTEM Configuration File + * watch: define HOST_NAME_MAX where not defined Debian #830734 + * vmstat: Fix alignment for disk partition format issue #69 + * watch: Support ANSI 39,49 reset sequences issue #73 + +procps-ng-3.3.12 +---------------- + * libprocps API 6:0:0 + * build: formerly optional --enable-oomem unconditional + * free: man document rewritten for shared Debian #755233 + * free: interpret intervals in non-locale way Debian #692113 + * kill: report error if cannot kill process Debian #733172 + * library: refine calculation of 'cached' memory + * library: find tty quicker Debian #770215 + * library: eliminate threads display inconsistencies Redhat #1284091 + * pidof: check cmd if space found in argv0 + * pmap: fixed detail parsing on long mapping lines + * pmap: fix occasional incorrect memory usage values Redhat #1262864 + * ps: sort by cgroup Debian #692279 + * ps: display control group name with -o cgname + * ps: fallback to attr/current for context Debian #786956 + * ps: enabled broken 'thcount' option Redhat #1174313 + * tests: conditionally add prctl Debian #816237 + * top: displays the 3 new linux-4.5 RES memory fields + * top: man page memory fields corrected + new narrative + * top: added display of CGNAME (control group name) + * top: is now more responsive to cpus brought online + * top: namespace cols use suppressible zero + * top: zero suppress ('0') includes out-of-memory & nice + * top: better 'i' toggle management when scrolled + * top: the '=' key now includes active locate requests + * vmstat: devices exceeding 15 chars now displayed Redhat #586078 + * watch: hostname added to header + * watch: better handling ANSI including esc[m Debian #830313 + * watch: use locale-independent float Debian #692113 + +procps-ng-3.3.11 +---------------- + * libprocps API 5:0:0 + * pgrep: don't crash with -a -w flags. Merge 33, Debian #768190 + * skill: command line with signal number interpreted correctly + * pmap: print process name even if smaps is unreadable Debian #775624 + * ps: sort by etimes column, uses etime Debian #794619 + * ps, top: Add support for LXC containers. Ubuntu #1174911 + * w: work with smaller window sizes Debian #183394 + * w: correctly find "best" proc with pid wrap + * library: use merged systemd library Debian #731256 + * kill,skill,pkill: fix option parsing + * top once again will fully honor a saved rcfile, + without requiring --disable-modern-top. Debian #762928, #762947 + * vmstat: Not crash if partition appears before disk Debian #736628 + * free: -s without -c works Debian #733758 + +procps-ng-3.3.10 +---------------- + * sysctl --system loads default config file - Debian #732920 + * ps doesn't exit on SIGCONT + * top better accommodates discontinuous NUMA nodes + * ps cmdline trailing spaces suppressed under zsh, redhat #1057600 + * kill restores the '-HUP -1' functionality + * vmstat -d / -p segfault eliminated when /sys is not mounted + * pgrep properly shows full command line when -au are combined + * vmstat supports timestamps with -t/--timestamp option + * top is now immune to distortions when system time is reset + * top standardized the key support with prompted input + * top missing summary area info added to man document, ubuntu #574624 + * top properly responds to the current locale LC_NUMERIC setting + * top provides alternate graph modes for cpu states and memory usage + * top offers new startup defaults, plus ./configure --disable-modern-top + * top exploits MemAvailable field and offers improved memory statistics + * ps new --quick-pid option, a more efficient alternative to --pid option + * usernames up to 32 characters now accommodated (up from 19), redhat #1112734 + * free exploits MemAvailable field and offers improved memory statistics + * free considers slabs in displayed totals, debian #565518, ubuntu #126329 + * watch supports new ANSI styles and background colors + +procps-ng-3.3.9 +--------------- + * kernel namespaces support added to skill, pgrep, ps and top + * pidof was reimplemented from scratch (replacing sysvinit pidof) + * ps has configurable libselinux support (--enable-libselinux) + * ps provides for display of systemd slice unit (--with-systemd) + * free can once again report non-zero 'shared' memory + * sysctl provides '--system' to ignore missing /etc/sysctl.conf + * watch interval capacity was increased - debian #720445 + * pwdx no longer fails in a nonexistent locale - debian #718766 + * top clarified summary area Mem/Swap stats - debian #718670 + * top batch mode -w (width) abend fixed - debian #721204 + * top man page removed 'Bd/Ed' mdoc macros - debian #725713 + * top no longer clears screen at exit - redhat #977561 + * top adapted to potential libnuma stderr message - redhat #998678 + * top added missing batch mode newline - redhat #1008674 + + +procps-ng-3.3.8 +--------------- + * top adds extensions for linux NUMA/Node capability + * top has reverted to former %CPU and %MEM precision + but also provides a '--enable-wide-percent' option + Debian #707648 + * eliminate the potential library segmentation fault + Debian #706259, RedHat #951391 + * top now accommodates a window manager like 'screen' + RedHat #962022 + * ps shows systemd unit and user unit for a process + + +procps-ng-3.3.7 +--------------- + + * top adds a powerful new filter feature wherein any + window can include or exlude selected fields which + contain specific values - Debian #682082 & #682083 + * top preserves user input for later recall and edit + * top provides true input editing vs. just backspace + * top user filtering with exclusion - Debian #682086 + * top field management resize errors no longer fatal + * top is more responsive to window resize (SIGWINCH) + * top will now preserve user's context when signaled + + +procps-ng-3.3.6 +--------------- + + * top adds a powerful new feature where the contents + of some file or output from a program, pipeline or + shell script can be viewed in its own scrollable & + searchable window while pausing the normal display + * top highlights matches with 'locate/next' commands + * top adds summary/task area memory scaling commands + * top adds a command to suppress insignificant zeros + * top adds a command line sort field override switch + * top provides a default PID for kill, nice commands + * top allows core dump generation, if a signal would + * pmap adds 2 new options based on smaps, -X and -XX + * Adjusted pmap pidlist storage Debian #688180 + * programs will permit core-dumps RedHat #87825, 512857 + * receiving a signal is not a crash RedHat #871824, 441656 + * ps: Fixed negative etime RedHat #871819, #433266 + * pkill -c option returns Debian #693783 + * pmap uses correct types for memory allocation Debian #688180 + * expose freeproc, adds function to API Debian #681653 + + +procps-ng-3.3.5 +--------------- + * Bumped SONAME to take into acccount API change + +procps-ng-3.3.4 +--------------- + * Removed ps -aux bogus message + * w get -i option to display IP addresses + * watch 8bit fixes Debian #675069 + * Fixed FTBFS for non-linux Debian #677055 + * pkill -u doesn't need space Debian #676239 + * top enables intra-column horizontal scrolling + * top can display a task's environment + * top can display major/minor pg fault deltas, Debian ##84992 + * top provides additional control over column widths + * top offers user controlled left/right justification + +procps-ng-3.3.3 +--------------- + * watch -g command repeats until something changes + * Changed labels of kB etc to KiB Debian #662786 + * top supports hotplugged memory and cpus Debian #351934, #459287 + * top %cpu not distorted when switch to/from threads Debian #441166 + * top can read old toprc configuration files Debian #651213, #651863 + * top supports input paste once again Debian #663334 + * top -p avoids SEGV when pid doesn't exist Debian 668335 + * Various DejaGNU test cases fixed + * pgrep.1 graoff syntax fix Debian #665425 + * sysctl avoid crash when -p file has unexpected input + * sysctl .conf off-by-one error Debian #669128 + * libprocps: protect locale env getting overwrite RedHat #548711 + + * Documentation catch up (fixed prior to 3.3.3) + . top repeating "%" wastes space Debian #322984 + . top -U user name parse error Debian #623200 + . top memory leaks Debian #627257 + . top impossible task swap statistics Debian #628462 + . top forest view segfault Debian #650864 + + +procps-ng-3.3.1 --> procps-ng-3.3.2 +-------------------------------- + + * Redefined library to use version-info + * NLS added! Programs can use po files to localise the output to suite + any supported languages. + * Imported a bunch of distribution patches: + watch: support unicode + watch: add precision wait time option -p + watch: interpret ANSI color code sequences + watch: add -exec and -beep flags and has better quoting + w: use environment to set user and from/host column widths + w: use COLUMNS environment if TIOCGWINSZ fails + w: bassman emulation with -o option + vmstat: do not scale si/so just like bi/bo + libprocps-ng: sysinfo.c: truncate the vmstat figure to 32 bits + tload: remote unneeded optarg and optind variables + sysctl: fix up some option processing + skill: kill prints perror + skill: do not treat skill null parameter as 0 + skill: fix too greedy option parser + libprocps-ng: readproc.c: some type conversion help + ps: rename SZ to SIZE + ps: add sorting to %mem for ps + pmap: provide information for -x option + pgrep: distinguish between invalid commandline parameters and '-?' + pgrep: fix compiler warning saved_start_time might be used uninitialized + pgrep: add -c option for counting number of matched proceesses + pwdx & libprocps-ng: Hurd does not have MAX_PATH defined + ps: --sort does not work with time argument + skill: add CR to warning line + contrib: minimal ps: define mips PAGE_SIZE + libproc-ng: prettyfy proc mount messages + ps: add build option to disable ps option warning + libproc-ng: support building without WCHAR support + sysctl: remove index() for buildroot + * top now has a search capability + * User import is validated better to stop negative values for intervals etc + +procps-ng-3.3.0 --> procps-ng-3.3.1 +-------------------------------- + + * Added DejaGNU regression testing + * Fixed pgrep -u not finding processes Debian#649591 + * Fixed pgrep crashing + * vmstat -p finds partitions. Was Debian patch vmstat_part_format + fixes closed bugs RH#485243 and Debian#588677 + * watch 8-bit clean, Was Debian patch watch_8bitchar + * slabtop prints plain ASCII in once mode + +procps-3.2.8 --> procps-ng-3.3.0 +------------------------------------------------------ +Debian, Fedora and openSUSE fork of procps. +https://gitlab.com/procps-ng/procps + +environment/build changes: + . autotools integrated + . procps-ng specific options + --enable-oomem (add out-of-memory flds) + --disable-kill (do not build kill pgm) + --enable-w-from (from as default for w) + +library changes: + . added control groups support + . added supplementary groups support + . introduced proc_t memory management + . enabled hot-plugged cpu support + . introduced new api's + readeither (readproc.c) + readproctab3 (readproc.c) + escaped_copy (escape.c) + +free changes: + . rewritten/modernized + improved help + includes long options + added new processing options + . updated manual page + +ps changes: + . added new fields + cgroups,etimes,supgid,supgrp,tgid + . exploited new library api's + +top changes: + . redesigned fields management + . added new fields + cgroups,gid,nmin,nth,pgrp,ruid, + sid,suid,supgids,supgrps,suser, + tgid,tpgid + . added horizontal/vertical scrolling + . added flexible output override via -w + . added COMMAND column forest view via V + . added hot-plugged cpu/memory support + . improved user filtering via u|U + . improved signal handling + . restored zero delay functionality + . introduced true line input editing + . exploited new library api's + . improved performance up to 300% + +Debian, Fedora and openSUSE fork of procps. +https://gitlab.com/procps-ng/procps +------------------------------------------------------ + +procps-3.2.8 --> procps-3.2.9 (pending) + +top: fix an aliasing problem -- thanks David Owen + +procps-3.2.7 --> procps-3.2.8 + +ps: allow "+" in sort specifications, as in man page rh208217 +ps: recognize SCHED_ISO and SCHED_IDLE +ps: document SCHED_BATCH and add a "see also" for stime +ps: man page less ambiguous +top: normal exit code should be 0 #341272 #354255 rh199174 suse493210 +top: misc fixes +pgrep: usage error should exit with 2 #413383 +vmstat: use EXIT_FAILURE -- thanks Yoshio Nakamura #425492 +sysctl: fix crash -- thanks Steinar Gunderson #423704 +watch: tolerate umlauts #207103 +pmap: range limits with -A low,high +update /dev/tty* info to May 2009 devices.txt +don't read off end of string const rh469495 rh498182 + +procps-3.2.6 --> procps-3.2.7 + +top: document H option -- thanks Tony Ernst +top: terabytes -- thanks Tony Ernst +top: CPU usage column width fixes -- thanks Tony Ernst +top: *roff change #326517 +ps: SCHED_BATCH is B +ps: fix s format (signals) output with thread display +watch: avoid integer overflow for the time delay +pwdx: buffer overflow fixed -- thanks Ulf Harnhammar +procps.spec needed a slash -- thanks Jesse Brandeburg +w: stale utmp entries snuck in via uninitialized var -- thanks Robert A Basch +pgrep/pkill: fix some realloc-related crashes #353894 +pgrep/pkill: g is criteria (PLD Linux, patch found in locked filing cabinet) +sysctl: use - for stdin (PLD Linux: beware of the leopard) +top: show CPU time stolen from a virtual machine + +procps-3.2.5 --> procps-3.2.6 + +vmstat: /proc/stat buffer big enough for 1024 CPUs +dietlibc needs termios.h for struct winsize -- thanks Thomas Ogrisegg +top: can do per-task display -- thanks John Blackwood rh114012 +more MIPS crud -- thanks Jim Gifford and Ryan Oliver +begin prep for setuid +top: fix %CPU max on 2..9 CPU SMP -- thanks Ga*tan LEURENT rh110555 +ps: fix crash related to realloc -- thanks David Houlder +ps: man page more detailed #334682 +spelling fixes #300333 #334684 #334685 +top: crash on resize fixed -- thanks Michal Maruska #320289 +vmstat: -p handles /dev/ and does not overflow #319523 #330969 + +procps-3.2.4 --> procps-3.2.5 + +display problem on 64-bit systems fixed #287947 +top: variable-width PID and PPID +top: variable-width %CPU rh110555 +sysctl: better error messages +ps: security labels can contain any printable ASCII +top: help and version message on stdout, with exit(0) #283541 +ps: SIGTSTP and SIGTTOU shouldn't print bug email address #246123 +slabtop: compile with glibc 2.2.17 (and older, likely) +slabtop: fix overflow on huge NUMA boxes #264640 +slabtop: accept any slabinfo 2.x format g77301 #287691 rh145369 rh145906 +ps: alignment after WCHAN fixed ub5385 +pmap: when no -x or -d option, show full path rh142751 + +procps-3.2.3 --> procps-3.2.4 + +support 64-bit MIPS with n32 binary +sparc32 optimized for sparc32 again +pwdx: new command -- thanks Nicholas Miell +ps: UTF-8 username + command -- thanks Karel Zak rh134763,rh112518,rh134780 +ps: more room for some columns +ps: tolerate SubDomain security module CONTEXT/LABEL data #277401 +watch: passes COLUMNS and LINES in environment +top: in batch mode, tolerate unknown $TERM -- thanks Daniel Walsh +pkill: quiet about processes that die before kill() + +procps-3.2.2 --> procps-3.2.3 + +avoid truncating long usernames +avoid warning about -lncurses when not linking (more) +new names for shared libraries (packagers: watch out!) +"make install" no longer rebuilds everything +wchan now '*' for multi-threaded processes +ps: new man page -- thanks Nicolas Francois +ps: STAT shows l for multi-threaded processes +vmstat: some overflow problems fixed -- thanks Holger Kiehl +sysctl: man page fix + +procps-3.2.1 --> procps-3.2.2 + +new packager (downstream maintainer) guidelines in README +move striping from install command to CFLAGS +new gcc options in use: -fweb, -frename-registers, etc. +avoid warning about -lncurses when not linking -- thanks FLWM +tolerate IA-64 headers without PAGE_SIZE +ps: k option, same as --sort +ps: personality-specific -x support (HP-UX and SVR4-MP) +pgrep: man page SEE ALSO updated #226817 +sysctl: -q and -N options +sysctl: better error handling of failed writes +top: tolerate sparse CPU numbering +top: try to handle terminals lacking rmam and smam #235003 +top: xterm dislikes clear-to-eol at eol (char lost) +vmstat: fixed -d +watch: allow sub-second intervals -- thanks Thomas Stewart + +procps-3.2.0 --> procps-3.2.1 + +build even w/ curses in an odd location -- thanks to Segher Boessenkool +ps: STAT flags for fg process group and session leader +ps: STAT flags for swapped out process dropped (was broken) +ps: new -M and Z options for security data (SELinux, etc.) +slabtop: detect broken /proc/slabinfo -- thanks to Fabian Frederick +slabtop: ensure that error messages show up on the screen -- FF again + +procps-3.1.15 --> procps-3.2.0 + +build on IA-64 again #227933 +pmap: output like Solaris 9, not Solaris 7 +ps: also handle SELinux on the 2.4.xx kernels +top: during a ^Z, the terminal was messed up #228822 +future-proof the tty handling (thanks to Zhou Wei) +slabtop (Chris Rivera and Robert Love) #226778 +pmap: detect the primary stack +pmap: -d format +free: report high and low memory + +procps-3.1.14 --> procps-3.1.15 + +install to /lib64 if it exists +hide kernel PID bug (Linux 2.4.13-pre1 to 2.4.MAX) #217278 #219730 #217525 #224470 +ps: faster threaded display +top: auto-margin problem #217559 +ps: support NSA SELinux, all builds, Linux 2.6+ #193648 +sysctl: tweak man page for ESR's broken parser + +procps-3.1.13 --> procps-3.1.14 + +top: displays on more genuine serial terminals +handle 32-bit dev_t of Linux 2.6 +ps: finally, m and -m satisfy the original design +ps: distinct per-thread and whole-process pending signals + +procps-3.1.12 --> procps-3.1.13 + +ps: can display NPTL threads w/ kernel patch +no seLinux for now (new kernel interface) + +procps-3.1.11 --> procps-3.1.12 + +ps: explicit width ("ps -o pid,wchan:42,args") +ps: $PS_FORMAT works properly #201575 +top: new Linux 2.6.0-test4 CPU stats shown +top: multiple -p options work again +top: fixed 4 GB wrap-around +ps: has a set of tests to ensure correctness +man page: /var/run/utmp, not /etc/utmp #206583 +required flags moved out of CFLAGS #205429 +RPM generation handles /lib64 +WCHAN skips leading '.' +vmstat: numerous new features + +procps-3.1.10 --> procps-3.1.11 + +compile with gcc 2.95 again (C99 issue) + +procps-3.1.9 --> procps-3.1.10 + +handle GPLONLY_ symbols #143549 #188374 +kill: better man page +skill: better man page +ps: PID-like columns change width as needed +top: COMMAND instead of Command +vmstat: -m displays slabinfo +vmstat: -d displays disk stats + +procps-3.1.8 --> procps-3.1.9 + +memory sizes fixed for 64-bit w/ gcc 3.x #194376 #191933 +ps: detect broken OS install w/o /proc mounted #172735 +top: fix suspend/resume behavior +top: ditch warning until a GOOD interface is found #188271 +kill: more info in the man page #182414 +ps: document the -o, o, -O, and O options #169301 +vmstat: choose units you like: 1000, 1024, 1000000... + +procps-3.1.7 --> procps-3.1.8 + +top: fix keyboard handling (help screen, etc.) + +procps-3.1.6 --> procps-3.1.7 + +Makefile: made SKIP feature easier to use +watch: --help now explains -t, --no-title #182246 +ps: warning directs users to the FAQ +top: batch mode can refresh by fractional seconds +top: faster start-up +top: do not refresh like crazy +ps: better crash message + +procps-3.1.5 --> procps-3.1.6 + +handle the 2.5.61 kernel +top: memory leak fixed +ps: new --ppid option selects by PPID +watch: new --no-title option #179862 +handle SPARC Linux badness +rare crash fixed +compile with gcc 2.91.xx again +more informative "ps --info" +README update +ps: compare more with "ps -C verylongname" #178127 + +procps-3.1.4 --> procps-3.1.5 + +ancient (2.x.xx era) data corruption fixed +serious hidden-process problem (3.1.3+) fixed +w: escape sequence vulnerability fixed + +procps-3.1.3 --> procps-3.1.4 + +top: was trashing every "3" in a command name +top: when killing a process, the PID was cut at a "3" +top: more reliable %CPU +update copyright dates (GPL & LGPL require this) +RPM generation works now + +procps-3.1.2 --> procps-3.1.3 + +uses /proc/*/wchan files when available +top: user selection +sysctl: add -e for Red Hat 8.0 boot scripts +sysctl: the obvious --help, -V, and --version +sysctl: some command line error checking +w: stdout, not stderr -- thanks to Sander van Malssen + +procps-3.1.1 --> procps-3.1.2 + +better RPM generation +use C99 features +some seLinux fixes +now count Inact_laundry as needed #172163 +ps: fewer globals +ps: hardware-enforced buffer protection +ps: 1 kB smaller +top: B command added (for bold on/off) +top: handle old (and future) config files +top: man page tweak +top: old sort keys #167249 +top: out-of-bounds RT as "RT" +top: several times faster +top: t command fixed +vmstat: -f +vmstat: -s +w: much faster +watch: don't drop empty lines #171005 +watch: re-indented + +procps-3.1.0 --> procps-3.1.1 + +vmstat faster on 2.5.xx kernels +vmstat header fixed +vmstat -a re-fixed + +procps-3.0.5 --> procps-3.1.0 + +vmstat displays IO-wait time instead of bogus "w" +can build w/o shared library (set SHARED=0) +when IO-wait hidden, count as idle, not as sys +pmap command added (like Sun has) +do not crash GNU make 3.79 +top slightly faster + +procps-3.0.4 --> procps-3.0.5 + +top tolerates super-wide displays +better (?) RPM generation +XConsole and top.desktop removed +old build system removed +code cleanup +pgrep and pkill get "-o" (oldest matching process) +had vmstat "bi" and "bo" output interchanged on 2.5.xx +fix man page tbl directives +top man page cleaned up + +procps-3.0.3 --> procps-3.0.4 + +make top go faster +Linux 2.2.xx ELF note warning removed +only show IO-wait on recent kernels +fix top's SMP stats +fix top for "dumb" and "vt510" terminals +in top, limit the priority values to -99 ... 99 + +procps-3.0.2 --> procps-3.0.3 + +more "make install" fixes +lib CFLAGS working again +top.1 codes fixed +bad (int*) cast in top removed +top runs faster +libproc memory corruption fixed +rant moved out of top.1 man page +ability to SKIP installing things +fixed ps --sort crash + +procps-3.0.1 --> procps-3.0.2 + +top defaults to the old layout +top defaults to sorting by %CPU +fix top for non-SMP 2.2.xx and 2.0.xx +new "make install" fixed +vmstat -a fixed +vmstat compiles with latest gcc-3.x +vmstat does 64-bit time + +procps-3.0.0 --> procps-3.0.1 + +sysctl handles net/ipv4/conf/eth1.0123/tag (VLAN interface) +sysctl handles net.ipv4.conf.eth1/0123.tag (VLAN interface) +"ps" is now about 2x faster than in procps-2.x.x +"ps -F" now documented +w works in KOI8-R locale +vmstat documentation update +"skill -n blah blah blah" lets you test options +simple "make && make install" now + +procps-2.x.x --> procps-3.0.0 + +designed to support Linux 2.0 through 2.5.41 and beyond +new top, with optional: color, windowing, SMP stats +runs faster +more "it crashes" bugs fixed +top shows IO-wait time +vmstat can show active/inactive memory stats +real-time info supported in ps +correct "ps -o size" and "ps --sort size" +new maintainers +reduced memory usage for ps +allow large PIDs to be specified +SELINUX support is just a recompile away +the "F" column shrank, so "ps -l" has more command name room +64-bit time reduces the overflow problem +support S/390, IA-64 emulator, and user-mode Linux +oldps is gone +configure script -- use "make -f Makefile.noam" as a backup +"w" program better at determining what a user is doing +more stable +code at http://procps.sf.net/ now (SourceForge) + +Earlier changes, for those not using Debian already: + +more stable +runs faster +-F format option +better error reporting in ps for unknown format specifiers +BSD's sysctl options -b and -X +top displays well on large-memory systems +old BSD-style select-by-PID ("ps l$$") +15-character user names +ps 'f' ASCII art forest fixed +add SIGSYS on i386 +top reports real RSS value +large-memory systems work +minimal ps program for embedded systems (minimal.c) +BSD personality process selection fixed +support locale (French) with ',' and '.' mixed up +pgrep program +includes the "kill" and "nice" programs +don't chop non-tty ps output at 80 columns diff --git a/README.md b/README.md new file mode 100644 index 0000000..39cd5fe --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +[![build status](https://gitlab.com/ci/projects/2142/status.png?ref=master)](https://gitlab.com/ci/projects/2142?ref=master) +procps +====== + +procps is a set of command line and full-screen utilities that provide +information out of the pseudo-filesystem most commonly located at /proc. +This filesystem provides a simple interface to the kernel data structures. +The programs of procps generally concentrate on the structures that describe +the processess running on the system. + +The following programs are found in procps: +* *free* - Report the amount of free and used memory in the system +* *kill* - Send a signal to a process based on PID +* *pgrep* - List processes based on name or other attributes +* *pkill* - Send a signal to a process based on name or other attributes +* *pmap* - Report memory map of a process +* *ps* - Report information of processes +* *pwdx* - Report current directory of a process +* *skill* - Obsolete version of pgrep/pkill +* *slabtop* - Display kernel slab cache information in real time +* *snice* - Renice a process +* *sysctl* - Read or Write kernel parameters at run-time +* *tload* - Graphical representation of system load average +* *top* - Dynamic real-time view of running processes +* *uptime* - Display how long the system has been running +* *vmstat* - Report virtual memory statistics +* *w* - Report logged in users and what they are doing +* *watch* - Execute a program periodically, showing output fullscreen + +## Reporting Bugs +There are a few ways of reporting bugs or feature requests: + +1. Your distribution's bug reporter. If you are using a distribution your first +port of call is their bug tracker. This is because each distribution has their +own patches and way of dealing with bugs. Also bug reporting often does not need +any subscription to websites. +2. GitLab Issues - To the left of this page is the issue tracker. You can report +bugs here. +3. Email list - We have an email list (see below) where you can report bugs. +The problem with this method is bug reports often get lost and cannot be +tracked. This is especially a big problem when its something that will take +time to resolve. + +If you need to report bugs, there is more details on the +[Bug Reporting](https://gitlab.com/procps-ng/procps/blob/master/Documentation/bugs.md) +page. + +## Email List +The email list for the developers and users of procps is found at +http://www.freelists.org/archive/procps/ +This email list discusses the development of procps and is used by distributions +to also forward or discuss bugs. diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..feefebb --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1507 @@ +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- + +# Copyright (C) 1996-2021 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.71],, +[m4_warning([this file was generated for autoconf 2.71. +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 use pkg-config. -*- Autoconf -*- +# serial 12 (pkg-config-0.29.2) + +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.2]) +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 occurrence 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 $2]) + +_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-2021 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.16' +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.16.5], [], + [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.16.5])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-2021 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-2021 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-2021 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-2021 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. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _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. +# This creates each '.Po' and '.Plo' makefile fragment that we'll 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" MAKE="${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2021 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 +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])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_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([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 +]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + +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-2021 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-2021 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-2021 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 whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2021 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 + MISSING="\${SHELL} '$am_aux_dir/missing'" +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-2021 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-2021 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-2021 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-2021 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-2021 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-2021 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-2021 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-2021 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/iconv.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]) diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..bd1b822 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,75 @@ +#!/bin/sh +# +# Helps generate autoconf/automake stuff, when code is checked +# out from SCM. + +SRCDIR=$(dirname ${0}) +test -z "${SRCDIR}" && SRCDIR=. + +THEDIR=$(pwd) +cd ${SRCDIR} +DIE=0 + +test -f autogen.sh || { + echo "You must run this script in the top-level procps-ng directory" + DIE=1 +} + +(autopoint --version) < /dev/null > /dev/null 2>&1 || { + echo "You must have autopoint installed to generate procps-ng build system." + echo "The autopoint command is part of the GNU gettext package." + DIE=1 +} + +(autoconf --version) < /dev/null > /dev/null || { + echo "You must have autoconf installed to generate procps-ng build system." + DIE=1 +} +(autoheader --version) < /dev/null > /dev/null || { + echo "You must have autoheader installed to generate procps-ng build system." + echo "The autoheader command is part of the GNU autoconf package." + DIE=1 +} +(automake --version) < /dev/null > /dev/null || { + echo "You must have automake installed to generate procps-ng build system." + DIE=1 +} + +LTVER=$(libtoolize --version | awk '/^libtoolize/ { print $4 }') +LTVER=${LTVER:-"none"} +test ${LTVER##2.} = "${LTVER}" && { + echo "You must have libtoolize version >= 2.x.x, but you have ${LTVER}." + DIE=1 +} + +if test ${DIE} -ne 0; then + exit 1 +fi + +echo "Generate build-system by:" +echo " autopoint: $(autopoint --version | head -1)" +echo " aclocal: $(aclocal --version | head -1)" +echo " autoconf: $(autoconf --version | head -1)" +echo " autoheader: $(autoheader --version | head -1)" +echo " automake: $(automake --version | head -1)" +echo " libtoolize: $(libtoolize --version | head -1)" + +rm -rf autom4te.cache + +set -e +po/update-potfiles +autopoint --force $AP_OPTS +if ! grep -q datarootdir po/Makefile.in.in; then + echo autopoint does not honor dataroot variable, patching. + sed -i -e 's/^datadir *=\(.*\)/datarootdir = @datarootdir@\ +datadir = @datadir@/g' po/Makefile.in.in +fi +libtoolize --force ${LT_OPTS} +aclocal -I m4 ${AL_OPTS} +autoconf ${AC_OPTS} +autoheader ${AH_OPTS} + +automake --add-missing ${AM_OPTS} + +echo +echo "Now type '${SRCDIR}/configure' and 'make' to compile." diff --git a/compile b/compile new file mode 100755 index 0000000..df363c8 --- /dev/null +++ b/compile @@ -0,0 +1,348 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2021 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* | MSYS*) + 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/* | msys/*) + 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 | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.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 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..7f76b62 --- /dev/null +++ b/config.guess @@ -0,0 +1,1754 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2022 Free Software Foundation, Inc. + +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-09' + +# 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: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess +# +# Please send patches to . + + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Options: + -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-2022 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 + +# Just in case it came from the environment. +GUESS= + +# 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. + +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { 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" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + 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 +} + +# 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 ; 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/*) + LIBC=unknown + + set_cc_for_build + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #elif defined(__GLIBC__) + LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif + #endif + EOF + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi + ;; +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". + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + echo unknown)` + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; + 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) + 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. + GUESS=$machine-${os}${release}${abi-} + ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; + *:MidnightBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; + *:ekkoBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; + *:SolidBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; + *:OS108:*:*) + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; + macppc:MirBSD:*:*) + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; + *:MirBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; + *:Sortix:*:*) + GUESS=$UNAME_MACHINE-unknown-sortix + ;; + *:Twizzler:*:*) + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; + *:Redox:*:*) + GUESS=$UNAME_MACHINE-unknown-redox + ;; + mips:OSF1:*.*) + GUESS=mips-dec-osf1 + ;; + alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 + 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. + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; + Amiga*:UNIX_System_V:4.0:*) + GUESS=m68k-unknown-sysv4 + ;; + *:[Aa]miga[Oo][Ss]:*:*) + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; + *:[Mm]orph[Oo][Ss]:*:*) + GUESS=$UNAME_MACHINE-unknown-morphos + ;; + *:OS/390:*:*) + GUESS=i370-ibm-openedition + ;; + *:z/VM:*:*) + GUESS=s390-ibm-zvmoe + ;; + *:OS400:*:*) + GUESS=powerpc-ibm-os400 + ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + GUESS=arm-unknown-riscos + ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + GUESS=hppa1.1-hitachi-hiuxmpp + ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; + NILE*:*:*:dcosx) + GUESS=pyramid-pyramid-svr4 + ;; + DRS?6000:unix:4.0:6*) + GUESS=sparc-icl-nx6 + ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; + s390x:SunOS:*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; + sun4H:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + 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 test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; + 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. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; + 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'. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; + sun3*:SunOS:*:*) + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; + 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) + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; + sun4) + GUESS=sparc-sun-sunos$UNAME_RELEASE + ;; + esac + ;; + aushp:SunOS:*:*) + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; + # 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:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; + m68k:machten:*:*) + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; + powerpc:machten:*:*) + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; + RISC*:Mach:*:*) + GUESS=mips-dec-mach_bsd4.3 + ;; + RISC*:ULTRIX:*:*) + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; + VAX*:ULTRIX*:*:*) + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + 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; } + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; + Motorola:PowerMAX_OS:*:*) + GUESS=powerpc-motorola-powermax + ;; + Motorola:*:4.3:PL8-*) + GUESS=powerpc-harris-powermax + ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + GUESS=powerpc-harris-powermax + ;; + Night_Hawk:Power_UNIX:*:*) + GUESS=powerpc-harris-powerunix + ;; + m88k:CX/UX:7*:*) + GUESS=m88k-harris-cxux7 + ;; + m88k:*:4*:R4*) + GUESS=m88k-motorola-sysv4 + ;; + m88k:*:3*:R3*) + GUESS=m88k-motorola-sysv3 + ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 + then + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x + then + GUESS=m88k-dg-dgux$UNAME_RELEASE + else + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE + fi + else + GUESS=i586-dg-dgux$UNAME_RELEASE + fi + ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + GUESS=m88k-dolphin-sysv3 + ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + GUESS=m88k-motorola-sysv3 + ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + GUESS=m88k-tektronix-sysv3 + ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + GUESS=m68k-tektronix-bsd + ;; + *:IRIX*:*:*) + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + GUESS=i386-ibm-aix + ;; + ia64:AIX:*:*) + if test -x /usr/bin/oslevel ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE + fi + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + 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 + GUESS=$SYSTEM_NAME + else + GUESS=rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + GUESS=rs6000-ibm-aix3.2.4 + else + GUESS=rs6000-ibm-aix3.2 + fi + ;; + *: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 test -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 + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; + *:AIX:*:*) + GUESS=rs6000-ibm-aix + ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + GUESS=romp-ibm-bsd4.4 + ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + GUESS=rs6000-bull-bosx + ;; + DPX/2?00:B.O.S.:*:*) + GUESS=m68k-bull-sysv3 + ;; + 9000/[34]??:4.3bsd:1.*:*) + GUESS=m68k-hp-bsd + ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + GUESS=m68k-hp-bsd4.4 + ;; + 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 test -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 test "$HP_ARCH" = ""; then + 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 test "$HP_ARCH" = hppa2.0w + then + 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 + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; + 3050*:HI-UX:*:*) + 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; } + GUESS=unknown-hitachi-hiuxwe2 + ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + GUESS=hppa1.1-hp-bsd + ;; + 9000/8??:4.3bsd:*:*) + GUESS=hppa1.0-hp-bsd + ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + GUESS=hppa1.0-hp-mpeix + ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + GUESS=hppa1.1-hp-osf + ;; + hp8??:OSF1:*:*) + GUESS=hppa1.0-hp-osf + ;; + i*86:OSF1:*:*) + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk + else + GUESS=$UNAME_MACHINE-unknown-osf1 + fi + ;; + parisc*:Lites*:*:*) + GUESS=hppa1.1-hp-lites + ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + GUESS=c1-convex-bsd + ;; + 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*:*) + GUESS=c34-convex-bsd + ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + GUESS=c38-convex-bsd + ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + GUESS=c4-convex-bsd + ;; + CRAY*Y-MP:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; + 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:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; + CRAY*T3E:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; + CRAY*SV1:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; + *:UNICOS/mp:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; + 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/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; + 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/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; + sparc*:BSD/OS:*:*) + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; + *:BSD/OS:*:*) + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi + else + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf + fi + ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case $UNAME_PROCESSOR in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; + i*:CYGWIN*:*) + GUESS=$UNAME_MACHINE-pc-cygwin + ;; + *:MINGW64*:*) + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; + *:MINGW*:*) + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; + *:MSYS*:*) + GUESS=$UNAME_MACHINE-pc-msys + ;; + i*:PW*:*) + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; + *:Interix*:*) + case $UNAME_MACHINE in + x86) + GUESS=i586-pc-interix$UNAME_RELEASE + ;; + authenticamd | genuineintel | EM64T) + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; + IA64) + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; + esac ;; + i*:UWIN*:*) + GUESS=$UNAME_MACHINE-pc-uwin + ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + GUESS=x86_64-pc-cygwin + ;; + prep*:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; + *:GNU:*:*) + # the GNU system + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + *:Minix:*:*) + GUESS=$UNAME_MACHINE-unknown-minix + ;; + aarch64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` 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 + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arm*:Linux:*:*) + set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi + else + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf + fi + fi + ;; + avr32*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + cris:Linux:*:*) + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + crisv32:Linux:*:*) + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + e2k:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + frv:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + hexagon:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + i*86:Linux:*:*) + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; + ia64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + k1om:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + m32r*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + m68*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + mips:Linux:*:* | mips64:Linux:*:*) + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + MIPS_ENDIAN=el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + MIPS_ENDIAN= + #else + MIPS_ENDIAN= + #endif + #endif +EOF + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } + ;; + mips64el:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + openrisc*:Linux:*:*) + GUESS=or1k-unknown-linux-$LIBC + ;; + or32:Linux:*:* | or1k*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + padre:Linux:*:*) + GUESS=sparc-unknown-linux-$LIBC + ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + GUESS=hppa64-unknown-linux-$LIBC + ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; + esac + ;; + ppc64:Linux:*:*) + GUESS=powerpc64-unknown-linux-$LIBC + ;; + ppc:Linux:*:*) + GUESS=powerpc-unknown-linux-$LIBC + ;; + ppc64le:Linux:*:*) + GUESS=powerpc64le-unknown-linux-$LIBC + ;; + ppcle:Linux:*:*) + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + s390:Linux:*:* | s390x:Linux:*:*) + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; + sh64*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sh*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + tile*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + vax:Linux:*:*) + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; + x86_64:Linux:*:*) + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI=${LIBC}x32 + fi + fi + GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI + ;; + xtensa*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + 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. + GUESS=i386-sequent-sysv4 + ;; + 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. + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; + i*86:XTS-300:*:STOP) + GUESS=$UNAME_MACHINE-unknown-stop + ;; + i*86:atheos:*:*) + GUESS=$UNAME_MACHINE-unknown-atheos + ;; + i*86:syllable:*:*) + GUESS=$UNAME_MACHINE-pc-syllable + ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; + i*86:*DOS:*:*) + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL + else + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL + fi + ;; + 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 + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; + 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 + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL + else + GUESS=$UNAME_MACHINE-pc-sysv32 + fi + ;; + 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. + GUESS=i586-pc-msdosdjgpp + ;; + Intel:Mach:3*:*) + GUESS=i386-pc-mach3 + ;; + paragon:*:*:*) + GUESS=i860-intel-osf1 + ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 + fi + ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + GUESS=m68010-convergent-sysv + ;; + mc68k:UNIX:SYSTEM5:3.51m) + GUESS=m68k-convergent-sysv + ;; + M680?0:D-NIX:5.3:*) + GUESS=m68k-diab-dnix + ;; + 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*:*) + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; + mc68030:UNIX_System_V:4.*:*) + GUESS=m68k-atari-sysv4 + ;; + TSUNAMI:LynxOS:2.*:*) + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; + rs6000:LynxOS:2.*:*) + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; + SM[BE]S:UNIX_SV:*:*) + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; + RM*:ReliantUNIX-*:*:*) + GUESS=mips-sni-sysv4 + ;; + RM*:SINIX-*:*:*) + GUESS=mips-sni-sysv4 + ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + GUESS=$UNAME_MACHINE-sni-sysv4 + else + GUESS=ns32k-sni-sysv + fi + ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + GUESS=i586-unisys-sysv4 + ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + GUESS=hppa1.1-stratus-sysv4 + ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + GUESS=i860-stratus-sysv4 + ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + GUESS=$UNAME_MACHINE-stratus-vos + ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + GUESS=hppa1.1-stratus-vos + ;; + mc68*:A/UX:*:*) + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; + news*:NEWS-OS:6*:*) + GUESS=mips-sony-newsos6 + ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE + else + GUESS=mips-unknown-sysv$UNAME_RELEASE + fi + ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + GUESS=powerpc-be-beos + ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + GUESS=powerpc-apple-beos + ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + GUESS=i586-pc-beos + ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + GUESS=i586-pc-haiku + ;; + x86_64:Haiku:*:*) + GUESS=x86_64-unknown-haiku + ;; + SX-4:SUPER-UX:*:*) + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; + SX-5:SUPER-UX:*:*) + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; + SX-6:SUPER-UX:*:*) + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; + SX-7:SUPER-UX:*:*) + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; + SX-8:SUPER-UX:*:*) + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; + SX-8R:SUPER-UX:*:*) + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; + SX-ACE:SUPER-UX:*:*) + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; + Power*:Rhapsody:*:*) + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; + *:Rhapsody:*:*) + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build + fi + if test "$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 + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE + fi + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; + *:QNX:*:4*) + GUESS=i386-pc-qnx + ;; + NEO-*:NONSTOP_KERNEL:*:*) + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; + NSE-*:NONSTOP_KERNEL:*:*) + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; + NSR-*:NONSTOP_KERNEL:*:*) + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; + NSV-*:NONSTOP_KERNEL:*:*) + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; + NSX-*:NONSTOP_KERNEL:*:*) + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; + *:NonStop-UX:*:*) + GUESS=mips-compaq-nonstopux + ;; + BS2000:POSIX*:*:*) + GUESS=bs2000-siemens-sysv + ;; + DS/*:UNIX_System_V:*:*) + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; + *: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 + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype + fi + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; + *:TOPS-10:*:*) + GUESS=pdp10-unknown-tops10 + ;; + *:TENEX:*:*) + GUESS=pdp10-unknown-tenex + ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + GUESS=pdp10-dec-tops20 + ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + GUESS=pdp10-xkl-tops20 + ;; + *:TOPS-20:*:*) + GUESS=pdp10-unknown-tops20 + ;; + *:ITS:*:*) + GUESS=pdp10-unknown-its + ;; + SEI:*:*:SEIUX) + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; + *:DragonFly:*:*) + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; + esac ;; + *:XENIX:*:SysV) + GUESS=i386-pc-xenix + ;; + i*86:skyos:*:*) + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; + i*86:rdos:*:*) + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; + x86_64:VMkernel:*:*) + GUESS=$UNAME_MACHINE-unknown-esx + ;; + amd64:Isilon\ OneFS:*:*) + GUESS=x86_64-unknown-onefs + ;; + *:Unleashed:*:*) + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; +esac + +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case $UNAME_MACHINE:$UNAME_SYSTEM in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 <&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 +fi + +exit 1 + +# Local variables: +# eval: (add-hook 'before-save-hook '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..47c3c0a --- /dev/null +++ b/config.h.in @@ -0,0 +1,499 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* provide extra precision under memory fields for top */ +#undef BOOST_MEMORY + +/* provide extra precision under %CPU and %MEM for top */ +#undef BOOST_PERCNT + +/* should extra warnings be printed (slackware-ism) */ +#undef BUILD_WITH_WHINE + +/* Enable libselinux */ +#undef ENABLE_LIBSELINUX + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + +/* Enable pidwait */ +#undef ENABLE_PIDWAIT + +/* Define to 1 if you have the `alarm' function. */ +#undef HAVE_ALARM + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the `atexit' function. */ +#undef HAVE_ATEXIT + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if you have the declaration of `__UT_HOSTSIZE', and to 0 if you + don't. */ +#undef HAVE_DECL___UT_HOSTSIZE + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the `dup2' function. */ +#undef HAVE_DUP2 + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERROR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FLOAT_H + +/* Define to 1 if you have the `fork' function. */ +#undef HAVE_FORK + +/* Define to 1 if you have the `gethostname' function. */ +#undef HAVE_GETHOSTNAME + +/* 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 if you have the iconv() function. */ +#undef HAVE_ICONV + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `iswprint' function. */ +#undef HAVE_ISWPRINT + +/* Define to 1 if you have the header file. */ +#undef HAVE_LANGINFO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBINTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if mbrtowc and mbstate_t are properly declared. */ +#undef HAVE_MBRTOWC + +/* Define to 1 if you have the `memchr' function. */ +#undef HAVE_MEMCHR + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the header file. */ +#undef HAVE_MINIX_CONFIG_H + +/* Define to 1 if you have the `mkdir' function. */ +#undef HAVE_MKDIR + +/* Define to 1 if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Use NCURSESW */ +#undef HAVE_NCURSES + +/* Define to 1 if you have the `nl_langinfo' function. */ +#undef HAVE_NL_LANGINFO + +/* Define if program_invocation_name is defined */ +#undef HAVE_PROGRAM_INVOCATION_NAME + +/* Define if program_invocation_short_name is defined */ +#undef HAVE_PROGRAM_INVOCATION_SHORT_NAME + +/* Define to 1 if you have the `putenv' function. */ +#undef HAVE_PUTENV + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#undef HAVE_REALLOC + +/* Define to 1 if you have the `regcomp' function. */ +#undef HAVE_REGCOMP + +/* Define to 1 if you have the `rpmatch' function. */ +#undef HAVE_RPMATCH + +/* Define to 1 if you have the `sd_session_get_leader' function. */ +#undef HAVE_SD_SESSION_GET_LEADER + +/* Define to 1 if you have the `select' function. */ +#undef HAVE_SELECT + +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + +/* Define to 1 if you have the `sigabbrev_np' function. */ +#undef HAVE_SIGABBREV_NP + +/* Define to 1 if `si_int' is a member of `siginfo_t'. */ +#undef HAVE_SIGINFO_T_SI_INT + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_EXT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strcoll' function and it is properly defined. + */ +#undef HAVE_STRCOLL + +/* Define to 1 if you have the `strcspn' function. */ +#undef HAVE_STRCSPN + +/* 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 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 `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + +/* Define to 1 if you have the `strndup' function. */ +#undef HAVE_STRNDUP + +/* Define to 1 if you have the `strpbrk' function. */ +#undef HAVE_STRPBRK + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the `strspn' function. */ +#undef HAVE_STRSPN + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* 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 you have the `strverscmp' function. */ +#undef HAVE_STRVERSCMP + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_FILE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_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_TERMIOS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `utmpname' function. */ +#undef HAVE_UTMPNAME + +/* Define to 1 if you have the header file. */ +#undef HAVE_UTMPX_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UTMP_H + +/* Define if __UT_HOSTSIZE in utmpx.h */ +#undef HAVE_UT_HOSTSIZE_IN_UTMPX + +/* Define to 1 if you have the header file. */ +#undef HAVE_VALUES_H + +/* Define to 1 if you have the `vfork' function. */ +#undef HAVE_VFORK + +/* Define to 1 if you have the header file. */ +#undef HAVE_VFORK_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_WCHAR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_WCTYPE_H + +/* Define to 1 if you have the `wcwidth' function. */ +#undef HAVE_WCWIDTH + +/* Define to 1 if `fork' works. */ +#undef HAVE_WORKING_FORK + +/* Define to 1 if `vfork' works. */ +#undef HAVE_WORKING_VFORK + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to 1 if you have the `__fpending' function. */ +#undef HAVE___FPENDING + +/* Define if __progname exists */ +#undef HAVE___PROGNAME + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Define to 1 if `major', `minor', and `makedev' are declared in . + */ +#undef MAJOR_IN_MKDEV + +/* Define to 1 if `major', `minor', and `makedev' are declared in + . */ +#undef MAJOR_IN_SYSMACROS + +/* disable NUMA/Node support in top */ +#undef NUMA_DISABLE + +/* disable new startup defaults, return to original top */ +#undef ORIG_TOPDEFS + +/* 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 + +/* reduce impact of x-windows resize operations on top */ +#undef SIGNALS_LESS + +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#undef STDC_HEADERS + +/* Use /proc/$PID/ctty to determine controlling TTY */ +#undef USE_PROC_CTTY + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable X/Open compliant socket functions that do not require linking + with -lxnet on HP-UX 11.11. */ +#ifndef _HPUX_ALT_XOPEN_SOCKET_API +# undef _HPUX_ALT_XOPEN_SOCKET_API +#endif +/* Identify the host operating system as Minix. + This macro does not affect the system headers' behavior. + A future release of Autoconf may stop defining this macro. */ +#ifndef _MINIX +# undef _MINIX +#endif +/* Enable general extensions on NetBSD. + Enable NetBSD compatibility extensions on Minix. */ +#ifndef _NETBSD_SOURCE +# undef _NETBSD_SOURCE +#endif +/* Enable OpenBSD compatibility extensions on NetBSD. + Oddly enough, this does nothing on OpenBSD. */ +#ifndef _OPENBSD_SOURCE +# undef _OPENBSD_SOURCE +#endif +/* Define to 1 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_SOURCE +# undef _POSIX_SOURCE +#endif +/* Define to 2 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_1_SOURCE +# undef _POSIX_1_SOURCE +#endif +/* Enable POSIX-compatible threading on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable X/Open extensions. Define to 500 only if necessary + to make mbstate_t available. */ +#ifndef _XOPEN_SOURCE +# undef _XOPEN_SOURCE +#endif + + +/* Version number of package */ +#undef VERSION + +/* Enable color watch by default */ +#undef WITH_COLORWATCH + +/* enable elogind support */ +#undef WITH_ELOGIND + +/* enable systemd support */ +#undef WITH_SYSTEMD + +/* Enable 8 bit clean watch */ +#undef WITH_WATCH8BIT + +/* enable w from field by default */ +#undef W_SHOWFROM + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* 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 the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef int32_t + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define as a signed integer type capable of holding a process identifier. */ +#undef pid_t + +/* Define to rpl_realloc if the replacement function should be used. */ +#undef realloc + +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported only directly. */ +#undef restrict +/* Work around a bug in older versions of Sun C++, which did not + #define __restrict__ or support _Restrict or __restrict__ + even though the corresponding Sun C compiler ended up with + "#define restrict _Restrict" or "#define restrict __restrict__" + in the previous line. This workaround can be removed once + we assume Oracle Developer Studio 12.5 (2016) or later. */ +#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__ +# define _Restrict +# define __restrict__ +#endif + +/* 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 + +/* Define as `fork' if `vfork' does not work. */ +#undef vfork diff --git a/config.rpath b/config.rpath new file mode 100755 index 0000000..4db13e5 --- /dev/null +++ b/config.rpath @@ -0,0 +1,548 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2003 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + mingw* | pw32* | os2*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + newsos6) + ;; + linux*) + case $CC in + icc|ecc) + wl='-Wl,' + ;; + ccc) + wl='-Wl,' + ;; + esac + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + sco3.2v5*) + ;; + solaris*) + wl='-Wl,' + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + case "$host_os" in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can use + # them. + ld_shlibs=no + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = yes; then + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + bsdi4*) + ;; + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + hardcode_direct=no + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd1*) + ld_shlibs=no + ;; + freebsd2.2*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + freebsd2*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10* | hpux11*) + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=no + ;; + ia64*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=no + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + *) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + openbsd*) + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + sco3.2v5*) + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4.2uw2*) + hardcode_direct=yes + hardcode_minus_L=no + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + ;; + sysv5*) + hardcode_libdir_flag_spec= + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. +libname_spec='lib$name' +case "$host_os" in + aix3*) + ;; + aix4* | aix5*) + ;; + amigaos*) + ;; + beos*) + ;; + bsdi4*) + ;; + cygwin* | mingw* | pw32*) + shrext=.dll + ;; + darwin* | rhapsody*) + shrext=.dylib + ;; + dgux*) + ;; + freebsd1*) + ;; + freebsd*) + ;; + gnu*) + ;; + hpux9* | hpux10* | hpux11*) + case "$host_cpu" in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux*) + ;; + netbsd*) + ;; + newsos6) + ;; + nto-qnx) + ;; + openbsd*) + ;; + os2*) + libname_spec='$name' + shrext=.dll + ;; + osf3* | osf4* | osf5*) + ;; + sco3.2v5*) + ;; + solaris*) + ;; + sunos4*) + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + ;; + sysv4*MP*) + ;; + uts4*) + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. +# +# 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: +# https://git.savannah.gnu.org/cgit/config.git/plain/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. + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -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-2022 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 ;; + + *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 + +# Split fields of configuration type +# shellcheck disable=SC2162 +saved_IFS=$IFS +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 + ;; + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 + ;; + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac + ;; + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | 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* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac + ;; + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac + ;; +esac + +# Decode 1-component or ad-hoc basic machines +case $basic_machine in + # 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) + cpu=hppa1.1 + vendor=winbond + ;; + op50n) + cpu=hppa1.1 + vendor=oki + ;; + op60c) + cpu=hppa1.1 + vendor=oki + ;; + ibm*) + cpu=i370 + vendor=ibm + ;; + orion105) + cpu=clipper + vendor=highlevel + ;; + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple + ;; + pmac | pmac-mpw) + cpu=powerpc + vendor=apple + ;; + + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + cpu=m68000 + vendor=att + ;; + 3b*) + cpu=we32k + vendor=att + ;; + bluegene*) + cpu=powerpc + vendor=ibm + basic_os=cnk + ;; + decsystem10* | dec10*) + cpu=pdp10 + vendor=dec + basic_os=tops10 + ;; + decsystem20* | dec20*) + cpu=pdp10 + vendor=dec + basic_os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + cpu=m68k + vendor=motorola + ;; + dpx2*) + cpu=m68k + vendor=bull + basic_os=sysv3 + ;; + encore | umax | mmax) + cpu=ns32k + vendor=encore + ;; + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} + ;; + fx2800) + cpu=i860 + vendor=alliant + ;; + genix) + cpu=ns32k + vendor=ns + ;; + h3050r* | hiux*) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + cpu=m68000 + vendor=hp + ;; + hp9k3[2-9][0-9]) + cpu=m68k + vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + i*86v32) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 + ;; + i*86v4*) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 + ;; + i*86v) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv + ;; + i*86sol2) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} + ;; + iris | iris4d) + cpu=mips + vendor=sgi + case $basic_os in + irix*) + ;; + *) + basic_os=irix4 + ;; + esac + ;; + miniframe) + cpu=m68000 + vendor=convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint + ;; + news-3600 | risc-news) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) + ;; + ns2*) + basic_os=nextstep2 + ;; + *) + basic_os=nextstep3 + ;; + esac + ;; + np1) + cpu=np1 + vendor=gould + ;; + op50n-* | op60c-*) + cpu=hppa1.1 + vendor=oki + basic_os=proelf + ;; + pa-hitachi) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + pbd) + cpu=sparc + vendor=tti + ;; + pbb) + cpu=m68k + vendor=tti + ;; + pc532) + cpu=ns32k + vendor=pc532 + ;; + pn) + cpu=pn + vendor=gould + ;; + power) + cpu=power + vendor=ibm + ;; + ps2) + cpu=i386 + vendor=ibm + ;; + rm[46]00) + cpu=mips + vendor=siemens + ;; + rtpc | rtpc-*) + cpu=romp + vendor=ibm + ;; + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} + ;; + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks + ;; + tower | tower-32) + cpu=m68k + vendor=ncr + ;; + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu + ;; + w65) + cpu=w65 + vendor=wdc + ;; + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf + ;; + none) + cpu=none + vendor=none + ;; + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine + ;; + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` + ;; + + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read cpu vendor <&2 + exit 1 + ;; + esac + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $vendor in + digital*) + vendor=dec + ;; + commodore*) + vendor=cbm + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if test x$basic_os != x +then + +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read kernel os <&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + vxworks-simlinux | vxworks-simwindows | vxworks-spe) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +case $vendor in + unknown) + case $cpu-$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 + ;; + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) + vendor=ibm + ;; + s390-* | s390x-*) + 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 + ;; +esac + +echo "$cpu-$vendor-${kernel:+$kernel-}$os" +exit + +# Local variables: +# eval: (add-hook 'before-save-hook '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..4a947dd --- /dev/null +++ b/configure @@ -0,0 +1,21818 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.71 for procps-ng 4.0.4. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 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 +as_nop=: +if test ${ZSH_VERSION+y} && (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 $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; 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 + + +# 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# 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'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +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="as_nop=: +if test \${ZSH_VERSION+y} && (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 \$as_nop + 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 \$as_nop + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || 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_nop + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi + + + 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'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: procps@freelists.org about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do 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_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# 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=`printf "%s\n" "$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 || +printf "%s\n" 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_nop + 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_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# 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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$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 || +printf "%s\n" 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" || + { printf "%s\n" "$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 +} + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +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 + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + +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='procps-ng' +PACKAGE_TARNAME='procps-ng' +PACKAGE_VERSION='4.0.4' +PACKAGE_STRING='procps-ng 4.0.4' +PACKAGE_BUGREPORT='procps@freelists.org' +PACKAGE_URL='https://gitlab.com/procps-ng/procps' + +ac_unique_file="src/free.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= +ac_func_c_list= +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +DEJAGNU +DL_LIB +EXAMPLE_FILES_FALSE +EXAMPLE_FILES_TRUE +BUILD_SKILL_FALSE +BUILD_SKILL_TRUE +CYGWIN_FALSE +CYGWIN_TRUE +LINUX_FALSE +LINUX_TRUE +BUILD_W_FALSE +BUILD_W_TRUE +BUILD_KILL_FALSE +BUILD_KILL_TRUE +BUILD_PIDOF_FALSE +BUILD_PIDOF_TRUE +WITH_ELOGIND_FALSE +WITH_ELOGIND_TRUE +ELOGIND_LIBS +ELOGIND_CFLAGS +WITH_SYSTEMD_FALSE +WITH_SYSTEMD_TRUE +SYSTEMD_LIBS +SYSTEMD_CFLAGS +NCURSES_LIBS +NCURSES_CFLAGS +WITH_NCURSES_FALSE +WITH_NCURSES_TRUE +HARDEN_LDFLAGS +HARDEN_CFLAGS +WITH_COLORWATCH +WITH_WATCH8BIT +BUILD_PIDWAIT_FALSE +BUILD_PIDWAIT_TRUE +POSUB +LTLIBINTL +LIBINTL +INTLLIBS +LTLIBICONV +LIBICONV +MSGMERGE +XGETTEXT +GMSGFMT +MSGFMT +MKINSTALLDIRS +usrbin_execdir +POW_LIB +LIBOBJS +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +DLLTOOL +OBJDUMP +FILECMD +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +EGREP +GREP +USE_PO4A +PO4A +USE_NLS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +LN_S +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +CSCOPE +ETAGS +CTAGS +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 +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 +runstatedir +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 +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_largefile +enable_nls +enable_shared +enable_static +with_pic +enable_fast_install +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_rpath +with_libiconv_prefix +with_libintl_prefix +enable_watch8bit +enable_colorwatch +enable_libselinux +enable_harden_flags +with_ncurses +with_systemd +with_elogind +enable_pidof +enable_kill +enable_w +enable_skill +enable_examples +enable_sigwinch +enable_wide_percent +enable_wide_memory +enable_modern_top +enable_numa +enable_w_from +enable_whining +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +LT_SYS_LIBRARY_PATH +NCURSES_CFLAGS +NCURSES_LIBS +SYSTEMD_CFLAGS +SYSTEMD_LIBS +ELOGIND_CFLAGS +ELOGIND_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' +runstatedir='${localstatedir}/run' +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 + + 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=`printf "%s\n" "$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=`printf "%s\n" "$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 ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -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=`printf "%s\n" "$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=`printf "%s\n" "$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. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$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" ;; + *) printf "%s\n" "$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 runstatedir +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 || +printf "%s\n" 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 procps-ng 4.0.4 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] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --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/procps-ng] + --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 + +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 procps-ng 4.0.4:";; + 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-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --disable-largefile omit support for large files + --disable-nls do not use Native Language Support + --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) + --disable-rpath do not hardcode runtime library paths + --enable-watch8bit enable watch to be 8bit clean (requires ncursesw) + --enable-colorwatch enable watch to use color by default + --enable-libselinux enable libselinux + --enable-harden-flags enable hardened compilier and linker flags + --disable-pidof do not build pidof + --disable-kill do not build kill + --disable-w do not build w + --enable-skill build skill and snice + --enable-examples add example files to installation + --enable-sigwinch reduce impact of x-windows resize operations on top + --enable-wide-percent provide extra precision under %CPU and %MEM for top + --enable-wide-memory provide extra precision under memory fields for top + --disable-modern-top disable new startup defaults, return to original top + --disable-numa disable NUMA/Node support in top + --enable-w-from enable w from field by default + --disable-whining do not print unnecessary warnings (slackware-ism) + +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-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 + --without-ncurses build only applications not needing ncurses + --with-systemd enable systemd support + --with-elogind enable elogind support + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + 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 + 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 + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + NCURSES_CFLAGS + C compiler flags for NCURSES, overriding pkg-config + NCURSES_LIBS + linker flags for NCURSES, overriding pkg-config + SYSTEMD_CFLAGS + C compiler flags for SYSTEMD, overriding pkg-config + SYSTEMD_LIBS + linker flags for SYSTEMD, overriding pkg-config + ELOGIND_CFLAGS + C compiler flags for ELOGIND, overriding pkg-config + ELOGIND_LIBS + linker flags for ELOGIND, 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 . +procps-ng home page: . +_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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$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 configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. + 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 + printf "%s\n" "$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 +procps-ng configure 4.0.4 +generated by GNU Autoconf 2.71 + +Copyright (C) 2021 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 conftest.beam + 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\"" +printf "%s\n" "$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 + printf "%s\n" "$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_nop + printf "%s\n" "$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_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run 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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$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_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\"" +printf "%s\n" "$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 + printf "%s\n" "$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_nop + printf "%s\n" "$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_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +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 (void) +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_find_intX_t LINENO BITS VAR +# ----------------------------------- +# Finds a signed integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_intX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +printf %s "checking for int$2_t... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in int$2_t 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main (void) +{ +static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main (void) +{ +static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + case $ac_type in #( + int$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no" +then : + +else $as_nop + break +fi + done +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_intX_t + +# 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +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 $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +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 $as_nop + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$4 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member + +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_check_decl + +# 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.beam 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\"" +printf "%s\n" "$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 + printf "%s\n" "$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_nop + printf "%s\n" "$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_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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. */ + +#include +#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 (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + +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 procps-ng $as_me 4.0.4, which was +generated by GNU Autoconf 2.71. Invocation command line was + + $ $0$ac_configure_args_raw + +_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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "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=`printf "%s\n" "$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=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## 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_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$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 + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$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 + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + ac_site_files="$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*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 do not provoke an error unfortunately, instead are silently treated + as an "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 is necessary to write \x00 == 0 to get something + that is 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 **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" +as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" +as_fn_append ac_header_c_list " vfork.h vfork_h HAVE_VFORK_H" +as_fn_append ac_func_c_list " fork HAVE_FORK" +as_fn_append ac_func_c_list " vfork HAVE_VFORK" +as_fn_append ac_header_c_list " sys/param.h sys_param_h HAVE_SYS_PARAM_H" +as_fn_append ac_func_c_list " getpagesize HAVE_GETPAGESIZE" + +# Auxiliary files required by this configure script. +ac_aux_files="config.guess config.sub ltmain.sh compile missing install-sh" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$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. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# 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,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$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=`printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-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 + + +am__api_version='1.16' + + + + # 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. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +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+y}; 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$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' + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "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=`printf "%s\n" "$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 + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 ('*'coreutils) '* | \ + 'BusyBox '* | \ + '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+y}; 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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+y} +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} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" '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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$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='procps-ng' + VERSION='4.0.4' + + +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h + + +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h + +# 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 pax cpio none' + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5 +printf %s "checking how to create a pax 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_pax-$_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=posix -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=posix -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 pax -w "$$tardir"' + am__tar_='pax -L -x pax -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H pax -L' + am__tar_='find "$tardir" -print | cpio -o -H pax -L' + am__untar='cpio -i -H pax -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_pax}" && 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 test ${am_cv_prog_tar_pax+y} +then : + printf %s "(cached) " >&6 +else $as_nop + am_cv_prog_tar_pax=$_am_tool +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_pax" >&5 +printf "%s\n" "$am_cv_prog_tar_pax" >&6; } + + + + + +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + + +# 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+y} +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} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" '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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$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='\' + + +ac_config_headers="$ac_config_headers config.h" + +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 + + +# Checks for programs. + + + + + + + + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test ${enable_dependency_tracking+y} +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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}clang" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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="clang" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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. +printf "%s\n" "$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 -version; 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\"" +printf "%s\n" "$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 + printf "%s\n" "$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 (void) +{ + + ; + 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. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf "%s\n" "$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+y} && 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 $as_nop + ac_file='' +fi +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$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_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$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 (void) +{ +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. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$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 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + 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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf "%s\n" "$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_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + 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.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; 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 +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_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 conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$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= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$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_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test ${ac_cv_safe_to_define___extensions__+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_safe_to_define___extensions__=yes +else $as_nop + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if test ${ac_cv_should_define__xopen_source+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_should_define__xopen_source=no + if test $ac_cv_header_wchar_h = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } + + printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h + + printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h + + if test $ac_cv_header_minix_config_h = yes +then : + MINIX=yes + printf "%s\n" "#define _MINIX 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h + +else $as_nop + MINIX= +fi + if test $ac_cv_safe_to_define___extensions__ = yes +then : + printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h + +fi + if test $ac_cv_should_define__xopen_source = yes +then : + printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h + +fi + +# Check whether --enable-largefile was given. +if test ${enable_largefile+y} +then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO" +then : + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test ${ac_cv_sys_file_offset_bits+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } +if test ${ac_cv_sys_large_files+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h +;; +esac +rm -rf conftest* + fi +fi + +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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}clang" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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="clang" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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. +printf "%s\n" "$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 -version; 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\"" +printf "%s\n" "$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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + 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.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; 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 +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_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 conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$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= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$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 + + + +if test "$cross_compiling" = no; then + if test "x$ac_cv_prog_cc_c99" = "xno" || test "x$ac_cv_prog_cc_c99" = "x"; then + # We might be on RHEL5 with a git checkout and so broken + # autoconf. Check if CC is gcc and if it bails when given -std=gnu99. + # If not, use that. Yuck. + if test "x$ac_cv_c_compiler_gnu" = "xyes"; then + CC="$CC -std=gnu99" + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + +else $as_nop + as_fn_error $? "Could not find a C99 compatible compiler" "$LINENO" 5 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + else + as_fn_error $? "Could not find a C99 compatible compiler" "$LINENO" 5 + fi + fi +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "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 test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" 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. + # 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. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop + # 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 $as_nop + # 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$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. + # 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. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop + # 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 $as_nop + # 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_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } +fi + + + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + PKG_CONFIG="" + fi +fi +if test -z "$PKG_CONFIG" +then : + + as_fn_error $? "Could not find pkg-config" "$LINENO" 5 +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +printf %s "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test ${enable_nls+y} +then : + enableval=$enable_nls; USE_NLS=$enableval +else $as_nop + USE_NLS=yes +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + + + + + for ac_prog in po4a +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PO4A+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$PO4A"; then + ac_cv_prog_PO4A="$PO4A" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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_PO4A="$ac_prog" + printf "%s\n" "$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 +PO4A=$ac_cv_prog_PO4A +if test -n "$PO4A"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PO4A" >&5 +printf "%s\n" "$PO4A" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$PO4A" && break +done + + if test "$USE_NLS" = "yes" && test -n "$PO4A" +then : + + USE_PO4A=yes + +else $as_nop + + USE_PO4A=no + +fi + + + +# Checks for header files. + +ac_fn_c_check_header_compile "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mkdev_h" = xyes +then : + +printf "%s\n" "#define MAJOR_IN_MKDEV 1" >>confdefs.h + +fi + +if test $ac_cv_header_sys_mkdev_h = no; then + ac_fn_c_check_header_compile "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sysmacros_h" = xyes +then : + +printf "%s\n" "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h + +fi + +fi + +ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_inet_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default" +if test "x$ac_cv_header_float_h" = xyes +then : + printf "%s\n" "#define HAVE_FLOAT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" +if test "x$ac_cv_header_langinfo_h" = xyes +then : + printf "%s\n" "#define HAVE_LANGINFO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" +if test "x$ac_cv_header_limits_h" = xyes +then : + printf "%s\n" "#define HAVE_LIMITS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" +if test "x$ac_cv_header_locale_h" = xyes +then : + printf "%s\n" "#define HAVE_LOCALE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdio_ext.h" "ac_cv_header_stdio_ext_h" "$ac_includes_default" +if test "x$ac_cv_header_stdio_ext_h" = xyes +then : + printf "%s\n" "#define HAVE_STDIO_EXT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes +then : + printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" +if test "x$ac_cv_header_string_h" = xyes +then : + printf "%s\n" "#define HAVE_STRING_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_file_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" +if test "x$ac_cv_header_termios_h" = xyes +then : + printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "utmp.h" "ac_cv_header_utmp_h" "$ac_includes_default" +if test "x$ac_cv_header_utmp_h" = xyes +then : + printf "%s\n" "#define HAVE_UTMP_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "utmpx.h" "ac_cv_header_utmpx_h" "$ac_includes_default" +if test "x$ac_cv_header_utmpx_h" = xyes +then : + printf "%s\n" "#define HAVE_UTMPX_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "values.h" "ac_cv_header_values_h" "$ac_includes_default" +if test "x$ac_cv_header_values_h" = xyes +then : + printf "%s\n" "#define HAVE_VALUES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" +if test "x$ac_cv_header_wchar_h" = xyes +then : + printf "%s\n" "#define HAVE_WCHAR_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "wctype.h" "ac_cv_header_wctype_h" "$ac_includes_default" +if test "x$ac_cv_header_wctype_h" = xyes +then : + printf "%s\n" "#define HAVE_WCTYPE_H 1" >>confdefs.h + +fi + + +# Checks for typedefs, structures, and compiler characteristics. +ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : + +printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h + + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + + #ifndef __bool_true_false_are_defined + #error "__bool_true_false_are_defined is not defined" + #endif + char a[__bool_true_false_are_defined == 1 ? 1 : -1]; + + /* Regardless of whether this is C++ or "_Bool" is a + valid type name, "true" and "false" should be usable + in #if expressions and integer constant expressions, + and "bool" should be a valid type name. */ + + #if !true + #error "'true' is not true" + #endif + #if true != 1 + #error "'true' is not equal to 1" + #endif + char b[true == 1 ? 1 : -1]; + char c[true]; + + #if false + #error "'false' is not false" + #endif + #if false != 0 + #error "'false' is not equal to 0" + #endif + char d[false == 0 ? 1 : -1]; + + enum { e = false, f = true, g = false * true, h = true * 256 }; + + char i[(bool) 0.5 == true ? 1 : -1]; + char j[(bool) 0.0 == false ? 1 : -1]; + char k[sizeof (bool) > 0 ? 1 : -1]; + + struct sb { bool s: 1; bool t; } s; + char l[sizeof s.t > 0 ? 1 : -1]; + + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + bool m[h]; + char n[sizeof m == h * sizeof m[0] ? 1 : -1]; + char o[-1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + bool p = true; + bool *pp = &p; + + /* C 1999 specifies that bool, true, and false are to be + macros, but C++ 2011 and later overrule this. */ + #if __cplusplus < 201103 + #ifndef bool + #error "bool is not defined" + #endif + #ifndef false + #error "false is not defined" + #endif + #ifndef true + #error "true is not defined" + #endif + #endif + + /* If _Bool is available, repeat with it all the tests + above that used bool. */ + #ifdef HAVE__BOOL + struct sB { _Bool s: 1; _Bool t; } t; + + char q[(_Bool) 0.5 == true ? 1 : -1]; + char r[(_Bool) 0.0 == false ? 1 : -1]; + char u[sizeof (_Bool) > 0 ? 1 : -1]; + char v[sizeof t.t > 0 ? 1 : -1]; + + _Bool w[h]; + char x[sizeof m == h * sizeof m[0] ? 1 : -1]; + char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; + _Bool z = true; + _Bool *pz = &p; + #endif + +int +main (void) +{ + + bool ps = &s; + *pp |= p; + *pp |= ! p; + + #ifdef HAVE__BOOL + _Bool pt = &t; + *pz |= z; + *pz |= ! z; + #endif + + /* Refer to every declared value, so they cannot be + discarded as unused. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + + !l + !m + !n + !o + !p + !pp + !ps + #ifdef HAVE__BOOL + + !q + !r + !u + !v + !w + !x + !y + !z + !pt + #endif + ); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_stdbool_h=yes +else $as_nop + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +printf %s "checking for uid_t in sys/types.h... " >&6; } +if test ${ac_cv_type_uid_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 $as_nop + ac_cv_type_uid_t=no +fi +rm -rf conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +printf "%s\n" "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +printf "%s\n" "#define uid_t int" >>confdefs.h + + +printf "%s\n" "#define gid_t int" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 (void) {return 0; } +$ac_kw foo_t foo (void) {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.beam conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$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_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h +;; +esac + + + 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 $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_pid_type='int' +else $as_nop + ac_pid_type='__int64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h + + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +printf %s "checking for C/C++ restrict keyword... " >&6; } +if test ${ac_cv_c_restrict+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_c_restrict=no + # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see: + # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html + # Put 'restrict' last, because C++ lacks it. + for ac_kw in __restrict__ __restrict _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + +int +main (void) +{ +int s[1]; + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_restrict=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +printf "%s\n" "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in + restrict) ;; + no) printf "%s\n" "#define restrict /**/" >>confdefs.h + ;; + *) printf "%s\n" "#define restrict $ac_cv_c_restrict" >>confdefs.h + ;; + esac + +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 $as_nop + +printf "%s\n" "#define size_t unsigned 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 $as_nop + +printf "%s\n" "#define ssize_t int" >>confdefs.h + +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 : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_RDEV 1" >>confdefs.h + + +fi + +ac_fn_c_check_member "$LINENO" "siginfo_t" "si_int" "ac_cv_member_siginfo_t_si_int" "#include +" +if test "x$ac_cv_member_siginfo_t_si_int" = xyes +then : + +printf "%s\n" "#define HAVE_SIGINFO_T_SI_INT 1" >>confdefs.h + + +fi + + +if test "x$ac_cv_header_utmpx_h" = xyes +then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else $as_nop + ac_cv_c_undeclared_builtin_options=$ac_arg +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + +ac_fn_check_decl "$LINENO" "__UT_HOSTSIZE" "ac_cv_have_decl___UT_HOSTSIZE" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl___UT_HOSTSIZE" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL___UT_HOSTSIZE $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + +printf "%s\n" "#define HAVE_UT_HOSTSIZE_IN_UTMPX 1" >>confdefs.h + +fi + +fi + +case `pwd` in + *\ * | *\ *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.7' +macro_revision='2.4.7' + + + + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + + + + # 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 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$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 + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$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 + + +# 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 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +printf %s "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*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +printf "%s\n" "printf" >&6; } ;; + print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +printf "%s\n" "print -r" >&6; } ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +printf "%s\n" "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$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+y} +then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test ${lt_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf "%s\n" "$DUMPBIN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +printf "%s\n" "$ac_ct_DUMPBIN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +printf %s "checking the name lister ($NM) interface... " >&6; } +if test ${lt_cv_nm_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +printf "%s\n" "$lt_cv_nm_interface" >&6; } + +# find the maximum length of command line arguments +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +printf %s "checking the maximum length of command line arguments... " >&6; } +if test ${lt_cv_sys_max_cmd_len+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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* | midnightbsd* | 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "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 + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +printf %s "checking how to convert $build file names to $host format... " >&6; } +if test ${lt_cv_to_host_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +printf %s "checking how to convert $build file names to toolchain format... " >&6; } +if test ${lt_cv_to_tool_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + #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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +printf %s "checking for $LD option to reload object files... " >&6; } +if test ${lt_cv_ld_reload_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_reload_flag='-r' +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$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}file", so it can be a program name with args. +set dummy ${ac_tool_prefix}file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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_FILECMD="${ac_tool_prefix}file" + printf "%s\n" "$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 +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_FILECMD"; then + ac_ct_FILECMD=$FILECMD + # Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_FILECMD"; then + ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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_FILECMD="file" + printf "%s\n" "$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_FILECMD=$ac_cv_prog_ac_ct_FILECMD +if test -n "$ac_ct_FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 +printf "%s\n" "$ac_ct_FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_FILECMD" = x; then + FILECMD=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FILECMD=$ac_ct_FILECMD + fi +else + FILECMD="$ac_cv_prog_FILECMD" +fi + + + + + + + +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +printf %s "checking how to recognize dependent libraries... " >&6; } +if test ${lt_cv_deplibs_check_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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='$FILECMD -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* | midnightbsd*) + 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=$FILECMD + 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=$FILECMD + 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* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=$FILECMD + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +printf %s "checking how to associate runtime and link libraries... " >&6; } +if test ${lt_cv_sharedlib_from_linklib_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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} + + + + + + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS + + + + + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +printf %s "checking for archiver @FILE support... " >&6; } +if test ${lt_cv_ar_at_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + 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=$? + printf "%s\n" "$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=$? + printf "%s\n" "$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.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +printf %s "checking command to parse $NM output from $compiler object... " >&6; } +if test ${lt_cv_sys_global_symbol_pipe+y} +then : + printf %s "(cached) " >&6 +else $as_nop + +# 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++ or ICC, + # 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=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_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 $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=$? + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +printf %s "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test ${with_sysroot+y} +then : + withval=$with_sysroot; +else $as_nop + 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|'') + ;; #( + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +printf "%s\n" "$with_sysroot" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf "%s\n" "${lt_sysroot:-no}" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +printf %s "checking for a working dd... " >&6; } +if test ${ac_cv_path_lt_DD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +printf "%s\n" "$ac_cv_path_lt_DD" >&6; } + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +printf %s "checking how to truncate binary pipes... " >&6; } +if test ${lt_cv_truncate_bin+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +printf "%s\n" "$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+y} +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=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `$FILECMD 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=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `$FILECMD conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `$FILECMD 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=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `$FILECMD conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `$FILECMD conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `$FILECMD 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=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `$FILECMD conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `$FILECMD 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" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +printf %s "checking whether the C compiler needs -belf... " >&6; } +if test ${lt_cv_cc_needs_belf+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_cc_needs_belf=yes +else $as_nop + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +printf "%s\n" "$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=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `$FILECMD 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf "%s\n" "$MANIFEST_TOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test ${lt_cv_path_mainfest_tool+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf "%s\n" "$DSYMUTIL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf "%s\n" "$NMEDIT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +printf "%s\n" "$ac_ct_NMEDIT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf "%s\n" "$LIPO" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +printf "%s\n" "$ac_ct_LIPO" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf "%s\n" "$OTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +printf "%s\n" "$ac_ct_OTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf "%s\n" "$OTOOL64" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +printf "%s\n" "$ac_ct_OTOOL64" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +printf %s "checking for -single_module linker flag... " >&6; } +if test ${lt_cv_apple_cc_single_mod+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +printf %s "checking for -exported_symbols_list linker flag... " >&6; } +if test ${lt_cv_ld_exported_symbols_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_ld_exported_symbols_list=yes +else $as_nop + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +printf %s "checking for -force_load linker flag... " >&6; } +if test ${lt_cv_ld_force_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +printf "%s\n" "$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*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[012],*|,*powerpc*-darwin[5-8]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _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 +} + +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 : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h + +fi + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test ${enable_shared+y} +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 $as_nop + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test ${enable_static+y} +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 $as_nop + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test ${with_pic+y} +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 $as_nop + pic_mode=default +fi + + + + + + + + + # Check whether --enable-fast-install was given. +if test ${enable_fast_install+y} +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 $as_nop + enable_fast_install=yes +fi + + + + + + + + + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +printf %s "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test ${with_aix_soname+y} +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 $as_nop + if test ${lt_cv_with_aix_soname+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +printf "%s\n" "$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 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +printf %s "checking for objdir... " >&6; } +if test ${lt_cv_objdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +printf "%s\n" "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h + + + + +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 and +# ICC, which need '.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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +printf %s "checking for ${ac_tool_prefix}file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +printf %s "checking for file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test ${lt_cv_prog_compiler_rtti_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +printf "%s\n" "$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' + ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + 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 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$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\" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works"; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } + if test no = "$hard_links"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$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 + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "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++ and ICC port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++ or Intel C++ Compiler. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=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 + file_list_spec='@' + ;; + + 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*) + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + 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* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $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 == "L") || (\$ 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 test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + 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.beam \ + 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 test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + 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.beam \ + 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++ or Intel C++ Compiler. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl* | icl*) + # Native MSVC or ICC + 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 and ICC 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* | midnightbsd*) + 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) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +printf %s "checking if $CC understands -b... " >&6; } +if test ${lt_cv_prog_compiler__b+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +printf "%s\n" "$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. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test ${lt_cv_irix_exported_symbol+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 $as_nop + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +printf "%s\n" "$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 + link_all_deplibs=no + 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' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + ;; + esac + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | 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 + file_list_spec='@' + ;; + + 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 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +printf "%s\n" "$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. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc+y} +then : + printf %s "(cached) " >&6 +else $as_nop + $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=$? + printf "%s\n" "$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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "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* | *,icl*) + # Native MSVC or ICC + 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 and ICC 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* | midnightbsd*) + # 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 test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 (void) +{ + + ; + 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.beam \ + 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 + + # 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="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dl_dlopen=yes +else $as_nop + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$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_nop + + 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_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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. */ +char shl_load (); +int +main (void) +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dld_shl_load=yes +else $as_nop + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$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 $as_nop + 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_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dl_dlopen=yes +else $as_nop + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$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_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +printf %s "checking for dlopen in -lsvld... " >&6; } +if test ${ac_cv_lib_svld_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_svld_dlopen=yes +else $as_nop + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +printf "%s\n" "$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_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +printf %s "checking for dld_link in -ldld... " >&6; } +if test ${ac_cv_lib_dld_dld_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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. */ +char dld_link (); +int +main (void) +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dld_dld_link=yes +else $as_nop + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +printf "%s\n" "$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" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +printf %s "checking whether a program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +printf "%s\n" "$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\" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +printf %s "checking whether a statically linked program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self_static+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +printf "%s\n" "$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= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +printf %s "checking whether stripping libraries is possible... " >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +else + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac + fi +fi + + + + + + + + + + + + + # Report what library types will actually be built + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +printf %s "checking if libtool supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf "%s\n" "$can_build_shared" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +printf %s "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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +printf %s "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf "%s\n" "$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: + + + +# Checks for library functions. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 +printf %s "checking for error_at_line... " >&6; } +if test ${ac_cv_lib_error_at_line+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +error_at_line (0, 0, "", 0, "an error occurred"); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_error_at_line=yes +else $as_nop + ac_cv_lib_error_at_line=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 +printf "%s\n" "$ac_cv_lib_error_at_line" >&6; } +if test $ac_cv_lib_error_at_line = no; then + case " $LIBOBJS " in + *" error.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS error.$ac_objext" + ;; +esac + +fi + + +ac_func= +for ac_item in $ac_func_c_list +do + if test $ac_func; then + ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func + if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then + echo "#define $ac_item 1" >> confdefs.h + fi + ac_func= + else + ac_func=$ac_item + fi +done + + + +if test "x$ac_cv_func_fork" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +printf %s "checking for working fork... " >&6; } +if test ${ac_cv_func_fork_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + ac_cv_func_fork_works=cross +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* By Ruediger Kuhlmann. */ + return fork () < 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_fork_works=yes +else $as_nop + ac_cv_func_fork_works=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +printf "%s\n" "$ac_cv_func_fork_works" >&6; } + +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +printf %s "checking for working vfork... " >&6; } +if test ${ac_cv_func_vfork_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + ac_cv_func_vfork_works=cross +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include +#include +#ifdef HAVE_VFORK_H +# include +#endif + +static void +do_nothing (int sig) +{ + (void) sig; +} + +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void +sparc_address_test (int arg) +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main (void) +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + /* On Solaris 2.4, changes by the child to the signal handler + also munge signal handlers in the parent. To detect this, + start by putting the parent's handler in a known state. */ + signal (SIGTERM, SIG_DFL); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* Alter the child's signal handler. */ + if (signal (SIGTERM, do_nothing) != SIG_DFL) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child munge the parent's signal handler? */ + || signal (SIGTERM, SIG_DFL) != SIG_DFL + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_vfork_works=yes +else $as_nop + ac_cv_func_vfork_works=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +printf "%s\n" "$ac_cv_func_vfork_works" >&6; } + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + +printf "%s\n" "#define HAVE_WORKING_VFORK 1" >>confdefs.h + +else + +printf "%s\n" "#define vfork fork" >>confdefs.h + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +printf "%s\n" "#define HAVE_WORKING_FORK 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +printf %s "checking for GNU libc compatible malloc... " >&6; } +if test ${ac_cv_func_malloc_0_nonnull+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | hpux* | solaris* | cygwin* | mingw* | msys* ) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +void *p = malloc (0); + int result = !p; + free (p); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_malloc_0_nonnull=yes +else $as_nop + ac_cv_func_malloc_0_nonnull=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes +then : + +printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h + +else $as_nop + printf "%s\n" "#define HAVE_MALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac + + +printf "%s\n" "#define malloc rpl_malloc" >>confdefs.h + +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc and mbstate_t are properly declared" >&5 +printf %s "checking whether mbrtowc and mbstate_t are properly declared... " >&6; } +if test ${ac_cv_func_mbrtowc+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +wchar_t wc; + char const s[] = ""; + size_t n = 1; + mbstate_t state; + return ! (sizeof state && (mbrtowc) (&wc, s, n, &state)); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_func_mbrtowc=yes +else $as_nop + ac_cv_func_mbrtowc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mbrtowc" >&5 +printf "%s\n" "$ac_cv_func_mbrtowc" >&6; } + if test $ac_cv_func_mbrtowc = yes; then + +printf "%s\n" "#define HAVE_MBRTOWC 1" >>confdefs.h + + fi + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +printf %s "checking for working mmap... " >&6; } +if test ${ac_cv_func_mmap_fixed_mapped+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + linux*) ac_cv_func_mmap_fixed_mapped=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_mmap_fixed_mapped=no ;; + esac +else $as_nop + 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 + +/* 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 (void) +{ + 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); + free (data); + free (data3); + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_mmap_fixed_mapped=yes +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 +printf "%s\n" "$ac_cv_func_mmap_fixed_mapped" >&6; } +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +printf "%s\n" "#define HAVE_MMAP 1" >>confdefs.h + +fi +rm -f conftest.mmap conftest.txt + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 +printf %s "checking for GNU libc compatible realloc... " >&6; } +if test ${ac_cv_func_realloc_0_nonnull+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | hpux* | solaris* | cygwin* | mingw* | msys* ) + ac_cv_func_realloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_realloc_0_nonnull=no ;; + esac +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +void *p = realloc (0, 0); + int result = !p; + free (p); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_realloc_0_nonnull=yes +else $as_nop + ac_cv_func_realloc_0_nonnull=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_realloc_0_nonnull" >&6; } +if test $ac_cv_func_realloc_0_nonnull = yes +then : + +printf "%s\n" "#define HAVE_REALLOC 1" >>confdefs.h + +else $as_nop + printf "%s\n" "#define HAVE_REALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" realloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS realloc.$ac_objext" + ;; +esac + + +printf "%s\n" "#define realloc rpl_realloc" >>confdefs.h + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strcoll" >&5 +printf %s "checking for working strcoll... " >&6; } +if test ${ac_cv_func_strcoll_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on glibc systems. + *-gnu*) ac_cv_func_strcoll_works=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_strcoll_works=no ;; + esac +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +return (strcoll ("abc", "def") >= 0 || + strcoll ("ABC", "DEF") >= 0 || + strcoll ("123", "456") >= 0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_strcoll_works=yes +else $as_nop + ac_cv_func_strcoll_works=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strcoll_works" >&5 +printf "%s\n" "$ac_cv_func_strcoll_works" >&6; } +if test $ac_cv_func_strcoll_works = yes; then + +printf "%s\n" "#define HAVE_STRCOLL 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 +printf %s "checking for working strtod... " >&6; } +if test ${ac_cv_func_strtod+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + ac_cv_func_strtod=no +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +$ac_includes_default +#ifndef strtod +double strtod (); +#endif +int +main (void) +{ + { + /* Some versions of Linux strtod mis-parse strings with leading '+'. */ + char *string = " +69"; + char *term; + double value; + value = strtod (string, &term); + if (value != 69 || term != (string + 4)) + return 1; + } + + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + char *string = "NaN"; + char *term; + strtod (string, &term); + if (term != string && *(term - 1) == 0) + return 1; + } + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_strtod=yes +else $as_nop + ac_cv_func_strtod=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 +printf "%s\n" "$ac_cv_func_strtod" >&6; } +if test $ac_cv_func_strtod = no; then + case " $LIBOBJS " in + *" strtod.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtod.$ac_objext" + ;; +esac + +ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = xyes +then : + +fi + +if test $ac_cv_func_pow = no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +printf %s "checking for pow in -lm... " >&6; } +if test ${ac_cv_lib_m_pow+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $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. */ +char pow (); +int +main (void) +{ +return pow (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_m_pow=yes +else $as_nop + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +printf "%s\n" "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = xyes +then : + POW_LIB=-lm +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +printf "%s\n" "$as_me: WARNING: cannot find library containing definition of pow" >&2;} +fi + +fi + +fi + + +usrbin_execdir='${exec_prefix}/bin' + + +if test "x$host_os" = xcygwin +then + prefix=/usr + sysconfdir='${prefix}/etc' + libexecdir='${prefix}/lib' + localstatedir='${prefix}/var' + datadir='${prefix}/share' + mandir='${prefix}/share/man' + infodir='${prefix}/share/info' + + + + + + + + +printf "%s\n" "#define USE_PROC_CTTY 1" >>confdefs.h + +else + +printf "%s\n" "#define USE_PROC_CTTY 0" >>confdefs.h + +fi + + + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + case "$ac_aux_dir" in + /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; + *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; + esac + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGFMT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +printf "%s\n" "$MSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GMSGFMT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +printf "%s\n" "$GMSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_XGETTEXT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +printf "%s\n" "$XGETTEXT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + rm -f messages.po + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGMERGE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +printf "%s\n" "$MSGMERGE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + if test "$GMSGFMT" != ":"; then + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 +printf "%s\n" "found $GMSGFMT program is not GNU msgfmt; ignore it" >&6; } + GMSGFMT=":" + fi + fi + + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 +printf "%s\n" "found xgettext program is not GNU xgettext; ignore it" >&6; } + XGETTEXT=":" + fi + rm -f messages.po + fi + + ac_config_commands="$ac_config_commands default-1" + + + + 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+y} +then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 +printf %s "checking for ld used by GCC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test ${acl_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$acl_cv_path_LD" +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${acl_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +printf %s "checking for shared library run path origin... " >&6; } +if test ${acl_cv_rpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +printf "%s\n" "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test ${enable_rpath+y} +then : + enableval=$enable_rpath; : +else $as_nop + enable_rpath=yes +fi + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix was given. +if test ${with_libiconv_prefix+y} +then : + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi + + LIBICONV= + LTLIBICONV= + INCICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +printf %s "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test ${enable_nls+y} +then : + enableval=$enable_nls; USE_NLS=$enableval +else $as_nop + USE_NLS=yes +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + + + + + LIBINTL= + LTLIBINTL= + POSUB= + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 +printf %s "checking for GNU gettext in libc... " >&6; } +if test ${gt_cv_func_gnugettext1_libc+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; +int +main (void) +{ +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_gnugettext1_libc=yes +else $as_nop + gt_cv_func_gnugettext1_libc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_gnugettext1_libc" >&5 +printf "%s\n" "$gt_cv_func_gnugettext1_libc" >&6; } + + if test "$gt_cv_func_gnugettext1_libc" != "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 + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + 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 (void) +{ +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.beam \ + 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 (void) +{ +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.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + +printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$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+y} +then : + withval=$with_libintl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi + + LIBINTL= + LTLIBINTL= + INCINTL= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 +printf %s "checking for GNU gettext in libintl... " >&6; } +if test ${gt_cv_func_gnugettext1_libintl+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (); +int +main (void) +{ +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_gnugettext1_libintl=yes +else $as_nop + gt_cv_func_gnugettext1_libintl=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (); +int +main (void) +{ +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + gt_cv_func_gnugettext1_libintl=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_gnugettext1_libintl" >&5 +printf "%s\n" "$gt_cv_func_gnugettext1_libintl" >&6; } + fi + + if test "$gt_cv_func_gnugettext1_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + +printf "%s\n" "#define ENABLE_NLS 1" >>confdefs.h + + else + USE_NLS=no + fi + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +printf %s "checking whether to use NLS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 +printf %s "checking where the gettext function comes from... " >&6; } + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 +printf "%s\n" "$gt_source" >&6; } + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 +printf %s "checking how to link with libintl... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 +printf "%s\n" "$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 + + +printf "%s\n" "#define HAVE_GETTEXT 1" >>confdefs.h + + +printf "%s\n" "#define HAVE_DCGETTEXT 1" >>confdefs.h + + fi + + POSUB=po + fi + + + + INTLLIBS="$LIBINTL" + + + + + + +if test -d "$srcdir/po" +then + ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'` +else + ALL_LINGUAS="af am ar as be bg bn_IN bn ca cs cy da de el en_GB es et eu_ES fa fi fr gl gu he hi hr hu hy id is it ja ka kn ko ku lo lt lv mk ml mr ms my nb nl nn no nso or pa pl pt_BR pt ro ru si sk sl sq sr@Latn sr sv ta te th tr uk ur vi zh_CN zh_TW zu" +fi + +ac_fn_c_check_header_compile "$LINENO" "error.h" "ac_cv_header_error_h" "$ac_includes_default +" +if test "x$ac_cv_header_error_h" = xyes +then : + printf "%s\n" "#define HAVE_ERROR_H 1" >>confdefs.h + +fi + + +ac_fn_c_check_header_compile "$LINENO" "stdio_ext.h" "ac_cv_header_stdio_ext_h" "$ac_includes_default +" +if test "x$ac_cv_header_stdio_ext_h" = xyes +then : + printf "%s\n" "#define HAVE_STDIO_EXT_H 1" >>confdefs.h + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __progname" >&5 +printf %s "checking for __progname... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + extern char *__progname; + int main(void) { + const char *cp = __progname; + printf("%s\n", cp); + exit(0); + } + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +printf "%s\n" "#define HAVE___PROGNAME 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether program_invocation_name is defined" >&5 +printf %s "checking whether program_invocation_name is defined... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +program_invocation_name = "test"; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_PROGRAM_INVOCATION_NAME 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether program_invocation_short_name is defined" >&5 +printf %s "checking whether program_invocation_short_name is defined... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +program_invocation_short_name = "test"; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_PROGRAM_INVOCATION_SHORT_NAME 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +ac_fn_c_check_func "$LINENO" "pidfd_open" "ac_cv_func_pidfd_open" +if test "x$ac_cv_func_pidfd_open" = xyes +then : + enable_pidwait=yes +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __NR_pidfd_open" >&5 +printf %s "checking for __NR_pidfd_open... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifndef __NR_pidfd_open +#error __NR_pidfd_open not defined +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + enable_pidwait=yes +else $as_nop + enable_pidwait=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_pidwait" >&5 +printf "%s\n" "$enable_pidwait" >&6; } + +fi + +if test "$enable_pidwait" = yes; then + +printf "%s\n" "#define ENABLE_PIDWAIT 1" >>confdefs.h + +fi + if test x$enable_pidwait = xyes; then + BUILD_PIDWAIT_TRUE= + BUILD_PIDWAIT_FALSE='#' +else + BUILD_PIDWAIT_TRUE='#' + BUILD_PIDWAIT_FALSE= +fi + + + +# Check whether --enable-watch8bit was given. +if test ${enable_watch8bit+y} +then : + enableval=$enable_watch8bit; +else $as_nop + enable_watch8bit=no + +fi + +if test "$enable_watch8bit" = "yes"; then + +printf "%s\n" "#define WITH_WATCH8BIT 1" >>confdefs.h + +fi + + +# Check whether --enable-colorwatch was given. +if test ${enable_colorwatch+y} +then : + enableval=$enable_colorwatch; +else $as_nop + enable_colorwatch=no + +fi + +if test "$enable_colorwatch" = "yes"; then + +printf "%s\n" "#define WITH_COLORWATCH 1" >>confdefs.h + +fi + + + +# Check whether --enable-libselinux was given. +if test ${enable_libselinux+y} +then : + enableval=$enable_libselinux; +else $as_nop + enable_libselinux=no + +fi + +if test "$enable_libselinux" = "yes"; then + +printf "%s\n" "#define ENABLE_LIBSELINUX 1" >>confdefs.h + +fi + +# Enable hardened compile and link flags +# Check whether --enable-harden_flags was given. +if test ${enable_harden_flags+y} +then : + enableval=$enable_harden_flags; enable_harden_flags=$enableval +else $as_nop + enable_harden_flags="no" +fi + + +# Check that harden CFLAGS and LDFLAGS will compile +if test "$enable_harden_flags" = "yes" +then : + HARDEN_CFLAGS="-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security" + HARDEN_LDFLAGS="-fPIE -pie -Wl,-z,relro -Wl,-z,now" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking compiler supports harden flags" >&5 +printf %s "checking compiler supports harden flags... " >&6; } + save_harden_cflags="$CFLAGS" + CFLAGS="$CFLAGS $HARDEN_CFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; HARDEN_CFLAGS='' + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$save_harden_cflags" +else $as_nop + HARDEN_CFLAGS="" + HARDEN_LDFLAGS="" +fi + + + +# Optional packages - AC_ARG_WITH + +# Check whether --with-ncurses was given. +if test ${with_ncurses+y} +then : + withval=$with_ncurses; +else $as_nop + with_ncurses=yes + +fi + +if test "x$with_ncurses" = xno; then + if false; then + WITH_NCURSES_TRUE= + WITH_NCURSES_FALSE='#' +else + WITH_NCURSES_TRUE='#' + WITH_NCURSES_FALSE= +fi + + if test "x$enable_watch8bit" = "xyes" +then : + as_fn_error $? "Cannot have both --enable-watch8bit and --without-ncurses" "$LINENO" 5 +fi +else + if true; then + WITH_NCURSES_TRUE= + WITH_NCURSES_FALSE='#' +else + WITH_NCURSES_TRUE='#' + WITH_NCURSES_FALSE= +fi + + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ncursesw" >&5 +printf %s "checking for ncursesw... " >&6; } + +if test -n "$NCURSES_CFLAGS"; then + pkg_cv_NCURSES_CFLAGS="$NCURSES_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ncursesw\""; } >&5 + ($PKG_CONFIG --exists --print-errors "ncursesw") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_NCURSES_CFLAGS=`$PKG_CONFIG --cflags "ncursesw" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$NCURSES_LIBS"; then + pkg_cv_NCURSES_LIBS="$NCURSES_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ncursesw\""; } >&5 + ($PKG_CONFIG --exists --print-errors "ncursesw") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_NCURSES_LIBS=`$PKG_CONFIG --libs "ncursesw" 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 + NCURSES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ncursesw" 2>&1` + else + NCURSES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ncursesw" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$NCURSES_PKG_ERRORS" >&5 + + + if test "x$enable_watch8bit" = "xyes" +then : + as_fn_error $? "Cannot find ncurses wide library ncursesw with --enable-watch8bit" "$LINENO" 5 +fi + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ncurses" >&5 +printf %s "checking for ncurses... " >&6; } + +if test -n "$NCURSES_CFLAGS"; then + pkg_cv_NCURSES_CFLAGS="$NCURSES_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ncurses\""; } >&5 + ($PKG_CONFIG --exists --print-errors "ncurses") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_NCURSES_CFLAGS=`$PKG_CONFIG --cflags "ncurses" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$NCURSES_LIBS"; then + pkg_cv_NCURSES_LIBS="$NCURSES_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ncurses\""; } >&5 + ($PKG_CONFIG --exists --print-errors "ncurses") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_NCURSES_LIBS=`$PKG_CONFIG --libs "ncurses" 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 + NCURSES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ncurses" 2>&1` + else + NCURSES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ncurses" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$NCURSES_PKG_ERRORS" >&5 + + as_fn_error $? "ncurses support missing/incomplete (for partial build use --without-ncurses)" "$LINENO" 5 + +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "ncurses support missing/incomplete (for partial build use --without-ncurses)" "$LINENO" 5 + +else + NCURSES_CFLAGS=$pkg_cv_NCURSES_CFLAGS + NCURSES_LIBS=$pkg_cv_NCURSES_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_NCURSES 1" >>confdefs.h + +fi + + +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + + if test "x$enable_watch8bit" = "xyes" +then : + as_fn_error $? "Cannot find ncurses wide library ncursesw with --enable-watch8bit" "$LINENO" 5 +fi + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ncurses" >&5 +printf %s "checking for ncurses... " >&6; } + +if test -n "$NCURSES_CFLAGS"; then + pkg_cv_NCURSES_CFLAGS="$NCURSES_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ncurses\""; } >&5 + ($PKG_CONFIG --exists --print-errors "ncurses") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_NCURSES_CFLAGS=`$PKG_CONFIG --cflags "ncurses" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$NCURSES_LIBS"; then + pkg_cv_NCURSES_LIBS="$NCURSES_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ncurses\""; } >&5 + ($PKG_CONFIG --exists --print-errors "ncurses") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_NCURSES_LIBS=`$PKG_CONFIG --libs "ncurses" 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 + NCURSES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ncurses" 2>&1` + else + NCURSES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ncurses" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$NCURSES_PKG_ERRORS" >&5 + + as_fn_error $? "ncurses support missing/incomplete (for partial build use --without-ncurses)" "$LINENO" 5 + +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "ncurses support missing/incomplete (for partial build use --without-ncurses)" "$LINENO" 5 + +else + NCURSES_CFLAGS=$pkg_cv_NCURSES_CFLAGS + NCURSES_LIBS=$pkg_cv_NCURSES_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_NCURSES 1" >>confdefs.h + +fi + + +else + NCURSES_CFLAGS=$pkg_cv_NCURSES_CFLAGS + NCURSES_LIBS=$pkg_cv_NCURSES_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_NCURSES 1" >>confdefs.h + +fi +fi +# PKG_CHECK_MODULES([NCURSES], [ncurses], [], [ +# AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no]) +# AC_CHECK_HEADERS(curses.h ncurses.h term.h, [], [have_ncurses=no], AC_INCLUDES_DEFAULT) +# if test "x$have_ncurses" = xno; then +# AC_MSG_ERROR([ncurses support missing/incomplete (for partial build use --without-ncurses)]) +# fi +# NCURSES_LIBS="-lncurses" +# ]) +# AM_CONDITIONAL(WITH_NCURSES, true) +# if test "$enable_watch8bit" = yes; then +# PKG_CHECK_MODULES([NCURSESW], [ncursesw], [WATCH_NCURSES_LIBS="$NCURSESW_LIBS"], [ +# AC_CHECK_LIB([ncursesw], [addwstr], [WATCH_NCURSES_LIBS=-lncursesw], [ +# AC_CHECK_LIB([ncurses], [addwstr], [WATCH_NCURSES_LIBS=-lncurses], [ +# AC_MSG_ERROR([Cannot find ncurses wide library ncursesw with --enable-watch8bit]) +# ]) +# ]) +# ]) +# else +# WATCH_NCURSES_LIBS="$NCURSES_LIBS" +# fi + + +# Check whether --with-systemd was given. +if test ${with_systemd+y} +then : + withval=$with_systemd; +else $as_nop + with_systemd=no + +fi + +if test "x$with_systemd" != "xno" +then : + + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsystemd" >&5 +printf %s "checking for libsystemd... " >&6; } + +if test -n "$SYSTEMD_CFLAGS"; then + pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SYSTEMD_LIBS"; then + pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd" 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 + SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd" 2>&1` + else + SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SYSTEMD_PKG_ERRORS" >&5 + + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsystemd-login" >&5 +printf %s "checking for libsystemd-login... " >&6; } + +if test -n "$SYSTEMD_CFLAGS"; then + pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd-login") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SYSTEMD_LIBS"; then + pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd-login") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd-login" 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 + SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login" 2>&1` + else + SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SYSTEMD_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (libsystemd-login) were not met: + +$SYSTEMD_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 SYSTEMD_CFLAGS +and SYSTEMD_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 SYSTEMD_CFLAGS +and SYSTEMD_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 + SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS + SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +fi + +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsystemd-login" >&5 +printf %s "checking for libsystemd-login... " >&6; } + +if test -n "$SYSTEMD_CFLAGS"; then + pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd-login") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SYSTEMD_LIBS"; then + pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd-login") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd-login" 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 + SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login" 2>&1` + else + SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SYSTEMD_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (libsystemd-login) were not met: + +$SYSTEMD_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 SYSTEMD_CFLAGS +and SYSTEMD_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 SYSTEMD_CFLAGS +and SYSTEMD_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 + SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS + SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +fi + +else + SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS + SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +fi + +printf "%s\n" "#define WITH_SYSTEMD 1" >>confdefs.h + + + # The functions needed to replace utmp with logind are only available + # with systemd v254 or later. + old_LIBS="$LIBS" + LIBS="$LIBS $SYSTEMD_LIBS" + ac_fn_c_check_func "$LINENO" "sd_session_get_leader" "ac_cv_func_sd_session_get_leader" +if test "x$ac_cv_func_sd_session_get_leader" = xyes +then : + printf "%s\n" "#define HAVE_SD_SESSION_GET_LEADER 1" >>confdefs.h + +fi + + LIBS="$old_LIBS" + +fi + if test x$with_systemd != xno; then + WITH_SYSTEMD_TRUE= + WITH_SYSTEMD_FALSE='#' +else + WITH_SYSTEMD_TRUE='#' + WITH_SYSTEMD_FALSE= +fi + + + +# Check whether --with-elogind was given. +if test ${with_elogind+y} +then : + withval=$with_elogind; +else $as_nop + with_elogind=no + +fi + +# Do not allow elogind if systemd is wanted and found +if test "x$with_systemd" != "xno" +then : + with_elogind=no +fi + +if test "x$with_elogind" != "xno" +then : + + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libelogind" >&5 +printf %s "checking for libelogind... " >&6; } + +if test -n "$ELOGIND_CFLAGS"; then + pkg_cv_ELOGIND_CFLAGS="$ELOGIND_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelogind\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libelogind") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ELOGIND_CFLAGS=`$PKG_CONFIG --cflags "libelogind" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$ELOGIND_LIBS"; then + pkg_cv_ELOGIND_LIBS="$ELOGIND_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelogind\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libelogind") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ELOGIND_LIBS=`$PKG_CONFIG --libs "libelogind" 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 + ELOGIND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libelogind" 2>&1` + else + ELOGIND_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libelogind" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$ELOGIND_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (libelogind) were not met: + +$ELOGIND_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 ELOGIND_CFLAGS +and ELOGIND_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 ELOGIND_CFLAGS +and ELOGIND_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 + ELOGIND_CFLAGS=$pkg_cv_ELOGIND_CFLAGS + ELOGIND_LIBS=$pkg_cv_ELOGIND_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +fi + +printf "%s\n" "#define WITH_ELOGIND 1" >>confdefs.h + + +fi + if test x$with_elogind != xno; then + WITH_ELOGIND_TRUE= + WITH_ELOGIND_FALSE='#' +else + WITH_ELOGIND_TRUE='#' + WITH_ELOGIND_FALSE= +fi + + +# AC_ARG_ENABLEs +# Check whether --enable-pidof was given. +if test ${enable_pidof+y} +then : + enableval=$enable_pidof; +else $as_nop + enable_pidof=yes + +fi + + if test "x$enable_pidof" = xyes; then + BUILD_PIDOF_TRUE= + BUILD_PIDOF_FALSE='#' +else + BUILD_PIDOF_TRUE='#' + BUILD_PIDOF_FALSE= +fi + + +# Check whether --enable-kill was given. +if test ${enable_kill+y} +then : + enableval=$enable_kill; +else $as_nop + enable_kill=yes + +fi + + if test "x$enable_kill" = xyes; then + BUILD_KILL_TRUE= + BUILD_KILL_FALSE='#' +else + BUILD_KILL_TRUE='#' + BUILD_KILL_FALSE= +fi + +# Check whether --enable-w was given. +if test ${enable_w+y} +then : + enableval=$enable_w; +else $as_nop + enable_w=yes + +fi + + if test "x$enable_w" = xyes; then + BUILD_W_TRUE= + BUILD_W_FALSE='#' +else + BUILD_W_TRUE='#' + BUILD_W_FALSE= +fi + + + if test "x$host_os" = xlinux-gnu; then + LINUX_TRUE= + LINUX_FALSE='#' +else + LINUX_TRUE='#' + LINUX_FALSE= +fi + + if test "x$host_os" = xcygwin; then + CYGWIN_TRUE= + CYGWIN_FALSE='#' +else + CYGWIN_TRUE='#' + CYGWIN_FALSE= +fi + + +# Check whether --enable-skill was given. +if test ${enable_skill+y} +then : + enableval=$enable_skill; +else $as_nop + enable_skill=no + +fi + + if test "x$enable_skill" = xyes; then + BUILD_SKILL_TRUE= + BUILD_SKILL_FALSE='#' +else + BUILD_SKILL_TRUE='#' + BUILD_SKILL_FALSE= +fi + + +# Check whether --enable-examples was given. +if test ${enable_examples+y} +then : + enableval=$enable_examples; +else $as_nop + enable_examples=no + +fi + + if test "x$enable_examples" = xyes; then + EXAMPLE_FILES_TRUE= + EXAMPLE_FILES_FALSE='#' +else + EXAMPLE_FILES_TRUE='#' + EXAMPLE_FILES_FALSE= +fi + + +# Check whether --enable-sigwinch was given. +if test ${enable_sigwinch+y} +then : + enableval=$enable_sigwinch; +else $as_nop + enable_sigwinch=no + +fi + +if test "x$enable_sigwinch" = xyes; then + +printf "%s\n" "#define SIGNALS_LESS 1" >>confdefs.h + +fi + +# Check whether --enable-wide-percent was given. +if test ${enable_wide_percent+y} +then : + enableval=$enable_wide_percent; +else $as_nop + enable_wide_percent=no + +fi + +if test "x$enable_wide_percent" = xyes; then + +printf "%s\n" "#define BOOST_PERCNT 1" >>confdefs.h + +fi + +# Check whether --enable-wide-memory was given. +if test ${enable_wide_memory+y} +then : + enableval=$enable_wide_memory; +else $as_nop + enable_wide_memory=no + +fi + +if test "x$enable_wide_memory" = xyes; then + +printf "%s\n" "#define BOOST_MEMORY 1" >>confdefs.h + +fi + +# Check whether --enable-modern-top was given. +if test ${enable_modern_top+y} +then : + enableval=$enable_modern_top; +else $as_nop + enable_modern_top=yes + +fi + +if test "x$enable_modern_top" = xno; then + +printf "%s\n" "#define ORIG_TOPDEFS 1" >>confdefs.h + +fi + +DL_LIB= +# Check whether --enable-numa was given. +if test ${enable_numa+y} +then : + enableval=$enable_numa; +else $as_nop + enable_numa=yes + +fi + +if test "x$enable_numa" = xno; then + +printf "%s\n" "#define NUMA_DISABLE 1" >>confdefs.h + +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 +printf %s "checking for library containing dlopen... " >&6; } +if test ${ac_cv_search_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dl +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_dlopen=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_dlopen+y} +then : + break +fi +done +if test ${ac_cv_search_dlopen+y} +then : + +else $as_nop + ac_cv_search_dlopen=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 +printf "%s\n" "$ac_cv_search_dlopen" >&6; } +ac_res=$ac_cv_search_dlopen +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else $as_nop + as_fn_error $? "dynamic linking unavailable, circumvent with --disable-numa" "$LINENO" 5 +fi + + if test "x$ac_cv_search_dlopen" != "xnone required"; then + DL_LIB="$ac_cv_search_dlopen" + fi +fi + + +# Check whether --enable-w-from was given. +if test ${enable_w_from+y} +then : + enableval=$enable_w_from; +else $as_nop + enable_w_from=no + +fi + +if test "x$enable_w_from" = xyes; then + +printf "%s\n" "#define W_SHOWFROM 1" >>confdefs.h + +fi + +# Check whether --enable-whining was given. +if test ${enable_whining+y} +then : + enableval=$enable_whining; +else $as_nop + enable_whining=yes + +fi + +if test "x$enable_whining" = xyes; then + +printf "%s\n" "#define BUILD_WITH_WHINE 1" >>confdefs.h + +fi + +if test x"$DEJAGNU" = x +then + DEJAGNU="/dev/null" +fi + + +ac_fn_c_check_func "$LINENO" "__fpending" "ac_cv_func___fpending" +if test "x$ac_cv_func___fpending" = xyes +then : + printf "%s\n" "#define HAVE___FPENDING 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "alarm" "ac_cv_func_alarm" +if test "x$ac_cv_func_alarm" = xyes +then : + printf "%s\n" "#define HAVE_ALARM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "atexit" "ac_cv_func_atexit" +if test "x$ac_cv_func_atexit" = xyes +then : + printf "%s\n" "#define HAVE_ATEXIT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2" +if test "x$ac_cv_func_dup2" = xyes +then : + printf "%s\n" "#define HAVE_DUP2 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname" +if test "x$ac_cv_func_gethostname" = xyes +then : + printf "%s\n" "#define HAVE_GETHOSTNAME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = xyes +then : + printf "%s\n" "#define HAVE_GETPAGESIZE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" +if test "x$ac_cv_func_gettimeofday" = xyes +then : + printf "%s\n" "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "iswprint" "ac_cv_func_iswprint" +if test "x$ac_cv_func_iswprint" = xyes +then : + printf "%s\n" "#define HAVE_ISWPRINT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "memchr" "ac_cv_func_memchr" +if test "x$ac_cv_func_memchr" = xyes +then : + printf "%s\n" "#define HAVE_MEMCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" +if test "x$ac_cv_func_memmove" = xyes +then : + printf "%s\n" "#define HAVE_MEMMOVE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = xyes +then : + printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mkdir" "ac_cv_func_mkdir" +if test "x$ac_cv_func_mkdir" = xyes +then : + printf "%s\n" "#define HAVE_MKDIR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" +if test "x$ac_cv_func_nl_langinfo" = xyes +then : + printf "%s\n" "#define HAVE_NL_LANGINFO 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "putenv" "ac_cv_func_putenv" +if test "x$ac_cv_func_putenv" = xyes +then : + printf "%s\n" "#define HAVE_PUTENV 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "regcomp" "ac_cv_func_regcomp" +if test "x$ac_cv_func_regcomp" = xyes +then : + printf "%s\n" "#define HAVE_REGCOMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "rpmatch" "ac_cv_func_rpmatch" +if test "x$ac_cv_func_rpmatch" = xyes +then : + printf "%s\n" "#define HAVE_RPMATCH 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select" +if test "x$ac_cv_func_select" = xyes +then : + printf "%s\n" "#define HAVE_SELECT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale" +if test "x$ac_cv_func_setlocale" = xyes +then : + printf "%s\n" "#define HAVE_SETLOCALE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigabbrev_np" "ac_cv_func_sigabbrev_np" +if test "x$ac_cv_func_sigabbrev_np" = xyes +then : + printf "%s\n" "#define HAVE_SIGABBREV_NP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes +then : + printf "%s\n" "#define HAVE_STRCASECMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strchr" "ac_cv_func_strchr" +if test "x$ac_cv_func_strchr" = xyes +then : + printf "%s\n" "#define HAVE_STRCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strcspn" "ac_cv_func_strcspn" +if test "x$ac_cv_func_strcspn" = xyes +then : + printf "%s\n" "#define HAVE_STRCSPN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" +if test "x$ac_cv_func_strdup" = xyes +then : + printf "%s\n" "#define HAVE_STRDUP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" +if test "x$ac_cv_func_strerror" = xyes +then : + printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" +if test "x$ac_cv_func_strncasecmp" = xyes +then : + printf "%s\n" "#define HAVE_STRNCASECMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup" +if test "x$ac_cv_func_strndup" = xyes +then : + printf "%s\n" "#define HAVE_STRNDUP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strpbrk" "ac_cv_func_strpbrk" +if test "x$ac_cv_func_strpbrk" = xyes +then : + printf "%s\n" "#define HAVE_STRPBRK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strrchr" "ac_cv_func_strrchr" +if test "x$ac_cv_func_strrchr" = xyes +then : + printf "%s\n" "#define HAVE_STRRCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strspn" "ac_cv_func_strspn" +if test "x$ac_cv_func_strspn" = xyes +then : + printf "%s\n" "#define HAVE_STRSPN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strstr" "ac_cv_func_strstr" +if test "x$ac_cv_func_strstr" = xyes +then : + printf "%s\n" "#define HAVE_STRSTR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" +if test "x$ac_cv_func_strtol" = xyes +then : + printf "%s\n" "#define HAVE_STRTOL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul" +if test "x$ac_cv_func_strtoul" = xyes +then : + printf "%s\n" "#define HAVE_STRTOUL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strverscmp" "ac_cv_func_strverscmp" +if test "x$ac_cv_func_strverscmp" = xyes +then : + printf "%s\n" "#define HAVE_STRVERSCMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "utmpname" "ac_cv_func_utmpname" +if test "x$ac_cv_func_utmpname" = xyes +then : + printf "%s\n" "#define HAVE_UTMPNAME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcwidth" "ac_cv_func_wcwidth" +if test "x$ac_cv_func_wcwidth" = xyes +then : + printf "%s\n" "#define HAVE_WCWIDTH 1" >>confdefs.h + +fi + + +ac_config_files="$ac_config_files Makefile local/Makefile po-man/Makefile po/Makefile.in library/libproc2.pc testsuite/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, 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_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$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+y} || &/ + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$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=`printf "%s\n" "$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 + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +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 "${BUILD_PIDWAIT_TRUE}" && test -z "${BUILD_PIDWAIT_FALSE}"; then + as_fn_error $? "conditional \"BUILD_PIDWAIT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_NCURSES_TRUE}" && test -z "${WITH_NCURSES_FALSE}"; then + as_fn_error $? "conditional \"WITH_NCURSES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_NCURSES_TRUE}" && test -z "${WITH_NCURSES_FALSE}"; then + as_fn_error $? "conditional \"WITH_NCURSES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_SYSTEMD_TRUE}" && test -z "${WITH_SYSTEMD_FALSE}"; then + as_fn_error $? "conditional \"WITH_SYSTEMD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_ELOGIND_TRUE}" && test -z "${WITH_ELOGIND_FALSE}"; then + as_fn_error $? "conditional \"WITH_ELOGIND\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_PIDOF_TRUE}" && test -z "${BUILD_PIDOF_FALSE}"; then + as_fn_error $? "conditional \"BUILD_PIDOF\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_KILL_TRUE}" && test -z "${BUILD_KILL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_KILL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_W_TRUE}" && test -z "${BUILD_W_FALSE}"; then + as_fn_error $? "conditional \"BUILD_W\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LINUX_TRUE}" && test -z "${LINUX_FALSE}"; then + as_fn_error $? "conditional \"LINUX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CYGWIN_TRUE}" && test -z "${CYGWIN_FALSE}"; then + as_fn_error $? "conditional \"CYGWIN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_SKILL_TRUE}" && test -z "${BUILD_SKILL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_SKILL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${EXAMPLE_FILES_TRUE}" && test -z "${EXAMPLE_FILES_FALSE}"; then + as_fn_error $? "conditional \"EXAMPLE_FILES\" 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" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$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 +as_nop=: +if test ${ZSH_VERSION+y} && (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 $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; 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 + + +# 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + + +# 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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$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_nop + 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_nop + 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 || +printf "%s\n" 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 + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +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 + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + +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=`printf "%s\n" "$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 || +printf "%s\n" 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 procps-ng $as_me 4.0.4, which was +generated by GNU Autoconf 2.71. 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 . +procps-ng home page: ." + +_ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config='$ac_cs_config_escaped' +ac_cs_version="\\ +procps-ng config.status 4.0.4 +configured by $0, generated by GNU Autoconf 2.71, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2021 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 ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$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=`printf "%s\n" "$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 ) + printf "%s\n" "$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 + \printf "%s\n" "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 + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + + +# 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"`' +FILECMD='`$ECHO "$FILECMD" | $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"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $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 \ +FILECMD \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +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. + 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" ;; + "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "local/Makefile") CONFIG_FILES="$CONFIG_FILES local/Makefile" ;; + "po-man/Makefile") CONFIG_FILES="$CONFIG_FILES po-man/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "library/libproc2.pc") CONFIG_FILES="$CONFIG_FILES library/libproc2.pc" ;; + "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; + + *) 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+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || 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=`printf "%s\n" "$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 '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf "%s\n" "$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 || +printf "%s\n" 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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$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@*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$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"; } && + { printf "%s\n" "$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 +printf "%s\n" "$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 + { + printf "%s\n" "/* $configure_input */" >&1 \ + && 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$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 + printf "%s\n" "/* $configure_input */" >&1 \ + && 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 || +printf "%s\n" 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) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$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. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + "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 +# 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 + +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + +# 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 (by configure). +lt_ar_flags=$lt_ar_flags + +# Flags to create an archive. +AR_FLAGS=\${ARFLAGS-"\$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" + + ;; + "default-1":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 + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; + + esac +done # 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..fec27e3 --- /dev/null +++ b/configure.ac @@ -0,0 +1,428 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_CONFIG_MACRO_DIR([m4]) +AC_INIT([procps-ng], + m4_esyscmd([local/git-version-gen .tarball-version]), + [procps@freelists.org],,[https://gitlab.com/procps-ng/procps]) +AM_INIT_AUTOMAKE([foreign 1.11 subdir-objects -Wall -Wno-portability tar-pax no-dist-gzip dist-xz]) +AM_SILENT_RULES([yes]) +AC_CONFIG_SRCDIR([src/free.c]) +AC_CONFIG_HEADERS([config.h]) +AC_LANG([C]) + +# Checks for programs. +AC_USE_SYSTEM_EXTENSIONS +AC_SYS_LARGEFILE +AC_PROG_AWK +AC_PROG_CC +AC_PROG_CC_STDC +if test "$cross_compiling" = no; then + if test "x$ac_cv_prog_cc_c99" = "xno" || test "x$ac_cv_prog_cc_c99" = "x"; then + # We might be on RHEL5 with a git checkout and so broken + # autoconf. Check if CC is gcc and if it bails when given -std=gnu99. + # If not, use that. Yuck. + if test "x$ac_cv_c_compiler_gnu" = "xyes"; then + CC="$CC -std=gnu99" + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([],[[ + return 0; + ]])], + [], + [AC_MSG_ERROR([Could not find a C99 compatible compiler])]) + else + AC_MSG_ERROR([Could not find a C99 compatible compiler]) + fi + fi +fi +AM_PROG_CC_C_O +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LN_S + +dnl Check pkg-config is there for autoconf and at ./configure +m4_ifndef([PKG_PREREQ], + [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +PKG_PROG_PKG_CONFIG +AS_IF([test -z "$PKG_CONFIG"],[ + AC_MSG_ERROR([Could not find pkg-config])]) + +AC_PROG_MAKE_SET + +AC_DEFUN([PROCPS_PROG_PO4A], [ + AC_REQUIRE([AM_NLS]) + AC_CHECK_PROGS([PO4A], [po4a]) + AS_IF([test "$USE_NLS" = "yes" && test -n "$PO4A"], [ + USE_PO4A=yes + ], [ + USE_PO4A=no + ]) + AC_SUBST([USE_PO4A]) +]) +PROCPS_PROG_PO4A + +# Checks for header files. +AC_HEADER_MAJOR +AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h langinfo.h libintl.h limits.h locale.h stdint.h stdio_ext.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/time.h termios.h unistd.h utmp.h utmpx.h values.h wchar.h wctype.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_CHECK_HEADER_STDBOOL +AC_TYPE_UID_T +AC_C_INLINE +AC_TYPE_INT32_T +AC_TYPE_PID_T +AC_C_RESTRICT +AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T +AC_CHECK_MEMBERS([struct stat.st_rdev]) +AC_CHECK_MEMBERS([siginfo_t.si_int], [], [], [[#include ]]) + +dnl Needed for musl +if test "x$ac_cv_header_utmpx_h" = xyes +then : +AC_CHECK_DECLS([__UT_HOSTSIZE], + [AC_DEFINE([HAVE_UT_HOSTSIZE_IN_UTMPX], [1], + [Define if __UT_HOSTSIZE in utmpx.h])], + [], + [[#include ]]) +fi + +dnl libtool +LT_INIT + +# Checks for library functions. +AC_FUNC_ERROR_AT_LINE +AC_FUNC_FORK +AC_FUNC_MALLOC +AC_FUNC_MBRTOWC +AC_FUNC_MMAP +AC_FUNC_REALLOC +AC_FUNC_STRCOLL +AC_FUNC_STRTOD + +usrbin_execdir='${exec_prefix}/bin' +AC_SUBST([usrbin_execdir]) + +if test "x$host_os" = xcygwin +then + prefix=/usr + sysconfdir='${prefix}/etc' + libexecdir='${prefix}/lib' + localstatedir='${prefix}/var' + datadir='${prefix}/share' + mandir='${prefix}/share/man' + infodir='${prefix}/share/info' + AC_SUBST([prefix]) + AC_SUBST([sysconfdir]) + AC_SUBST([libexecdir]) + AC_SUBST([localstatedir]) + AC_SUBST([datadir]) + AC_SUBST([mandir]) + AC_SUBST([infodir]) + AC_DEFINE([USE_PROC_CTTY], [1], [Use /proc/$PID/ctty to determine controlling TTY]) +else + AC_DEFINE([USE_PROC_CTTY], [0], [Use /proc/$PID/ctty to determine controlling TTY]) +fi + +AM_GNU_GETTEXT_VERSION([0.14.1]) +AM_GNU_GETTEXT([external]) +if test -d "$srcdir/po" +then + ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'` +else + ALL_LINGUAS="af am ar as be bg bn_IN bn ca cs cy da de el en_GB es et eu_ES fa fi fr gl gu he hi hr hu hy id is it ja ka kn ko ku lo lt lv mk ml mr ms my nb nl nn no nso or pa pl pt_BR pt ro ru si sk sl sq sr@Latn sr sv ta te th tr uk ur vi zh_CN zh_TW zu" +fi + +AC_CHECK_HEADERS(error.h, [], [], AC_INCLUDES_DEFAULT) + +AC_CHECK_HEADERS(stdio_ext.h, [], [], AC_INCLUDES_DEFAULT) + +AC_MSG_CHECKING(for __progname) +AC_LINK_IFELSE([AC_LANG_SOURCE( + [ + #include + #include + extern char *__progname; + int main(void) { + const char *cp = __progname; + printf("%s\n", cp); + exit(0); + } + ])], + AC_DEFINE(HAVE___PROGNAME, 1, [Define if __progname exists]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) + +AC_MSG_CHECKING(whether program_invocation_name is defined) +AC_TRY_COMPILE([#include ], + [program_invocation_name = "test";], + AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME, 1, + [Define if program_invocation_name is defined]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) + +AC_MSG_CHECKING(whether program_invocation_short_name is defined) +AC_TRY_COMPILE([#include ], + [program_invocation_short_name = "test";], + AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME, 1, + [Define if program_invocation_short_name is defined]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) + +AC_CHECK_FUNC([pidfd_open], [enable_pidwait=yes], [ + AC_MSG_CHECKING([for __NR_pidfd_open]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([ +#include +#ifndef __NR_pidfd_open +#error __NR_pidfd_open not defined +#endif + ])], [enable_pidwait=yes], [enable_pidwait=no]) + AC_MSG_RESULT([$enable_pidwait]) +]) +if test "$enable_pidwait" = yes; then + AC_DEFINE([ENABLE_PIDWAIT], [1], [Enable pidwait]) +fi +AM_CONDITIONAL([BUILD_PIDWAIT], [test x$enable_pidwait = xyes]) + +dnl watch8bit must be before the AC_ARG_WITH set as it sets up ncurses +AC_SUBST([WITH_WATCH8BIT]) +AC_ARG_ENABLE([watch8bit], + AS_HELP_STRING([--enable-watch8bit], [enable watch to be 8bit clean (requires ncursesw)]), + [], [enable_watch8bit=no] +) +if test "$enable_watch8bit" = "yes"; then + AC_DEFINE([WITH_WATCH8BIT], [1], [Enable 8 bit clean watch]) +fi + +AC_SUBST([WITH_COLORWATCH]) +AC_ARG_ENABLE([colorwatch], + AS_HELP_STRING([--enable-colorwatch], [enable watch to use color by default]), + [], [enable_colorwatch=no] +) +if test "$enable_colorwatch" = "yes"; then + AC_DEFINE([WITH_COLORWATCH], [1], [Enable color watch by default]) +fi + + + +AC_ARG_ENABLE([libselinux], + AS_HELP_STRING([--enable-libselinux], [enable libselinux]), + [], [enable_libselinux=no] +) +if test "$enable_libselinux" = "yes"; then + AC_DEFINE([ENABLE_LIBSELINUX], [1], [Enable libselinux]) +fi + +# Enable hardened compile and link flags +AC_ARG_ENABLE([harden_flags], + [AS_HELP_STRING([--enable-harden-flags], [enable hardened compilier and linker flags])], + [enable_harden_flags=$enableval], + [enable_harden_flags="no"]) + +# Check that harden CFLAGS and LDFLAGS will compile +AS_IF([test "$enable_harden_flags" = "yes"], + HARDEN_CFLAGS="-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security" + [HARDEN_LDFLAGS="-fPIE -pie -Wl,-z,relro -Wl,-z,now"] + [ AC_MSG_CHECKING([compiler supports harden flags]) + save_harden_cflags="$CFLAGS" + CFLAGS="$CFLAGS $HARDEN_CFLAGS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,,)], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]); HARDEN_CFLAGS=''] + ) + CFLAGS="$save_harden_cflags"], + [HARDEN_CFLAGS="" + HARDEN_LDFLAGS=""]) +AC_SUBST([HARDEN_CFLAGS]) +AC_SUBST([HARDEN_LDFLAGS]) + +# Optional packages - AC_ARG_WITH +AC_ARG_WITH([ncurses], + AS_HELP_STRING([--without-ncurses], [build only applications not needing ncurses]), + [], + [with_ncurses=yes] +) +if test "x$with_ncurses" = xno; then + AM_CONDITIONAL(WITH_NCURSES, false) + AS_IF([test "x$enable_watch8bit" = "xyes"], + [AC_MSG_ERROR([Cannot have both --enable-watch8bit and --without-ncurses])]) +else + AM_CONDITIONAL(WITH_NCURSES, true) + PKG_CHECK_MODULES([NCURSES], [ncursesw], + [AC_DEFINE([HAVE_NCURSES], [1], [Use NCURSESW])], + [ + AS_IF([test "x$enable_watch8bit" = "xyes"], + [AC_MSG_ERROR([Cannot find ncurses wide library ncursesw with --enable-watch8bit])]) + PKG_CHECK_MODULES([NCURSES], [ncurses], + [AC_DEFINE([HAVE_NCURSES], [1], [Use NCURSES])], + [AC_MSG_ERROR([ncurses support missing/incomplete (for partial build use --without-ncurses)])] + ) + ] + ) +fi +# PKG_CHECK_MODULES([NCURSES], [ncurses], [], [ +# AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no]) +# AC_CHECK_HEADERS(curses.h ncurses.h term.h, [], [have_ncurses=no], AC_INCLUDES_DEFAULT) +# if test "x$have_ncurses" = xno; then +# AC_MSG_ERROR([ncurses support missing/incomplete (for partial build use --without-ncurses)]) +# fi +# NCURSES_LIBS="-lncurses" +# ]) +# AM_CONDITIONAL(WITH_NCURSES, true) +# if test "$enable_watch8bit" = yes; then +# PKG_CHECK_MODULES([NCURSESW], [ncursesw], [WATCH_NCURSES_LIBS="$NCURSESW_LIBS"], [ +# AC_CHECK_LIB([ncursesw], [addwstr], [WATCH_NCURSES_LIBS=-lncursesw], [ +# AC_CHECK_LIB([ncurses], [addwstr], [WATCH_NCURSES_LIBS=-lncurses], [ +# AC_MSG_ERROR([Cannot find ncurses wide library ncursesw with --enable-watch8bit]) +# ]) +# ]) +# ]) +# else +# WATCH_NCURSES_LIBS="$NCURSES_LIBS" +# fi + +AC_ARG_WITH([systemd], + [AS_HELP_STRING([--with-systemd], [enable systemd support])], + [], [with_systemd=no] +) +AS_IF([test "x$with_systemd" != "xno"], [ + PKG_CHECK_MODULES([SYSTEMD], [libsystemd],, + [PKG_CHECK_MODULES([SYSTEMD], [libsystemd-login])] + ) + AC_DEFINE(WITH_SYSTEMD, 1, [enable systemd support]) + + # The functions needed to replace utmp with logind are only available + # with systemd v254 or later. + old_LIBS="$LIBS" + LIBS="$LIBS $SYSTEMD_LIBS" + AC_CHECK_FUNCS([sd_session_get_leader]) + LIBS="$old_LIBS" +]) +AM_CONDITIONAL([WITH_SYSTEMD], [test x$with_systemd != xno]) + +AC_ARG_WITH([elogind], + [AS_HELP_STRING([--with-elogind], [enable elogind support])], + [], [with_elogind=no] +) +# Do not allow elogind if systemd is wanted and found +AS_IF([test "x$with_systemd" != "xno"], [with_elogind=no]) + +AS_IF([test "x$with_elogind" != "xno"], [ + PKG_CHECK_MODULES([ELOGIND], [libelogind]) + AC_DEFINE(WITH_ELOGIND, 1, [enable elogind support]) +]) +AM_CONDITIONAL([WITH_ELOGIND], [test x$with_elogind != xno]) + +# AC_ARG_ENABLEs +AC_ARG_ENABLE([pidof], + AS_HELP_STRING([--disable-pidof], [do not build pidof]), + [], [enable_pidof=yes] +) +AM_CONDITIONAL(BUILD_PIDOF, test "x$enable_pidof" = xyes) + +AC_ARG_ENABLE([kill], + AS_HELP_STRING([--disable-kill], [do not build kill]), + [], [enable_kill=yes] +) +AM_CONDITIONAL(BUILD_KILL, test "x$enable_kill" = xyes) +AC_ARG_ENABLE([w], + AS_HELP_STRING([--disable-w], [do not build w]), + [], [enable_w=yes] +) +AM_CONDITIONAL(BUILD_W, test "x$enable_w" = xyes) + +AM_CONDITIONAL(LINUX, test "x$host_os" = xlinux-gnu) +AM_CONDITIONAL(CYGWIN, test "x$host_os" = xcygwin) + +AC_ARG_ENABLE([skill], + AS_HELP_STRING([--enable-skill], [build skill and snice]), + [], [enable_skill=no] +) +AM_CONDITIONAL(BUILD_SKILL, test "x$enable_skill" = xyes) + +AC_ARG_ENABLE([examples], + AS_HELP_STRING([--enable-examples], [add example files to installation]), + [], [enable_examples=no] +) +AM_CONDITIONAL(EXAMPLE_FILES, test "x$enable_examples" = xyes) + +AC_ARG_ENABLE([sigwinch], + AS_HELP_STRING([--enable-sigwinch], [reduce impact of x-windows resize operations on top]), + [], [enable_sigwinch=no] +) +if test "x$enable_sigwinch" = xyes; then + AC_DEFINE(SIGNALS_LESS, 1, [reduce impact of x-windows resize operations on top]) +fi + +AC_ARG_ENABLE([wide-percent], + AS_HELP_STRING([--enable-wide-percent], [provide extra precision under %CPU and %MEM for top]), + [], [enable_wide_percent=no] +) +if test "x$enable_wide_percent" = xyes; then + AC_DEFINE(BOOST_PERCNT, 1, [provide extra precision under %CPU and %MEM for top]) +fi + +AC_ARG_ENABLE([wide-memory], + AS_HELP_STRING([--enable-wide-memory], [provide extra precision under memory fields for top]), + [], [enable_wide_memory=no] +) +if test "x$enable_wide_memory" = xyes; then + AC_DEFINE(BOOST_MEMORY, 1, [provide extra precision under memory fields for top]) +fi + +AC_ARG_ENABLE([modern-top], + AS_HELP_STRING([--disable-modern-top], [disable new startup defaults, return to original top]), + [], [enable_modern_top=yes] +) +if test "x$enable_modern_top" = xno; then + AC_DEFINE(ORIG_TOPDEFS, 1, [disable new startup defaults, return to original top]) +fi + +DL_LIB= +AC_ARG_ENABLE([numa], + AS_HELP_STRING([--disable-numa], [disable NUMA/Node support in top]), + [], [enable_numa=yes] +) +if test "x$enable_numa" = xno; then + AC_DEFINE([NUMA_DISABLE], [1], [disable NUMA/Node support in top]) +else + AC_SEARCH_LIBS([dlopen], [dl], [], + [AC_MSG_ERROR([dynamic linking unavailable, circumvent with --disable-numa])]) + if test "x$ac_cv_search_dlopen" != "xnone required"; then + DL_LIB="$ac_cv_search_dlopen" + fi +fi +AC_SUBST([DL_LIB]) + +AC_ARG_ENABLE([w-from], + AS_HELP_STRING([--enable-w-from], [enable w from field by default]), + [], [enable_w_from=no] +) +if test "x$enable_w_from" = xyes; then + AC_DEFINE(W_SHOWFROM, 1, [enable w from field by default]) +fi + +AC_ARG_ENABLE([whining], + AS_HELP_STRING([--disable-whining], [do not print unnecessary warnings (slackware-ism)]), + [], [enable_whining=yes] +) +if test "x$enable_whining" = xyes; then + AC_DEFINE(BUILD_WITH_WHINE, 1, [should extra warnings be printed (slackware-ism)]) +fi + +if test x"$DEJAGNU" = x +then + DEJAGNU="/dev/null" +fi +AC_SUBST(DEJAGNU) + +AC_CHECK_FUNCS([__fpending alarm atexit dup2 gethostname getpagesize gettimeofday iswprint memchr memmove memset mkdir nl_langinfo putenv regcomp rpmatch select setlocale sigabbrev_np strcasecmp strchr strcspn strdup strerror strncasecmp strndup strpbrk strrchr strspn strstr strtol strtoul strverscmp utmpname wcwidth]) + +AC_CONFIG_FILES([Makefile + local/Makefile + po-man/Makefile + po/Makefile.in + library/libproc2.pc + testsuite/Makefile]) +AC_OUTPUT diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..715e343 --- /dev/null +++ b/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2021 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 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/doc/CodingStyle.md b/doc/CodingStyle.md new file mode 100644 index 0000000..3184e32 --- /dev/null +++ b/doc/CodingStyle.md @@ -0,0 +1,27 @@ +Most developers find Linux coding style easy to read, and there is +really no reason to reinvent this practise, so procps-ng goes along +with others. + +http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob_plain;f=Documentation/CodingStyle + +In addition to Linux coding style this project has few additional +wishes to contributors. + +* Many small patches are favoured over one big. Break down is done on + basis of logical functionality; for example #endif mark ups, + compiler warning and exit codes fixes all should be individual + small patches. + +* Use 'FIXME: ' in code comments, manual pages, autotools files, + scripts and so on to indicate something is wrong. The reason we do + is as simple as being able to find easily where problem areas are. + +* In writing arithmetic comparisons, use "<" and "<=" rather than + ">" and ">=". For some justification, read this: + http://thread.gmane.org/gmane.comp.version-control.git/3903/focus=4126 + +* Be nice to translators. Don't change translatable strings if you + can avoid it. If you must rearrange individual lines (e.g., in + multi-line --help strings), extract and create new strings, rather + than extracting and moving into existing blocks. This avoids + making unnecessary work for translators. diff --git a/doc/FAQ b/doc/FAQ new file mode 100644 index 0000000..b2e5a24 --- /dev/null +++ b/doc/FAQ @@ -0,0 +1,97 @@ +Why does "ps -aux" complain about a bogus '-'? + + According to the POSIX and UNIX standards, the above command asks to + display all processes with a TTY (generally the commands users are + running) plus all processes owned by a user named "x". If that user + doesn't exist, then ps will assume you really meant "ps aux". The + warning is given to gently break you of a habit that will cause you + trouble if a user named "x" were created. + +Why don't I see SMP (per-CPU) stats in top? + + You didn't enable it. Press '?' for built-in help or read the man + page. Per-CPU stats are disabled by default because they take up too + much space. Some Linux systems have hundreds of CPUs. + +Why do long usernames get printed as numbers? + + The UNIX and POSIX standards require that user names and group names + be printed as decimal integers when there is not enough room in the + column. Truncating the names, besides being a violation of the + standard, would lead to confusion between names like MichelleRichards + and MichelleRichardson. The UNIX and POSIX way to change column + width is to rename the column: + + ps -o pid,user=CumbersomeUserNames -o comm + + The easy way is to directly specify the desired width: + + ps -o pid,user:19,comm + +Why is %CPU underreported for multi-threaded (Java, etc.) apps? + + You need to upgrade to the 2.6.10 kernel at least. Older kernels do + not provide a reasonable way to get this information. + +Why do ps and top show threads individually? + + The 2.4.xx kernel does not provide proper support for grouping + threads by process. Hacks exist to group them anyway, but such hacks + will falsely group similar tasks and will fail to group tasks due to + race conditions. The hacks are also slow. As none of this is + acceptable in a critical system tool, task grouping is not currently + available for the 2.4.xx kernel. The 2.6.xx kernel allows for proper + thread grouping and reporting. To take advantage of this, your + programs must use a threading library that features the CLONE_THREAD + flag. The NPTL pthreads provided by recent glibc releases use + CLONE_THREAD. + +What systems are supported? + + Linux 2.4.xx 2.6.xx and 3.xx are commonly tested and expected to work + well. SMP is well supported. Multi-node cluster views require a + multi-node /proc filesystem; without that you will see a single-node + view. + +Where to I send bug reports? + + You may use the Debian bug tracking system or send your report to + procps@freelists.org (no subscription required) instead. + +Why are there so many procps projects? + + The original maintainer seems to have had little time for procps. + Whatever his reasons, the project didn't get maintained. Starting in + 1997, Albert Cahalan wrote a new ps program for the package. For the + next few years, Albert quietly helped the Debian package maintainer + fix bugs. In 2001, Rik van Riel decided to do something about what + appeared to be the lack of a maintainer. He picked up the buggy old + code in Red Hat's CVS and started adding patches. Meanwhile, other + people have patched procps in a great many ways. + + In 2002, Albert moved procps to http://procps.sourceforge.net. This + was done to ensure that years of testing and bug fixes would not be + lost. The major version number was changed to 3, partly to avoid + confusing users and partly because the top program had been redone. + + After development essentially stopped on sourceforge.net, in 2011 the + project found a new home at http://gitorious.org/procps. This + represents the Debian, Fedora and openSUSE fork of procps. To avoid + confusion and potential name clashes the package is now known as + procps-ng (next generation), the version number was raised to 3.3.0 + and the library so-name changed to libprocps.so + +What is being done to procps-ng at its new home? + + All programs are in the process of being modernized, both in terms of + coding style and supporting documentation. Autotools have been + integrated and the library API has been expanded with many new fields + supported such as control groups, supplementary groups, etc. The top + program has been rewritten offering many new capabilities while + providing performance improvements up to 300%. + +Why does ps get signal 17? + + No ps release has ever had this problem. Most likely your system has + been broken into. You might want to install a more recent version of + the OS. If you'd rather take your chances, simply upgrade procps. diff --git a/doc/TODO b/doc/TODO new file mode 100644 index 0000000..2611b28 --- /dev/null +++ b/doc/TODO @@ -0,0 +1,145 @@ +-------------------------- general ------------------------ + +Consider using glibc obstacks for memory allocation. + +Implement /usr/proc/bin tools like Solaris has. +The prstat command is interesting, like top in batch mode. +SCO has a pstat command. + +Don't these really belong in the procps-ng package? + killall pstree fuser lsof who +(they are maintained elsewhere, which causes version problems) + +OpenBSD has a pfind command. + +Cache results of dev_to_tty. + +---------------------- kernel ------------------------- + +Add an "adopted child" flag to mark processes that are not +natural children of init. This can make --forest work better. + +Supply better data for top's CPU state display. Currently top has +to subtract old numbers from new numbers and divide that result by +the number of processors. The kernel won't even supply the number +of processors in a portable way. + +Supply data for the ADDR and JOBC fields. + +Support & supply data for SL and RE. + +Add a /proc/*/tty symlink to eliminate guessing when /proc/*/fd is +not accessible. + +Add /proc/*/.bindata files to avoid string parsing. It should be an array +of 64-bit values on all machines. New entries go on the end and obsolete +ones get filled in with something logical -- entries must never be deleted! + +Add all the stuff Solaris has. This would also replace ptrace. + +---------------------- watch -------------------------- + +Tolerate VT100 line-drawing characters. Maybe translate them. + +---------------------- w -------------------------- + +The LOGIN@ column sometimes has a space in it. This makes correct +scripting difficult. + +Time formats are demented. + +---------------------- vmstat -------------------------- + +Extract /proc/diskstats parsing from vmstat into libproc somewhere. + +--------------------- libproc ---------------------- + +Stop storing fields with duplicate info (often different +units: kB and pages, seconds and jiffies) in the proc_t struct. + +Use own readdir code (assembly language) because glibc sucks ass. + +---------------------- top ------------------------- + +Share more stuff with ps. + +don't truncate long usernames + +have a --config option + +---------------- ps for now, maybe move to libproc ------------------ + +With forest output and a tty named /dev/this_is_my_tty, the position +of the command name gets messed up. (we print too many spaces) (fixed?) + +Fix missing stuff for these formats: FB_j FB_l FB_v HP_f HP_l HP_fl JFMT OL_m +(jobc,cpu,sl,re,cpu,prmgrp,m_swap,m_share,vm_lib,m_dt) +Note that "cpu" has two meanings. + +Add Beowulf support. This is ugly, since the current patches use a +daemon to collect info and add a HOST field after the PID field. + +Query optimizer, put cheap/required process selection first. + +Avoid reading both /proc/*/status and /proc/*/stat. + +Support printing the client hostname (the FROM that w(1) uses) in place +of a pty. + +Disambiguate narrow tty info. (/dev/tty7 == /dev/pts/7 now) +1------8 1--4 +ttyS2 S2 +ttyI31 I31 +pts/7 7 Short form could be /999. +pts/9999 9999 Short form could just be trunctuated to /999. +tty7 7 Short form could be vc-7. +tty63 63 Short form could be vc63. + +Internationalization, as specified by XPG3, Volume 1, Commands and Utilities. +(and suggested by Unix98) LC_TIME affects date format. + +----------------------- ps ----------------------- + +Add an option to select all processes that a user can kill. +(related to RUID, EUID, tty, etc. -- but maybe ignore root power) + +Add a nice display option for killing things. +ruser,euser,ppid,pid,pmem,stime,args + +For RT stuff: +pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm + +For job control: +stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm + +Make the column alignment algorithm support this: + FOO BAR + 8 44444 + 453 45 + 45 2989 + 63666 0 + 34 333 +(useful for the UNIX tty and time values, since the time might look +like 100-10:40:32 for old processes and the tty might have extra room) + +Improve long sort/format specifiers documentation and fill in the missing +code as much as the kernel can support. Make sure that memory amounts are in +pages when they should be and in kB when they should be, not backwards. + +output encoding: UTF8 --nul --null + +Make BSD formats use non-standard BSD time format, at least when it +doesn't violate the "no whitespace" rule. + +Better unmangling of '?' as a tty. The shell destroys '?' when there +is a filename that matches. If the argument seems like garbage, +check for a file that might have screwed up the '?'. + +If the 'O' option is given something already implied by 'O', +assume the user wanted a sorting option. + +Conflict: +Digital THREAD is user,pcpu,pri,scnt,wchan,usertime,systime +AIX THREAD is uname,pid,ppid,tid,S,C,PRI,scount,WCHAN,F,tty,bnd,comm +AIX looks like this: + USER PID PPID TID S C PRI SC WCHAN FLAG TTY BND CMD diff --git a/doc/bugs.md b/doc/bugs.md new file mode 100644 index 0000000..71c48b5 --- /dev/null +++ b/doc/bugs.md @@ -0,0 +1,92 @@ +BUG REPORTS +=========== + +The following is information for reporting bugs. Please read +the file as well as the documentation for the relevant program +before posting. This document is more useful for advanced users +and the people that package for the distributions. + +Also if you are an end-user of the programs and not the packager +and are using a distribution, check their bug tracker first, +you may find its a known bug already. + + +Where to send +------------- +You can raise issues on the GitLab issues tracker which is +located at https://gitlab.com/procps-ng/procps/issues You +will need a GitLab login to do so. + +Alternatively send comments, bug reports, patches, etc. +to the email list procps@freelists.org + +What to send +------------ +It is much more useful to us if a program really crashes to recompile it +with make `CFLAGS=-ggdb -O`, run it with `gdb prog` and `run` and send +me a stack trace (`bt` command). That said, any bug report is still +better than none. + +strace and ltrace output are very helpful: + +> strace -o output-file ps --blah +> bzip2 output-file + +The output of `ps --info` is often quite useful, even if the problem +is not with ps itself. A lot of the utilities use the same library. + +Merge Requests +-------------- +Merge requests are fine to use and give a central place for +everyone involved to have a look. Merge requests are found +on GitLab at https://gitlab.com/procps-ng/procps/merge_requests +It is best to follow up your merge request with an email to +the list saying what you have done. + +Patches +------- +While merge requests are preferred, patches are also welcome. +Get latest version of the source from upstream git. + +> git clone git@gitlab.com:procps-ng/procps.git + +and use `git format-patch` format. It is fine to attach patches as +compressed tar balls. When you are about to send very large number +of patches consider setting up your personal clone, and send a pull +request. + +> git request-pull commit-id \ +> git://gitorious.org/~yourlogin/procps/your-clone.git + + +Kernel-Dependent Patches +------------------------ +If you send patches which are specific to *running* with a particular +kernel version of /proc, please condition them with the runtime determined +variable `linux_version_code` from libproc/version.c. It is the same +number as the macro `LINUX_VERSION_CODE` for which the kernel /proc fs +code was compiled. + +A macro is provide in libproc/misc.h to construct the code from its +components, e.g. +> if (linux_version_code < LINUX_VERSION(2,5,41)) +> /* blah blah blah */ +A startup call to `set_linux_version` may also be necessary. + +Of course, if a bug is due to a change in kernel file formats, it would +be best to first try to generalize the parsing, since the code is then +more resilient against future change. + +Code Structure +-------------- +A goal is to encapsulate *all* parsing dependent on /proc +file formats into the libproc library. If the API is general enough +it can hopefully stabilize and then /proc changes might only require +updating libproc.so. Beyond that having the set of utilities be simple +command lines parsers and output formatters and encapsulating all kernel +divergence in libproc is the way to go. + +Hence if you are submitting a new program or are fixing an old one, keep +in mind that adding files to libproc which encapsulate such things is +more desirable than patching the actual driver program. (well, except +to move it toward the API of the library). diff --git a/doc/libproc.supp b/doc/libproc.supp new file mode 100644 index 0000000..d7f92d3 --- /dev/null +++ b/doc/libproc.supp @@ -0,0 +1,78 @@ +# +# This is a warning-suppression file for valgrind supplied by libproc +# to be used with the option: --suppressions=/libproc.supp. +# +# Memory leak warnings will only be encountered when a multi-threaded +# program has called the 'procps_pids' interface. That's because this +# library employs heap based memory in a thread safe manner. However, +# such memory will not be freed until the address space is reclaimed. +# +# When a sibling thread using this 'procps_pids' API ends, or if some +# other thread in that address space calls 'pthread_cancel()' on such +# a thread, valgrind will warn that some memory is 'definitely lost'. +# +# The majority of warnings depend on the 'pids_item' enumerators that +# have been specified using 'procps_pids_new' or 'procps_pids_reset'. +# +# Single-threaded applications will not experience any such warnings. +# + +## always present 'definitely lost' warnings +# 2 blocks of 128k each +{ + HEAP_BASED_TLS_startup + Memcheck:Leak + ... + fun:openproc +} + +## for most of the 'definitely lost' warnings +# up to 4 blocks ranging from 1024 to 2048 bytes each +{ + HEAP_BASED_TLS_input + Memcheck:Leak + ... + fun:file2str +} + +## additional potential 'definitely lost' warnings +# 48 bytes for each user +{ + HEAP_BASED_TLS_users + Memcheck:Leak + ... + fun:pwcache_get_user +} +# 48 bytes for each group +{ + HEAP_BASED_TLS_groups + Memcheck:Leak + ... + fun:pwcache_get_group +} +# 40 bytes for each tty +{ + HEAP_BASED_TLS_terminals + Memcheck:Leak + ... + fun:dev_to_tty +} + +## remaining potential 'definitely lost' warnings +# 16 bytes + sizeof name for each lxc container +{ + HEAP_BASED_TLS_lxc + Memcheck:Leak + ... + fun:lxc_containers +} + +## in case an installed library has been stripped, +## this will embrace all of the above warning categories +{ + HEAP_BASED_TLS_library + Memcheck:Leak + ... + obj:/usr/*lib*/libproc* + obj:/usr/local/*lib*/libproc* +} diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..ec298b5 --- /dev/null +++ b/install-sh @@ -0,0 +1,541 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2020-11-14.01; # 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 + +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= +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 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. + -p pass -p to $cpprog. + -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. + -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 + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ +" + +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;; + + -p) cpprog="$cpprog -p";; + + -s) stripcmd=$stripprog;; + + -S) backupsuffix="$2" + shift;; + + -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=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi + 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. + 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 + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # 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 + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/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. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # 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=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_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 && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $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 + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + + # 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 "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd "$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 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/library/devname.c b/library/devname.c new file mode 100644 index 0000000..6a23653 --- /dev/null +++ b/library/devname.c @@ -0,0 +1,364 @@ +/* + * devname - device name functions + * + * Copyright © 2011-2023 Jim Warner + * Copyright © 2017-2023 Craig Small + * Copyright © 1998-2009 Albert Cahalan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; 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 "misc.h" +#include "devname.h" + +// This is the buffer size for a tty name. Any path is legal, +// which makes PAGE_SIZE appropriate (see kernel source), but +// that is only 99% portable and utmp only holds 32 anyway. +// We need at least 20 for guess_name(). +#define TTY_NAME_SIZE 128 + +/* Who uses what: + * + * dev_to_tty top, ps + */ + +#ifdef MAJOR_IN_MKDEV +#include +#elif defined MAJOR_IN_SYSMACROS +#include +#else +#define major(d) ( ((unsigned)(d)>>8u) & 0xfffu ) +#define minor(d) ( ((unsigned)(d)&0xffu) | (((unsigned)(d)&0xfff00000u)>>12u) ) +#endif + +typedef struct tty_map_node { + struct tty_map_node *next; + unsigned short devfs_type; // bool + unsigned short major_number; + unsigned minor_first; + unsigned minor_last; + char name[16]; +} tty_map_node; + +static __thread tty_map_node *tty_map = NULL; + +/* Load /proc/tty/drivers for device name mapping use. */ +static void load_drivers(void){ + char buf[10000]; + char *p; + int fd; + int bytes; + fd = open("/proc/tty/drivers",O_RDONLY); + if(fd == -1) goto fail; + bytes = read(fd, buf, sizeof(buf) - 1); + if(bytes == -1) goto fail; + buf[bytes] = '\0'; + p = buf; + while(( p = strstr(p, " /dev/") )){ // " /dev/" is the second column + tty_map_node *tmn; + size_t len; + char *end; + p += 6; + end = strchr(p, ' '); + if(!end) continue; + len = end - p; + if (!(tmn = calloc(1, sizeof(tty_map_node)))) + goto fail; + tmn->next = tty_map; + tty_map = tmn; + /* if we have a devfs type name such as /dev/tts/%d then strip the %d but + keep a flag. */ + if(len >= 3 && !strncmp(end - 2, "%d", 2)){ + len -= 2; + tmn->devfs_type = 1; + } + if(len >= sizeof tmn->name) + len = sizeof tmn->name - 1; // mangle it to avoid overflow + memcpy(tmn->name, p, len); + p = end; /* set p to point past the %d as well if there is one */ + while(*p == ' ') p++; + tmn->major_number = atoi(p); + p += strspn(p, "0123456789"); + while(*p == ' ') p++; + switch(sscanf(p, "%u-%u", &tmn->minor_first, &tmn->minor_last)){ + default: + /* Can't finish parsing this line so we remove it from the list */ + tty_map = tty_map->next; + free(tmn); + break; + case 1: + tmn->minor_last = tmn->minor_first; + break; + case 2: + break; + } + } +fail: + if(fd != -1) close(fd); + if(!tty_map) tty_map = (tty_map_node *)-1; +} + +/* Try to guess the device name from /proc/tty/drivers info. */ +static int driver_name(char *restrict const buf, unsigned maj, unsigned min){ + struct stat sbuf; + tty_map_node *tmn; + if(!tty_map) load_drivers(); + if(tty_map == (tty_map_node *)-1) return 0; + tmn = tty_map; + for(;;){ + if(!tmn) return 0; + if(tmn->major_number == maj && tmn->minor_first <= min && tmn->minor_last >= min) break; + tmn = tmn->next; + } + sprintf(buf, "/dev/%s%d", tmn->name, min); /* like "/dev/ttyZZ255" */ + if(stat(buf, &sbuf) < 0){ + sprintf(buf, "/dev/%s/%d", tmn->name, min); /* like "/dev/pts/255" */ + if(stat(buf, &sbuf) < 0){ + if(tmn->devfs_type) return 0; + sprintf(buf, "/dev/%s", tmn->name); /* like "/dev/ttyZZ255" */ + if(stat(buf, &sbuf) < 0) return 0; + } + } + if(min != minor(sbuf.st_rdev)) return 0; + if(maj != major(sbuf.st_rdev)) return 0; + return 1; +} + +// major 204 is a mess -- "Low-density serial ports" +static const char low_density_names[][6] = { +"LU0", "LU1", "LU2", "LU3", +"FB0", +"SA0", "SA1", "SA2", +"SC0", "SC1", "SC2", "SC3", +"FW0", "FW1", "FW2", "FW3", +"AM0", "AM1", "AM2", "AM3", "AM4", "AM5", "AM6", "AM7", +"AM8", "AM9", "AM10", "AM11", "AM12", "AM13", "AM14", "AM15", +"DB0", "DB1", "DB2", "DB3", "DB4", "DB5", "DB6", "DB7", +"SG0", +"SMX0", "SMX1", "SMX2", +"MM0", "MM1", +"CPM0", "CPM1", "CPM2", "CPM3", /* "CPM4", "CPM5", */ // bad allocation? +"IOC0", "IOC1", "IOC2", "IOC3", "IOC4", "IOC5", "IOC6", "IOC7", +"IOC8", "IOC9", "IOC10", "IOC11", "IOC12", "IOC13", "IOC14", "IOC15", +"IOC16", "IOC17", "IOC18", "IOC19", "IOC20", "IOC21", "IOC22", "IOC23", +"IOC24", "IOC25", "IOC26", "IOC27", "IOC28", "IOC29", "IOC30", "IOC31", +"VR0", "VR1", +"IOC84", "IOC85", "IOC86", "IOC87", "IOC88", "IOC89", "IOC90", "IOC91", +"IOC92", "IOC93", "IOC94", "IOC95", "IOC96", "IOC97", "IOC98", "IOC99", +"IOC100", "IOC101", "IOC102", "IOC103", "IOC104", "IOC105", "IOC106", "IOC107", +"IOC108", "IOC109", "IOC110", "IOC111", "IOC112", "IOC113", "IOC114", "IOC115", +"SIOC0", "SIOC1", "SIOC2", "SIOC3", "SIOC4", "SIOC5", "SIOC6", "SIOC7", +"SIOC8", "SIOC9", "SIOC10", "SIOC11", "SIOC12", "SIOC13", "SIOC14", "SIOC15", +"SIOC16", "SIOC17", "SIOC18", "SIOC19", "SIOC20", "SIOC21", "SIOC22", "SIOC23", +"SIOC24", "SIOC25", "SIOC26", "SIOC27", "SIOC28", "SIOC29", "SIOC30", "SIOC31", +"PSC0", "PSC1", "PSC2", "PSC3", "PSC4", "PSC5", +"AT0", "AT1", "AT2", "AT3", "AT4", "AT5", "AT6", "AT7", +"AT8", "AT9", "AT10", "AT11", "AT12", "AT13", "AT14", "AT15", +"NX0", "NX1", "NX2", "NX3", "NX4", "NX5", "NX6", "NX7", +"NX8", "NX9", "NX10", "NX11", "NX12", "NX13", "NX14", "NX15", +"J0", // minor is 186 +"UL0","UL1","UL2","UL3", +"xvc0", // FAIL -- "/dev/xvc0" lacks "tty" prefix +"PZ0","PZ1","PZ2","PZ3", +"TX0","TX1","TX2","TX3","TX4","TX5","TX6","TX7", +"SC0","SC1","SC2","SC3", +"MAX0","MAX1","MAX2","MAX3", +}; + +#if 0 +// test code +#include +#define AS(x) (sizeof(x)/sizeof((x)[0])) +int main(int argc, char *argv[]){ + int i = 0; + while(i 255) return 0; // should never happen; array index protection +#ifdef __CYGWIN__ + sprintf(buf, "cons%d", tmpmin); + /* Skip stat call. The reason is that cons devices are local to + * the processes running in that console. Calling stat from another + * console or pty will return -1. */ + return 1; +#else + t0 = "pqrstuvwxyzabcde"[tmpmin>>4]; + t1 = "0123456789abcdef"[tmpmin&0x0f]; + sprintf(buf, "/dev/tty%c%c", t0, t1); +#endif + break; + case 4: + if(min<64){ + sprintf(buf, "/dev/tty%d", min); + break; + } + sprintf(buf, "/dev/ttyS%d", min-64); + break; + case 11: sprintf(buf, "/dev/ttyB%d", min); break; + case 17: sprintf(buf, "/dev/ttyH%d", min); break; + case 19: sprintf(buf, "/dev/ttyC%d", min); break; + case 22: sprintf(buf, "/dev/ttyD%d", min); break; /* devices.txt */ + case 23: sprintf(buf, "/dev/ttyD%d", min); break; /* driver code */ + case 24: sprintf(buf, "/dev/ttyE%d", min); break; + case 32: sprintf(buf, "/dev/ttyX%d", min); break; + case 43: sprintf(buf, "/dev/ttyI%d", min); break; + case 46: sprintf(buf, "/dev/ttyR%d", min); break; + case 48: sprintf(buf, "/dev/ttyL%d", min); break; + case 57: sprintf(buf, "/dev/ttyP%d", min); break; + case 71: sprintf(buf, "/dev/ttyF%d", min); break; + case 75: sprintf(buf, "/dev/ttyW%d", min); break; + case 78: sprintf(buf, "/dev/ttyM%d", min); break; /* conflict */ + case 105: sprintf(buf, "/dev/ttyV%d", min); break; + case 112: sprintf(buf, "/dev/ttyM%d", min); break; /* conflict */ +#ifdef __CYGWIN__ + case 136: sprintf(buf, "/dev/pty%d", min); break; +#else + /* 136 ... 143 are /dev/pts/0, /dev/pts/1, /dev/pts/2 ... */ + case 136 ... 143: sprintf(buf, "/dev/pts/%d", min+(maj-136)*256); break; +#endif + case 148: sprintf(buf, "/dev/ttyT%d", min); break; + case 154: sprintf(buf, "/dev/ttySR%d", min); break; + case 156: sprintf(buf, "/dev/ttySR%d", min+256); break; + case 164: sprintf(buf, "/dev/ttyCH%d", min); break; + case 166: sprintf(buf, "/dev/ttyACM%d", min); break; /* bummer, 9-char */ + case 172: sprintf(buf, "/dev/ttyMX%d", min); break; + case 174: sprintf(buf, "/dev/ttySI%d", min); break; + case 188: sprintf(buf, "/dev/ttyUSB%d", min); break; /* bummer, 9-char */ + case 204: + if(min >= sizeof low_density_names / sizeof low_density_names[0]) return 0; + memcpy(buf,"/dev/tty",8); + memcpy(buf+8, low_density_names[min], sizeof low_density_names[0]); + buf[8 + sizeof low_density_names[0]] = '\0'; +// snprintf(buf, 9 + sizeof low_density_names[0], "/dev/tty%.*s", sizeof low_density_names[0], low_density_names[min]); + break; + case 208: sprintf(buf, "/dev/ttyU%d", min); break; + case 216: sprintf(buf, "/dev/ttyUB%d", min); break; // "/dev/rfcomm%d" now? + case 224: sprintf(buf, "/dev/ttyY%d", min); break; + case 227: sprintf(buf, "/dev/3270/tty%d", min); break; /* bummer, HUGE */ + case 229: sprintf(buf, "/dev/iseries/vtty%d", min); break; /* bummer, HUGE */ + case 256: sprintf(buf, "/dev/ttyEQ%d", min); break; + default: return 0; + } + if(stat(buf, &sbuf) < 0) return 0; + if(min != minor(sbuf.st_rdev)) return 0; + if(maj != major(sbuf.st_rdev)) return 0; + return 1; +} + +/* Linux 2.2 can give us filenames that might be correct. + * Useful names could be in /proc/PID/fd/2 (stderr, seldom redirected) + * and in /proc/PID/fd/255 (used by bash to remember the tty). + */ +static int link_name(char *restrict const buf, unsigned maj, unsigned min, int pid, const char *restrict name){ + struct stat sbuf; + char path[32]; + ssize_t count; + const int len = snprintf(path, sizeof path, "/proc/%d/%s", pid, name); /* often permission denied */ + if(len <= 0 || (size_t)len >= sizeof path) return 0; + count = readlink(path,buf,TTY_NAME_SIZE-1); + if(count <= 0 || count >= TTY_NAME_SIZE-1) return 0; + buf[count] = '\0'; + if(stat(buf, &sbuf) < 0) return 0; + if(min != minor(sbuf.st_rdev)) return 0; + if(maj != major(sbuf.st_rdev)) return 0; + return 1; +} + +#ifdef USE_PROC_CTTY +/* Cygwin keeps the name to the controlling tty in a virtual file called + /proc/PID/ctty, including a trailing LF (sigh). */ +static int ctty_name(char *restrict const buf, int pid) { + char path[32]; + FILE *fp; + char *lf; + sprintf (path, "/proc/%d/ctty", pid); /* often permission denied */ + fp = fopen (path, "r"); + if (!fp) + return 0; + if (!fgets (buf,TTY_NAME_SIZE,fp)) + { + fclose (fp); + return 0; + } + fclose (fp); + lf = strchr (buf, '\n'); + if (lf) + *lf = (lf == buf ? '?' : '\0'); + return 1; +} +#endif + +/* number --> name */ +unsigned dev_to_tty(char *restrict ret, unsigned chop, dev_t dev_t_dev, int pid, unsigned int flags) { + static __thread char buf[TTY_NAME_SIZE]; + char *restrict tmp = buf; + unsigned dev = dev_t_dev; + unsigned i = 0; + int c; +#ifdef USE_PROC_CTTY + if( ctty_name(tmp, pid )) goto abbrev; +#endif + if(dev == 0u) goto no_tty; + if(driver_name(tmp, major(dev), minor(dev) )) goto abbrev; + if( link_name(tmp, major(dev), minor(dev), pid, "fd/2" )) goto abbrev; + if( guess_name(tmp, major(dev), minor(dev) )) goto abbrev; + if( link_name(tmp, major(dev), minor(dev), pid, "fd/255")) goto abbrev; + // fall through if unable to find a device file +no_tty: + strcpy(ret, chop >= 1 ? "?" : ""); + return 1; +abbrev: + if((flags&ABBREV_DEV) && !strncmp(tmp,"/dev/",5) && tmp[5]) tmp += 5; + if((flags&ABBREV_TTY) && !strncmp(tmp,"tty", 3) && tmp[3]) tmp += 3; + if((flags&ABBREV_PTS) && !strncmp(tmp,"pts/", 4) && tmp[4]) tmp += 4; + /* gotta check before we chop or we may chop someone else's memory */ + if(chop + (unsigned long)(tmp-buf) < sizeof buf) + tmp[chop] = '\0'; + /* replace non-ASCII characters with '?' and return the number of chars */ + while(i < chop){ + c = *tmp; + tmp++; + if(!c) break; + i++; + if(c<=' ') c = '?'; + if(c>126) c = '?'; + *ret = c; + ret++; + } + *ret = '\0'; + return i; +} diff --git a/library/diskstats.c b/library/diskstats.c new file mode 100644 index 0000000..b4e41f3 --- /dev/null +++ b/library/diskstats.c @@ -0,0 +1,1027 @@ +/* + * diskstats.c - disk I/O related definitions for libproc2 + * + * Copyright © 2015-2023 Craig Small + * Copyright © 2015-2023 Jim Warner + * Copyright © 2003 Albert Cahalan + * Copyright © 2003 Fabian Frederick + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; 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 "procps-private.h" +#include "diskstats.h" + +/* The following define will cause the 'node_add' function to maintain our | + nodes list in ascending alphabetical order which could be used to avoid | + a sort on name. Without it, we default to a 'pull-up' stack at slightly | + more effort than a simple 'push-down' list to duplicate prior behavior. | */ +//#define ALPHABETIC_NODES + +#define DISKSTATS_LINE_LEN 1024 +#define DISKSTATS_NAME_LEN 34 +#define DISKSTATS_FILE "/proc/diskstats" +#define SYSBLOCK_DIR "/sys/block" + +#define STACKS_INCR 64 // amount reap stack allocations grow +#define STR_COMPARE strverscmp + +/* ----------------------------------------------------------------------- + + this provision can help ensure that our Item_table remains synchronized | + with the enumerators found in the associated header file. It's intended | + to only be used locally (& temporarily) at some point before a release! | */ +// #define ITEMTABLE_DEBUG //--------------------------------------------- | +// ----------------------------------------------------------------------- + + + +struct dev_data { + unsigned long reads; + unsigned long reads_merged; + unsigned long read_sectors; + unsigned long read_time; + unsigned long writes; + unsigned long writes_merged; + unsigned long write_sectors; + unsigned long write_time; + unsigned long io_inprogress; + unsigned long io_time; + unsigned long io_wtime; +}; + +struct dev_node { + char name[DISKSTATS_NAME_LEN+1]; + int type; + int major; + int minor; + time_t stamped; + struct dev_data new; + struct dev_data old; + struct dev_node *next; +}; + +struct stacks_extent { + int ext_numstacks; + struct stacks_extent *next; + struct diskstats_stack **stacks; +}; + +struct ext_support { + int numitems; // includes 'logical_end' delimiter + enum diskstats_item *items; // includes 'logical_end' delimiter + struct stacks_extent *extents; // anchor for these extents +}; + +struct fetch_support { + struct diskstats_stack **anchor; // fetch consolidated extents + int n_alloc; // number of above pointers allocated + int n_inuse; // number of above pointers occupied + int n_alloc_save; // last known reap.stacks allocation + struct diskstats_reaped results; // count + stacks for return to caller +}; + +struct diskstats_info { + int refcount; + FILE *diskstats_fp; + time_t old_stamp; // previous read seconds + time_t new_stamp; // current read seconds + struct dev_node *nodes; // dev nodes anchor + struct ext_support select_ext; // supports concurrent select/reap + struct ext_support fetch_ext; // supports concurrent select/reap + struct fetch_support fetch; // support for procps_diskstats_reap + struct diskstats_result get_this; // used by procps_diskstats_get +}; + + +// ___ Results 'Set' Support |||||||||||||||||||||||||||||||||||||||||||||||||| + +#define setNAME(e) set_diskstats_ ## e +#define setDECL(e) static void setNAME(e) \ + (struct diskstats_result *R, struct dev_node *N) + +// regular assignment +#define DEV_set(e,t,x) setDECL(e) { R->result. t = N-> x; } +#define REG_set(e,t,x) setDECL(e) { R->result. t = N->new. x; } +// delta assignment +#define HST_set(e,t,x) setDECL(e) { R->result. t = ( N->new. x - N->old. x ); } + +setDECL(noop) { (void)R; (void)N; } +setDECL(extra) { (void)N; R->result.ul_int = 0; } + +DEV_set(NAME, str, name) +DEV_set(TYPE, s_int, type) +DEV_set(MAJOR, s_int, major) +DEV_set(MINOR, s_int, minor) + +REG_set(READS, ul_int, reads) +REG_set(READS_MERGED, ul_int, reads_merged) +REG_set(READ_SECTORS, ul_int, read_sectors) +REG_set(READ_TIME, ul_int, read_time) +REG_set(WRITES, ul_int, writes) +REG_set(WRITES_MERGED, ul_int, writes_merged) +REG_set(WRITE_SECTORS, ul_int, write_sectors) +REG_set(WRITE_TIME, ul_int, write_time) +REG_set(IO_TIME, ul_int, io_time) +REG_set(WEIGHTED_TIME, ul_int, io_wtime) + +REG_set(IO_INPROGRESS, s_int, io_inprogress) + +HST_set(DELTA_READS, s_int, reads) +HST_set(DELTA_READS_MERGED, s_int, reads_merged) +HST_set(DELTA_READ_SECTORS, s_int, read_sectors) +HST_set(DELTA_READ_TIME, s_int, read_time) +HST_set(DELTA_WRITES, s_int, writes) +HST_set(DELTA_WRITES_MERGED, s_int, writes_merged) +HST_set(DELTA_WRITE_SECTORS, s_int, write_sectors) +HST_set(DELTA_WRITE_TIME, s_int, write_time) +HST_set(DELTA_IO_TIME, s_int, io_time) +HST_set(DELTA_WEIGHTED_TIME, s_int, io_wtime) + +#undef setDECL +#undef DEV_set +#undef REG_set +#undef HST_set + + +// ___ Sorting Support |||||||||||||||||||||||||||||||||||||||||||||||||||||||| + +struct sort_parms { + int offset; + enum diskstats_sort_order order; +}; + +#define srtNAME(t) sort_diskstats_ ## t +#define srtDECL(t) static int srtNAME(t) \ + (const struct diskstats_stack **A, const struct diskstats_stack **B, struct sort_parms *P) + +srtDECL(s_int) { + const struct diskstats_result *a = (*A)->head + P->offset; \ + const struct diskstats_result *b = (*B)->head + P->offset; \ + return P->order * (a->result.s_int - b->result.s_int); +} + +srtDECL(ul_int) { + const struct diskstats_result *a = (*A)->head + P->offset; \ + const struct diskstats_result *b = (*B)->head + P->offset; \ + if ( a->result.ul_int > b->result.ul_int ) return P->order > 0 ? 1 : -1; \ + if ( a->result.ul_int < b->result.ul_int ) return P->order > 0 ? -1 : 1; \ + return 0; +} + +srtDECL(str) { + const struct diskstats_result *a = (*A)->head + P->offset; + const struct diskstats_result *b = (*B)->head + P->offset; + return P->order * STR_COMPARE(a->result.str, b->result.str); +} + +srtDECL(noop) { \ + (void)A; (void)B; (void)P; \ + return 0; +} + +#undef srtDECL + + +// ___ Controlling Table |||||||||||||||||||||||||||||||||||||||||||||||||||||| + +typedef void (*SET_t)(struct diskstats_result *, struct dev_node *); +#ifdef ITEMTABLE_DEBUG +#define RS(e) (SET_t)setNAME(e), DISKSTATS_ ## e, STRINGIFY(DISKSTATS_ ## e) +#else +#define RS(e) (SET_t)setNAME(e) +#endif + +typedef int (*QSR_t)(const void *, const void *, void *); +#define QS(t) (QSR_t)srtNAME(t) + +#define TS(t) STRINGIFY(t) +#define TS_noop "" + + /* + * Need it be said? + * This table must be kept in the exact same order as + * those *enum diskstats_item* guys ! */ +static struct { + SET_t setsfunc; // the actual result setting routine +#ifdef ITEMTABLE_DEBUG + int enumnumb; // enumerator (must match position!) + char *enum2str; // enumerator name as a char* string +#endif + QSR_t sortfunc; // sort cmp func for a specific type + char *type2str; // the result type as a string value +} Item_table[] = { +/* setsfunc sortfunc type2str + ------------------------ ----------- ---------- */ + { RS(noop), QS(noop), TS_noop }, + { RS(extra), QS(ul_int), TS_noop }, + + { RS(NAME), QS(str), TS(str) }, + { RS(TYPE), QS(s_int), TS(s_int) }, + { RS(MAJOR), QS(s_int), TS(s_int) }, + { RS(MINOR), QS(s_int), TS(s_int) }, + + { RS(READS), QS(ul_int), TS(ul_int) }, + { RS(READS_MERGED), QS(ul_int), TS(ul_int) }, + { RS(READ_SECTORS), QS(ul_int), TS(ul_int) }, + { RS(READ_TIME), QS(ul_int), TS(ul_int) }, + { RS(WRITES), QS(ul_int), TS(ul_int) }, + { RS(WRITES_MERGED), QS(ul_int), TS(ul_int) }, + { RS(WRITE_SECTORS), QS(ul_int), TS(ul_int) }, + { RS(WRITE_TIME), QS(ul_int), TS(ul_int) }, + { RS(IO_TIME), QS(ul_int), TS(ul_int) }, + { RS(WEIGHTED_TIME), QS(ul_int), TS(ul_int) }, + + { RS(IO_INPROGRESS), QS(s_int), TS(s_int) }, + + { RS(DELTA_READS), QS(s_int), TS(s_int) }, + { RS(DELTA_READS_MERGED), QS(s_int), TS(s_int) }, + { RS(DELTA_READ_SECTORS), QS(s_int), TS(s_int) }, + { RS(DELTA_READ_TIME), QS(s_int), TS(s_int) }, + { RS(DELTA_WRITES), QS(s_int), TS(s_int) }, + { RS(DELTA_WRITES_MERGED), QS(s_int), TS(s_int) }, + { RS(DELTA_WRITE_SECTORS), QS(s_int), TS(s_int) }, + { RS(DELTA_WRITE_TIME), QS(s_int), TS(s_int) }, + { RS(DELTA_IO_TIME), QS(s_int), TS(s_int) }, + { RS(DELTA_WEIGHTED_TIME), QS(s_int), TS(s_int) }, +}; + + /* please note, + * this enum MUST be 1 greater than the highest value of any enum */ +enum diskstats_item DISKSTATS_logical_end = MAXTABLE(Item_table); + +#undef setNAME +#undef srtNAME +#undef RS +#undef QS + + +// ___ Private Functions |||||||||||||||||||||||||||||||||||||||||||||||||||||| +// --- dev_node specific support ---------------------------------------------- + +static struct dev_node *node_add ( + struct diskstats_info *info, + struct dev_node *this) +{ + struct dev_node *prev, *walk; + +#ifdef ALPHABETIC_NODES + if (!info->nodes + || (STR_COMPARE(this->name, info->nodes->name) < 0)) { + this->next = info->nodes; + info->nodes = this; + return this; + } + prev = info->nodes; + walk = info->nodes->next; + while (walk) { + if (STR_COMPARE(this->name, walk->name) < 0) + break; + prev = walk; + walk = walk->next; + } + prev->next = this; + this->next = walk; +#else + if (!info->nodes) + info->nodes = this; + else { + walk = info->nodes; + do { + prev = walk; + walk = walk->next; + } while (walk); + prev->next = this; + } +#endif + return this; +} // end: node_add + + +static void node_classify ( + struct dev_node *this) +{ + DIR *dirp; + struct dirent *dent; + + /* all disks start off as partitions. this function + checks /sys/block and changes a device found there + into a disk. if /sys/block cannot have the directory + read, all devices are then treated as disks. */ + this->type = DISKSTATS_TYPE_PARTITION; + + if (!(dirp = opendir(SYSBLOCK_DIR))) { + this->type = DISKSTATS_TYPE_DISK; + return; + } + while ((dent = readdir(dirp))) { + if (strcmp(this->name, dent->d_name) == 0) { + this->type = DISKSTATS_TYPE_DISK; + break; + } + } + closedir(dirp); +} // end: node_classify + + +static struct dev_node *node_cut ( + struct diskstats_info *info, + struct dev_node *this) +{ + struct dev_node *node = info->nodes; + + if (this) { + if (this == node) { + info->nodes = node->next; + return this; + } + do { + if (this == node->next) { + node->next = node->next->next; + return this; + } + node = node->next; + } while (node); + } + return NULL; +} // end: node_cut + + +static struct dev_node *node_get ( + struct diskstats_info *info, + const char *name) +{ + struct dev_node *node = info->nodes; + + while (node) { + if (strcmp(name, node->name) == 0) + break; + node = node->next; + } + if (node) { + /* if this disk or partition has somehow gotten stale, we'll lose + it and then pretend it was never actually found ... + [ we test against both stamps in case a 'read' was avoided ] */ + if (node->stamped != info->old_stamp + && (node->stamped != info->new_stamp)) { + free(node_cut(info, node)); + node = NULL; + } + } + return node; +} // end: node_get + + +static int node_update ( + struct diskstats_info *info, + struct dev_node *source) +{ + struct dev_node *target = node_get(info, source->name); + + if (!target) { + if (!(target = malloc(sizeof(struct dev_node)))) + return 0; + memcpy(target, source, sizeof(struct dev_node)); + // let's not distort the deltas when a new node is created ... + memcpy(&target->old, &target->new, sizeof(struct dev_data)); + node_classify(target); + node_add(info, target); + return 1; + } + // remember history from last time around ... + memcpy(&source->old, &target->new, sizeof(struct dev_data)); + // preserve some stuff from the existing node struct ... + source->type = target->type; + source->next = target->next; + // finally 'update' the existing node struct ... + memcpy(target, source, sizeof(struct dev_node)); + return 1; +} // end: node_update + + +// ___ Private Functions |||||||||||||||||||||||||||||||||||||||||||||||||||||| +// --- generalized support ---------------------------------------------------- + +static inline void diskstats_assign_results ( + struct diskstats_stack *stack, + struct dev_node *node) +{ + struct diskstats_result *this = stack->head; + + for (;;) { + enum diskstats_item item = this->item; + if (item >= DISKSTATS_logical_end) + break; + Item_table[item].setsfunc(this, node); + ++this; + } + return; +} // end: diskstats_assign_results + + +static void diskstats_extents_free_all ( + struct ext_support *this) +{ + while (this->extents) { + struct stacks_extent *p = this->extents; + this->extents = this->extents->next; + free(p); + }; +} // end: diskstats_extents_free_all + + +static inline struct diskstats_result *diskstats_itemize_stack ( + struct diskstats_result *p, + int depth, + enum diskstats_item *items) +{ + struct diskstats_result *p_sav = p; + int i; + + for (i = 0; i < depth; i++) { + p->item = items[i]; + ++p; + } + return p_sav; +} // end: diskstats_itemize_stack + + +static inline int diskstats_items_check_failed ( + enum diskstats_item *items, + int numitems) +{ + int i; + + /* if an enum is passed instead of an address of one or more enums, ol' gcc + * will silently convert it to an address (possibly NULL). only clang will + * offer any sort of warning like the following: + * + * warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'enum diskstats_item *' + * my_stack = procps_diskstats_select(info, DISKSTATS_noop, num); + * ^~~~~~~~~~~~~~~~ + */ + if (numitems < 1 + || (void *)items < (void *)(unsigned long)(2 * DISKSTATS_logical_end)) + return 1; + + for (i = 0; i < numitems; i++) { + // a diskstats_item is currently unsigned, but we'll protect our future + if (items[i] < 0) + return 1; + if (items[i] >= DISKSTATS_logical_end) + return 1; + } + + return 0; +} // end: diskstats_items_check_failed + + +/* + * diskstats_read_failed: + * + * @info: info structure created at procps_diskstats_new + * + * Read the data out of /proc/diskstats putting the information + * into the supplied info structure + * + * Returns: 0 on success, 1 on error + */ +static int diskstats_read_failed ( + struct diskstats_info *info) +{ + static const char *fmtstr = "%d %d %" STRINGIFY(DISKSTATS_NAME_LEN) \ + "s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu"; + char buf[DISKSTATS_LINE_LEN]; + struct dev_node node; + int rc; + + if (!info->diskstats_fp + && (!(info->diskstats_fp = fopen(DISKSTATS_FILE, "r")))) + return 1; + + if (fseek(info->diskstats_fp, 0L, SEEK_SET) == -1) + return 1; + + info->old_stamp = info->new_stamp; + info->new_stamp = time(NULL); + + while (fgets(buf, DISKSTATS_LINE_LEN, info->diskstats_fp)) { + // clear out the soon to be 'current'values + memset(&node, 0, sizeof(struct dev_node)); + + rc = sscanf(buf, fmtstr + , &node.major + , &node.minor + , &node.name[0] + , &node.new.reads + , &node.new.reads_merged + , &node.new.read_sectors + , &node.new.read_time + , &node.new.writes + , &node.new.writes_merged + , &node.new.write_sectors + , &node.new.write_time + , &node.new.io_inprogress + , &node.new.io_time + , &node.new.io_wtime); + + if (rc != 14) { + errno = ERANGE; + return 1; + } + node.stamped = info->new_stamp; + if (!node_update(info, &node)) + return 1; // here, errno was set to ENOMEM + } + + return 0; +} // end: diskstats_read_failed + + +/* + * diskstats_stacks_alloc(): + * + * Allocate and initialize one or more stacks each of which is anchored in an + * associated context structure. + * + * All such stacks will have their result structures properly primed with + * 'items', while the result itself will be zeroed. + * + * Returns a stacks_extent struct anchoring the 'heads' of each new stack. + */ +static struct stacks_extent *diskstats_stacks_alloc ( + struct ext_support *this, + int maxstacks) +{ + struct stacks_extent *p_blob; + struct diskstats_stack **p_vect; + struct diskstats_stack *p_head; + size_t vect_size, head_size, list_size, blob_size; + void *v_head, *v_list; + int i; + + vect_size = sizeof(void *) * maxstacks; // size of the addr vectors | + vect_size += sizeof(void *); // plus NULL addr delimiter | + head_size = sizeof(struct diskstats_stack); // size of that head struct | + list_size = sizeof(struct diskstats_result) * this->numitems; // any single results stack | + blob_size = sizeof(struct stacks_extent); // the extent anchor itself | + blob_size += vect_size; // plus room for addr vects | + blob_size += head_size * maxstacks; // plus room for head thing | + blob_size += list_size * maxstacks; // plus room for our stacks | + + /* note: all of our memory is allocated in one single blob, facilitating some later free(). | + as a minimum, it's important that all of those result structs themselves always be | + contiguous within every stack since they will be accessed via a relative position. | */ + if (NULL == (p_blob = calloc(1, blob_size))) + return NULL; + + p_blob->next = this->extents; // push this extent onto... | + this->extents = p_blob; // ...some existing extents | + p_vect = (void *)p_blob + sizeof(struct stacks_extent); // prime our vector pointer | + p_blob->stacks = p_vect; // set actual vectors start | + v_head = (void *)p_vect + vect_size; // prime head pointer start | + v_list = v_head + (head_size * maxstacks); // prime our stacks pointer | + + for (i = 0; i < maxstacks; i++) { + p_head = (struct diskstats_stack *)v_head; + p_head->head = diskstats_itemize_stack((struct diskstats_result *)v_list, this->numitems, this->items); + p_blob->stacks[i] = p_head; + v_list += list_size; + v_head += head_size; + } + p_blob->ext_numstacks = maxstacks; + return p_blob; +} // end: diskstats_stacks_alloc + + +static int diskstats_stacks_fetch ( + struct diskstats_info *info) +{ + #define n_alloc info->fetch.n_alloc + #define n_inuse info->fetch.n_inuse + #define n_saved info->fetch.n_alloc_save + struct stacks_extent *ext; + struct dev_node *node; + + // initialize stuff ----------------------------------- + if (!info->fetch.anchor) { + if (!(info->fetch.anchor = calloc(sizeof(void *), STACKS_INCR))) + return -ENOMEM; + n_alloc = STACKS_INCR; + } + if (!info->fetch_ext.extents) { + if (!(ext = diskstats_stacks_alloc(&info->fetch_ext, n_alloc))) + return -1; // here, errno was set to ENOMEM + memcpy(info->fetch.anchor, ext->stacks, sizeof(void *) * n_alloc); + } + + // iterate stuff -------------------------------------- + n_inuse = 0; + node = info->nodes; + while (node) { + if (!(n_inuse < n_alloc)) { + n_alloc += STACKS_INCR; + if ((!(info->fetch.anchor = realloc(info->fetch.anchor, sizeof(void *) * n_alloc))) + || (!(ext = diskstats_stacks_alloc(&info->fetch_ext, STACKS_INCR)))) + return -1; // here, errno was set to ENOMEM + memcpy(info->fetch.anchor + n_inuse, ext->stacks, sizeof(void *) * STACKS_INCR); + } + diskstats_assign_results(info->fetch.anchor[n_inuse], node); + ++n_inuse; + node = node->next; + } + + // finalize stuff ------------------------------------- + /* note: we go to this trouble of maintaining a duplicate of the consolidated | + extent stacks addresses represented as our 'anchor' since these ptrs | + are exposed to a user (um, not that we don't trust 'em or anything). | + plus, we can NULL delimit these ptrs which we couldn't do otherwise. | */ + if (n_saved < n_inuse + 1) { + n_saved = n_inuse + 1; + if (!(info->fetch.results.stacks = realloc(info->fetch.results.stacks, sizeof(void *) * n_saved))) + return -1; + } + memcpy(info->fetch.results.stacks, info->fetch.anchor, sizeof(void *) * n_inuse); + info->fetch.results.stacks[n_inuse] = NULL; + info->fetch.results.total = n_inuse; + + return n_inuse; + #undef n_alloc + #undef n_inuse + #undef n_saved +} // end: diskstats_stacks_fetch + + +static int diskstats_stacks_reconfig_maybe ( + struct ext_support *this, + enum diskstats_item *items, + int numitems) +{ + if (diskstats_items_check_failed(items, numitems)) + return -1; + /* is this the first time or have things changed since we were last called? + if so, gotta' redo all of our stacks stuff ... */ + if (this->numitems != numitems + 1 + || memcmp(this->items, items, sizeof(enum diskstats_item) * numitems)) { + // allow for our DISKSTATS_logical_end + if (!(this->items = realloc(this->items, sizeof(enum diskstats_item) * (numitems + 1)))) + return -1; // here, errno was set to ENOMEM + memcpy(this->items, items, sizeof(enum diskstats_item) * numitems); + this->items[numitems] = DISKSTATS_logical_end; + this->numitems = numitems + 1; + diskstats_extents_free_all(this); + return 1; + } + return 0; +} // end: diskstats_stacks_reconfig_maybe + + +// ___ Public Functions ||||||||||||||||||||||||||||||||||||||||||||||||||||||| + +// --- standard required functions -------------------------------------------- + +/* + * procps_diskstats_new(): + * + * @info: location of returned new structure + * + * Returns: < 0 on failure, 0 on success along with + * a pointer to a new context struct + */ +PROCPS_EXPORT int procps_diskstats_new ( + struct diskstats_info **info) +{ + struct diskstats_info *p; + +#ifdef ITEMTABLE_DEBUG + int i, failed = 0; + for (i = 0; i < MAXTABLE(Item_table); i++) { + if (i != Item_table[i].enumnumb) { + fprintf(stderr, "%s: enum/table error: Item_table[%d] was %s, but its value is %d\n" + , __FILE__, i, Item_table[i].enum2str, Item_table[i].enumnumb); + failed = 1; + } + } + if (failed) _Exit(EXIT_FAILURE); +#endif + + if (info == NULL || *info != NULL) + return -EINVAL; + if (!(p = calloc(1, sizeof(struct diskstats_info)))) + return -ENOMEM; + + p->refcount = 1; + + /* do a priming read here for the following potential benefits: | + 1) ensure there will be no problems with subsequent access | + 2) make delta results potentially useful, even if 1st time | + 3) elimnate need for history distortions 1st time 'switch' | */ + if (diskstats_read_failed(p)) { + procps_diskstats_unref(&p); + return -errno; + } + + *info = p; + return 0; +} // end: procps_diskstats_new + + +PROCPS_EXPORT int procps_diskstats_ref ( + struct diskstats_info *info) +{ + if (info == NULL) + return -EINVAL; + + info->refcount++; + return info->refcount; +} // end: procps_diskstats_ref + + +PROCPS_EXPORT int procps_diskstats_unref ( + struct diskstats_info **info) +{ + struct dev_node *node; + + if (info == NULL || *info == NULL) + return -EINVAL; + + (*info)->refcount--; + + if ((*info)->refcount < 1) { + int errno_sav = errno; + + if ((*info)->diskstats_fp) { + fclose((*info)->diskstats_fp); + (*info)->diskstats_fp = NULL; + } + node = (*info)->nodes; + while (node) { + struct dev_node *p = node; + node = p->next; + free(p); + } + if ((*info)->select_ext.extents) + diskstats_extents_free_all((&(*info)->select_ext)); + if ((*info)->select_ext.items) + free((*info)->select_ext.items); + + if ((*info)->fetch.anchor) + free((*info)->fetch.anchor); + if ((*info)->fetch.results.stacks) + free((*info)->fetch.results.stacks); + + if ((*info)->fetch_ext.extents) + diskstats_extents_free_all(&(*info)->fetch_ext); + if ((*info)->fetch_ext.items) + free((*info)->fetch_ext.items); + + free(*info); + *info = NULL; + + errno = errno_sav; + return 0; + } + return (*info)->refcount; +} // end: procps_diskstats_unref + + +// --- variable interface functions ------------------------------------------- + +PROCPS_EXPORT struct diskstats_result *procps_diskstats_get ( + struct diskstats_info *info, + const char *name, + enum diskstats_item item) +{ + struct dev_node *node; + time_t cur_secs; + + errno = EINVAL; + if (info == NULL) + return NULL; + if (item < 0 || item >= DISKSTATS_logical_end) + return NULL; + errno = 0; + + /* we will NOT read the diskstat file with every call - rather, we'll offer + a granularity of 1 second between reads ... */ + cur_secs = time(NULL); + if (1 <= cur_secs - info->new_stamp) { + if (diskstats_read_failed(info)) + return NULL; + } + + info->get_this.item = item; + // with 'get', we must NOT honor the usual 'noop' guarantee + info->get_this.result.ul_int = 0; + + if (!(node = node_get(info, name))) { + errno = ENXIO; + return NULL; + } + Item_table[item].setsfunc(&info->get_this, node); + + return &info->get_this; +} // end: procps_diskstats_get + + +/* procps_diskstats_reap(): + * + * Harvest all the requested disks information providing + * the result stacks along with the total number of harvested. + * + * Returns: pointer to a diskstats_reaped struct on success, NULL on error. + */ +PROCPS_EXPORT struct diskstats_reaped *procps_diskstats_reap ( + struct diskstats_info *info, + enum diskstats_item *items, + int numitems) +{ + errno = EINVAL; + if (info == NULL || items == NULL) + return NULL; + if (0 > diskstats_stacks_reconfig_maybe(&info->fetch_ext, items, numitems)) + return NULL; // here, errno may be overridden with ENOMEM + errno = 0; + + if (diskstats_read_failed(info)) + return NULL; + if (0 > diskstats_stacks_fetch(info)) + return NULL; + + return &info->fetch.results; +} // end: procps_diskstats_reap + + +/* procps_diskstats_select(): + * + * Obtain all the requested disk/partition information then return + * it in a single library provided results stack. + * + * Returns: pointer to a diskstats_stack struct on success, NULL on error. + */ +PROCPS_EXPORT struct diskstats_stack *procps_diskstats_select ( + struct diskstats_info *info, + const char *name, + enum diskstats_item *items, + int numitems) +{ + struct dev_node *node; + + errno = EINVAL; + if (info == NULL || items == NULL) + return NULL; + if (0 > diskstats_stacks_reconfig_maybe(&info->select_ext, items, numitems)) + return NULL; // here, errno may be overridden with ENOMEM + errno = 0; + + if (!info->select_ext.extents + && (!diskstats_stacks_alloc(&info->select_ext, 1))) + return NULL; + + if (diskstats_read_failed(info)) + return NULL; + if (!(node = node_get(info, name))) { + errno = ENXIO; + return NULL; + } + + diskstats_assign_results(info->select_ext.extents->stacks[0], node); + + return info->select_ext.extents->stacks[0]; +} // end: procps_diskstats_select + + +/* + * procps_diskstats_sort(): + * + * Sort stacks anchored in the passed stack pointers array + * based on the designated sort enumerator and specified order. + * + * Returns those same addresses sorted. + * + * Note: all of the stacks must be homogeneous (of equal length and content). + */ +PROCPS_EXPORT struct diskstats_stack **procps_diskstats_sort ( + struct diskstats_info *info, + struct diskstats_stack *stacks[], + int numstacked, + enum diskstats_item sortitem, + enum diskstats_sort_order order) +{ + struct diskstats_result *p; + struct sort_parms parms; + int offset; + + errno = EINVAL; + if (info == NULL || stacks == NULL) + return NULL; + // a diskstats_item is currently unsigned, but we'll protect our future + if (sortitem < 0 || sortitem >= DISKSTATS_logical_end) + return NULL; + if (order != DISKSTATS_SORT_ASCEND && order != DISKSTATS_SORT_DESCEND) + return NULL; + if (numstacked < 2) + return stacks; + + offset = 0; + p = stacks[0]->head; + for (;;) { + if (p->item == sortitem) + break; + ++offset; + if (p->item >= DISKSTATS_logical_end) + return NULL; + ++p; + } + errno = 0; + + parms.offset = offset; + parms.order = order; + + qsort_r(stacks, numstacked, sizeof(void *), (QSR_t)Item_table[p->item].sortfunc, &parms); + return stacks; +} // end: procps_diskstats_sort + + +// --- special debugging function(s) ------------------------------------------ +/* + * The following isn't part of the normal programming interface. Rather, + * it exists to validate result types referenced in application programs. + * + * It's used only when: + * 1) the 'XTRA_PROCPS_DEBUG' has been defined, or + * 2) an #include of 'xtra-procps-debug.h' is used + */ + +PROCPS_EXPORT struct diskstats_result *xtra_diskstats_get ( + struct diskstats_info *info, + const char *name, + enum diskstats_item actual_enum, + const char *typestr, + const char *file, + int lineno) +{ + struct diskstats_result *r = procps_diskstats_get(info, name, actual_enum); + + if (actual_enum < 0 || actual_enum >= DISKSTATS_logical_end) { + fprintf(stderr, "%s line %d: invalid item = %d, type = %s\n" + , file, lineno, actual_enum, typestr); + } + if (r) { + char *str = Item_table[r->item].type2str; + if (str[0] + && (strcmp(typestr, str))) + fprintf(stderr, "%s line %d: was %s, expected %s\n", file, lineno, typestr, str); + } + return r; +} // end: xtra_diskstats_get_ + + +PROCPS_EXPORT struct diskstats_result *xtra_diskstats_val ( + int relative_enum, + const char *typestr, + const struct diskstats_stack *stack, + struct diskstats_info *info, + const char *file, + int lineno) +{ + char *str; + int i; + + for (i = 0; stack->head[i].item < DISKSTATS_logical_end; i++) + ; + if (relative_enum < 0 || relative_enum >= i) { + fprintf(stderr, "%s line %d: invalid relative_enum = %d, valid range = 0-%d\n" + , file, lineno, relative_enum, i-1); + return NULL; + } + str = Item_table[stack->head[relative_enum].item].type2str; + if (str[0] + && (strcmp(typestr, str))) { + fprintf(stderr, "%s line %d: was %s, expected %s\n", file, lineno, typestr, str); + } + return &stack->head[relative_enum]; + (void)info; +} // end: xtra_diskstats_val diff --git a/library/escape.c b/library/escape.c new file mode 100644 index 0000000..f988672 --- /dev/null +++ b/library/escape.c @@ -0,0 +1,157 @@ +/* + * escape.c - printing handling + * + * Copyright © 2011-2023 Jim Warner + * Copyright © 2016-2023 Craig Small + * Copyright © 1998-2005 Albert Cahalan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include + +#include "escape.h" +#include "readproc.h" +#include "nls.h" + +#define SECURE_ESCAPE_ARGS(dst, bytes) do { \ + if ((bytes) <= 0) return 0; \ + *(dst) = '\0'; \ + if ((bytes) >= INT_MAX) return 0; \ +} while (0) + +static const char UTF_tab[] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00 - 0x0F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x10 - 0x1F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x20 - 0x2F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x30 - 0x3F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40 - 0x4F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x50 - 0x5F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60 - 0x6F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x70 - 0x7F + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, // 0x80 - 0x8F + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, // 0x90 - 0x9F + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, // 0xA0 - 0xAF + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, // 0xB0 - 0xBF + -1,-1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xC0 - 0xCF + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xD0 - 0xDF + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xE0 - 0xEF + 4, 4, 4, 4, 4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, // 0xF0 - 0xFF +}; + +static const unsigned char ESC_tab[] = { + "@..............................." // 0x00 - 0x1F + "||||||||||||||||||||||||||||||||" // 0x20 - 0x3F + "||||||||||||||||||||||||||||||||" // 0x40 - 0x5f + "|||||||||||||||||||||||||||||||." // 0x60 - 0x7F + "????????????????????????????????" // 0x80 - 0x9F + "????????????????????????????????" // 0xA0 - 0xBF + "????????????????????????????????" // 0xC0 - 0xDF + "????????????????????????????????" // 0xE0 - 0xFF +}; + +static inline void esc_all (unsigned char *str) { + unsigned char c; + + // if bad locale/corrupt str, replace non-printing stuff + while (*str) { + if ((c = ESC_tab[*str]) != '|') + *str = c; + ++str; + } +} + +static inline void esc_ctl (unsigned char *str, int len) { + #define setQ { *str = '?'; n = 1; goto next_up; } + int i, n, x; + + for (i = 0; i < len; ) { + n = UTF_tab[*str]; + /* even with a proper locale, strings might be corrupt or we + might encounter one of those 32 unicode multibyte control + characters which begin at U+0080 (0xc280) */ + if (n < 0 || i + n > len + || (*str == 0xc2 && str[1] >= 0x80 && str[1] <= 0x9f)) { + setQ + } + /* let's validate those utf-8 continuation bytes too, all of + which must take the binary form of 10xxxxxx */ + for (x = 1; x < n; x++) { + if (str[x] < 0x80 || str[x] > 0xbf) { + setQ + } + } + // and eliminate those non-printing control characters + if (*str < 0x20 || *str == 0x7f) + *str = '?'; +next_up: + str += n; + i += n; + } + #undef setQ +} + +int escape_str (char *dst, const char *src, int bufsize) { + static __thread int utf_sw = 0; + int n; + + if (utf_sw == 0) { + char *enc = nl_langinfo(CODESET); + utf_sw = enc && strcasecmp(enc, "UTF-8") == 0 ? 1 : -1; + } + SECURE_ESCAPE_ARGS(dst, bufsize); + n = snprintf(dst, bufsize, "%s", src); + if (n < 0) { + *dst = '\0'; + return 0; + } + if (n >= bufsize) n = bufsize-1; + if (utf_sw < 0) + esc_all((unsigned char *)dst); + else + esc_ctl((unsigned char *)dst, n); + return n; +} + +int escape_command (char *outbuf, const proc_t *pp, int bytes, unsigned flags) { + int overhead = 0; + int end = 0; + + if (flags & ESC_BRACKETS) + overhead += 2; + if (flags & ESC_DEFUNCT) { + if (pp->state == 'Z') overhead += 10; // chars in " " + else flags &= ~ESC_DEFUNCT; + } + if (overhead + 1 >= bytes) { + // if no room for even one byte of the command name + outbuf[0] = '\0'; + return 0; + } + if (flags & ESC_BRACKETS) + outbuf[end++] = '['; + end += escape_str(outbuf+end, pp->cmd, bytes-overhead); + // we want "[foo] ", not "[foo ]" + if (flags & ESC_BRACKETS) + outbuf[end++] = ']'; + if (flags & ESC_DEFUNCT) { + memcpy(outbuf+end, " ", 10); + end += 10; + } + outbuf[end] = '\0'; + return end; // bytes, not including the NUL +} diff --git a/library/include/devname.h b/library/include/devname.h new file mode 100644 index 0000000..467cd29 --- /dev/null +++ b/library/include/devname.h @@ -0,0 +1,10 @@ +#ifndef PROC_DEVNAME_H +#define PROC_DEVNAME_H + +#define ABBREV_DEV 1 /* remove /dev/ */ +#define ABBREV_TTY 2 /* remove tty */ +#define ABBREV_PTS 4 /* remove pts/ */ + +unsigned dev_to_tty(char *__restrict ret, unsigned chop, dev_t dev_t_dev, int pid, unsigned int flags); + +#endif diff --git a/library/include/diskstats.h b/library/include/diskstats.h new file mode 100644 index 0000000..d5a4b1f --- /dev/null +++ b/library/include/diskstats.h @@ -0,0 +1,135 @@ +/* + * diskstats.h - disk I/O related declarations for libproc2 + * + * Copyright © 2015-2023 Jim Warner + * Copyright © 2015-2023 Craig Small + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#ifndef PROCPS_DISKSTATS_H +#define PROCPS_DISKSTATS_H + +#ifdef __cplusplus +extern "C" { +#endif + +enum diskstats_item { + DISKSTATS_noop, // ( never altered ) + DISKSTATS_extra, // ( reset to zero ) + // returns origin, see proc(5) + // ------- ------------------- + DISKSTATS_NAME, // str /proc/diskstats + DISKSTATS_TYPE, // s_int " + DISKSTATS_MAJOR, // s_int " + DISKSTATS_MINOR, // s_int " + + DISKSTATS_READS, // ul_int " + DISKSTATS_READS_MERGED, // ul_int " + DISKSTATS_READ_SECTORS, // ul_int " + DISKSTATS_READ_TIME, // ul_int " + DISKSTATS_WRITES, // ul_int " + DISKSTATS_WRITES_MERGED, // ul_int " + DISKSTATS_WRITE_SECTORS, // ul_int " + DISKSTATS_WRITE_TIME, // ul_int " + DISKSTATS_IO_TIME, // ul_int " + DISKSTATS_WEIGHTED_TIME, // ul_int " + + DISKSTATS_IO_INPROGRESS, // s_int " + + DISKSTATS_DELTA_READS, // s_int derived from above + DISKSTATS_DELTA_READS_MERGED, // s_int " + DISKSTATS_DELTA_READ_SECTORS, // s_int " + DISKSTATS_DELTA_READ_TIME, // s_int " + DISKSTATS_DELTA_WRITES, // s_int " + DISKSTATS_DELTA_WRITES_MERGED, // s_int " + DISKSTATS_DELTA_WRITE_SECTORS, // s_int " + DISKSTATS_DELTA_WRITE_TIME, // s_int " + DISKSTATS_DELTA_IO_TIME, // s_int " + DISKSTATS_DELTA_WEIGHTED_TIME // s_int " +}; + +enum diskstats_sort_order { + DISKSTATS_SORT_ASCEND = +1, + DISKSTATS_SORT_DESCEND = -1 +}; + + +struct diskstats_result { + enum diskstats_item item; + union { + signed int s_int; + unsigned long ul_int; + char *str; + } result; +}; + +struct diskstats_stack { + struct diskstats_result *head; +}; + +struct diskstats_reaped { + int total; + struct diskstats_stack **stacks; +}; + +struct diskstats_info; + + +#define DISKSTATS_TYPE_DISK -11111 +#define DISKSTATS_TYPE_PARTITION -22222 + +#define DISKSTATS_GET( info, name, actual_enum, type ) ( { \ + struct diskstats_result *r = procps_diskstats_get( info, name, actual_enum ); \ + r ? r->result . type : 0; } ) + +#define DISKSTATS_VAL( relative_enum, type, stack, info ) \ + stack -> head [ relative_enum ] . result . type + + +int procps_diskstats_new (struct diskstats_info **info); +int procps_diskstats_ref (struct diskstats_info *info); +int procps_diskstats_unref (struct diskstats_info **info); + +struct diskstats_result *procps_diskstats_get ( + struct diskstats_info *info, + const char *name, + enum diskstats_item item); + +struct diskstats_reaped *procps_diskstats_reap ( + struct diskstats_info *info, + enum diskstats_item *items, + int numitems); + +struct diskstats_stack *procps_diskstats_select ( + struct diskstats_info *info, + const char *name, + enum diskstats_item *items, + int numitems); + +struct diskstats_stack **procps_diskstats_sort ( + struct diskstats_info *info, + struct diskstats_stack *stacks[], + int numstacked, + enum diskstats_item sortitem, + enum diskstats_sort_order order); + + +#ifdef XTRA_PROCPS_DEBUG +# include "xtra-procps-debug.h" +#endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/library/include/escape.h b/library/include/escape.h new file mode 100644 index 0000000..1f0b0f9 --- /dev/null +++ b/library/include/escape.h @@ -0,0 +1,35 @@ +/* + * escape.h - printing handling + * + * Copyright © 2011-2023 Jim Warner + * Copyright © 2016-2023 Craig Small + * Copyright © 1998-2005 Albert Cahalan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PROCPS_PROC_ESCAPE_H +#define PROCPS_PROC_ESCAPE_H + +#include "readproc.h" + +#define ESC_BRACKETS 0x2 // if using cmd, put '[' and ']' around it +#define ESC_DEFUNCT 0x4 // mark zombies with " " + +int escape_command (char *outbuf, const proc_t *pp, int bytes, unsigned flags); + +int escape_str (char *dst, const char *src, int bufsize); + +#endif diff --git a/library/include/meminfo.h b/library/include/meminfo.h new file mode 100644 index 0000000..edca8d2 --- /dev/null +++ b/library/include/meminfo.h @@ -0,0 +1,216 @@ +/* + * meminfo.h - memory related declarations for libproc2 + * + * Copyright © 2015-2023 Jim Warner + * Copyright © 2015-2023 Craig Small + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PROCPS_MEMINFO_H +#define PROCPS_MEMINFO_H + +#ifdef __cplusplus +extern "C" { +#endif + +enum meminfo_item { + MEMINFO_noop, // ( never altered ) + MEMINFO_extra, // ( reset to zero ) + /* + note: all of the following values are expressed as KiB + */ + // returns origin, see proc(5) + // ------- ------------------- + MEMINFO_MEM_ACTIVE, // ul_int /proc/meminfo + MEMINFO_MEM_ACTIVE_ANON, // ul_int " + MEMINFO_MEM_ACTIVE_FILE, // ul_int " + MEMINFO_MEM_ANON, // ul_int " + MEMINFO_MEM_AVAILABLE, // ul_int " + MEMINFO_MEM_BOUNCE, // ul_int " + MEMINFO_MEM_BUFFERS, // ul_int " + MEMINFO_MEM_CACHED, // ul_int " + MEMINFO_MEM_CACHED_ALL, // ul_int derived from MEM_CACHED + MEM_SLAB_RECLAIM + MEMINFO_MEM_CMA_FREE, // ul_int /proc/meminfo + MEMINFO_MEM_CMA_TOTAL, // ul_int " + MEMINFO_MEM_COMMITTED_AS, // ul_int " + MEMINFO_MEM_COMMIT_LIMIT, // ul_int " + MEMINFO_MEM_DIRECTMAP_1G, // ul_int " + MEMINFO_MEM_DIRECTMAP_2M, // ul_int " + MEMINFO_MEM_DIRECTMAP_4K, // ul_int " + MEMINFO_MEM_DIRECTMAP_4M, // ul_int " + MEMINFO_MEM_DIRTY, // ul_int " + MEMINFO_MEM_FILE_HUGEPAGES, // ul_int " + MEMINFO_MEM_FILE_PMDMAPPED, // ul_int " + MEMINFO_MEM_FREE, // ul_int " + MEMINFO_MEM_HARD_CORRUPTED, // ul_int " + MEMINFO_MEM_HIGH_FREE, // ul_int " + MEMINFO_MEM_HIGH_TOTAL, // ul_int " + MEMINFO_MEM_HIGH_USED, // ul_int derived from MEM_HIGH_TOTAL - MEM_HIGH_FREE + MEMINFO_MEM_HUGETBL, // ul_int /proc/meminfo + MEMINFO_MEM_HUGE_ANON, // ul_int " + MEMINFO_MEM_HUGE_FREE, // ul_int " + MEMINFO_MEM_HUGE_RSVD, // ul_int " + MEMINFO_MEM_HUGE_SIZE, // ul_int " + MEMINFO_MEM_HUGE_SURPLUS, // ul_int " + MEMINFO_MEM_HUGE_TOTAL, // ul_int " + MEMINFO_MEM_INACTIVE, // ul_int " + MEMINFO_MEM_INACTIVE_ANON, // ul_int " + MEMINFO_MEM_INACTIVE_FILE, // ul_int " + MEMINFO_MEM_KERNEL_RECLAIM, // ul_int " + MEMINFO_MEM_KERNEL_STACK, // ul_int " + MEMINFO_MEM_LOCKED, // ul_int " + MEMINFO_MEM_LOW_FREE, // ul_int " + MEMINFO_MEM_LOW_TOTAL, // ul_int " + MEMINFO_MEM_LOW_USED, // ul_int derived from MEM_LOW_TOTAL - MEM_LOW_FREE + MEMINFO_MEM_MAPPED, // ul_int /proc/meminfo + MEMINFO_MEM_MAP_COPY, // ul_int " + MEMINFO_MEM_NFS_UNSTABLE, // ul_int " + MEMINFO_MEM_PAGE_TABLES, // ul_int " + MEMINFO_MEM_PER_CPU, // ul_int " + MEMINFO_MEM_SHADOWCALLSTACK, // ul_int " + MEMINFO_MEM_SHARED, // ul_int " + MEMINFO_MEM_SHMEM_HUGE, // ul_int " + MEMINFO_MEM_SHMEM_HUGE_MAP, // ul_int " + MEMINFO_MEM_SLAB, // ul_int " + MEMINFO_MEM_SLAB_RECLAIM, // ul_int " + MEMINFO_MEM_SLAB_UNRECLAIM, // ul_int " + MEMINFO_MEM_TOTAL, // ul_int " + MEMINFO_MEM_UNEVICTABLE, // ul_int " + MEMINFO_MEM_USED, // ul_int derived from MEM_TOTAL - MEM_AVAILABLE + MEMINFO_MEM_VM_ALLOC_CHUNK, // ul_int /proc/meminfo + MEMINFO_MEM_VM_ALLOC_TOTAL, // ul_int " + MEMINFO_MEM_VM_ALLOC_USED, // ul_int " + MEMINFO_MEM_WRITEBACK, // ul_int " + MEMINFO_MEM_WRITEBACK_TMP, // ul_int " + + MEMINFO_DELTA_ACTIVE, // s_int derived from above + MEMINFO_DELTA_ACTIVE_ANON, // s_int " + MEMINFO_DELTA_ACTIVE_FILE, // s_int " + MEMINFO_DELTA_ANON, // s_int " + MEMINFO_DELTA_AVAILABLE, // s_int " + MEMINFO_DELTA_BOUNCE, // s_int " + MEMINFO_DELTA_BUFFERS, // s_int " + MEMINFO_DELTA_CACHED, // s_int " + MEMINFO_DELTA_CACHED_ALL, // s_int " + MEMINFO_DELTA_CMA_FREE, // s_int " + MEMINFO_DELTA_CMA_TOTAL, // s_int " + MEMINFO_DELTA_COMMITTED_AS, // s_int " + MEMINFO_DELTA_COMMIT_LIMIT, // s_int " + MEMINFO_DELTA_DIRECTMAP_1G, // s_int " + MEMINFO_DELTA_DIRECTMAP_2M, // s_int " + MEMINFO_DELTA_DIRECTMAP_4K, // s_int " + MEMINFO_DELTA_DIRECTMAP_4M, // s_int " + MEMINFO_DELTA_DIRTY, // s_int " + MEMINFO_DELTA_FILE_HUGEPAGES, // s_int " + MEMINFO_DELTA_FILE_PMDMAPPED, // s_int " + MEMINFO_DELTA_FREE, // s_int " + MEMINFO_DELTA_HARD_CORRUPTED, // s_int " + MEMINFO_DELTA_HIGH_FREE, // s_int " + MEMINFO_DELTA_HIGH_TOTAL, // s_int " + MEMINFO_DELTA_HIGH_USED, // s_int " + MEMINFO_DELTA_HUGETBL, // s_int " + MEMINFO_DELTA_HUGE_ANON, // s_int " + MEMINFO_DELTA_HUGE_FREE, // s_int " + MEMINFO_DELTA_HUGE_RSVD, // s_int " + MEMINFO_DELTA_HUGE_SIZE, // s_int " + MEMINFO_DELTA_HUGE_SURPLUS, // s_int " + MEMINFO_DELTA_HUGE_TOTAL, // s_int " + MEMINFO_DELTA_INACTIVE, // s_int " + MEMINFO_DELTA_INACTIVE_ANON, // s_int " + MEMINFO_DELTA_INACTIVE_FILE, // s_int " + MEMINFO_DELTA_KERNEL_RECLAIM, // s_int " + MEMINFO_DELTA_KERNEL_STACK, // s_int " + MEMINFO_DELTA_LOCKED, // s_int " + MEMINFO_DELTA_LOW_FREE, // s_int " + MEMINFO_DELTA_LOW_TOTAL, // s_int " + MEMINFO_DELTA_LOW_USED, // s_int " + MEMINFO_DELTA_MAPPED, // s_int " + MEMINFO_DELTA_MAP_COPY, // s_int " + MEMINFO_DELTA_NFS_UNSTABLE, // s_int " + MEMINFO_DELTA_PAGE_TABLES, // s_int " + MEMINFO_DELTA_PER_CPU, // s_int " + MEMINFO_DELTA_SHADOWCALLSTACK, // s_int " + MEMINFO_DELTA_SHARED, // s_int " + MEMINFO_DELTA_SHMEM_HUGE, // s_int " + MEMINFO_DELTA_SHMEM_HUGE_MAP, // s_int " + MEMINFO_DELTA_SLAB, // s_int " + MEMINFO_DELTA_SLAB_RECLAIM, // s_int " + MEMINFO_DELTA_SLAB_UNRECLAIM, // s_int " + MEMINFO_DELTA_TOTAL, // s_int " + MEMINFO_DELTA_UNEVICTABLE, // s_int " + MEMINFO_DELTA_USED, // s_int " + MEMINFO_DELTA_VM_ALLOC_CHUNK, // s_int " + MEMINFO_DELTA_VM_ALLOC_TOTAL, // s_int " + MEMINFO_DELTA_VM_ALLOC_USED, // s_int " + MEMINFO_DELTA_WRITEBACK, // s_int " + MEMINFO_DELTA_WRITEBACK_TMP, // s_int " + + MEMINFO_SWAP_CACHED, // ul_int /proc/meminfo + MEMINFO_SWAP_FREE, // ul_int " + MEMINFO_SWAP_TOTAL, // ul_int " + MEMINFO_SWAP_USED, // ul_int derived from SWAP_TOTAL - SWAP_FREE + + MEMINFO_SWAP_DELTA_CACHED, // s_int derived from above + MEMINFO_SWAP_DELTA_FREE, // s_int " + MEMINFO_SWAP_DELTA_TOTAL, // s_int " + MEMINFO_SWAP_DELTA_USED // s_int " +}; + + +struct meminfo_result { + enum meminfo_item item; + union { + signed int s_int; + unsigned long ul_int; + } result; +}; + +struct meminfo_stack { + struct meminfo_result *head; +}; + +struct meminfo_info; + + +#define MEMINFO_GET( info, actual_enum, type ) ( { \ + struct meminfo_result *r = procps_meminfo_get( info, actual_enum ); \ + r ? r->result . type : 0; } ) + +#define MEMINFO_VAL( relative_enum, type, stack, info ) \ + stack -> head [ relative_enum ] . result . type + + +int procps_meminfo_new (struct meminfo_info **info); +int procps_meminfo_ref (struct meminfo_info *info); +int procps_meminfo_unref (struct meminfo_info **info); + +struct meminfo_result *procps_meminfo_get ( + struct meminfo_info *info, + enum meminfo_item item); + +struct meminfo_stack *procps_meminfo_select ( + struct meminfo_info *info, + enum meminfo_item *items, + int numitems); + + +#ifdef XTRA_PROCPS_DEBUG +# include "xtra-procps-debug.h" +#endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/library/include/misc.h b/library/include/misc.h new file mode 100644 index 0000000..bbfa5e2 --- /dev/null +++ b/library/include/misc.h @@ -0,0 +1,90 @@ +/* + * misc.h - miscellaneous declarations for libproc2 + * + * Copyright © 2015-2023 Craig Small + * Copyright © 2021-2023 Jim Warner + * Copyright © 1998-2003 Albert Cahalan + * Copyright © 1992-1998 Michael K. Johnson + * Copyright © 1996 Charles Blake + * Copyright © 1993 J. Cowley + * Copyright © 1995 Martin Schulze + * Copyright © ???? Larry Greenfield + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PROC_MISC_H +#define PROC_MISC_H +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +// ////////////////////////////////////////////////////////////////// +// Platform Particulars ///////////////////////////////////////////// + +long procps_cpu_count (void); +long procps_hertz_get (void); +unsigned int procps_pid_length (void); + + // Convenience macros for composing/decomposing version codes +#define LINUX_VERSION(x,y,z) (0x10000*((x)&0x7fff) + 0x100*((y)&0xff) + ((z)&0xff)) +#define LINUX_VERSION_MAJOR(x) (((x)>>16) & 0xFF) +#define LINUX_VERSION_MINOR(x) (((x)>> 8) & 0xFF) +#define LINUX_VERSION_PATCH(x) ( (x) & 0xFF) + +int procps_linux_version(void); + + +// ////////////////////////////////////////////////////////////////// +// Runtime Particulars ////////////////////////////////////////////// + +int procps_loadavg (double *av1, double *av5, double *av15); +int procps_uptime (double *uptime_secs, double *idle_secs); +char *procps_uptime_sprint (void); +char *procps_uptime_sprint_short (void); + + +// ////////////////////////////////////////////////////////////////// +// Namespace Particulars //////////////////////////////////////////// + +enum namespace_type { + PROCPS_NS_CGROUP, + PROCPS_NS_IPC, + PROCPS_NS_MNT, + PROCPS_NS_NET, + PROCPS_NS_PID, + PROCPS_NS_TIME, + PROCPS_NS_USER, + PROCPS_NS_UTS, + PROCPS_NS_COUNT // total namespaces (fencepost) +}; + +struct procps_ns { + unsigned long ns[PROCPS_NS_COUNT]; +}; + +const char *procps_ns_get_name (const int id); +int procps_ns_get_id (const char *name); +int procps_ns_read_pid (const int pid, struct procps_ns *nsp); + + +#ifdef __cplusplus +} +#endif +#endif diff --git a/library/include/numa.h b/library/include/numa.h new file mode 100644 index 0000000..5a4368b --- /dev/null +++ b/library/include/numa.h @@ -0,0 +1,30 @@ +/* + * NUMA node support for & interfaces + * + * Copyright © 2017-2023 Jim Warner + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PROCPS_NUMA_H +#define PROCPS_NUMA_H + +void numa_init (void); +void numa_uninit (void); + +extern int (*numa_max_node) (void); +extern int (*numa_node_of_cpu) (int); + +#endif diff --git a/library/include/pids.h b/library/include/pids.h new file mode 100644 index 0000000..8245e36 --- /dev/null +++ b/library/include/pids.h @@ -0,0 +1,287 @@ +/* + * pids.h - process related declarations for libproc2 + * + * Copyright © 2015-2023 Jim Warner + * Copyright © 2015-2023 Craig Small + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PROCPS_PIDS_H +#define PROCPS_PIDS_H + +#ifdef __cplusplus +extern "C" { +#endif + +enum pids_item { + PIDS_noop, // ( never altered ) + PIDS_extra, // ( reset to zero ) + // returns origin, see proc(5) + // ------- ------------------- + PIDS_ADDR_CODE_END, // ul_int stat: end_code + PIDS_ADDR_CODE_START, // ul_int stat: start_code + PIDS_ADDR_CURR_EIP, // ul_int stat: eip + PIDS_ADDR_CURR_ESP, // ul_int stat: esp + PIDS_ADDR_STACK_START, // ul_int stat: start_stack + PIDS_AUTOGRP_ID, // s_int autogroup + PIDS_AUTOGRP_NICE, // s_int autogroup + PIDS_CGNAME, // str derived from CGROUP ':name=' + PIDS_CGROUP, // str cgroup + PIDS_CGROUP_V, // strv cgroup, as *str[] + PIDS_CMD, // str stat: comm or status: Name + PIDS_CMDLINE, // str cmdline + PIDS_CMDLINE_V, // strv cmdline, as *str[] + PIDS_ENVIRON, // str environ + PIDS_ENVIRON_V, // strv environ, as *str[] + PIDS_EXE, // str exe + PIDS_EXIT_SIGNAL, // s_int stat: exit_signal + PIDS_FLAGS, // ul_int stat: flags + PIDS_FLT_MAJ, // ul_int stat: maj_flt + PIDS_FLT_MAJ_C, // ul_int derived from stat: maj_flt + cmaj_flt + PIDS_FLT_MAJ_DELTA, // s_int derived from FLT_MAJ + PIDS_FLT_MIN, // ul_int stat: min_flt + PIDS_FLT_MIN_C, // ul_int derived from stat: min_flt + cmin_flt + PIDS_FLT_MIN_DELTA, // s_int derived from FLT_MIN + PIDS_ID_EGID, // u_int status: Gid + PIDS_ID_EGROUP, // str derived from EGID, see getgrgid(3) + PIDS_ID_EUID, // u_int status: Uid + PIDS_ID_EUSER, // str derived from EUID, see getpwuid(3) + PIDS_ID_FGID, // u_int status: Gid + PIDS_ID_FGROUP, // str derived from FGID, see getgrgid(3) + PIDS_ID_FUID, // u_int status: Uid + PIDS_ID_FUSER, // str derived from FUID, see getpwuid(3) + PIDS_ID_LOGIN, // s_int loginuid + PIDS_ID_PGRP, // s_int stat: pgrp + PIDS_ID_PID, // s_int from /proc/ + PIDS_ID_PPID, // s_int stat: ppid or status: PPid + PIDS_ID_RGID, // u_int status: Gid + PIDS_ID_RGROUP, // str derived from RGID, see getgrgid(3) + PIDS_ID_RUID, // u_int status: Uid + PIDS_ID_RUSER, // str derived from RUID, see getpwuid(3) + PIDS_ID_SESSION, // s_int stat: sid + PIDS_ID_SGID, // u_int status: Gid + PIDS_ID_SGROUP, // str derived from SGID, see getgrgid(3) + PIDS_ID_SUID, // u_int status: Uid + PIDS_ID_SUSER, // str derived from SUID, see getpwuid(3) + PIDS_ID_TGID, // s_int status: Tgid + PIDS_ID_TID, // s_int from /proc//task/ + PIDS_ID_TPGID, // s_int stat: tty_pgrp + PIDS_IO_READ_BYTES, // ul_int io: read_bytes + PIDS_IO_READ_CHARS, // ul_int io: rchar + PIDS_IO_READ_OPS, // ul_int io: syscr + PIDS_IO_WRITE_BYTES, // ul_int io: write_bytes + PIDS_IO_WRITE_CBYTES, // ul_int io: cancelled_write_bytes + PIDS_IO_WRITE_CHARS, // ul_int io: wchar + PIDS_IO_WRITE_OPS, // ul_int io: syscw + PIDS_LXCNAME, // str derived from CGROUP 'lxc.payload' + PIDS_MEM_CODE, // ul_int derived from MEM_CODE_PGS, as KiB + PIDS_MEM_CODE_PGS, // ul_int statm: trs + PIDS_MEM_DATA, // ul_int derived from MEM_DATA_PGS, as KiB + PIDS_MEM_DATA_PGS, // ul_int statm: drs + PIDS_MEM_RES, // ul_int derived from MEM_RES_PGS, as KiB + PIDS_MEM_RES_PGS, // ul_int statm: resident + PIDS_MEM_SHR, // ul_int derived from MEM_SHR_PGS, as KiB + PIDS_MEM_SHR_PGS, // ul_int statm: shared + PIDS_MEM_VIRT, // ul_int derived from MEM_VIRT_PGS, as KiB + PIDS_MEM_VIRT_PGS, // ul_int statm: size + PIDS_NICE, // s_int stat: nice + PIDS_NLWP, // s_int stat: num_threads or status: Threads + PIDS_NS_CGROUP, // ul_int ns/ + PIDS_NS_IPC, // ul_int " + PIDS_NS_MNT, // ul_int " + PIDS_NS_NET, // ul_int " + PIDS_NS_PID, // ul_int " + PIDS_NS_TIME, // ul_int " + PIDS_NS_USER, // ul_int " + PIDS_NS_UTS, // ul_int " + PIDS_OOM_ADJ, // s_int oom_score_adj + PIDS_OOM_SCORE, // s_int oom_score + PIDS_PRIORITY, // s_int stat: priority + PIDS_PRIORITY_RT, // s_int stat: rt_priority + PIDS_PROCESSOR, // s_int stat: task_cpu + PIDS_PROCESSOR_NODE, // s_int derived from PROCESSOR, see numa(3) + PIDS_RSS, // ul_int stat: rss + PIDS_RSS_RLIM, // ul_int stat: rsslim + PIDS_SCHED_CLASS, // s_int stat: policy + PIDS_SD_MACH, // str derived from PID/TID, see sd-login(3) + PIDS_SD_OUID, // str " + PIDS_SD_SEAT, // str " + PIDS_SD_SESS, // str " + PIDS_SD_SLICE, // str " + PIDS_SD_UNIT, // str " + PIDS_SD_UUNIT, // str " + PIDS_SIGBLOCKED, // str status: SigBlk + PIDS_SIGCATCH, // str status: SigCgt + PIDS_SIGIGNORE, // str status: SigIgn + PIDS_SIGNALS, // str status: ShdPnd + PIDS_SIGPENDING, // str status: SigPnd + PIDS_SMAP_ANONYMOUS, // ul_int smaps_rollup: Anonymous + PIDS_SMAP_HUGE_ANON, // ul_int smaps_rollup: AnonHugePages + PIDS_SMAP_HUGE_FILE, // ul_int smaps_rollup: FilePmdMapped + PIDS_SMAP_HUGE_SHMEM, // ul_int smaps_rollup: ShmemPmdMapped + PIDS_SMAP_HUGE_TLBPRV, // ul_int smaps_rollup: Private_Hugetlb + PIDS_SMAP_HUGE_TLBSHR, // ul_int smaps_rollup: Shared_Hugetlb + PIDS_SMAP_LAZY_FREE, // ul_int smaps_rollup: LazyFree + PIDS_SMAP_LOCKED, // ul_int smaps_rollup: Locked + PIDS_SMAP_PRV_CLEAN, // ul_int smaps_rollup: Private_Clean + PIDS_SMAP_PRV_DIRTY, // ul_int smaps_rollup: Private_Dirty + PIDS_SMAP_PRV_TOTAL, // ul_int derived from SMAP_PRV_CLEAN + SMAP_PRV_DIRTY + PIDS_SMAP_PSS, // ul_int smaps_rollup: Pss + PIDS_SMAP_PSS_ANON, // ul_int smaps_rollup: Pss_Anon + PIDS_SMAP_PSS_FILE, // ul_int smaps_rollup: Pss_File + PIDS_SMAP_PSS_SHMEM, // ul_int smaps_rollup: Pss_Shmem + PIDS_SMAP_REFERENCED, // ul_int smaps_rollup: Referenced + PIDS_SMAP_RSS, // ul_int smaps_rollup: Rss + PIDS_SMAP_SHR_CLEAN, // ul_int smaps_rollup: Shared_Clean + PIDS_SMAP_SHR_DIRTY, // ul_int smaps_rollup: Shared_Dirty + PIDS_SMAP_SWAP, // ul_int smaps_rollup: Swap + PIDS_SMAP_SWAP_PSS, // ul_int smaps_rollup: SwapPss + PIDS_STATE, // s_ch stat: state or status: State + PIDS_SUPGIDS, // str status: Groups + PIDS_SUPGROUPS, // str derived from SUPGIDS, see getgrgid(3) + PIDS_TICS_ALL, // ull_int derived from stat: stime + utime + PIDS_TICS_ALL_C, // ull_int derived from stat: stime + utime + cstime + cutime + PIDS_TICS_ALL_DELTA, // u_int derived from TICS_ALL + PIDS_TICS_BEGAN, // ull_int stat: start_time + PIDS_TICS_BLKIO, // ull_int stat: blkio_ticks + PIDS_TICS_GUEST, // ull_int stat: gtime + PIDS_TICS_GUEST_C, // ull_int derived from stat: gtime + cgtime + PIDS_TICS_SYSTEM, // ull_int stat: stime + PIDS_TICS_SYSTEM_C, // ull_int derived from stat: stime + cstime + PIDS_TICS_USER, // ull_int stat: utime + PIDS_TICS_USER_C, // ull_int derived from stat: utime + cutime + PIDS_TIME_ALL, // real * derived from stat: (utime + stime) / hertz + PIDS_TIME_ALL_C, // real * derived from stat: (utime + stime + cutime + cstime) / hertz + PIDS_TIME_ELAPSED, // real * derived from stat: (/proc/uptime - start_time) / hertz + PIDS_TIME_START, // real * derived from stat: start_time / hertz + PIDS_TTY, // s_int stat: tty_nr + PIDS_TTY_NAME, // str derived from TTY + PIDS_TTY_NUMBER, // str derived from TTY as str + PIDS_UTILIZATION, // real derived from TIME_ALL / TIME_ELAPSED, as percentage + PIDS_UTILIZATION_C, // real derived from TIME_ALL_C / TIME_ELAPSED, as percentage + PIDS_VM_DATA, // ul_int status: VmData + PIDS_VM_EXE, // ul_int status: VmExe + PIDS_VM_LIB, // ul_int status: VmLib + PIDS_VM_RSS, // ul_int status: VmRSS + PIDS_VM_RSS_ANON, // ul_int status: RssAnon + PIDS_VM_RSS_FILE, // ul_int status: RssFile + PIDS_VM_RSS_LOCKED, // ul_int status: VmLck + PIDS_VM_RSS_SHARED, // ul_int status: RssShmem + PIDS_VM_SIZE, // ul_int status: VmSize + PIDS_VM_STACK, // ul_int status: VmStk + PIDS_VM_SWAP, // ul_int status: VmSwap + PIDS_VM_USED, // ul_int derived from status: VmRSS + VmSwap + PIDS_VSIZE_BYTES, // ul_int stat: vsize + PIDS_WCHAN_NAME // str wchan +}; + // * while these are all expressed as seconds, each can be + // converted into tics/jiffies with no loss of precision + // when multiplied by hertz obtained via procps_misc(3). +enum pids_fetch_type { + PIDS_FETCH_TASKS_ONLY, + PIDS_FETCH_THREADS_TOO +}; + +enum pids_select_type { + PIDS_SELECT_PID = 0x10000, + PIDS_SELECT_PID_THREADS = 0x10001, + PIDS_SELECT_UID = 0x20000, + PIDS_SELECT_UID_THREADS = 0x20001 +}; + +enum pids_sort_order { + PIDS_SORT_ASCEND = +1, + PIDS_SORT_DESCEND = -1 +}; + + +struct pids_result { + enum pids_item item; + union { + signed char s_ch; + signed int s_int; + unsigned int u_int; + unsigned long ul_int; + unsigned long long ull_int; + char *str; + char **strv; + double real; + } result; +}; + +struct pids_stack { + struct pids_result *head; +}; + +struct pids_counts { + int total; + int running, sleeping, stopped, zombied, other; +}; + +struct pids_fetch { + struct pids_counts *counts; + struct pids_stack **stacks; +}; + +struct pids_info; + + +#define PIDS_VAL( relative_enum, type, stack, info ) \ + stack -> head [ relative_enum ] . result . type + + +int procps_pids_new (struct pids_info **info, enum pids_item *items, int numitems); +int procps_pids_ref (struct pids_info *info); +int procps_pids_unref (struct pids_info **info); + +struct pids_stack *fatal_proc_unmounted ( + struct pids_info *info, + int return_self); + +struct pids_stack *procps_pids_get ( + struct pids_info *info, + enum pids_fetch_type which); + +struct pids_fetch *procps_pids_reap ( + struct pids_info *info, + enum pids_fetch_type which); + +int procps_pids_reset ( + struct pids_info *info, + enum pids_item *newitems, + int newnumitems); + +struct pids_fetch *procps_pids_select ( + struct pids_info *info, + unsigned *these, + int numthese, + enum pids_select_type which); + +struct pids_stack **procps_pids_sort ( + struct pids_info *info, + struct pids_stack *stacks[], + int numstacked, + enum pids_item sortitem, + enum pids_sort_order order); + + +#ifdef XTRA_PROCPS_DEBUG +# include "xtra-procps-debug.h" +#endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/library/include/procps-private.h b/library/include/procps-private.h new file mode 100644 index 0000000..835ea21 --- /dev/null +++ b/library/include/procps-private.h @@ -0,0 +1,28 @@ +/* + * libprocps - Library to read proc filesystem + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#ifndef PROCPS_PRIVATE_H +#define PROCPS_PRIVATE_H + +#define PROCPS_EXPORT __attribute__ ((visibility("default"))) + +#define STRINGIFY_ARG(a) #a +#define STRINGIFY(a) STRINGIFY_ARG(a) + +#define MAXTABLE(t) (int)(sizeof(t) / sizeof(t[0])) + +#endif diff --git a/library/include/pwcache.h b/library/include/pwcache.h new file mode 100644 index 0000000..524a2af --- /dev/null +++ b/library/include/pwcache.h @@ -0,0 +1,38 @@ +/* + * pwcache.c - memory cache passwd file handling + * + * Copyright © 2011-2023 Jim Warner + * Copyright © 2015-2023 Craig Small + * Copyright © 2002 Albert Cahalan + * + * Older version: + * Copyright © 1992-1998 Michael K. Johnson + * Note: most likely none of his code remains + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PROCPS_PROC_PWCACHE_H +#define PROCPS_PROC_PWCACHE_H + +#include + +// used in pwcache and in readproc to set size of username or groupname +#define P_G_SZ 33 + +char *pwcache_get_user(uid_t uid); +char *pwcache_get_group(gid_t gid); + +#endif diff --git a/library/include/readproc.h b/library/include/readproc.h new file mode 100644 index 0000000..33c630e --- /dev/null +++ b/library/include/readproc.h @@ -0,0 +1,303 @@ +/* + * readproc - interface to process table + * + * Copyright © 2002-2023 Craig Small + * Copyright © 2011-2023 Jim Warner + * Copyright © 1998-2010 Albert Cahalan + * Copyright © 1998 Michael K. Johnson + * Copyright © 1996 Charles L. Blake. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PROCPS_PROC_READPROC_H +#define PROCPS_PROC_READPROC_H + +#include +#include +#include +#include "misc.h" + +// the following is development only, forcing display of "[ duplicate ENUM ]" strings +// #define FALSE_THREADS /* set most child string fields to NULL */ + + +// This is to help document a transition from pid to tgid/tid caused +// by the introduction of thread support. It is used in cases where +// neither tgid nor tid seemed correct. (in other words, FIXME) +#define XXXID tid + +// Basic data structure which holds all information we can get about a process. +// (unless otherwise specified, fields are read from /proc/#/stat) +// +// Most of it comes from task_struct in linux/sched.h +// +typedef struct proc_t { + int + tid, // (special) task id, the POSIX thread ID (see also: tgid) + ppid; // stat,status pid of parent process + char + state, // stat,status single-char code for process state (S=sleeping) + pad_1, // n/a padding + pad_2, // n/a padding + pad_3; // n/a padding + unsigned long long + utime, // stat user-mode CPU time accumulated by process + stime, // stat kernel-mode CPU time accumulated by process + cutime, // stat cumulative utime of process and reaped children + cstime, // stat cumulative stime of process and reaped children + start_time, // stat start time of process -- seconds since system boot + blkio_tics, // stat time spent waiting for block IO + gtime, // stat guest time of the task in jiffies + cgtime; // stat guest time of the task children in jiffies + int // next 3 fields are NOT filled in by readproc + pcpu, // stat (special) elapsed tics for %CPU usage calculation + maj_delta, // stat (special) major page faults since last update + min_delta; // stat (special) minor page faults since last update + char + // Linux 2.1.7x and up have 64 signals. Allow 64, plus '\0' and padding. + signal[18], // status mask of pending signals + blocked[18], // status mask of blocked signals + sigignore[18], // status mask of ignored signals + sigcatch[18], // status mask of caught signals + _sigpnd[18]; // status mask of PER TASK pending signals + unsigned long + start_code, // stat address of beginning of code segment + end_code, // stat address of end of code segment + start_stack, // stat address of the bottom of stack for the process + kstk_esp, // stat kernel stack pointer + kstk_eip, // stat kernel instruction pointer + wchan, // stat (special) address of kernel wait channel proc is sleeping in + rss, // stat identical to 'resident' + alarm; // stat ? + int + priority, // stat kernel scheduling priority + nice; // stat standard unix nice level of process + unsigned long + // the next 7 members come from /proc/#/statm + size, // statm total virtual memory (as # pages) + resident, // statm resident non-swapped memory (as # pages) + share, // statm shared (mmap'd) memory (as # pages) + trs, // statm text (exe) resident set (as # pages) + lrs, // statm library resident set (always 0 w/ 2.6) + drs, // statm data+stack resident set (as # pages) + dt; // statm dirty pages (always 0 w/ 2.6) + unsigned long + vm_size, // status equals 'size' (as kb) + vm_lock, // status locked pages (as kb) + vm_rss, // status equals 'rss' and/or 'resident' (as kb) + vm_rss_anon, // status the 'anonymous' portion of vm_rss (as kb) + vm_rss_file, // status the 'file-backed' portion of vm_rss (as kb) + vm_rss_shared, // status the 'shared' portion of vm_rss (as kb) + vm_data, // status data only size (as kb) + vm_stack, // status stack only size (as kb) + vm_swap, // status based on linux-2.6.34 "swap ents" (as kb) + vm_exe, // status equals 'trs' (as kb) + vm_lib, // status total, not just used, library pages (as kb) + vsize, // stat number of pages of virtual memory ... + rss_rlim, // stat resident set size limit? + flags, // stat kernel flags for the process + min_flt, // stat number of minor page faults since process start + maj_flt, // stat number of major page faults since process start + cmin_flt, // stat cumulative min_flt of process and child processes + cmaj_flt, // stat cumulative maj_flt of process and child processes + rchar, // io characters read + wchar, // io characters written + syscr, // io number of read I/O operations + syscw, // io number of write I/O operations + read_bytes, // io number of bytes fetched from the storage layer + write_bytes, // io number of bytes sent to the storage layer + cancelled_write_bytes, // io number of bytes truncating pagecache + smap_Rss, // smaps_rollup mapping currently resident in RAM + smap_Pss, // " Rss divided by total processes sharing it + smap_Pss_Anon, // " proportional share of 'anonymous' memory + smap_Pss_File, // " proportional share of 'file' memory + smap_Pss_Shmem, // " proportional share of 'shmem' memory + smap_Shared_Clean, // " unmodified shared memory + smap_Shared_Dirty, // " altered shared memory + smap_Private_Clean, // " unmodified private memory + smap_Private_Dirty, // " altered private memory + smap_Referenced, // " memory marked as referenced/accessed + smap_Anonymous, // " memory not belonging to any file + smap_LazyFree, // " memory marked by madvise(MADV_FREE) + smap_AnonHugePages, // " memory backed by transparent huge pages + smap_ShmemPmdMapped, // " shmem/tmpfs memory backed by huge pages + smap_FilePmdMapped, // " file memory backed by huge pages + smap_Shared_Hugetlb, // " hugetlbfs backed memory *not* counted in Rss/Pss + smap_Private_Hugetlb, // " hugetlbfs backed memory *not* counted in Rss/Pss + smap_Swap, // " swapped would-be-anonymous memory (includes swapped out shmem) + smap_SwapPss, // " the proportional share of 'Swap' (excludes swapped out shmem) + smap_Locked; // " memory amount locked to RAM + char + *environ, // (special) environment as string (/proc/#/environ) + *cmdline, // (special) command line as string (/proc/#/cmdline) + *cgroup, // (special) cgroup as string (/proc/#/cgroup) + *cgname, // (special) name portion of above (if possible) + *supgid, // status supplementary gids as comma delimited str + *supgrp, // supp grp names as comma delimited str, derived from supgid + **environ_v, // (special) environment string vectors (/proc/#/environ) + **cmdline_v, // (special) command line string vectors (/proc/#/cmdline) + **cgroup_v; // (special) cgroup string vectors (/proc/#/cgroup) + char + *euser, // stat(),status effective user name + *ruser, // status real user name + *suser, // status saved user name + *fuser, // status filesystem user name + *rgroup, // status real group name + *egroup, // status effective group name + *sgroup, // status saved group name + *fgroup, // status filesystem group name + *cmd; // stat,status basename of executable file in call to exec(2) + int + rtprio, // stat real-time priority + sched, // stat scheduling class + pgrp, // stat process group id + session, // stat session id + nlwp, // stat,status number of threads, or 0 if no clue + tgid, // (special) thread group ID, the POSIX PID (see also: tid) + tty; // stat full device number of controlling terminal + /* FIXME: int uids & gids should be uid_t or gid_t from pwd.h */ + uid_t euid; gid_t egid; // stat(),status effective + uid_t ruid; gid_t rgid; // status real + uid_t suid; gid_t sgid; // status saved + uid_t fuid; gid_t fgid; // status fs (used for file access only) + int + tpgid, // stat terminal process group id + exit_signal, // stat might not be SIGCHLD + processor; // stat current (or most recent?) CPU + int + oom_score, // oom_score (badness for OOM killer) + oom_adj; // oom_adj (adjustment to OOM score) + struct procps_ns ns; // (ns subdir) inode number of namespaces + char + *sd_mach, // n/a systemd vm/container name + *sd_ouid, // n/a systemd session owner uid + *sd_seat, // n/a systemd login session seat + *sd_sess, // n/a systemd login session id + *sd_slice, // n/a systemd slice unit + *sd_unit, // n/a systemd system unit id + *sd_uunit; // n/a systemd user unit id + char + *lxcname, // n/a lxc container name + *exe; // exe executable path + name + int + luid, // loginuid user id at login + autogrp_id, // autogroup autogroup number (id) + autogrp_nice; // autogroup autogroup nice value +} proc_t; + +// PROCTAB: data structure holding the persistent information readproc needs +// from openproc(). The setup is intentionally similar to the dirent interface +// and other system table interfaces (utmp+wtmp come to mind). + +#define PROCPATHLEN 64 // must hold /proc/2000222000/task/2000222000/cmdline + +typedef struct PROCTAB { + DIR *procfs; +// char deBug0[64]; + DIR *taskdir; // for threads +// char deBug1[64]; + pid_t taskdir_user; // for threads + int(*finder)(struct PROCTAB *__restrict const, proc_t *__restrict const); + proc_t*(*reader)(struct PROCTAB *__restrict const, proc_t *__restrict const); + int(*taskfinder)(struct PROCTAB *__restrict const, const proc_t *__restrict const, proc_t *__restrict const, char *__restrict const); + proc_t*(*taskreader)(struct PROCTAB *__restrict const, proc_t *__restrict const, char *__restrict const); + pid_t *pids; // pids of the procs + uid_t *uids; // uids of procs + int nuid; // cannot really sentinel-terminate unsigned short[] + int i; // generic + int hide_kernel; // getenv LIBPROC_HIDE_KERNEL was set + unsigned flags; + unsigned u; // generic + void * vp; // generic + char path[PROCPATHLEN]; // must hold /proc/2000222000/task/2000222000/cmdline + unsigned pathlen; // length of string in the above (w/o '\0') +} PROCTAB; + + +// openproc/readproctab: +// +// Return PROCTAB* / *proc_t[] or NULL on error ((probably) "/proc" cannot be +// opened.) By default readproc will consider all processes as valid to parse +// and return, but not actually fill in the cmdline, environ, and /proc/#/statm +// derived memory fields. +// +// `flags' (a bitwise-or of PROC_* below) modifies the default behavior. The +// "fill" options will cause more of the proc_t to be filled in. The "filter" +// options all use the second argument as the pointer to a list of objects: +// process status', process id's, user id's. The third +// argument is the length of the list (currently only used for lists of user +// id's since uid_t supports no convenient termination sentinel.) + +#define PROC_FILLMEM 0x00000001 // read statm +#define PROC_FILLARG 0x00000002 // alloc and fill in `cmdline' vectors +#define PROC_FILLENV 0x00000004 // alloc and fill in `environ' vectors +#define PROC_FILLUSR 0x00000008 // resolve user id number -> user name +#define PROC_FILLGRP 0x00000010 // resolve group id number -> group name +#define PROC_FILLSTATUS 0x00000020 // read status +#define PROC_FILLSTAT 0x00000040 // read stat +#define PROC_FILLCGROUP 0x00000080 // alloc and fill in `cgroup` vectors +#define PROC_FILLOOM 0x00000100 // fill in proc_t oom_score and oom_adj +#define PROC_FILLNS 0x00000200 // fill in proc_t namespace information +#define PROC_FILLSYSTEMD 0x00000400 // fill in proc_t systemd information +#define PROC_FILL_LXC 0x00000800 // fill in proc_t lxcname, if possible +#define PROC_FILL_LUID 0x00001000 // fill in proc_t luid (login user id) +#define PROC_FILL_EXE 0x00002000 // fill in proc_t exe path + pgm name +#define PROC_FILLIO 0x00004000 // fill in proc_t io information +#define PROC_FILLSMAPS 0x00008000 // fill in proc_t smaps_rollup stuff + +// consider only processes with one of the passed: +#define PROC_PID 0x00010000 // process id numbers ( 0 terminated ) +#define PROC_UID 0x00020000 // user id numbers ( length needed ) +// Note: the above 2 values must NOT change without also changing pids.h !!! + +#define PROC_EDITCGRPCVT 0x00040000 // edit `cgroup' as regular string +#define PROC_EDITCMDLCVT 0x00080000 // edit `cmdline' as regular string +#define PROC_EDITENVRCVT 0x00100000 // edit `environ' as regular string + +// these three also require the PROC_FILLSTATUS flage +#define PROC_FILL_OUSERS ( 0x00200000 | PROC_FILLSTATUS ) // obtain other user names +#define PROC_FILL_OGROUPS ( 0x00400000 | PROC_FILLSTATUS ) // obtain other group names +#define PROC_FILL_SUPGRP ( 0x00800000 | PROC_FILLSTATUS ) // obtain supplementary group names + +// and let's put new flags here ... +#define PROC_FILLAUTOGRP 0x01000000 // fill in proc_t autogroup stuff + +// it helps to give app code a few spare bits +#define PROC_SPARE_1 0x10000000 +#define PROC_SPARE_2 0x20000000 +#define PROC_SPARE_3 0x40000000 +#define PROC_SPARE_4 0x80000000 + +// Function definitions +// Initialize a PROCTAB structure holding needed call-to-call persistent data +PROCTAB *openproc(unsigned flags, ... /* pid_t *| uid_t *| dev_t *| char *[, int n] */ ); +// Retrieve the next process or task matching the criteria set by the openproc(). +// +// Note: When NULL is used as the readproc 'p' or readeither 'x' +// parameter, the library will allocate the necessary proc_t storage. +// +// Alternatively, you may provide your own reuseable buffer address +// in which case that buffer *MUST* be initialized to zero one time +// only before first use. Thereafter, the library will manage such +// a passed proc_t, freeing any additional acquired memory associated +// with the previous process or thread. +proc_t *readproc(PROCTAB *__restrict const PT, proc_t *__restrict p); +proc_t *readeither(PROCTAB *__restrict const PT, proc_t *__restrict x); +int look_up_our_self(void); +void closeproc(PROCTAB *PT); +char **vectorize_this_str(const char *src); + +#endif diff --git a/library/include/slabinfo.h b/library/include/slabinfo.h new file mode 100644 index 0000000..f63ca79 --- /dev/null +++ b/library/include/slabinfo.h @@ -0,0 +1,140 @@ +/* + * slabinfo.h - slab pools related declarations for libproc2 + * + * Copyright © 2015-2023 Jim Warner + * Copyright © 2015-2023 Craig Small + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PROCPS_SLABINFO_H +#define PROCPS_SLABINFO_H + +#ifdef __cplusplus +extern "C "{ +#endif + +enum slabinfo_item { + SLABINFO_noop, // ( never altered ) + SLABINFO_extra, // ( reset to zero ) + // returns origin, see proc(5) + // ------- ------------------- + SLAB_NAME, // str /proc/slabinfo + SLAB_NUM_OBJS, // u_int " + SLAB_ACTIVE_OBJS, // u_int " + SLAB_OBJ_SIZE, // u_int " + SLAB_OBJ_PER_SLAB, // u_int " + SLAB_NUMS_SLABS, // u_int " + SLAB_ACTIVE_SLABS, // u_int " + SLAB_PAGES_PER_SLAB, // u_int " + SLAB_PERCENT_USED, // u_int derived from ACTIVE_OBJS / NUM_OBJS + SLAB_SIZE_TOTAL, // ul_int derived from page size * NUMS_SLABS * PAGES_PER_SLAB + + SLABS_CACHES_TOTAL, // u_int derived from all caches + SLABS_CACHES_ACTIVE, // u_int " + SLABS_NUM_OBJS, // u_int " + SLABS_ACTIVE_OBJS, // u_int " + SLABS_OBJ_SIZE_AVG, // u_int " + SLABS_OBJ_SIZE_MIN, // u_int " + SLABS_OBJ_SIZE_MAX, // u_int " + SLABS_NUMS_SLABS, // u_int " + SLABS_ACTIVE_SLABS, // u_int " + SLABS_PAGES_TOTAL, // u_int " + SLABS_SIZE_ACTIVE, // ul_int " + SLABS_SIZE_TOTAL, // ul_int " + + SLABS_DELTA_CACHES_TOTAL, // s_int derived from above + SLABS_DELTA_CACHES_ACTIVE, // s_int " + SLABS_DELTA_NUM_OBJS, // s_int " + SLABS_DELTA_ACTIVE_OBJS, // s_int " + SLABS_DELTA_OBJ_SIZE_AVG, // s_int " + SLABS_DELTA_OBJ_SIZE_MIN, // s_int " + SLABS_DELTA_OBJ_SIZE_MAX, // s_int " + SLABS_DELTA_NUMS_SLABS, // s_int " + SLABS_DELTA_ACTIVE_SLABS, // s_int " + SLABS_DELTA_PAGES_TOTAL, // s_int " + SLABS_DELTA_SIZE_ACTIVE, // s_int " + SLABS_DELTA_SIZE_TOTAL // s_int " +}; + +enum slabinfo_sort_order { + SLABINFO_SORT_ASCEND = +1, + SLABINFO_SORT_DESCEND = -1 +}; + + +struct slabinfo_result { + enum slabinfo_item item; + union { + signed int s_int; + unsigned int u_int; + unsigned long ul_int; + char *str; + } result; +}; + +struct slabinfo_stack { + struct slabinfo_result *head; +}; + +struct slabinfo_reaped { + int total; + struct slabinfo_stack **stacks; +}; + +struct slabinfo_info; + + +#define SLABINFO_GET( info, actual_enum, type ) ( { \ + struct slabinfo_result *r = procps_slabinfo_get( info, actual_enum ); \ + r ? r->result . type : 0; } ) + +#define SLABINFO_VAL( relative_enum, type, stack, info ) \ + stack -> head [ relative_enum ] . result . type + + +int procps_slabinfo_new (struct slabinfo_info **info); +int procps_slabinfo_ref (struct slabinfo_info *info); +int procps_slabinfo_unref (struct slabinfo_info **info); + +struct slabinfo_result *procps_slabinfo_get ( + struct slabinfo_info *info, + enum slabinfo_item item); + +struct slabinfo_reaped *procps_slabinfo_reap ( + struct slabinfo_info *info, + enum slabinfo_item *items, + int numitems); + +struct slabinfo_stack *procps_slabinfo_select ( + struct slabinfo_info *info, + enum slabinfo_item *items, + int numitems); + +struct slabinfo_stack **procps_slabinfo_sort ( + struct slabinfo_info *info, + struct slabinfo_stack *stacks[], + int numstacked, + enum slabinfo_item sortitem, + enum slabinfo_sort_order order); + + +#ifdef XTRA_PROCPS_DEBUG +# include "xtra-procps-debug.h" +#endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/library/include/stat.h b/library/include/stat.h new file mode 100644 index 0000000..7adefa6 --- /dev/null +++ b/library/include/stat.h @@ -0,0 +1,175 @@ +/* + * stat.h - cpu/numa related declarations for libproc2 + * + * Copyright © 2015-2023 Jim Warner + * Copyright © 2015-2023 Craig Small + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PROCPS_STAT_H +#define PROCPS_STAT_H + +#ifdef __cplusplus +extern "C" { +#endif + +enum stat_item { + STAT_noop, // ( never altered ) + STAT_extra, // ( reset to zero ) + // returns origin, see proc(5) + // ------- ------------------- + STAT_TIC_ID, // s_int /proc/stat, cpu or numa node id + STAT_TIC_ID_CORE, // s_int /proc/cpuinfo: 'core id', -1 = n/a + STAT_TIC_NUMA_NODE, // s_int [ CPU ID based, see: numa(3) ] + STAT_TIC_NUM_CONTRIBUTORS, // s_int [ total CPUs contributing to TIC counts ] + STAT_TIC_TYPE_CORE, // s_int [ 2 = P-core, 1 = E-core, 0 = n/a ] + + STAT_TIC_USER, // ull_int /proc/stat + STAT_TIC_NICE, // ull_int " + STAT_TIC_SYSTEM, // ull_int " + STAT_TIC_IDLE, // ull_int " + STAT_TIC_IOWAIT, // ull_int " + STAT_TIC_IRQ, // ull_int " + STAT_TIC_SOFTIRQ, // ull_int " + STAT_TIC_STOLEN, // ull_int " + STAT_TIC_GUEST, // ull_int " + STAT_TIC_GUEST_NICE, // ull_int " + + STAT_TIC_DELTA_USER, // sl_int derived from above + STAT_TIC_DELTA_NICE, // sl_int " + STAT_TIC_DELTA_SYSTEM, // sl_int " + STAT_TIC_DELTA_IDLE, // sl_int " + STAT_TIC_DELTA_IOWAIT, // sl_int " + STAT_TIC_DELTA_IRQ, // sl_int " + STAT_TIC_DELTA_SOFTIRQ, // sl_int " + STAT_TIC_DELTA_STOLEN, // sl_int " + STAT_TIC_DELTA_GUEST, // sl_int " + STAT_TIC_DELTA_GUEST_NICE, // sl_int " + + STAT_TIC_SUM_USER, // ull_int derived from USER + NICE tics + STAT_TIC_SUM_SYSTEM, // ull_int derived from SYSTEM + IRQ + SOFTIRQ tics + STAT_TIC_SUM_IDLE, // ull_int derived from IDLE + IOWAIT tics + STAT_TIC_SUM_BUSY, // ull_int derived from SUM_TOTAL - SUM_IDLE tics + STAT_TIC_SUM_TOTAL, // ull_int derived from sum of all 10 tics + + STAT_TIC_SUM_DELTA_USER, // sl_int derived from above + STAT_TIC_SUM_DELTA_SYSTEM, // sl_int " + STAT_TIC_SUM_DELTA_IDLE, // sl_int " + STAT_TIC_SUM_DELTA_BUSY, // sl_int " + STAT_TIC_SUM_DELTA_TOTAL, // sl_int " + + STAT_SYS_CTX_SWITCHES, // ul_int /proc/stat + STAT_SYS_INTERRUPTS, // ul_int " + STAT_SYS_PROC_BLOCKED, // ul_int " + STAT_SYS_PROC_CREATED, // ul_int " + STAT_SYS_PROC_RUNNING, // ul_int " + STAT_SYS_TIME_OF_BOOT, // ul_int " + + STAT_SYS_DELTA_CTX_SWITCHES, // s_int derived from above + STAT_SYS_DELTA_INTERRUPTS, // s_int " + STAT_SYS_DELTA_PROC_BLOCKED, // s_int " + STAT_SYS_DELTA_PROC_CREATED, // s_int " + STAT_SYS_DELTA_PROC_RUNNING // s_int " +}; + +enum stat_reap_type { + STAT_REAP_CPUS_ONLY, + STAT_REAP_NUMA_NODES_TOO +}; + +enum stat_sort_order { + STAT_SORT_ASCEND = +1, + STAT_SORT_DESCEND = -1 +}; + + +struct stat_result { + enum stat_item item; + union { + signed int s_int; + signed long sl_int; + unsigned long ul_int; + unsigned long long ull_int; + } result; +}; + +struct stat_stack { + struct stat_result *head; +}; + +struct stat_reap { + int total; + struct stat_stack **stacks; +}; + +struct stat_reaped { + struct stat_stack *summary; + struct stat_reap *cpus; + struct stat_reap *numa; +}; + +struct stat_info; + + + // STAT_TIC_ID value for /proc/stat cpu summary +#define STAT_SUMMARY_ID -11111 + // STAT_TIC_NUMA_NODE value for STAT_REAP_CPUS_ONLY or + // for STAT_REAP_NUMA_NODES_TOO when node was inactive +#define STAT_NODE_INVALID -22222 + + +#define STAT_GET( info, actual_enum, type ) ( { \ + struct stat_result *r = procps_stat_get( info, actual_enum ); \ + r ? r->result . type : 0; } ) + +#define STAT_VAL( relative_enum, type, stack, info ) \ + stack -> head [ relative_enum ] . result . type + + +int procps_stat_new (struct stat_info **info); +int procps_stat_ref (struct stat_info *info); +int procps_stat_unref (struct stat_info **info); + +struct stat_result *procps_stat_get ( + struct stat_info *info, + enum stat_item item); + +struct stat_reaped *procps_stat_reap ( + struct stat_info *info, + enum stat_reap_type what, + enum stat_item *items, + int numitems); + +struct stat_stack *procps_stat_select ( + struct stat_info *info, + enum stat_item *items, + int numitems); + +struct stat_stack **procps_stat_sort ( + struct stat_info *info, + struct stat_stack *stacks[], + int numstacked, + enum stat_item sortitem, + enum stat_sort_order order); + + +#ifdef XTRA_PROCPS_DEBUG +# include "xtra-procps-debug.h" +#endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/library/include/vmstat.h b/library/include/vmstat.h new file mode 100644 index 0000000..9b94931 --- /dev/null +++ b/library/include/vmstat.h @@ -0,0 +1,382 @@ +/* + * vmstat.h - virtual memory related declarations for libproc2 + * + * Copyright © 2015-2023 Jim Warner + * Copyright © 2015-2023 Craig Small + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#ifndef PROCPS_VMSTAT_H +#define PROCPS_VMSTAT_H + +#ifdef __cplusplus +extern "C" { +#endif + +enum vmstat_item { + VMSTAT_noop, // ( never altered ) + VMSTAT_extra, // ( reset to zero ) + // returns origin, see proc(5) + // ------- ------------------- + VMSTAT_ALLOCSTALL_DMA, // ul_int /proc/vmstat + VMSTAT_ALLOCSTALL_DMA32, // ul_int " + VMSTAT_ALLOCSTALL_HIGH, // ul_int " + VMSTAT_ALLOCSTALL_MOVABLE, // ul_int " + VMSTAT_ALLOCSTALL_NORMAL, // ul_int " + VMSTAT_BALLOON_DEFLATE, // ul_int " + VMSTAT_BALLOON_INFLATE, // ul_int " + VMSTAT_BALLOON_MIGRATE, // ul_int " + VMSTAT_COMPACT_DAEMON_FREE_SCANNED, // ul_int " + VMSTAT_COMPACT_DAEMON_MIGRATE_SCANNED, // ul_int " + VMSTAT_COMPACT_DAEMON_WAKE, // ul_int " + VMSTAT_COMPACT_FAIL, // ul_int " + VMSTAT_COMPACT_FREE_SCANNED, // ul_int " + VMSTAT_COMPACT_ISOLATED, // ul_int " + VMSTAT_COMPACT_MIGRATE_SCANNED, // ul_int " + VMSTAT_COMPACT_STALL, // ul_int " + VMSTAT_COMPACT_SUCCESS, // ul_int " + VMSTAT_DROP_PAGECACHE, // ul_int " + VMSTAT_DROP_SLAB, // ul_int " + VMSTAT_HTLB_BUDDY_ALLOC_FAIL, // ul_int " + VMSTAT_HTLB_BUDDY_ALLOC_SUCCESS, // ul_int " + VMSTAT_KSWAPD_HIGH_WMARK_HIT_QUICKLY, // ul_int " + VMSTAT_KSWAPD_INODESTEAL, // ul_int " + VMSTAT_KSWAPD_LOW_WMARK_HIT_QUICKLY, // ul_int " + VMSTAT_NR_ACTIVE_ANON, // ul_int " + VMSTAT_NR_ACTIVE_FILE, // ul_int " + VMSTAT_NR_ANON_PAGES, // ul_int " + VMSTAT_NR_ANON_TRANSPARENT_HUGEPAGES, // ul_int " + VMSTAT_NR_BOUNCE, // ul_int " + VMSTAT_NR_DIRTIED, // ul_int " + VMSTAT_NR_DIRTY, // ul_int " + VMSTAT_NR_DIRTY_BACKGROUND_THRESHOLD, // ul_int " + VMSTAT_NR_DIRTY_THRESHOLD, // ul_int " + VMSTAT_NR_FILE_HUGEPAGES, // ul_int " + VMSTAT_NR_FILE_PAGES, // ul_int " + VMSTAT_NR_FILE_PMDMAPPED, // ul_int " + VMSTAT_NR_FOLL_PIN_ACQUIRED, // ul_int " + VMSTAT_NR_FOLL_PIN_RELEASED, // ul_int " + VMSTAT_NR_FREE_CMA, // ul_int " + VMSTAT_NR_FREE_PAGES, // ul_int " + VMSTAT_NR_INACTIVE_ANON, // ul_int " + VMSTAT_NR_INACTIVE_FILE, // ul_int " + VMSTAT_NR_ISOLATED_ANON, // ul_int " + VMSTAT_NR_ISOLATED_FILE, // ul_int " + VMSTAT_NR_KERNEL_MISC_RECLAIMABLE, // ul_int " + VMSTAT_NR_KERNEL_STACK, // ul_int " + VMSTAT_NR_MAPPED, // ul_int " + VMSTAT_NR_MLOCK, // ul_int " + VMSTAT_NR_PAGE_TABLE_PAGES, // ul_int " + VMSTAT_NR_SHADOW_CALL_STACK, // ul_int " + VMSTAT_NR_SHMEM, // ul_int " + VMSTAT_NR_SHMEM_HUGEPAGES, // ul_int " + VMSTAT_NR_SHMEM_PMDMAPPED, // ul_int " + VMSTAT_NR_SLAB_RECLAIMABLE, // ul_int " + VMSTAT_NR_SLAB_UNRECLAIMABLE, // ul_int " + VMSTAT_NR_UNEVICTABLE, // ul_int " + VMSTAT_NR_UNSTABLE, // ul_int " + VMSTAT_NR_VMSCAN_IMMEDIATE_RECLAIM, // ul_int " + VMSTAT_NR_VMSCAN_WRITE, // ul_int " + VMSTAT_NR_WRITEBACK, // ul_int " + VMSTAT_NR_WRITEBACK_TEMP, // ul_int " + VMSTAT_NR_WRITTEN, // ul_int " + VMSTAT_NR_ZONE_ACTIVE_ANON, // ul_int " + VMSTAT_NR_ZONE_ACTIVE_FILE, // ul_int " + VMSTAT_NR_ZONE_INACTIVE_ANON, // ul_int " + VMSTAT_NR_ZONE_INACTIVE_FILE, // ul_int " + VMSTAT_NR_ZONE_UNEVICTABLE, // ul_int " + VMSTAT_NR_ZONE_WRITE_PENDING, // ul_int " + VMSTAT_NR_ZSPAGES, // ul_int " + VMSTAT_NUMA_FOREIGN, // ul_int " + VMSTAT_NUMA_HINT_FAULTS, // ul_int " + VMSTAT_NUMA_HINT_FAULTS_LOCAL, // ul_int " + VMSTAT_NUMA_HIT, // ul_int " + VMSTAT_NUMA_HUGE_PTE_UPDATES, // ul_int " + VMSTAT_NUMA_INTERLEAVE, // ul_int " + VMSTAT_NUMA_LOCAL, // ul_int " + VMSTAT_NUMA_MISS, // ul_int " + VMSTAT_NUMA_OTHER, // ul_int " + VMSTAT_NUMA_PAGES_MIGRATED, // ul_int " + VMSTAT_NUMA_PTE_UPDATES, // ul_int " + VMSTAT_OOM_KILL, // ul_int " + VMSTAT_PAGEOUTRUN, // ul_int " + VMSTAT_PGACTIVATE, // ul_int " + VMSTAT_PGALLOC_DMA, // ul_int " + VMSTAT_PGALLOC_DMA32, // ul_int " + VMSTAT_PGALLOC_HIGH, // ul_int " + VMSTAT_PGALLOC_MOVABLE, // ul_int " + VMSTAT_PGALLOC_NORMAL, // ul_int " + VMSTAT_PGDEACTIVATE, // ul_int " + VMSTAT_PGFAULT, // ul_int " + VMSTAT_PGFREE, // ul_int " + VMSTAT_PGINODESTEAL, // ul_int " + VMSTAT_PGLAZYFREE, // ul_int " + VMSTAT_PGLAZYFREED, // ul_int " + VMSTAT_PGMAJFAULT, // ul_int " + VMSTAT_PGMIGRATE_FAIL, // ul_int " + VMSTAT_PGMIGRATE_SUCCESS, // ul_int " + VMSTAT_PGPGIN, // ul_int " + VMSTAT_PGPGOUT, // ul_int " + VMSTAT_PGREFILL, // ul_int " + VMSTAT_PGROTATED, // ul_int " + VMSTAT_PGSCAN_ANON, // ul_int " + VMSTAT_PGSCAN_DIRECT, // ul_int " + VMSTAT_PGSCAN_DIRECT_THROTTLE, // ul_int " + VMSTAT_PGSCAN_FILE, // ul_int " + VMSTAT_PGSCAN_KSWAPD, // ul_int " + VMSTAT_PGSKIP_DMA, // ul_int " + VMSTAT_PGSKIP_DMA32, // ul_int " + VMSTAT_PGSKIP_HIGH, // ul_int " + VMSTAT_PGSKIP_MOVABLE, // ul_int " + VMSTAT_PGSKIP_NORMAL, // ul_int " + VMSTAT_PGSTEAL_ANON, // ul_int " + VMSTAT_PGSTEAL_DIRECT, // ul_int " + VMSTAT_PGSTEAL_FILE, // ul_int " + VMSTAT_PGSTEAL_KSWAPD, // ul_int " + VMSTAT_PSWPIN, // ul_int " + VMSTAT_PSWPOUT, // ul_int " + VMSTAT_SLABS_SCANNED, // ul_int " + VMSTAT_SWAP_RA, // ul_int " + VMSTAT_SWAP_RA_HIT, // ul_int " + VMSTAT_THP_COLLAPSE_ALLOC, // ul_int " + VMSTAT_THP_COLLAPSE_ALLOC_FAILED, // ul_int " + VMSTAT_THP_DEFERRED_SPLIT_PAGE, // ul_int " + VMSTAT_THP_FAULT_ALLOC, // ul_int " + VMSTAT_THP_FAULT_FALLBACK, // ul_int " + VMSTAT_THP_FAULT_FALLBACK_CHARGE, // ul_int " + VMSTAT_THP_FILE_ALLOC, // ul_int " + VMSTAT_THP_FILE_FALLBACK, // ul_int " + VMSTAT_THP_FILE_FALLBACK_CHARGE, // ul_int " + VMSTAT_THP_FILE_MAPPED, // ul_int " + VMSTAT_THP_SPLIT_PAGE, // ul_int " + VMSTAT_THP_SPLIT_PAGE_FAILED, // ul_int " + VMSTAT_THP_SPLIT_PMD, // ul_int " + VMSTAT_THP_SPLIT_PUD, // ul_int " + VMSTAT_THP_SWPOUT, // ul_int " + VMSTAT_THP_SWPOUT_FALLBACK, // ul_int " + VMSTAT_THP_ZERO_PAGE_ALLOC, // ul_int " + VMSTAT_THP_ZERO_PAGE_ALLOC_FAILED, // ul_int " + VMSTAT_UNEVICTABLE_PGS_CLEARED, // ul_int " + VMSTAT_UNEVICTABLE_PGS_CULLED, // ul_int " + VMSTAT_UNEVICTABLE_PGS_MLOCKED, // ul_int " + VMSTAT_UNEVICTABLE_PGS_MUNLOCKED, // ul_int " + VMSTAT_UNEVICTABLE_PGS_RESCUED, // ul_int " + VMSTAT_UNEVICTABLE_PGS_SCANNED, // ul_int " + VMSTAT_UNEVICTABLE_PGS_STRANDED, // ul_int " + VMSTAT_WORKINGSET_ACTIVATE, // ul_int " + VMSTAT_WORKINGSET_NODERECLAIM, // ul_int " + VMSTAT_WORKINGSET_NODES, // ul_int " + VMSTAT_WORKINGSET_REFAULT, // ul_int " + VMSTAT_WORKINGSET_RESTORE, // ul_int " + VMSTAT_ZONE_RECLAIM_FAILED, // ul_int " + + VMSTAT_DELTA_ALLOCSTALL_DMA, // sl_int derived from above + VMSTAT_DELTA_ALLOCSTALL_DMA32, // sl_int " + VMSTAT_DELTA_ALLOCSTALL_HIGH, // sl_int " + VMSTAT_DELTA_ALLOCSTALL_MOVABLE, // sl_int " + VMSTAT_DELTA_ALLOCSTALL_NORMAL, // sl_int " + VMSTAT_DELTA_BALLOON_DEFLATE, // sl_int " + VMSTAT_DELTA_BALLOON_INFLATE, // sl_int " + VMSTAT_DELTA_BALLOON_MIGRATE, // sl_int " + VMSTAT_DELTA_COMPACT_DAEMON_FREE_SCANNED, // sl_int " + VMSTAT_DELTA_COMPACT_DAEMON_MIGRATE_SCANNED, // sl_int " + VMSTAT_DELTA_COMPACT_DAEMON_WAKE, // sl_int " + VMSTAT_DELTA_COMPACT_FAIL, // sl_int " + VMSTAT_DELTA_COMPACT_FREE_SCANNED, // sl_int " + VMSTAT_DELTA_COMPACT_ISOLATED, // sl_int " + VMSTAT_DELTA_COMPACT_MIGRATE_SCANNED, // sl_int " + VMSTAT_DELTA_COMPACT_STALL, // sl_int " + VMSTAT_DELTA_COMPACT_SUCCESS, // sl_int " + VMSTAT_DELTA_DROP_PAGECACHE, // sl_int " + VMSTAT_DELTA_DROP_SLAB, // sl_int " + VMSTAT_DELTA_HTLB_BUDDY_ALLOC_FAIL, // sl_int " + VMSTAT_DELTA_HTLB_BUDDY_ALLOC_SUCCESS, // sl_int " + VMSTAT_DELTA_KSWAPD_HIGH_WMARK_HIT_QUICKLY, // sl_int " + VMSTAT_DELTA_KSWAPD_INODESTEAL, // sl_int " + VMSTAT_DELTA_KSWAPD_LOW_WMARK_HIT_QUICKLY, // sl_int " + VMSTAT_DELTA_NR_ACTIVE_ANON, // sl_int " + VMSTAT_DELTA_NR_ACTIVE_FILE, // sl_int " + VMSTAT_DELTA_NR_ANON_PAGES, // sl_int " + VMSTAT_DELTA_NR_ANON_TRANSPARENT_HUGEPAGES, // sl_int " + VMSTAT_DELTA_NR_BOUNCE, // sl_int " + VMSTAT_DELTA_NR_DIRTIED, // sl_int " + VMSTAT_DELTA_NR_DIRTY, // sl_int " + VMSTAT_DELTA_NR_DIRTY_BACKGROUND_THRESHOLD, // sl_int " + VMSTAT_DELTA_NR_DIRTY_THRESHOLD, // sl_int " + VMSTAT_DELTA_NR_FILE_HUGEPAGES, // sl_int " + VMSTAT_DELTA_NR_FILE_PAGES, // sl_int " + VMSTAT_DELTA_NR_FILE_PMDMAPPED, // sl_int " + VMSTAT_DELTA_NR_FOLL_PIN_ACQUIRED, // sl_int " + VMSTAT_DELTA_NR_FOLL_PIN_RELEASED, // sl_int " + VMSTAT_DELTA_NR_FREE_CMA, // sl_int " + VMSTAT_DELTA_NR_FREE_PAGES, // sl_int " + VMSTAT_DELTA_NR_INACTIVE_ANON, // sl_int " + VMSTAT_DELTA_NR_INACTIVE_FILE, // sl_int " + VMSTAT_DELTA_NR_ISOLATED_ANON, // sl_int " + VMSTAT_DELTA_NR_ISOLATED_FILE, // sl_int " + VMSTAT_DELTA_NR_KERNEL_MISC_RECLAIMABLE, // sl_int " + VMSTAT_DELTA_NR_KERNEL_STACK, // sl_int " + VMSTAT_DELTA_NR_MAPPED, // sl_int " + VMSTAT_DELTA_NR_MLOCK, // sl_int " + VMSTAT_DELTA_NR_PAGE_TABLE_PAGES, // sl_int " + VMSTAT_DELTA_NR_SHADOW_CALL_STACK, // sl_int " + VMSTAT_DELTA_NR_SHMEM, // sl_int " + VMSTAT_DELTA_NR_SHMEM_HUGEPAGES, // sl_int " + VMSTAT_DELTA_NR_SHMEM_PMDMAPPED, // sl_int " + VMSTAT_DELTA_NR_SLAB_RECLAIMABLE, // sl_int " + VMSTAT_DELTA_NR_SLAB_UNRECLAIMABLE, // sl_int " + VMSTAT_DELTA_NR_UNEVICTABLE, // sl_int " + VMSTAT_DELTA_NR_UNSTABLE, // sl_int " + VMSTAT_DELTA_NR_VMSCAN_IMMEDIATE_RECLAIM, // sl_int " + VMSTAT_DELTA_NR_VMSCAN_WRITE, // sl_int " + VMSTAT_DELTA_NR_WRITEBACK, // sl_int " + VMSTAT_DELTA_NR_WRITEBACK_TEMP, // sl_int " + VMSTAT_DELTA_NR_WRITTEN, // sl_int " + VMSTAT_DELTA_NR_ZONE_ACTIVE_ANON, // sl_int " + VMSTAT_DELTA_NR_ZONE_ACTIVE_FILE, // sl_int " + VMSTAT_DELTA_NR_ZONE_INACTIVE_ANON, // sl_int " + VMSTAT_DELTA_NR_ZONE_INACTIVE_FILE, // sl_int " + VMSTAT_DELTA_NR_ZONE_UNEVICTABLE, // sl_int " + VMSTAT_DELTA_NR_ZONE_WRITE_PENDING, // sl_int " + VMSTAT_DELTA_NR_ZSPAGES, // sl_int " + VMSTAT_DELTA_NUMA_FOREIGN, // sl_int " + VMSTAT_DELTA_NUMA_HINT_FAULTS, // sl_int " + VMSTAT_DELTA_NUMA_HINT_FAULTS_LOCAL, // sl_int " + VMSTAT_DELTA_NUMA_HIT, // sl_int " + VMSTAT_DELTA_NUMA_HUGE_PTE_UPDATES, // sl_int " + VMSTAT_DELTA_NUMA_INTERLEAVE, // sl_int " + VMSTAT_DELTA_NUMA_LOCAL, // sl_int " + VMSTAT_DELTA_NUMA_MISS, // sl_int " + VMSTAT_DELTA_NUMA_OTHER, // sl_int " + VMSTAT_DELTA_NUMA_PAGES_MIGRATED, // sl_int " + VMSTAT_DELTA_NUMA_PTE_UPDATES, // sl_int " + VMSTAT_DELTA_OOM_KILL, // sl_int " + VMSTAT_DELTA_PAGEOUTRUN, // sl_int " + VMSTAT_DELTA_PGACTIVATE, // sl_int " + VMSTAT_DELTA_PGALLOC_DMA, // sl_int " + VMSTAT_DELTA_PGALLOC_DMA32, // sl_int " + VMSTAT_DELTA_PGALLOC_HIGH, // sl_int " + VMSTAT_DELTA_PGALLOC_MOVABLE, // sl_int " + VMSTAT_DELTA_PGALLOC_NORMAL, // sl_int " + VMSTAT_DELTA_PGDEACTIVATE, // sl_int " + VMSTAT_DELTA_PGFAULT, // sl_int " + VMSTAT_DELTA_PGFREE, // sl_int " + VMSTAT_DELTA_PGINODESTEAL, // sl_int " + VMSTAT_DELTA_PGLAZYFREE, // sl_int " + VMSTAT_DELTA_PGLAZYFREED, // sl_int " + VMSTAT_DELTA_PGMAJFAULT, // sl_int " + VMSTAT_DELTA_PGMIGRATE_FAIL, // sl_int " + VMSTAT_DELTA_PGMIGRATE_SUCCESS, // sl_int " + VMSTAT_DELTA_PGPGIN, // sl_int " + VMSTAT_DELTA_PGPGOUT, // sl_int " + VMSTAT_DELTA_PGREFILL, // sl_int " + VMSTAT_DELTA_PGROTATED, // sl_int " + VMSTAT_DELTA_PGSCAN_ANON, // sl_int " + VMSTAT_DELTA_PGSCAN_DIRECT, // sl_int " + VMSTAT_DELTA_PGSCAN_DIRECT_THROTTLE, // sl_int " + VMSTAT_DELTA_PGSCAN_FILE, // sl_int " + VMSTAT_DELTA_PGSCAN_KSWAPD, // sl_int " + VMSTAT_DELTA_PGSKIP_DMA, // sl_int " + VMSTAT_DELTA_PGSKIP_DMA32, // sl_int " + VMSTAT_DELTA_PGSKIP_HIGH, // sl_int " + VMSTAT_DELTA_PGSKIP_MOVABLE, // sl_int " + VMSTAT_DELTA_PGSKIP_NORMAL, // sl_int " + VMSTAT_DELTA_PGSTEAL_ANON, // sl_int " + VMSTAT_DELTA_PGSTEAL_DIRECT, // sl_int " + VMSTAT_DELTA_PGSTEAL_FILE, // sl_int " + VMSTAT_DELTA_PGSTEAL_KSWAPD, // sl_int " + VMSTAT_DELTA_PSWPIN, // sl_int " + VMSTAT_DELTA_PSWPOUT, // sl_int " + VMSTAT_DELTA_SLABS_SCANNED, // sl_int " + VMSTAT_DELTA_SWAP_RA, // sl_int " + VMSTAT_DELTA_SWAP_RA_HIT, // sl_int " + VMSTAT_DELTA_THP_COLLAPSE_ALLOC, // sl_int " + VMSTAT_DELTA_THP_COLLAPSE_ALLOC_FAILED, // sl_int " + VMSTAT_DELTA_THP_DEFERRED_SPLIT_PAGE, // sl_int " + VMSTAT_DELTA_THP_FAULT_ALLOC, // sl_int " + VMSTAT_DELTA_THP_FAULT_FALLBACK, // sl_int " + VMSTAT_DELTA_THP_FAULT_FALLBACK_CHARGE, // sl_int " + VMSTAT_DELTA_THP_FILE_ALLOC, // sl_int " + VMSTAT_DELTA_THP_FILE_FALLBACK, // sl_int " + VMSTAT_DELTA_THP_FILE_FALLBACK_CHARGE, // sl_int " + VMSTAT_DELTA_THP_FILE_MAPPED, // sl_int " + VMSTAT_DELTA_THP_SPLIT_PAGE, // sl_int " + VMSTAT_DELTA_THP_SPLIT_PAGE_FAILED, // sl_int " + VMSTAT_DELTA_THP_SPLIT_PMD, // sl_int " + VMSTAT_DELTA_THP_SPLIT_PUD, // sl_int " + VMSTAT_DELTA_THP_SWPOUT, // sl_int " + VMSTAT_DELTA_THP_SWPOUT_FALLBACK, // sl_int " + VMSTAT_DELTA_THP_ZERO_PAGE_ALLOC, // sl_int " + VMSTAT_DELTA_THP_ZERO_PAGE_ALLOC_FAILED, // sl_int " + VMSTAT_DELTA_UNEVICTABLE_PGS_CLEARED, // sl_int " + VMSTAT_DELTA_UNEVICTABLE_PGS_CULLED, // sl_int " + VMSTAT_DELTA_UNEVICTABLE_PGS_MLOCKED, // sl_int " + VMSTAT_DELTA_UNEVICTABLE_PGS_MUNLOCKED, // sl_int " + VMSTAT_DELTA_UNEVICTABLE_PGS_RESCUED, // sl_int " + VMSTAT_DELTA_UNEVICTABLE_PGS_SCANNED, // sl_int " + VMSTAT_DELTA_UNEVICTABLE_PGS_STRANDED, // sl_int " + VMSTAT_DELTA_WORKINGSET_ACTIVATE, // sl_int " + VMSTAT_DELTA_WORKINGSET_NODERECLAIM, // sl_int " + VMSTAT_DELTA_WORKINGSET_NODES, // sl_int " + VMSTAT_DELTA_WORKINGSET_REFAULT, // sl_int " + VMSTAT_DELTA_WORKINGSET_RESTORE, // sl_int " + VMSTAT_DELTA_ZONE_RECLAIM_FAILED // sl_int " +}; + + +struct vmstat_result { + enum vmstat_item item; + union { + signed long sl_int; + unsigned long ul_int; + } result; +}; + +struct vmstat_stack { + struct vmstat_result *head; +}; + +struct vmstat_info; + + +#define VMSTAT_GET( info, actual_enum, type ) ( { \ + struct vmstat_result *r = procps_vmstat_get( info, actual_enum ); \ + r ? r->result . type : 0; } ) + +#define VMSTAT_VAL( relative_enum, type, stack, info ) \ + stack -> head [ relative_enum ] . result . type + + +int procps_vmstat_new (struct vmstat_info **info); +int procps_vmstat_ref (struct vmstat_info *info); +int procps_vmstat_unref (struct vmstat_info **info); + +struct vmstat_result *procps_vmstat_get ( + struct vmstat_info *info, + enum vmstat_item item); + +struct vmstat_stack *procps_vmstat_select ( + struct vmstat_info *info, + enum vmstat_item *items, + int numitems); + + +#ifdef XTRA_PROCPS_DEBUG +# include "xtra-procps-debug.h" +#endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/library/include/wchan.h b/library/include/wchan.h new file mode 100644 index 0000000..ef1d689 --- /dev/null +++ b/library/include/wchan.h @@ -0,0 +1,27 @@ +/* + * wchan.c - kernel symbol handling + * + * Copyright © 2015-2023 Jim Warner + * Copyright © 1998-2003 Albert Cahalan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PROCPS_PROC_WCHAN_H +#define PROCPS_PROC_WCHAN_H + +extern const char *lookup_wchan (int pid); + +#endif diff --git a/library/include/xtra-procps-debug.h b/library/include/xtra-procps-debug.h new file mode 100644 index 0000000..ead8075 --- /dev/null +++ b/library/include/xtra-procps-debug.h @@ -0,0 +1,208 @@ +/* + * libproc2 - Library to read proc filesystem + * + * Copyright © 2016-2023 Jim Warner + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define STRINGIFY_ARG(a) #a +#define STRINGIFY(a) STRINGIFY_ARG(a) + + +// --- DISKSTATS ------------------------------------------ +#if defined(PROCPS_DISKSTATS_H) && !defined(PROCPS_DISKSTATS_H_DEBUG) +#define PROCPS_DISKSTATS_H_DEBUG + +struct diskstats_result *xtra_diskstats_get ( + struct diskstats_info *info, + const char *name, + enum diskstats_item actual_enum, + const char *typestr, + const char *file, + int lineno); + +# undef DISKSTATS_GET +#define DISKSTATS_GET( info, name, actual_enum, type ) ( { \ + struct diskstats_result *r; \ + r = xtra_diskstats_get(info, name, actual_enum , STRINGIFY(type), __FILE__, __LINE__); \ + r ? r->result . type : 0; } ) + +struct diskstats_result *xtra_diskstats_val ( + int relative_enum, + const char *typestr, + const struct diskstats_stack *stack, + struct diskstats_info *info, + const char *file, + int lineno); + +# undef DISKSTATS_VAL +#define DISKSTATS_VAL( relative_enum, type, stack, info ) ( { \ + struct diskstats_result *r; \ + r = xtra_diskstats_val(relative_enum, STRINGIFY(type), stack, info, __FILE__, __LINE__); \ + r ? r->result . type : 0; } ) +#endif // . . . . . . . . . . + + +// --- MEMINFO -------------------------------------------- +#if defined(PROCPS_MEMINFO_H) && !defined(PROCPS_MEMINFO_H_DEBUG) +#define PROCPS_MEMINFO_H_DEBUG + +struct meminfo_result *xtra_meminfo_get ( + struct meminfo_info *info, + enum meminfo_item actual_enum, + const char *typestr, + const char *file, + int lineno); + +# undef MEMINFO_GET +#define MEMINFO_GET( info, actual_enum, type ) ( { \ + struct meminfo_result *r; \ + r = xtra_meminfo_get(info, actual_enum , STRINGIFY(type), __FILE__, __LINE__); \ + r ? r->result . type : 0; } ) + +struct meminfo_result *xtra_meminfo_val ( + int relative_enum, + const char *typestr, + const struct meminfo_stack *stack, + struct meminfo_info *info, + const char *file, + int lineno); + +# undef MEMINFO_VAL +#define MEMINFO_VAL( relative_enum, type, stack, info ) ( { \ + struct meminfo_result *r; \ + r = xtra_meminfo_val(relative_enum, STRINGIFY(type), stack, info, __FILE__, __LINE__); \ + r ? r->result . type : 0; } ) +#endif // . . . . . . . . . . + + +// --- PIDS ----------------------------------------------- +#if defined(PROCPS_PIDS_H) && !defined(PROCPS_PIDS_H_DEBUG) +#define PROCPS_PIDS_H_DEBUG + +struct pids_result *xtra_pids_val ( + int relative_enum, + const char *typestr, + const struct pids_stack *stack, + struct pids_info *info, + const char *file, + int lineno); + +# undef PIDS_VAL +#define PIDS_VAL( relative_enum, type, stack, info ) ( { \ + struct pids_result *r; \ + r = xtra_pids_val(relative_enum, STRINGIFY(type), stack, info, __FILE__, __LINE__); \ + r ? r->result . type : 0; } ) +#endif // . . . . . . . . . . + + +// --- SLABINFO ------------------------------------------- +#if defined(PROCPS_SLABINFO_H) && !defined(PROCPS_SLABINFO_H_DEBUG) +#define PROCPS_SLABINFO_H_DEBUG + +struct slabinfo_result *xtra_slabinfo_get ( + struct slabinfo_info *info, + enum slabinfo_item actual_enum, + const char *typestr, + const char *file, + int lineno); + +# undef SLABINFO_GET +#define SLABINFO_GET( info, actual_enum, type ) ( { \ + struct slabinfo_result *r; \ + r = xtra_slabinfo_get(info, actual_enum , STRINGIFY(type), __FILE__, __LINE__); \ + r ? r->result . type : 0; } ) + +struct slabinfo_result *xtra_slabinfo_val ( + int relative_enum, + const char *typestr, + const struct slabinfo_stack *stack, + struct slabinfo_info *info, + const char *file, + int lineno); + +# undef SLABINFO_VAL +#define SLABINFO_VAL( relative_enum, type, stack, info ) ( { \ + struct slabinfo_result *r; \ + r = xtra_slabinfo_val(relative_enum, STRINGIFY(type), stack, info, __FILE__, __LINE__); \ + r ? r->result . type : 0; } ) +#endif // . . . . . . . . . . + + +// --- STAT ----------------------------------------------- +#if defined(PROCPS_STAT_H) && !defined(PROCPS_STAT_H_DEBUG) +#define PROCPS_STAT_H_DEBUG + +struct stat_result *xtra_stat_get ( + struct stat_info *info, + enum stat_item actual_enum, + const char *typestr, + const char *file, + int lineno); + +# undef STAT_GET +#define STAT_GET( info, actual_enum, type ) ( { \ + struct stat_result *r; \ + r = xtra_stat_get(info, actual_enum , STRINGIFY(type), __FILE__, __LINE__); \ + r ? r->result . type : 0; } ) + +struct stat_result *xtra_stat_val ( + int relative_enum, + const char *typestr, + const struct stat_stack *stack, + struct stat_info *info, + const char *file, + int lineno); + +# undef STAT_VAL +#define STAT_VAL( relative_enum, type, stack, info ) ( { \ + struct stat_result *r; \ + r = xtra_stat_val(relative_enum, STRINGIFY(type), stack, info, __FILE__, __LINE__); \ + r ? r->result . type : 0; } ) +#endif // . . . . . . . . . . + + +// --- VMSTAT --------------------------------------------- +#if defined(PROCPS_VMSTAT_H) && !defined(PROCPS_VMSTAT_H_DEBUG) +#define PROCPS_VMSTAT_H_DEBUG + +struct vmstat_result *xtra_vmstat_get ( + struct vmstat_info *info, + enum vmstat_item actual_enum, + const char *typestr, + const char *file, + int lineno); + +# undef VMSTAT_GET +#define VMSTAT_GET( info, actual_enum, type ) ( { \ + struct vmstat_result *r; \ + r = xtra_vmstat_get(info, actual_enum , STRINGIFY(type), __FILE__, __LINE__); \ + r ? r->result . type : 0; } ) + +struct vmstat_result *xtra_vmstat_val ( + int relative_enum, + const char *typestr, + const struct vmstat_stack *stack, + struct vmstat_info *info, + const char *file, + int lineno); + +# undef VMSTAT_VAL +#define VMSTAT_VAL( relative_enum, type, stack, info ) ( { \ + struct vmstat_result *r; \ + r = xtra_vmstat_val(relative_enum, STRINGIFY(type), stack, info, __FILE__, __LINE__); \ + r ? r->result . type : 0; } ) +#endif // . . . . . . . . . . diff --git a/library/libproc2.pc.in b/library/libproc2.pc.in new file mode 100644 index 0000000..99fd97e --- /dev/null +++ b/library/libproc2.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libproc2 +Description: Library to control and query process state +Version: @VERSION@ +Libs: -L${libdir} -lproc2 +Libs.private: +Cflags: -I${includedir} diff --git a/library/libproc2.sym b/library/libproc2.sym new file mode 100644 index 0000000..bb84ba9 --- /dev/null +++ b/library/libproc2.sym @@ -0,0 +1,67 @@ +LIBPROC_2 { +global: + fatal_proc_unmounted; + procps_cpu_count; + procps_diskstats_new; + procps_diskstats_ref; + procps_diskstats_unref; + procps_diskstats_get; + procps_diskstats_reap; + procps_diskstats_select; + procps_diskstats_sort; + procps_hertz_get; + procps_linux_version; + procps_loadavg; + procps_meminfo_new; + procps_meminfo_ref; + procps_meminfo_unref; + procps_meminfo_get; + procps_meminfo_select; + procps_ns_get_name; + procps_ns_get_id; + procps_ns_read_pid; + procps_pid_length; + procps_pids_new; + procps_pids_ref; + procps_pids_unref; + procps_pids_get; + procps_pids_reap; + procps_pids_reset; + procps_pids_select; + procps_pids_sort; + procps_slabinfo_new; + procps_slabinfo_ref; + procps_slabinfo_unref; + procps_slabinfo_get; + procps_slabinfo_reap; + procps_slabinfo_select; + procps_slabinfo_sort; + procps_stat_new; + procps_stat_ref; + procps_stat_unref; + procps_stat_get; + procps_stat_reap; + procps_stat_select; + procps_stat_sort; + procps_uptime; + procps_uptime_sprint; + procps_uptime_sprint_short; + procps_vmstat_new; + procps_vmstat_ref; + procps_vmstat_unref; + procps_vmstat_get; + procps_vmstat_select; + xtra_diskstats_get; + xtra_diskstats_val; + xtra_meminfo_get; + xtra_meminfo_val; + xtra_pids_val; + xtra_slabinfo_get; + xtra_slabinfo_val; + xtra_stat_get; + xtra_stat_val; + xtra_vmstat_get; + xtra_vmstat_val; +local: + *; +}; diff --git a/library/meminfo.c b/library/meminfo.c new file mode 100644 index 0000000..4289a23 --- /dev/null +++ b/library/meminfo.c @@ -0,0 +1,1016 @@ +/* + * meminfo.c - memory related definitions for libproc2 + * + * Copyright © 2015-2023 Jim Warner + * Copyright © 2015-2023 Craig Small + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; 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 "procps-private.h" +#include "meminfo.h" + + +#define MEMINFO_FILE "/proc/meminfo" +#define MEMINFO_BUFF 8192 + +/* ------------------------------------------------------------------------- + + this provision can be used to ensure that our Item_table was synchronized | + with those enumerators found in the associated header file. It's intended | + to only be used locally (& temporarily) at some point prior to a release! | */ +// #define ITEMTABLE_DEBUG //----------------------------------------------- | +// ------------------------------------------------------------------------- + + + +struct meminfo_data { + unsigned long Active; + unsigned long Active_anon; // as: Active(anon): man 5 proc: 'to be documented' + unsigned long Active_file; // as: Active(file): man 5 proc: 'to be documented' + unsigned long AnonHugePages; + unsigned long AnonPages; + unsigned long Bounce; + unsigned long Buffers; + unsigned long Cached; + unsigned long CmaFree; + unsigned long CmaTotal; + unsigned long CommitLimit; + unsigned long Committed_AS; + unsigned long DirectMap1G; + unsigned long DirectMap2M; + unsigned long DirectMap4M; + unsigned long DirectMap4k; + unsigned long Dirty; + unsigned long FileHugePages; + unsigned long FilePmdMapped; + unsigned long HardwareCorrupted; // man 5 proc: 'to be documented' + unsigned long HighFree; + unsigned long HighTotal; + unsigned long HugePages_Free; + unsigned long HugePages_Rsvd; + unsigned long HugePages_Surp; + unsigned long HugePages_Total; + unsigned long Hugepagesize; + unsigned long Hugetlb; + unsigned long Inactive; + unsigned long Inactive_anon; // as: Inactive(anon): man 5 proc: 'to be documented' + unsigned long Inactive_file; // as: Inactive(file): man 5 proc: 'to be documented' + unsigned long KReclaimable; + unsigned long KernelStack; + unsigned long LowFree; + unsigned long LowTotal; + unsigned long Mapped; + unsigned long MemAvailable; + unsigned long MemFree; + unsigned long MemTotal; + unsigned long Mlocked; // man 5 proc: 'to be documented' + unsigned long MmapCopy; // man 5 proc: 'to be documented' + unsigned long NFS_Unstable; + unsigned long PageTables; + unsigned long Percpu; + unsigned long SReclaimable; + unsigned long SUnreclaim; + unsigned long ShadowCallStack; + unsigned long Shmem; + unsigned long ShmemHugePages; + unsigned long ShmemPmdMapped; + unsigned long Slab; + unsigned long SwapCached; + unsigned long SwapFree; + unsigned long SwapTotal; + unsigned long Unevictable; // man 5 proc: 'to be documented' + unsigned long VmallocChunk; + unsigned long VmallocTotal; + unsigned long VmallocUsed; + unsigned long Writeback; + unsigned long WritebackTmp; + + unsigned long derived_mem_cached; + unsigned long derived_mem_hi_used; + unsigned long derived_mem_lo_used; + unsigned long derived_mem_used; + unsigned long derived_swap_used; +}; + +struct mem_hist { + struct meminfo_data new; + struct meminfo_data old; +}; + +struct stacks_extent { + int ext_numstacks; + struct stacks_extent *next; + struct meminfo_stack **stacks; +}; + +struct meminfo_info { + int refcount; + int meminfo_fd; + struct mem_hist hist; + int numitems; + enum meminfo_item *items; + struct stacks_extent *extents; + struct hsearch_data hashtab; + struct meminfo_result get_this; + time_t sav_secs; +}; + + +// ___ Results 'Set' Support |||||||||||||||||||||||||||||||||||||||||||||||||| + +#define setNAME(e) set_meminfo_ ## e +#define setDECL(e) static void setNAME(e) \ + (struct meminfo_result *R, struct mem_hist *H) + +// regular assignment +#define MEM_set(e,t,x) setDECL(e) { R->result. t = H->new. x; } +// delta assignment +#define HST_set(e,t,x) setDECL(e) { R->result. t = ( H->new. x - H->old. x ); } + +setDECL(noop) { (void)R; (void)H; } +setDECL(extra) { (void)H; R->result.ul_int = 0; } + +MEM_set(MEM_ACTIVE, ul_int, Active) +MEM_set(MEM_ACTIVE_ANON, ul_int, Active_anon) +MEM_set(MEM_ACTIVE_FILE, ul_int, Active_file) +MEM_set(MEM_ANON, ul_int, AnonPages) +MEM_set(MEM_AVAILABLE, ul_int, MemAvailable) +MEM_set(MEM_BOUNCE, ul_int, Bounce) +MEM_set(MEM_BUFFERS, ul_int, Buffers) +MEM_set(MEM_CACHED, ul_int, Cached) +MEM_set(MEM_CACHED_ALL, ul_int, derived_mem_cached) +MEM_set(MEM_CMA_FREE, ul_int, CmaFree) +MEM_set(MEM_CMA_TOTAL, ul_int, CmaTotal) +MEM_set(MEM_COMMITTED_AS, ul_int, Committed_AS) +MEM_set(MEM_COMMIT_LIMIT, ul_int, CommitLimit) +MEM_set(MEM_DIRECTMAP_1G, ul_int, DirectMap1G) +MEM_set(MEM_DIRECTMAP_2M, ul_int, DirectMap2M) +MEM_set(MEM_DIRECTMAP_4K, ul_int, DirectMap4k) +MEM_set(MEM_DIRECTMAP_4M, ul_int, DirectMap4M) +MEM_set(MEM_DIRTY, ul_int, Dirty) +MEM_set(MEM_FILE_HUGEPAGES, ul_int, FileHugePages) +MEM_set(MEM_FILE_PMDMAPPED, ul_int, FilePmdMapped) +MEM_set(MEM_FREE, ul_int, MemFree) +MEM_set(MEM_HARD_CORRUPTED, ul_int, HardwareCorrupted) +MEM_set(MEM_HIGH_FREE, ul_int, HighFree) +MEM_set(MEM_HIGH_TOTAL, ul_int, HighTotal) +MEM_set(MEM_HIGH_USED, ul_int, derived_mem_hi_used) +MEM_set(MEM_HUGETBL, ul_int, Hugetlb) +MEM_set(MEM_HUGE_ANON, ul_int, AnonHugePages) +MEM_set(MEM_HUGE_FREE, ul_int, HugePages_Free) +MEM_set(MEM_HUGE_RSVD, ul_int, HugePages_Rsvd) +MEM_set(MEM_HUGE_SIZE, ul_int, Hugepagesize) +MEM_set(MEM_HUGE_SURPLUS, ul_int, HugePages_Surp) +MEM_set(MEM_HUGE_TOTAL, ul_int, HugePages_Total) +MEM_set(MEM_INACTIVE, ul_int, Inactive) +MEM_set(MEM_INACTIVE_ANON, ul_int, Inactive_anon) +MEM_set(MEM_INACTIVE_FILE, ul_int, Inactive_file) +MEM_set(MEM_KERNEL_RECLAIM, ul_int, KReclaimable) +MEM_set(MEM_KERNEL_STACK, ul_int, KernelStack) +MEM_set(MEM_LOCKED, ul_int, Mlocked) +MEM_set(MEM_LOW_FREE, ul_int, LowFree) +MEM_set(MEM_LOW_TOTAL, ul_int, LowTotal) +MEM_set(MEM_LOW_USED, ul_int, derived_mem_lo_used) +MEM_set(MEM_MAPPED, ul_int, Mapped) +MEM_set(MEM_MAP_COPY, ul_int, MmapCopy) +MEM_set(MEM_NFS_UNSTABLE, ul_int, NFS_Unstable) +MEM_set(MEM_PAGE_TABLES, ul_int, PageTables) +MEM_set(MEM_PER_CPU, ul_int, Percpu) +MEM_set(MEM_SHADOWCALLSTACK, ul_int, ShadowCallStack) +MEM_set(MEM_SHARED, ul_int, Shmem) +MEM_set(MEM_SHMEM_HUGE, ul_int, ShmemHugePages) +MEM_set(MEM_SHMEM_HUGE_MAP, ul_int, ShmemPmdMapped) +MEM_set(MEM_SLAB, ul_int, Slab) +MEM_set(MEM_SLAB_RECLAIM, ul_int, SReclaimable) +MEM_set(MEM_SLAB_UNRECLAIM, ul_int, SUnreclaim) +MEM_set(MEM_TOTAL, ul_int, MemTotal) +MEM_set(MEM_UNEVICTABLE, ul_int, Unevictable) +MEM_set(MEM_USED, ul_int, derived_mem_used) +MEM_set(MEM_VM_ALLOC_CHUNK, ul_int, VmallocChunk) +MEM_set(MEM_VM_ALLOC_TOTAL, ul_int, VmallocTotal) +MEM_set(MEM_VM_ALLOC_USED, ul_int, VmallocUsed) +MEM_set(MEM_WRITEBACK, ul_int, Writeback) +MEM_set(MEM_WRITEBACK_TMP, ul_int, WritebackTmp) + +HST_set(DELTA_ACTIVE, s_int, Active) +HST_set(DELTA_ACTIVE_ANON, s_int, Active_anon) +HST_set(DELTA_ACTIVE_FILE, s_int, Active_file) +HST_set(DELTA_ANON, s_int, AnonPages) +HST_set(DELTA_AVAILABLE, s_int, MemAvailable) +HST_set(DELTA_BOUNCE, s_int, Bounce) +HST_set(DELTA_BUFFERS, s_int, Buffers) +HST_set(DELTA_CACHED, s_int, Cached) +HST_set(DELTA_CACHED_ALL, s_int, derived_mem_cached) +HST_set(DELTA_CMA_FREE, s_int, CmaFree) +HST_set(DELTA_CMA_TOTAL, s_int, CmaTotal) +HST_set(DELTA_COMMITTED_AS, s_int, Committed_AS) +HST_set(DELTA_COMMIT_LIMIT, s_int, CommitLimit) +HST_set(DELTA_DIRECTMAP_1G, s_int, DirectMap1G) +HST_set(DELTA_DIRECTMAP_2M, s_int, DirectMap2M) +HST_set(DELTA_DIRECTMAP_4K, s_int, DirectMap4k) +HST_set(DELTA_DIRECTMAP_4M, s_int, DirectMap4M) +HST_set(DELTA_DIRTY, s_int, Dirty) +HST_set(DELTA_FILE_HUGEPAGES, s_int, FileHugePages) +HST_set(DELTA_FILE_PMDMAPPED, s_int, FilePmdMapped) +HST_set(DELTA_FREE, s_int, MemFree) +HST_set(DELTA_HARD_CORRUPTED, s_int, HardwareCorrupted) +HST_set(DELTA_HIGH_FREE, s_int, HighFree) +HST_set(DELTA_HIGH_TOTAL, s_int, HighTotal) +HST_set(DELTA_HIGH_USED, s_int, derived_mem_hi_used) +HST_set(DELTA_HUGETBL, s_int, Hugetlb) +HST_set(DELTA_HUGE_ANON, s_int, AnonHugePages) +HST_set(DELTA_HUGE_FREE, s_int, HugePages_Free) +HST_set(DELTA_HUGE_RSVD, s_int, HugePages_Rsvd) +HST_set(DELTA_HUGE_SIZE, s_int, Hugepagesize) +HST_set(DELTA_HUGE_SURPLUS, s_int, HugePages_Surp) +HST_set(DELTA_HUGE_TOTAL, s_int, HugePages_Total) +HST_set(DELTA_INACTIVE, s_int, Inactive) +HST_set(DELTA_INACTIVE_ANON, s_int, Inactive_anon) +HST_set(DELTA_INACTIVE_FILE, s_int, Inactive_file) +HST_set(DELTA_KERNEL_RECLAIM, s_int, KReclaimable) +HST_set(DELTA_KERNEL_STACK, s_int, KernelStack) +HST_set(DELTA_LOCKED, s_int, Mlocked) +HST_set(DELTA_LOW_FREE, s_int, LowFree) +HST_set(DELTA_LOW_TOTAL, s_int, LowTotal) +HST_set(DELTA_LOW_USED, s_int, derived_mem_lo_used) +HST_set(DELTA_MAPPED, s_int, Mapped) +HST_set(DELTA_MAP_COPY, s_int, MmapCopy) +HST_set(DELTA_NFS_UNSTABLE, s_int, NFS_Unstable) +HST_set(DELTA_PAGE_TABLES, s_int, PageTables) +HST_set(DELTA_PER_CPU, s_int, Percpu) +HST_set(DELTA_SHADOWCALLSTACK, s_int, ShadowCallStack) +HST_set(DELTA_SHARED, s_int, Shmem) +HST_set(DELTA_SHMEM_HUGE, s_int, ShmemHugePages) +HST_set(DELTA_SHMEM_HUGE_MAP, s_int, ShmemPmdMapped) +HST_set(DELTA_SLAB, s_int, Slab) +HST_set(DELTA_SLAB_RECLAIM, s_int, SReclaimable) +HST_set(DELTA_SLAB_UNRECLAIM, s_int, SUnreclaim) +HST_set(DELTA_TOTAL, s_int, MemTotal) +HST_set(DELTA_UNEVICTABLE, s_int, Unevictable) +HST_set(DELTA_USED, s_int, derived_mem_used) +HST_set(DELTA_VM_ALLOC_CHUNK, s_int, VmallocChunk) +HST_set(DELTA_VM_ALLOC_TOTAL, s_int, VmallocTotal) +HST_set(DELTA_VM_ALLOC_USED, s_int, VmallocUsed) +HST_set(DELTA_WRITEBACK, s_int, Writeback) +HST_set(DELTA_WRITEBACK_TMP, s_int, WritebackTmp) + +MEM_set(SWAP_CACHED, ul_int, SwapCached) +MEM_set(SWAP_FREE, ul_int, SwapFree) +MEM_set(SWAP_TOTAL, ul_int, SwapTotal) +MEM_set(SWAP_USED, ul_int, derived_swap_used) + +HST_set(SWAP_DELTA_CACHED, s_int, SwapCached) +HST_set(SWAP_DELTA_FREE, s_int, SwapFree) +HST_set(SWAP_DELTA_TOTAL, s_int, SwapTotal) +HST_set(SWAP_DELTA_USED, s_int, derived_swap_used) + +#undef setDECL +#undef MEM_set +#undef HST_set + + +// ___ Controlling Table |||||||||||||||||||||||||||||||||||||||||||||||||||||| + +typedef void (*SET_t)(struct meminfo_result *, struct mem_hist *); +#ifdef ITEMTABLE_DEBUG +#define RS(e) (SET_t)setNAME(e), MEMINFO_ ## e, STRINGIFY(MEMINFO_ ## e) +#else +#define RS(e) (SET_t)setNAME(e) +#endif + +#define TS(t) STRINGIFY(t) +#define TS_noop "" + + /* + * Need it be said? + * This table must be kept in the exact same order as + * those 'enum meminfo_item' guys ! */ +static struct { + SET_t setsfunc; // the actual result setting routine +#ifdef ITEMTABLE_DEBUG + int enumnumb; // enumerator (must match position!) + char *enum2str; // enumerator name as a char* string +#endif + char *type2str; // the result type as a string value +} Item_table[] = { +/* setsfunc type2str + ------------------------- ---------- */ + { RS(noop), TS_noop }, + { RS(extra), TS_noop }, + + { RS(MEM_ACTIVE), TS(ul_int) }, + { RS(MEM_ACTIVE_ANON), TS(ul_int) }, + { RS(MEM_ACTIVE_FILE), TS(ul_int) }, + { RS(MEM_ANON), TS(ul_int) }, + { RS(MEM_AVAILABLE), TS(ul_int) }, + { RS(MEM_BOUNCE), TS(ul_int) }, + { RS(MEM_BUFFERS), TS(ul_int) }, + { RS(MEM_CACHED), TS(ul_int) }, + { RS(MEM_CACHED_ALL), TS(ul_int) }, + { RS(MEM_CMA_FREE), TS(ul_int) }, + { RS(MEM_CMA_TOTAL), TS(ul_int) }, + { RS(MEM_COMMITTED_AS), TS(ul_int) }, + { RS(MEM_COMMIT_LIMIT), TS(ul_int) }, + { RS(MEM_DIRECTMAP_1G), TS(ul_int) }, + { RS(MEM_DIRECTMAP_2M), TS(ul_int) }, + { RS(MEM_DIRECTMAP_4K), TS(ul_int) }, + { RS(MEM_DIRECTMAP_4M), TS(ul_int) }, + { RS(MEM_DIRTY), TS(ul_int) }, + { RS(MEM_FILE_HUGEPAGES), TS(ul_int) }, + { RS(MEM_FILE_PMDMAPPED), TS(ul_int) }, + { RS(MEM_FREE), TS(ul_int) }, + { RS(MEM_HARD_CORRUPTED), TS(ul_int) }, + { RS(MEM_HIGH_FREE), TS(ul_int) }, + { RS(MEM_HIGH_TOTAL), TS(ul_int) }, + { RS(MEM_HIGH_USED), TS(ul_int) }, + { RS(MEM_HUGETBL), TS(ul_int) }, + { RS(MEM_HUGE_ANON), TS(ul_int) }, + { RS(MEM_HUGE_FREE), TS(ul_int) }, + { RS(MEM_HUGE_RSVD), TS(ul_int) }, + { RS(MEM_HUGE_SIZE), TS(ul_int) }, + { RS(MEM_HUGE_SURPLUS), TS(ul_int) }, + { RS(MEM_HUGE_TOTAL), TS(ul_int) }, + { RS(MEM_INACTIVE), TS(ul_int) }, + { RS(MEM_INACTIVE_ANON), TS(ul_int) }, + { RS(MEM_INACTIVE_FILE), TS(ul_int) }, + { RS(MEM_KERNEL_RECLAIM), TS(ul_int) }, + { RS(MEM_KERNEL_STACK), TS(ul_int) }, + { RS(MEM_LOCKED), TS(ul_int) }, + { RS(MEM_LOW_FREE), TS(ul_int) }, + { RS(MEM_LOW_TOTAL), TS(ul_int) }, + { RS(MEM_LOW_USED), TS(ul_int) }, + { RS(MEM_MAPPED), TS(ul_int) }, + { RS(MEM_MAP_COPY), TS(ul_int) }, + { RS(MEM_NFS_UNSTABLE), TS(ul_int) }, + { RS(MEM_PAGE_TABLES), TS(ul_int) }, + { RS(MEM_PER_CPU), TS(ul_int) }, + { RS(MEM_SHADOWCALLSTACK), TS(ul_int) }, + { RS(MEM_SHARED), TS(ul_int) }, + { RS(MEM_SHMEM_HUGE), TS(ul_int) }, + { RS(MEM_SHMEM_HUGE_MAP), TS(ul_int) }, + { RS(MEM_SLAB), TS(ul_int) }, + { RS(MEM_SLAB_RECLAIM), TS(ul_int) }, + { RS(MEM_SLAB_UNRECLAIM), TS(ul_int) }, + { RS(MEM_TOTAL), TS(ul_int) }, + { RS(MEM_UNEVICTABLE), TS(ul_int) }, + { RS(MEM_USED), TS(ul_int) }, + { RS(MEM_VM_ALLOC_CHUNK), TS(ul_int) }, + { RS(MEM_VM_ALLOC_TOTAL), TS(ul_int) }, + { RS(MEM_VM_ALLOC_USED), TS(ul_int) }, + { RS(MEM_WRITEBACK), TS(ul_int) }, + { RS(MEM_WRITEBACK_TMP), TS(ul_int) }, + + { RS(DELTA_ACTIVE), TS(s_int) }, + { RS(DELTA_ACTIVE_ANON), TS(s_int) }, + { RS(DELTA_ACTIVE_FILE), TS(s_int) }, + { RS(DELTA_ANON), TS(s_int) }, + { RS(DELTA_AVAILABLE), TS(s_int) }, + { RS(DELTA_BOUNCE), TS(s_int) }, + { RS(DELTA_BUFFERS), TS(s_int) }, + { RS(DELTA_CACHED), TS(s_int) }, + { RS(DELTA_CACHED_ALL), TS(s_int) }, + { RS(DELTA_CMA_FREE), TS(s_int) }, + { RS(DELTA_CMA_TOTAL), TS(s_int) }, + { RS(DELTA_COMMITTED_AS), TS(s_int) }, + { RS(DELTA_COMMIT_LIMIT), TS(s_int) }, + { RS(DELTA_DIRECTMAP_1G), TS(s_int) }, + { RS(DELTA_DIRECTMAP_2M), TS(s_int) }, + { RS(DELTA_DIRECTMAP_4K), TS(s_int) }, + { RS(DELTA_DIRECTMAP_4M), TS(s_int) }, + { RS(DELTA_DIRTY), TS(s_int) }, + { RS(DELTA_FILE_HUGEPAGES), TS(s_int) }, + { RS(DELTA_FILE_PMDMAPPED), TS(s_int) }, + { RS(DELTA_FREE), TS(s_int) }, + { RS(DELTA_HARD_CORRUPTED), TS(s_int) }, + { RS(DELTA_HIGH_FREE), TS(s_int) }, + { RS(DELTA_HIGH_TOTAL), TS(s_int) }, + { RS(DELTA_HIGH_USED), TS(s_int) }, + { RS(DELTA_HUGETBL), TS(s_int) }, + { RS(DELTA_HUGE_ANON), TS(s_int) }, + { RS(DELTA_HUGE_FREE), TS(s_int) }, + { RS(DELTA_HUGE_RSVD), TS(s_int) }, + { RS(DELTA_HUGE_SIZE), TS(s_int) }, + { RS(DELTA_HUGE_SURPLUS), TS(s_int) }, + { RS(DELTA_HUGE_TOTAL), TS(s_int) }, + { RS(DELTA_INACTIVE), TS(s_int) }, + { RS(DELTA_INACTIVE_ANON), TS(s_int) }, + { RS(DELTA_INACTIVE_FILE), TS(s_int) }, + { RS(DELTA_KERNEL_RECLAIM), TS(s_int) }, + { RS(DELTA_KERNEL_STACK), TS(s_int) }, + { RS(DELTA_LOCKED), TS(s_int) }, + { RS(DELTA_LOW_FREE), TS(s_int) }, + { RS(DELTA_LOW_TOTAL), TS(s_int) }, + { RS(DELTA_LOW_USED), TS(s_int) }, + { RS(DELTA_MAPPED), TS(s_int) }, + { RS(DELTA_MAP_COPY), TS(s_int) }, + { RS(DELTA_NFS_UNSTABLE), TS(s_int) }, + { RS(DELTA_PAGE_TABLES), TS(s_int) }, + { RS(DELTA_PER_CPU), TS(s_int) }, + { RS(DELTA_SHADOWCALLSTACK), TS(s_int) }, + { RS(DELTA_SHARED), TS(s_int) }, + { RS(DELTA_SHMEM_HUGE), TS(s_int) }, + { RS(DELTA_SHMEM_HUGE_MAP), TS(s_int) }, + { RS(DELTA_SLAB), TS(s_int) }, + { RS(DELTA_SLAB_RECLAIM), TS(s_int) }, + { RS(DELTA_SLAB_UNRECLAIM), TS(s_int) }, + { RS(DELTA_TOTAL), TS(s_int) }, + { RS(DELTA_UNEVICTABLE), TS(s_int) }, + { RS(DELTA_USED), TS(s_int) }, + { RS(DELTA_VM_ALLOC_CHUNK), TS(s_int) }, + { RS(DELTA_VM_ALLOC_TOTAL), TS(s_int) }, + { RS(DELTA_VM_ALLOC_USED), TS(s_int) }, + { RS(DELTA_WRITEBACK), TS(s_int) }, + { RS(DELTA_WRITEBACK_TMP), TS(s_int) }, + + { RS(SWAP_CACHED), TS(ul_int) }, + { RS(SWAP_FREE), TS(ul_int) }, + { RS(SWAP_TOTAL), TS(ul_int) }, + { RS(SWAP_USED), TS(ul_int) }, + + { RS(SWAP_DELTA_CACHED), TS(s_int) }, + { RS(SWAP_DELTA_FREE), TS(s_int) }, + { RS(SWAP_DELTA_TOTAL), TS(s_int) }, + { RS(SWAP_DELTA_USED), TS(s_int) }, +}; + + /* please note, + * this enum MUST be 1 greater than the highest value of any enum */ +enum meminfo_item MEMINFO_logical_end = MAXTABLE(Item_table); + +#undef setNAME +#undef RS + + +// ___ Private Functions |||||||||||||||||||||||||||||||||||||||||||||||||||||| + +static inline void meminfo_assign_results ( + struct meminfo_stack *stack, + struct mem_hist *hist) +{ + struct meminfo_result *this = stack->head; + + for (;;) { + enum meminfo_item item = this->item; + if (item >= MEMINFO_logical_end) + break; + Item_table[item].setsfunc(this, hist); + ++this; + } + return; +} // end: meminfo_assign_results + + +static void meminfo_extents_free_all ( + struct meminfo_info *info) +{ + while (info->extents) { + struct stacks_extent *p = info->extents; + info->extents = info->extents->next; + free(p); + }; +} // end: meminfo_extents_free_all + + +static inline struct meminfo_result *meminfo_itemize_stack ( + struct meminfo_result *p, + int depth, + enum meminfo_item *items) +{ + struct meminfo_result *p_sav = p; + int i; + + for (i = 0; i < depth; i++) { + p->item = items[i]; + ++p; + } + return p_sav; +} // end: meminfo_itemize_stack + + +static inline int meminfo_items_check_failed ( + int numitems, + enum meminfo_item *items) +{ + int i; + + /* if an enum is passed instead of an address of one or more enums, ol' gcc + * will silently convert it to an address (possibly NULL). only clang will + * offer any sort of warning like the following: + * + * warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'enum meminfo_item *' + * my_stack = procps_meminfo_select(info, MEMINFO_noop, num); + * ^~~~~~~~~~~~~~~~ + */ + if (numitems < 1 + || (void *)items < (void *)(unsigned long)(2 * MEMINFO_logical_end)) + return 1; + + for (i = 0; i < numitems; i++) { + // a meminfo_item is currently unsigned, but we'll protect our future + if (items[i] < 0) + return 1; + if (items[i] >= MEMINFO_logical_end) + return 1; + } + + return 0; +} // end: meminfo_items_check_failed + + +static int meminfo_make_hash_failed ( + struct meminfo_info *info) +{ + #define htVAL(f) e.key = STRINGIFY(f); e.data = &info->hist.new. f; \ + if (!hsearch_r(e, ENTER, &ep, &info->hashtab)) return 1; + #define htXTRA(k,f) e.key = STRINGIFY(k); e.data = &info->hist.new. f; \ + if (!hsearch_r(e, ENTER, &ep, &info->hashtab)) return 1; + ENTRY e, *ep; + size_t n; + + // will also include those derived fields (more is better) + n = sizeof(struct meminfo_data) / sizeof(unsigned long); + // we'll follow the hsearch recommendation of an extra 25% + if (!hcreate_r(n + (n / 4), &info->hashtab)) + return 1; + + htVAL(Active) + htXTRA(Active(anon), Active_anon) + htXTRA(Active(file), Active_file) + htVAL(AnonHugePages) + htVAL(AnonPages) + htVAL(Bounce) + htVAL(Buffers) + htVAL(Cached) + htVAL(CmaFree) + htVAL(CmaTotal) + htVAL(CommitLimit) + htVAL(Committed_AS) + htVAL(DirectMap1G) + htVAL(DirectMap2M) + htVAL(DirectMap4M) + htVAL(DirectMap4k) + htVAL(Dirty) + htVAL(FileHugePages) + htVAL(FilePmdMapped) + htVAL(HardwareCorrupted) + htVAL(HighFree) + htVAL(HighTotal) + htVAL(HugePages_Free) + htVAL(HugePages_Rsvd) + htVAL(HugePages_Surp) + htVAL(HugePages_Total) + htVAL(Hugepagesize) + htVAL(Hugetlb) + htVAL(Inactive) + htXTRA(Inactive(anon), Inactive_anon) + htXTRA(Inactive(file), Inactive_file) + htVAL(KReclaimable) + htVAL(KernelStack) + htVAL(LowFree) + htVAL(LowTotal) + htVAL(Mapped) + htVAL(MemAvailable) + htVAL(MemFree) + htVAL(MemTotal) + htVAL(Mlocked) + htVAL(MmapCopy) + htVAL(NFS_Unstable) + htVAL(PageTables) + htVAL(Percpu) + htVAL(SReclaimable) + htVAL(SUnreclaim) + htVAL(ShadowCallStack) + htVAL(Shmem) + htVAL(ShmemHugePages) + htVAL(ShmemPmdMapped) + htVAL(Slab) + htVAL(SwapCached) + htVAL(SwapFree) + htVAL(SwapTotal) + htVAL(Unevictable) + htVAL(VmallocChunk) + htVAL(VmallocTotal) + htVAL(VmallocUsed) + htVAL(Writeback) + htVAL(WritebackTmp) + + return 0; + #undef htVAL + #undef htXTRA +} // end: meminfo_make_hash_failed + + +/* + * meminfo_read_failed(): + * + * Read the data out of /proc/meminfo putting the information + * into the supplied info structure + */ +static int meminfo_read_failed ( + struct meminfo_info *info) +{ + /* a 'memory history reference' macro for readability, + so we can focus the field names ... */ + #define mHr(f) info->hist.new. f + char buf[MEMINFO_BUFF]; + char *head, *tail; + int size; + unsigned long *valptr; + signed long mem_used; + + // remember history from last time around + memcpy(&info->hist.old, &info->hist.new, sizeof(struct meminfo_data)); + // clear out the soon to be 'current' values + memset(&info->hist.new, 0, sizeof(struct meminfo_data)); + + if (-1 == info->meminfo_fd + && (-1 == (info->meminfo_fd = open(MEMINFO_FILE, O_RDONLY)))) + return 1; + + if (lseek(info->meminfo_fd, 0L, SEEK_SET) == -1) + return 1; + + for (;;) { + if ((size = read(info->meminfo_fd, buf, sizeof(buf)-1)) < 0) { + if (errno == EINTR || errno == EAGAIN) + continue; + return 1; + } + break; + } + if (size == 0) { + errno = EIO; + return 1; + } + buf[size] = '\0'; + + head = buf; + + for (;;) { + static __thread ENTRY e; // keep coverity off our backs (e.data) + ENTRY *ep; + + if (!(tail = strchr(head, ':'))) + break; + *tail = '\0'; + valptr = NULL; + + e.key = head; + if (hsearch_r(e, FIND, &ep, &info->hashtab)) + valptr = ep->data; + head = tail + 1; + if (valptr) + *valptr = strtoul(head, NULL, 10); + + if (!(tail = strchr(head, '\n'))) + break; + head = tail + 1; + } + + if (0 == mHr(MemAvailable)) + mHr(MemAvailable) = mHr(MemFree); + mHr(derived_mem_cached) = mHr(Cached) + mHr(SReclaimable); + + /* if 'available' is greater than 'total' or our calculation of mem_used + overflows, that's symptomatic of running within a lxc container where + such values will be dramatically distorted over those of the host. */ + if (mHr(MemAvailable) > mHr(MemTotal)) + mHr(MemAvailable) = mHr(MemFree); + mem_used = mHr(MemTotal) - mHr(MemAvailable); + if (mem_used < 0) + mem_used = mHr(MemTotal) - mHr(MemFree); + mHr(derived_mem_used) = (unsigned long)mem_used; + + if (mHr(HighFree) < mHr(HighTotal)) + mHr(derived_mem_hi_used) = mHr(HighTotal) - mHr(HighFree); + + if (0 == mHr(LowTotal)) { + mHr(LowTotal) = mHr(MemTotal); + mHr(LowFree) = mHr(MemFree); + } + if (mHr(LowFree) < mHr(LowTotal)) + mHr(derived_mem_lo_used) = mHr(LowTotal) - mHr(LowFree); + + if (mHr(SwapFree) < mHr(SwapTotal)) + mHr(derived_swap_used) = mHr(SwapTotal) - mHr(SwapFree); + + return 0; + #undef mHr +} // end: meminfo_read_failed + + +/* + * meminfo_stacks_alloc(): + * + * Allocate and initialize one or more stacks each of which is anchored in an + * associated context structure. + * + * All such stacks will have their result structures properly primed with + * 'items', while the result itself will be zeroed. + * + * Returns a stacks_extent struct anchoring the 'heads' of each new stack. + */ +static struct stacks_extent *meminfo_stacks_alloc ( + struct meminfo_info *info, + int maxstacks) +{ + struct stacks_extent *p_blob; + struct meminfo_stack **p_vect; + struct meminfo_stack *p_head; + size_t vect_size, head_size, list_size, blob_size; + void *v_head, *v_list; + int i; + + vect_size = sizeof(void *) * maxstacks; // size of the addr vectors | + vect_size += sizeof(void *); // plus NULL addr delimiter | + head_size = sizeof(struct meminfo_stack); // size of that head struct | + list_size = sizeof(struct meminfo_result)*info->numitems; // any single results stack | + blob_size = sizeof(struct stacks_extent); // the extent anchor itself | + blob_size += vect_size; // plus room for addr vects | + blob_size += head_size * maxstacks; // plus room for head thing | + blob_size += list_size * maxstacks; // plus room for our stacks | + + /* note: all of this memory is allocated in a single blob, facilitating a later free(). | + as a minimum, it is important that the result structures themselves always are | + contiguous within each stack since they're accessed through relative position. | */ + if (NULL == (p_blob = calloc(1, blob_size))) + return NULL; + + p_blob->next = info->extents; // push this extent onto... | + info->extents = p_blob; // ...some existing extents | + p_vect = (void *)p_blob + sizeof(struct stacks_extent); // prime our vector pointer | + p_blob->stacks = p_vect; // set actual vectors start | + v_head = (void *)p_vect + vect_size; // prime head pointer start | + v_list = v_head + (head_size * maxstacks); // prime our stacks pointer | + + for (i = 0; i < maxstacks; i++) { + p_head = (struct meminfo_stack *)v_head; + p_head->head = meminfo_itemize_stack((struct meminfo_result *)v_list, info->numitems, info->items); + p_blob->stacks[i] = p_head; + v_list += list_size; + v_head += head_size; + } + p_blob->ext_numstacks = maxstacks; + return p_blob; +} // end: meminfo_stacks_alloc + + +// ___ Public Functions ||||||||||||||||||||||||||||||||||||||||||||||||||||||| + +// --- standard required functions -------------------------------------------- + +/* + * procps_meminfo_new: + * + * Create a new container to hold the stat information + * + * The initial refcount is 1, and needs to be decremented + * to release the resources of the structure. + * + * Returns: < 0 on failure, 0 on success along with + * a pointer to a new context struct + */ +PROCPS_EXPORT int procps_meminfo_new ( + struct meminfo_info **info) +{ + struct meminfo_info *p; + +#ifdef ITEMTABLE_DEBUG + int i, failed = 0; + for (i = 0; i < MAXTABLE(Item_table); i++) { + if (i != Item_table[i].enumnumb) { + fprintf(stderr, "%s: enum/table error: Item_table[%d] was %s, but its value is %d\n" + , __FILE__, i, Item_table[i].enum2str, Item_table[i].enumnumb); + failed = 1; + } + } + if (failed) _Exit(EXIT_FAILURE); +#endif + + if (info == NULL || *info != NULL) + return -EINVAL; + if (!(p = calloc(1, sizeof(struct meminfo_info)))) + return -ENOMEM; + + p->refcount = 1; + p->meminfo_fd = -1; + + if (meminfo_make_hash_failed(p)) { + free(p); + return -errno; + } + + /* do a priming read here for the following potential benefits: | + 1) ensure there will be no problems with subsequent access | + 2) make delta results potentially useful, even if 1st time | + 3) elimnate need for history distortions 1st time 'switch' | */ + if (meminfo_read_failed(p)) { + procps_meminfo_unref(&p); + return -errno; + } + + *info = p; + return 0; +} // end: procps_meminfo_new + + +PROCPS_EXPORT int procps_meminfo_ref ( + struct meminfo_info *info) +{ + if (info == NULL) + return -EINVAL; + + info->refcount++; + return info->refcount; +} // end: procps_meminfo_ref + + +PROCPS_EXPORT int procps_meminfo_unref ( + struct meminfo_info **info) +{ + if (info == NULL || *info == NULL) + return -EINVAL; + + (*info)->refcount--; + + if ((*info)->refcount < 1) { + int errno_sav = errno; + + if ((*info)->meminfo_fd != -1) + close((*info)->meminfo_fd); + + if ((*info)->extents) + meminfo_extents_free_all((*info)); + if ((*info)->items) + free((*info)->items); + hdestroy_r(&(*info)->hashtab); + + free(*info); + *info = NULL; + + errno = errno_sav; + return 0; + } + return (*info)->refcount; +} // end: procps_meminfo_unref + + +// --- variable interface functions ------------------------------------------- + +PROCPS_EXPORT struct meminfo_result *procps_meminfo_get ( + struct meminfo_info *info, + enum meminfo_item item) +{ + time_t cur_secs; + + errno = EINVAL; + if (info == NULL) + return NULL; + if (item < 0 || item >= MEMINFO_logical_end) + return NULL; + errno = 0; + + /* we will NOT read the meminfo file with every call - rather, we'll offer + a granularity of 1 second between reads ... */ + cur_secs = time(NULL); + if (1 <= cur_secs - info->sav_secs) { + if (meminfo_read_failed(info)) + return NULL; + info->sav_secs = cur_secs; + } + + info->get_this.item = item; + // with 'get', we must NOT honor the usual 'noop' guarantee + info->get_this.result.ul_int = 0; + Item_table[item].setsfunc(&info->get_this, &info->hist); + + return &info->get_this; +} // end: procps_meminfo_get + + +/* procps_meminfo_select(): + * + * Harvest all the requested MEM and/or SWAP information then return + * it in a results stack. + * + * Returns: pointer to a meminfo_stack struct on success, NULL on error. + */ +PROCPS_EXPORT struct meminfo_stack *procps_meminfo_select ( + struct meminfo_info *info, + enum meminfo_item *items, + int numitems) +{ + errno = EINVAL; + if (info == NULL || items == NULL) + return NULL; + if (meminfo_items_check_failed(numitems, items)) + return NULL; + errno = 0; + + /* is this the first time or have things changed since we were last called? + if so, gotta' redo all of our stacks stuff ... */ + if (info->numitems != numitems + 1 + || memcmp(info->items, items, sizeof(enum meminfo_item) * numitems)) { + // allow for our MEMINFO_logical_end + if (!(info->items = realloc(info->items, sizeof(enum meminfo_item) * (numitems + 1)))) + return NULL; + memcpy(info->items, items, sizeof(enum meminfo_item) * numitems); + info->items[numitems] = MEMINFO_logical_end; + info->numitems = numitems + 1; + if (info->extents) + meminfo_extents_free_all(info); + } + if (!info->extents + && (!meminfo_stacks_alloc(info, 1))) + return NULL; + + if (meminfo_read_failed(info)) + return NULL; + meminfo_assign_results(info->extents->stacks[0], &info->hist); + + return info->extents->stacks[0]; +} // end: procps_meminfo_select + + +// --- special debugging function(s) ------------------------------------------ +/* + * The following isn't part of the normal programming interface. Rather, + * it exists to validate result types referenced in application programs. + * + * It's used only when: + * 1) the 'XTRA_PROCPS_DEBUG' has been defined, or + * 2) an #include of 'xtra-procps-debug.h' is used + */ + +PROCPS_EXPORT struct meminfo_result *xtra_meminfo_get ( + struct meminfo_info *info, + enum meminfo_item actual_enum, + const char *typestr, + const char *file, + int lineno) +{ + struct meminfo_result *r = procps_meminfo_get(info, actual_enum); + + if (actual_enum < 0 || actual_enum >= MEMINFO_logical_end) { + fprintf(stderr, "%s line %d: invalid item = %d, type = %s\n" + , file, lineno, actual_enum, typestr); + } + if (r) { + char *str = Item_table[r->item].type2str; + if (str[0] + && (strcmp(typestr, str))) + fprintf(stderr, "%s line %d: was %s, expected %s\n", file, lineno, typestr, str); + } + return r; +} // end: xtra_meminfo_get_ + + +PROCPS_EXPORT struct meminfo_result *xtra_meminfo_val ( + int relative_enum, + const char *typestr, + const struct meminfo_stack *stack, + struct meminfo_info *info, + const char *file, + int lineno) +{ + char *str; + int i; + + for (i = 0; stack->head[i].item < MEMINFO_logical_end; i++) + ; + if (relative_enum < 0 || relative_enum >= i) { + fprintf(stderr, "%s line %d: invalid relative_enum = %d, valid range = 0-%d\n" + , file, lineno, relative_enum, i-1); + return NULL; + } + str = Item_table[stack->head[relative_enum].item].type2str; + if (str[0] + && (strcmp(typestr, str))) { + fprintf(stderr, "%s line %d: was %s, expected %s\n", file, lineno, typestr, str); + } + return &stack->head[relative_enum]; + (void)info; +} // end: xtra_meminfo_val diff --git a/library/namespace.c b/library/namespace.c new file mode 100644 index 0000000..04e4c45 --- /dev/null +++ b/library/namespace.c @@ -0,0 +1,116 @@ +/* + * namespace.c - Library API for Linux namespaces + * + * Copyright © 2015-2023 Jim Warner + * Copyright © 2015-2023 Craig Small + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include + +#include "misc.h" +#include "procps-private.h" + +#define NSPATHLEN 64 + +static const char *ns_names[] = { + [PROCPS_NS_CGROUP] = "cgroup", + [PROCPS_NS_IPC] = "ipc", + [PROCPS_NS_MNT] = "mnt", + [PROCPS_NS_NET] = "net", + [PROCPS_NS_PID] = "pid", + [PROCPS_NS_TIME] = "time", + [PROCPS_NS_USER] = "user", + [PROCPS_NS_UTS] = "uts" +}; + + +/* + * procps_ns_get_name: + * + * Find the name of the namespace with the given ID + * + * @id: The ID of the required namespace, see + * namespace_type + * + * Returns: static string of the namespace + */ +PROCPS_EXPORT const char *procps_ns_get_name(const int id) +{ + if (id >= PROCPS_NS_COUNT || id < 0) + return NULL; + return ns_names[id]; +} + +/* + * procps_ns_get_id: + * + * Find the namespace ID that matches the given + * name. + * + * @name: the name of the required namespace + * + * Returns: ID of found name + * < 0 means error + */ +PROCPS_EXPORT int procps_ns_get_id(const char *name) +{ + int i; + + if (name == NULL) + return -EINVAL; + for (i=0; i < PROCPS_NS_COUNT; i++) + if (!strcmp(ns_names[i], name)) + return i; + return -EINVAL; +} + +/* + * procs_ns_read_pid: + * + * Find all namespaces for the given process. + * @pid: Process ID for required process + * @nsp: Pointer to the struct procps_ns + * + * Returns: + * 0 on success + * < 0 on error + */ +PROCPS_EXPORT int procps_ns_read_pid( + const int pid, + struct procps_ns *nsp) +{ + char path[NSPATHLEN+1]; + struct stat st; + int i; + + if (nsp == NULL) + return -EINVAL; + if (pid < 1) + return -EINVAL; + + for (i=0; i < PROCPS_NS_COUNT; i++) { + snprintf(path, NSPATHLEN, "/proc/%d/ns/%s", pid, ns_names[i]); + if (0 == stat(path, &st)) + nsp->ns[i] = (unsigned long)st.st_ino; + else + nsp->ns[i] = 0; + } + return 0; +} diff --git a/library/numa.c b/library/numa.c new file mode 100644 index 0000000..3fca413 --- /dev/null +++ b/library/numa.c @@ -0,0 +1,114 @@ +/* + * NUMA node support for & interfaces + * + * Copyright © 2017-2023 Jim Warner + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef NUMA_DISABLE +#include +#endif +#include + +#include "numa.h" + +/* + * We're structured so that if numa_init() is NOT called or that ./configure | + * --disable-numa WAS specified, then calls to both of our primary functions | + * of numa_max_node() plus numa_node_of_cpu() would always return a negative | + * 1 which signifies that NUMA information isn't available. That ./configure | + * option might be required when libdl.so (necessary for dlopen) is missing. | + */ + + +/* ------------------------------------------------------------------------- + + a strictly development #define, existing specifically for the top program | + ( and it has no affect if ./configure --disable-numa has been specified ) | */ +//#define PRETEND_NUMA // pretend there are 3 'discontiguous' numa nodes | +// ------------------------------------------------------------------------- + + + +static int null_max_node (void) { return -1; } +static int null_node_of_cpu (int n) { (void)n; return -1; } + + +#ifndef NUMA_DISABLE + #ifdef PRETEND_NUMA +static int fake_max_node (void) { return 3; } +static int fake_node_of_cpu (int n) { return (1 == (n % 4)) ? 0 : (n % 4); } + #endif +#endif + + +#ifndef NUMA_DISABLE +static void *libnuma_handle; +#endif +int (*numa_max_node) (void) = null_max_node; +int (*numa_node_of_cpu) (int) = null_node_of_cpu; + + +void numa_init (void) { + static int initialized; + + if (initialized) + return; + +#ifndef NUMA_DISABLE + #ifndef PRETEND_NUMA + // we'll try for the most recent version, then a version we know works... + if ((libnuma_handle = dlopen("libnuma.so", RTLD_LAZY)) + || (libnuma_handle = dlopen("libnuma.so.1", RTLD_LAZY))) { + numa_max_node = dlsym(libnuma_handle, "numa_max_node"); + numa_node_of_cpu = dlsym(libnuma_handle, "numa_node_of_cpu"); + if (numa_max_node == NULL + || (numa_node_of_cpu == NULL)) { + // this dlclose is safe - we've yet to call numa_node_of_cpu + // ( there's one other dlclose which has now been disabled ) + dlclose(libnuma_handle); + libnuma_handle = NULL; + numa_max_node = null_max_node; + numa_node_of_cpu = null_node_of_cpu; + } + } + #else + libnuma_handle = (void *)-1; + numa_max_node = fake_max_node; + numa_node_of_cpu = fake_node_of_cpu; + #endif +#endif + initialized = 1; +} // end: numa_init + + +void numa_uninit (void) { +#ifndef PRETEND_NUMA + /* note: we'll skip a dlcose() to avoid the following libnuma memory + * leak which is triggered after a call to numa_node_of_cpu(): + * ==1234== LEAK SUMMARY: + * ==1234== definitely lost: 512 bytes in 1 blocks + * ==1234== indirectly lost: 48 bytes in 2 blocks + * ==1234== ... + * [ thanks very much libnuma for all the pains you have caused us ] + */ +// if (libnuma_handle) +// dlclose(libnuma_handle); +#endif +} // end: numa_uninit + + +#if defined(PRETEND_NUMA) && defined(NUMA_DISABLE) +# warning 'PRETEND_NUMA' ignored, 'NUMA_DISABLE' is active +#endif diff --git a/library/pids.c b/library/pids.c new file mode 100644 index 0000000..6ae94ad --- /dev/null +++ b/library/pids.c @@ -0,0 +1,1700 @@ +/* + * pids.c - process related definitions for libproc2 + * + * Copyright © 2015-2023 Jim Warner + * Copyright © 2015-2023 Craig Small + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +//efine _GNU_SOURCE // for qsort_r + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "devname.h" +#include "misc.h" +#include "numa.h" +#include "readproc.h" +#include "wchan.h" + +#include "procps-private.h" +#include "pids.h" + + +//#define UNREF_RPTHASH // report hash details at uref() time + +#define FILL_ID_MAX 255 // upper limit with select of pid/uid +#define STACKS_INIT 1024 // amount of initial stack allocation +#define STACKS_GROW 128 // amount reap stack allocations grow +#define NEWOLD_INIT 1024 // amount for initial hist allocation +#define NEWOLD_GROW 128 // amt by which hist allocations grow + +/* ------------------------------------------------------------------------- + + this provision can be used to ensure that our Item_table was synchronized | + with those enumerators found in the associated header file. It's intended | + to only be used locally (& temporarily) at some point prior to a release! | */ +// #define ITEMTABLE_DEBUG //----------------------------------------------- | +// ------------------------------------------------------------------------- + + + +struct stacks_extent { + int ext_numstacks; + struct stacks_extent *next; + struct pids_stack **stacks; +}; + +struct fetch_support { + struct pids_stack **anchor; // reap/select consolidated extents + int n_alloc; // number of above pointers allocated + int n_inuse; // number of above pointers occupied + int n_alloc_save; // last known results.stacks allocation + struct pids_fetch results; // counts + stacks for return to caller + struct pids_counts counts; // actual counts pointed to by 'results' +}; + +typedef void (*SET_t)(struct pids_info *, struct pids_result *, proc_t *); + +struct pids_info { + int refcount; + int maxitems; // includes 'logical_end' delimiter + enum pids_item *items; // includes 'logical_end' delimiter + struct stacks_extent *extents; // anchor for all resettable extents + struct stacks_extent *otherexts; // anchor for invariant extents // <=== currently unused + struct fetch_support fetch; // support for procps_pids_reap, select, fatal + int history_yes; // need historical data + struct history_info *hist; // pointer to historical support data + proc_t*(*read_something)(PROCTAB*, proc_t*); // readproc/readeither via which + unsigned pgs2k_shift; // to convert some proc vaules + unsigned oldflags; // the old library PROC_FILL flagss + PROCTAB *fetch_PT; // oldlib interface for 'select' & 'reap' + unsigned long hertz; // for the 'TIME' & 'UTILIZATION' calculations + unsigned long long boot_tics; // for TIME_ELAPSED & 'UTILIZATION' calculations + PROCTAB *get_PT; // oldlib interface for active 'get' + struct stacks_extent *get_ext; // for active 'get' (also within 'extents') + enum pids_fetch_type get_type; // last known type of 'get' request + int seterr; // an ENOMEM encountered during assign + proc_t get_proc; // the proc_t used by procps_pids_get + proc_t fetch_proc; // the proc_t used by pids_stacks_fetch + SET_t *func_array; // extracted Item_table 'setsfunc' pointers +}; + + +// ___ Free Storage Support ||||||||||||||||||||||||||||||||||||||||||||||||||| + +#define freNAME(t) free_pids_ ## t + +static void freNAME(str) (struct pids_result *R) { + if (R->result.str) free(R->result.str); +} + +static void freNAME(strv) (struct pids_result *R) { + if (R->result.strv && *R->result.strv) free(*R->result.strv); +} + + +// ___ Results 'Set' Support |||||||||||||||||||||||||||||||||||||||||||||||||| + +#define setNAME(e) set_pids_ ## e +#define setDECL(e) static void setNAME(e) \ + (struct pids_info *I, struct pids_result *R, proc_t *P) + +/* convert pages to kib */ +#define CVT_set(e,t,x) setDECL(e) { \ + R->result. t = (long)(P-> x) << I -> pgs2k_shift; } +/* strdup of a static char array */ +#define DUP_set(e,x) setDECL(e) { \ + freNAME(str)(R); \ + if (!(R->result.str = strdup(P-> x))) I->seterr = 1; } +/* regular assignment copy */ +#define REG_set(e,t,x) setDECL(e) { \ + (void)I; R->result. t = P-> x; } +/* take ownership of a normal single string if possible, else return + some sort of hint that they duplicated this char * item ... */ +#define STR_set(e,x) setDECL(e) { \ + freNAME(str)(R); \ + if (NULL != P-> x) { R->result.str = P-> x; P-> x = NULL; } \ + else { R->result.str = strdup("[ duplicate " STRINGIFY(e) " ]"); \ + if (!R->result.str) I->seterr = 1; } } +/* take ownership of true vectorized strings if possible, else return + some sort of hint that they duplicated this char ** item ... */ +#define VEC_set(e,x) setDECL(e) { \ + freNAME(strv)(R); \ + if (NULL != P-> x) { R->result.strv = P-> x; P-> x = NULL; } \ + else { R->result.strv = vectorize_this_str("[ duplicate " STRINGIFY(e) " ]"); \ + if (!R->result.strv) I->seterr = 1; } } + + +setDECL(noop) { (void)I; (void)R; (void)P; } +setDECL(extra) { (void)I; (void)P; R->result.ull_int = 0; } + +REG_set(ADDR_CODE_END, ul_int, end_code) +REG_set(ADDR_CODE_START, ul_int, start_code) +REG_set(ADDR_CURR_EIP, ul_int, kstk_eip) +REG_set(ADDR_CURR_ESP, ul_int, kstk_esp) +REG_set(ADDR_STACK_START, ul_int, start_stack) +REG_set(AUTOGRP_ID, s_int, autogrp_id) +REG_set(AUTOGRP_NICE, s_int, autogrp_nice) +STR_set(CGNAME, cgname) +STR_set(CGROUP, cgroup) +VEC_set(CGROUP_V, cgroup_v) +STR_set(CMD, cmd) +STR_set(CMDLINE, cmdline) +VEC_set(CMDLINE_V, cmdline_v) +STR_set(ENVIRON, environ) +VEC_set(ENVIRON_V, environ_v) +STR_set(EXE, exe) +REG_set(EXIT_SIGNAL, s_int, exit_signal) +REG_set(FLAGS, ul_int, flags) +REG_set(FLT_MAJ, ul_int, maj_flt) +setDECL(FLT_MAJ_C) { (void)I; R->result.ul_int = P->maj_flt + P->cmaj_flt; } +REG_set(FLT_MAJ_DELTA, s_int, maj_delta) +REG_set(FLT_MIN, ul_int, min_flt) +setDECL(FLT_MIN_C) { (void)I; R->result.ul_int = P->min_flt + P->cmin_flt; } +REG_set(FLT_MIN_DELTA, s_int, min_delta) +REG_set(ID_EGID, u_int, egid) +REG_set(ID_EGROUP, str, egroup) +REG_set(ID_EUID, u_int, euid) +REG_set(ID_EUSER, str, euser) +REG_set(ID_FGID, u_int, fgid) +REG_set(ID_FGROUP, str, fgroup) +REG_set(ID_FUID, u_int, fuid) +REG_set(ID_FUSER, str, fuser) +REG_set(ID_LOGIN, s_int, luid) +REG_set(ID_PGRP, s_int, pgrp) +REG_set(ID_PID, s_int, tid) +REG_set(ID_PPID, s_int, ppid) +REG_set(ID_RGID, u_int, rgid) +REG_set(ID_RGROUP, str, rgroup) +REG_set(ID_RUID, u_int, ruid) +REG_set(ID_RUSER, str, ruser) +REG_set(ID_SESSION, s_int, session) +REG_set(ID_SGID, u_int, sgid) +REG_set(ID_SGROUP, str, sgroup) +REG_set(ID_SUID, u_int, suid) +REG_set(ID_SUSER, str, suser) +REG_set(ID_TGID, s_int, tgid) +REG_set(ID_TID, s_int, tid) +REG_set(ID_TPGID, s_int, tpgid) +REG_set(IO_READ_BYTES, ul_int, read_bytes) +REG_set(IO_READ_CHARS, ul_int, rchar) +REG_set(IO_READ_OPS, ul_int, syscr) +REG_set(IO_WRITE_BYTES, ul_int, write_bytes) +REG_set(IO_WRITE_CBYTES, ul_int, cancelled_write_bytes) +REG_set(IO_WRITE_CHARS, ul_int, wchar) +REG_set(IO_WRITE_OPS, ul_int, syscw) +REG_set(LXCNAME, str, lxcname) +CVT_set(MEM_CODE, ul_int, trs) +REG_set(MEM_CODE_PGS, ul_int, trs) +CVT_set(MEM_DATA, ul_int, drs) +REG_set(MEM_DATA_PGS, ul_int, drs) +CVT_set(MEM_RES, ul_int, resident) +REG_set(MEM_RES_PGS, ul_int, resident) +CVT_set(MEM_SHR, ul_int, share) +REG_set(MEM_SHR_PGS, ul_int, share) +CVT_set(MEM_VIRT, ul_int, size) +REG_set(MEM_VIRT_PGS, ul_int, size) +REG_set(NICE, s_int, nice) +REG_set(NLWP, s_int, nlwp) +REG_set(NS_CGROUP, ul_int, ns.ns[0]) +REG_set(NS_IPC, ul_int, ns.ns[1]) +REG_set(NS_MNT, ul_int, ns.ns[2]) +REG_set(NS_NET, ul_int, ns.ns[3]) +REG_set(NS_PID, ul_int, ns.ns[4]) +REG_set(NS_TIME, ul_int, ns.ns[5]) +REG_set(NS_USER, ul_int, ns.ns[6]) +REG_set(NS_UTS, ul_int, ns.ns[7]) +REG_set(OOM_ADJ, s_int, oom_adj) +REG_set(OOM_SCORE, s_int, oom_score) +REG_set(PRIORITY, s_int, priority) +REG_set(PRIORITY_RT, s_int, rtprio) +REG_set(PROCESSOR, s_int, processor) +setDECL(PROCESSOR_NODE) { (void)I; R->result.s_int = numa_node_of_cpu(P->processor); } +REG_set(RSS, ul_int, rss) +REG_set(RSS_RLIM, ul_int, rss_rlim) +REG_set(SCHED_CLASS, s_int, sched) +STR_set(SD_MACH, sd_mach) +STR_set(SD_OUID, sd_ouid) +STR_set(SD_SEAT, sd_seat) +STR_set(SD_SESS, sd_sess) +STR_set(SD_SLICE, sd_slice) +STR_set(SD_UNIT, sd_unit) +STR_set(SD_UUNIT, sd_uunit) +DUP_set(SIGBLOCKED, blocked) +DUP_set(SIGCATCH, sigcatch) +DUP_set(SIGIGNORE, sigignore) +DUP_set(SIGNALS, signal) +DUP_set(SIGPENDING, _sigpnd) +REG_set(SMAP_ANONYMOUS, ul_int, smap_Anonymous) +REG_set(SMAP_HUGE_ANON, ul_int, smap_AnonHugePages) +REG_set(SMAP_HUGE_FILE, ul_int, smap_FilePmdMapped) +REG_set(SMAP_HUGE_SHMEM, ul_int, smap_ShmemPmdMapped) +REG_set(SMAP_HUGE_TLBPRV, ul_int, smap_Private_Hugetlb) +REG_set(SMAP_HUGE_TLBSHR, ul_int, smap_Shared_Hugetlb) +REG_set(SMAP_LAZY_FREE, ul_int, smap_LazyFree) +REG_set(SMAP_LOCKED, ul_int, smap_Locked) +REG_set(SMAP_PRV_CLEAN, ul_int, smap_Private_Clean) +REG_set(SMAP_PRV_DIRTY, ul_int, smap_Private_Dirty) +setDECL(SMAP_PRV_TOTAL) { (void)I; R->result.ul_int = P->smap_Private_Clean + P->smap_Private_Dirty; } +REG_set(SMAP_PSS, ul_int, smap_Pss) +REG_set(SMAP_PSS_ANON, ul_int, smap_Pss_Anon) +REG_set(SMAP_PSS_FILE, ul_int, smap_Pss_File) +REG_set(SMAP_PSS_SHMEM, ul_int, smap_Pss_Shmem) +REG_set(SMAP_REFERENCED, ul_int, smap_Referenced) +REG_set(SMAP_RSS, ul_int, smap_Rss) +REG_set(SMAP_SHR_CLEAN, ul_int, smap_Shared_Clean) +REG_set(SMAP_SHR_DIRTY, ul_int, smap_Shared_Dirty) +REG_set(SMAP_SWAP, ul_int, smap_Swap) +REG_set(SMAP_SWAP_PSS, ul_int, smap_SwapPss) +REG_set(STATE, s_ch, state) +STR_set(SUPGIDS, supgid) +STR_set(SUPGROUPS, supgrp) +setDECL(TICS_ALL) { (void)I; R->result.ull_int = P->utime + P->stime; } +setDECL(TICS_ALL_C) { (void)I; R->result.ull_int = P->utime + P->stime + P->cutime + P->cstime; } +REG_set(TICS_ALL_DELTA, u_int, pcpu) +REG_set(TICS_BEGAN, ull_int, start_time) +REG_set(TICS_BLKIO, ull_int, blkio_tics) +REG_set(TICS_GUEST, ull_int, gtime) +setDECL(TICS_GUEST_C) { (void)I; R->result.ull_int = P->gtime + P->cgtime; } +REG_set(TICS_SYSTEM, ull_int, stime) +setDECL(TICS_SYSTEM_C) { (void)I; R->result.ull_int = P->stime + P->cstime; } +REG_set(TICS_USER, ull_int, utime) +setDECL(TICS_USER_C) { (void)I; R->result.ull_int = P->utime + P->cutime; } +setDECL(TIME_ALL) { R->result.real = ((double)P->utime + P->stime) / I->hertz; } +setDECL(TIME_ALL_C) { R->result.real = ((double)P->utime + P->stime + P->cutime + P->cstime) / I->hertz; } +setDECL(TIME_ELAPSED) { double t = I->boot_tics - P->start_time; if (t > 0) R->result.real = t / I->hertz; } +setDECL(TIME_START) { R->result.real = (double)P->start_time / I->hertz; } +REG_set(TTY, s_int, tty) +setDECL(TTY_NAME) { char buf[64]; freNAME(str)(R); dev_to_tty(buf, sizeof(buf), P->tty, P->tid, ABBREV_DEV); if (!(R->result.str = strdup(buf))) I->seterr = 1; } +setDECL(TTY_NUMBER) { char buf[64]; freNAME(str)(R); dev_to_tty(buf, sizeof(buf), P->tty, P->tid, ABBREV_DEV|ABBREV_TTY|ABBREV_PTS); if (!(R->result.str = strdup(buf))) I->seterr = 1; } +setDECL(UTILIZATION) { double t = I->boot_tics - P->start_time; if (t > 0) R->result.real = ((P->utime + P->stime) * 100.0f) / t; } +setDECL(UTILIZATION_C) { double t = I->boot_tics - P->start_time; if (t > 0) R->result.real = ((P->utime + P->stime + P->cutime + P->cstime) * 100.0f) / t; } +REG_set(VM_DATA, ul_int, vm_data) +REG_set(VM_EXE, ul_int, vm_exe) +REG_set(VM_LIB, ul_int, vm_lib) +REG_set(VM_RSS, ul_int, vm_rss) +REG_set(VM_RSS_ANON, ul_int, vm_rss_anon) +REG_set(VM_RSS_FILE, ul_int, vm_rss_file) +REG_set(VM_RSS_LOCKED, ul_int, vm_lock) +REG_set(VM_RSS_SHARED, ul_int, vm_rss_shared) +REG_set(VM_SIZE, ul_int, vm_size) +REG_set(VM_STACK, ul_int, vm_stack) +REG_set(VM_SWAP, ul_int, vm_swap) +setDECL(VM_USED) { (void)I; R->result.ul_int = P->vm_swap + P->vm_rss; } +REG_set(VSIZE_BYTES, ul_int, vsize) +setDECL(WCHAN_NAME) { freNAME(str)(R); if (!(R->result.str = strdup(lookup_wchan(P->tid)))) I->seterr = 1;; } + +#undef setDECL +#undef CVT_set +#undef DUP_set +#undef REG_set +#undef STR_set +#undef VEC_set + + +// ___ Sorting Support |||||||||||||||||||||||||||||||||||||||||||||||||||||||| + +struct sort_parms { + int offset; + enum pids_sort_order order; +}; + +#define srtNAME(t) sort_pids_ ## t +#define srtDECL(t) static int srtNAME(t) \ + (const struct pids_stack **A, const struct pids_stack **B, struct sort_parms *P) + +#define NUM_srt(T) srtDECL(T) { \ + const struct pids_result *a = (*A)->head + P->offset; \ + const struct pids_result *b = (*B)->head + P->offset; \ + return P->order * (a->result. T - b->result. T); } + +#define REG_srt(T) srtDECL(T) { \ + const struct pids_result *a = (*A)->head + P->offset; \ + const struct pids_result *b = (*B)->head + P->offset; \ + if ( a->result. T > b->result. T ) return P->order > 0 ? 1 : -1; \ + if ( a->result. T < b->result. T ) return P->order > 0 ? -1 : 1; \ + return 0; } + +NUM_srt(s_ch) +NUM_srt(s_int) + +REG_srt(u_int) +REG_srt(ul_int) +REG_srt(ull_int) + +REG_srt(real) + +srtDECL(str) { + const struct pids_result *a = (*A)->head + P->offset; + const struct pids_result *b = (*B)->head + P->offset; + return P->order * strcoll(a->result.str, b->result.str); +} + +srtDECL(strv) { + const struct pids_result *a = (*A)->head + P->offset; + const struct pids_result *b = (*B)->head + P->offset; + if (!a->result.strv || !b->result.strv) return 0; + return P->order * strcoll((*a->result.strv), (*b->result.strv)); +} + +srtDECL(strvers) { + const struct pids_result *a = (*A)->head + P->offset; + const struct pids_result *b = (*B)->head + P->offset; + return P->order * strverscmp(a->result.str, b->result.str); +} + +srtDECL(noop) { + (void)A; (void)B; (void)P; + return 0; +} + +#undef srtDECL +#undef NUM_srt +#undef REG_srt + + +// ___ Controlling Table |||||||||||||||||||||||||||||||||||||||||||||||||||||| + +#define f_either PROC_SPARE_1 // either status or stat (favor stat) +#define f_exe PROC_FILL_EXE +#define f_grp PROC_FILLGRP +#define f_io PROC_FILLIO +#define f_login PROC_FILL_LUID +#define f_lxc PROC_FILL_LXC +#define f_ns PROC_FILLNS +#define f_oom PROC_FILLOOM +#define f_smaps PROC_FILLSMAPS +#define f_stat PROC_FILLSTAT +#define f_statm PROC_FILLMEM +#define f_status PROC_FILLSTATUS +#define f_systemd PROC_FILLSYSTEMD +#define f_usr PROC_FILLUSR + // these next three will yield true verctorized strings +#define v_arg PROC_FILLARG +#define v_cgroup PROC_FILLCGROUP +#define v_env PROC_FILLENV + // these next three will yield a single string (never vectorized) +#define x_cgroup PROC_EDITCGRPCVT +#define x_cmdline PROC_EDITCMDLCVT +#define x_environ PROC_EDITENVRCVT + // these next three will also force PROC_FILLSTATUS +#define x_ogroup PROC_FILL_OGROUPS +#define x_ouser PROC_FILL_OUSERS +#define x_supgrp PROC_FILL_SUPGRP + // placed here so an 'f' prefix wouldn't make 'em first +#define z_autogrp PROC_FILLAUTOGRP + +typedef void (*FRE_t)(struct pids_result *); +typedef int (*QSR_t)(const void *, const void *, void *); + +#ifdef ITEMTABLE_DEBUG +#define RS(e) (SET_t)setNAME(e), PIDS_ ## e, STRINGIFY(PIDS_ ## e) +#else +#define RS(e) (SET_t)setNAME(e) +#endif +#define FF(t) (FRE_t)freNAME(t) +#define QS(t) (QSR_t)srtNAME(t) +#define TS(t) STRINGIFY(t) +#define TS_noop "" + + /* + * Need it be said? + * This table must be kept in the exact same order as + * those 'enum pids_item' guys ! */ +static struct { + SET_t setsfunc; // the actual result setting routine +#ifdef ITEMTABLE_DEBUG + int enumnumb; // enumerator (must match position!) + char *enum2str; // enumerator name as a char* string +#endif + unsigned oldflags; // PROC_FILLxxxx flags for this item + FRE_t freefunc; // free function for strings storage + QSR_t sortfunc; // sort cmp func for a specific type + int needhist; // a result requires history support + char *type2str; // the result type as a string value +} Item_table[] = { +/* setsfunc oldflags freefunc sortfunc needhist type2str + --------------------- ---------- --------- ------------- -------- ----------- */ + { RS(noop), 0, NULL, QS(noop), 0, TS_noop }, // user only, never altered + { RS(extra), 0, NULL, QS(ull_int), 0, TS_noop }, // user only, reset to zero + + { RS(ADDR_CODE_END), f_stat, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(ADDR_CODE_START), f_stat, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(ADDR_CURR_EIP), f_stat, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(ADDR_CURR_ESP), f_stat, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(ADDR_STACK_START), f_stat, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(AUTOGRP_ID), z_autogrp, NULL, QS(s_int), 0, TS(s_int) }, + { RS(AUTOGRP_NICE), z_autogrp, NULL, QS(s_int), 0, TS(s_int) }, + { RS(CGNAME), x_cgroup, FF(str), QS(str), 0, TS(str) }, + { RS(CGROUP), x_cgroup, FF(str), QS(str), 0, TS(str) }, + { RS(CGROUP_V), v_cgroup, FF(strv), QS(strv), 0, TS(strv) }, + { RS(CMD), f_either, FF(str), QS(str), 0, TS(str) }, + { RS(CMDLINE), x_cmdline, FF(str), QS(str), 0, TS(str) }, + { RS(CMDLINE_V), v_arg, FF(strv), QS(strv), 0, TS(strv) }, + { RS(ENVIRON), x_environ, FF(str), QS(str), 0, TS(str) }, + { RS(ENVIRON_V), v_env, FF(strv), QS(strv), 0, TS(strv) }, + { RS(EXE), f_exe, FF(str), QS(str), 0, TS(str) }, + { RS(EXIT_SIGNAL), f_stat, NULL, QS(s_int), 0, TS(s_int) }, + { RS(FLAGS), f_stat, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(FLT_MAJ), f_stat, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(FLT_MAJ_C), f_stat, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(FLT_MAJ_DELTA), f_stat, NULL, QS(s_int), +1, TS(s_int) }, + { RS(FLT_MIN), f_stat, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(FLT_MIN_C), f_stat, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(FLT_MIN_DELTA), f_stat, NULL, QS(s_int), +1, TS(s_int) }, + { RS(ID_EGID), 0, NULL, QS(u_int), 0, TS(u_int) }, // oldflags: free w/ simple_read + { RS(ID_EGROUP), f_grp, NULL, QS(str), 0, TS(str) }, + { RS(ID_EUID), 0, NULL, QS(u_int), 0, TS(u_int) }, // oldflags: free w/ simple_read + { RS(ID_EUSER), f_usr, NULL, QS(str), 0, TS(str) }, // freefunc NULL w/ cached string + { RS(ID_FGID), f_status, NULL, QS(u_int), 0, TS(u_int) }, + { RS(ID_FGROUP), x_ogroup, NULL, QS(str), 0, TS(str) }, + { RS(ID_FUID), f_status, NULL, QS(u_int), 0, TS(u_int) }, + { RS(ID_FUSER), x_ouser, NULL, QS(str), 0, TS(str) }, // freefunc NULL w/ cached string + { RS(ID_LOGIN), f_login, NULL, QS(s_int), 0, TS(s_int) }, + { RS(ID_PGRP), f_stat, NULL, QS(s_int), 0, TS(s_int) }, + { RS(ID_PID), 0, NULL, QS(s_int), 0, TS(s_int) }, // oldflags: free w/ simple_nextpid + { RS(ID_PPID), f_either, NULL, QS(s_int), 0, TS(s_int) }, + { RS(ID_RGID), f_status, NULL, QS(u_int), 0, TS(u_int) }, + { RS(ID_RGROUP), x_ogroup, NULL, QS(str), 0, TS(str) }, + { RS(ID_RUID), f_status, NULL, QS(u_int), 0, TS(u_int) }, + { RS(ID_RUSER), x_ouser, NULL, QS(str), 0, TS(str) }, // freefunc NULL w/ cached string + { RS(ID_SESSION), f_stat, NULL, QS(s_int), 0, TS(s_int) }, + { RS(ID_SGID), f_status, NULL, QS(u_int), 0, TS(u_int) }, + { RS(ID_SGROUP), x_ogroup, NULL, QS(str), 0, TS(str) }, + { RS(ID_SUID), f_status, NULL, QS(u_int), 0, TS(u_int) }, + { RS(ID_SUSER), x_ouser, NULL, QS(str), 0, TS(str) }, // freefunc NULL w/ cached string + { RS(ID_TGID), 0, NULL, QS(s_int), 0, TS(s_int) }, // oldflags: free w/ simple_nextpid + { RS(ID_TID), 0, NULL, QS(s_int), 0, TS(s_int) }, // oldflags: free w/ simple_nexttid + { RS(ID_TPGID), f_stat, NULL, QS(s_int), 0, TS(s_int) }, + { RS(IO_READ_BYTES), f_io, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(IO_READ_CHARS), f_io, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(IO_READ_OPS), f_io, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(IO_WRITE_BYTES), f_io, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(IO_WRITE_CBYTES), f_io, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(IO_WRITE_CHARS), f_io, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(IO_WRITE_OPS), f_io, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(LXCNAME), f_lxc, NULL, QS(str), 0, TS(str) }, // freefunc NULL w/ cached string + { RS(MEM_CODE), f_statm, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(MEM_CODE_PGS), f_statm, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(MEM_DATA), f_statm, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(MEM_DATA_PGS), f_statm, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(MEM_RES), f_statm, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(MEM_RES_PGS), f_statm, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(MEM_SHR), f_statm, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(MEM_SHR_PGS), f_statm, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(MEM_VIRT), f_statm, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(MEM_VIRT_PGS), f_statm, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(NICE), f_stat, NULL, QS(s_int), 0, TS(s_int) }, + { RS(NLWP), f_either, NULL, QS(s_int), 0, TS(s_int) }, + { RS(NS_CGROUP), f_ns, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(NS_IPC), f_ns, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(NS_MNT), f_ns, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(NS_NET), f_ns, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(NS_PID), f_ns, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(NS_TIME), f_ns, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(NS_USER), f_ns, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(NS_UTS), f_ns, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(OOM_ADJ), f_oom, NULL, QS(s_int), 0, TS(s_int) }, + { RS(OOM_SCORE), f_oom, NULL, QS(s_int), 0, TS(s_int) }, + { RS(PRIORITY), f_stat, NULL, QS(s_int), 0, TS(s_int) }, + { RS(PRIORITY_RT), f_stat, NULL, QS(s_int), 0, TS(s_int) }, + { RS(PROCESSOR), f_stat, NULL, QS(s_int), 0, TS(s_int) }, + { RS(PROCESSOR_NODE), f_stat, NULL, QS(s_int), 0, TS(s_int) }, + { RS(RSS), f_stat, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(RSS_RLIM), f_stat, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SCHED_CLASS), f_stat, NULL, QS(s_int), 0, TS(s_int) }, + { RS(SD_MACH), f_systemd, FF(str), QS(str), 0, TS(str) }, + { RS(SD_OUID), f_systemd, FF(str), QS(str), 0, TS(str) }, + { RS(SD_SEAT), f_systemd, FF(str), QS(str), 0, TS(str) }, + { RS(SD_SESS), f_systemd, FF(str), QS(str), 0, TS(str) }, + { RS(SD_SLICE), f_systemd, FF(str), QS(str), 0, TS(str) }, + { RS(SD_UNIT), f_systemd, FF(str), QS(str), 0, TS(str) }, + { RS(SD_UUNIT), f_systemd, FF(str), QS(str), 0, TS(str) }, + { RS(SIGBLOCKED), f_status, FF(str), QS(str), 0, TS(str) }, + { RS(SIGCATCH), f_status, FF(str), QS(str), 0, TS(str) }, + { RS(SIGIGNORE), f_status, FF(str), QS(str), 0, TS(str) }, + { RS(SIGNALS), f_status, FF(str), QS(str), 0, TS(str) }, + { RS(SIGPENDING), f_status, FF(str), QS(str), 0, TS(str) }, + { RS(SMAP_ANONYMOUS), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_HUGE_ANON), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_HUGE_FILE), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_HUGE_SHMEM), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_HUGE_TLBPRV), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_HUGE_TLBSHR), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_LAZY_FREE), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_LOCKED), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_PRV_CLEAN), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_PRV_DIRTY), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_PRV_TOTAL), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_PSS), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_PSS_ANON), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_PSS_FILE), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_PSS_SHMEM), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_REFERENCED), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_RSS), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_SHR_CLEAN), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_SHR_DIRTY), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_SWAP), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(SMAP_SWAP_PSS), f_smaps, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(STATE), f_either, NULL, QS(s_ch), 0, TS(s_ch) }, + { RS(SUPGIDS), f_status, FF(str), QS(str), 0, TS(str) }, + { RS(SUPGROUPS), x_supgrp, FF(str), QS(str), 0, TS(str) }, + { RS(TICS_ALL), f_stat, NULL, QS(ull_int), 0, TS(ull_int) }, + { RS(TICS_ALL_C), f_stat, NULL, QS(ull_int), 0, TS(ull_int) }, + { RS(TICS_ALL_DELTA), f_stat, NULL, QS(u_int), +1, TS(u_int) }, + { RS(TICS_BEGAN), f_stat, NULL, QS(ull_int), 0, TS(ull_int) }, + { RS(TICS_BLKIO), f_stat, NULL, QS(ull_int), 0, TS(ull_int) }, + { RS(TICS_GUEST), f_stat, NULL, QS(ull_int), 0, TS(ull_int) }, + { RS(TICS_GUEST_C), f_stat, NULL, QS(ull_int), 0, TS(ull_int) }, + { RS(TICS_SYSTEM), f_stat, NULL, QS(ull_int), 0, TS(ull_int) }, + { RS(TICS_SYSTEM_C), f_stat, NULL, QS(ull_int), 0, TS(ull_int) }, + { RS(TICS_USER), f_stat, NULL, QS(ull_int), 0, TS(ull_int) }, + { RS(TICS_USER_C), f_stat, NULL, QS(ull_int), 0, TS(ull_int) }, + { RS(TIME_ALL), f_stat, NULL, QS(real), 0, TS(real) }, + { RS(TIME_ALL_C), f_stat, NULL, QS(real), 0, TS(real) }, + { RS(TIME_ELAPSED), f_stat, NULL, QS(real), 0, TS(real) }, + { RS(TIME_START), f_stat, NULL, QS(real), 0, TS(real) }, + { RS(TTY), f_stat, NULL, QS(s_int), 0, TS(s_int) }, + { RS(TTY_NAME), f_stat, FF(str), QS(strvers), 0, TS(str) }, + { RS(TTY_NUMBER), f_stat, FF(str), QS(strvers), 0, TS(str) }, + { RS(UTILIZATION), f_stat, NULL, QS(real), 0, TS(real) }, + { RS(UTILIZATION_C), f_stat, NULL, QS(real), 0, TS(real) }, + { RS(VM_DATA), f_status, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(VM_EXE), f_status, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(VM_LIB), f_status, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(VM_RSS), f_status, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(VM_RSS_ANON), f_status, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(VM_RSS_FILE), f_status, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(VM_RSS_LOCKED), f_status, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(VM_RSS_SHARED), f_status, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(VM_SIZE), f_status, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(VM_STACK), f_status, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(VM_SWAP), f_status, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(VM_USED), f_status, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(VSIZE_BYTES), f_stat, NULL, QS(ul_int), 0, TS(ul_int) }, + { RS(WCHAN_NAME), 0, FF(str), QS(str), 0, TS(str) }, // oldflags: tid already free +}; + + /* please note, + * this enum MUST be 1 greater than the highest value of any enum */ +enum pids_item PIDS_logical_end = MAXTABLE(Item_table); + +#undef setNAME +#undef freNAME +#undef srtNAME +#undef RS +#undef FF +#undef QS + +//#undef f_either // needed later +#undef f_exe +#undef f_grp +#undef f_io +#undef f_login +#undef f_lxc +#undef f_ns +#undef f_oom +#undef f_smaps +//#undef f_stat // needed later +#undef f_statm +//#undef f_status // needed later +#undef f_systemd +#undef f_usr +#undef v_arg +#undef v_cgroup +#undef v_env +#undef x_cgroup +#undef x_cmdline +#undef x_environ +#undef x_ogroup +#undef x_ouser +#undef x_supgrp +#undef z_autogrp + + +// ___ History Support Private Functions |||||||||||||||||||||||||||||||||||||| +// ( stolen from top when he wasn't looking ) ------------------------------- + +#define HHASH_SIZE 4096 +#define _HASH_PID_(K) (K & (HHASH_SIZE - 1)) + +#define Hr(x) info->hist->x // 'hist ref', minimize stolen impact + +typedef unsigned long long TIC_t; + +typedef struct HST_t { + TIC_t tics; // last frame's tics count + unsigned long maj, min; // last frame's maj/min_flt counts + int pid; // record 'key' + int lnk; // next on hash chain +} HST_t; + + +struct history_info { + int num_tasks; // used as index (tasks tallied) + int HHist_siz; // max number of HST_t structs + HST_t *PHist_sav; // alternating 'old/new' HST_t anchors + HST_t *PHist_new; + int HHash_one [HHASH_SIZE]; // the actual hash tables + int HHash_two [HHASH_SIZE]; // (accessed via PHash_sav/PHash_new) + int HHash_nul [HHASH_SIZE]; // an 'empty' hash table image + int *PHash_sav; // alternating 'old/new' hash tables + int *PHash_new; // (aka. the 'one/two' actual tables) +}; + + +static void pids_config_history ( + struct pids_info *info) +{ + int i; + + for (i = 0; i < HHASH_SIZE; i++) // make the 'empty' table image + Hr(HHash_nul[i]) = -1; + memcpy(Hr(HHash_one), Hr(HHash_nul), sizeof(Hr(HHash_nul))); + memcpy(Hr(HHash_two), Hr(HHash_nul), sizeof(Hr(HHash_nul))); + Hr(PHash_sav) = Hr(HHash_one); // alternating 'old/new' hash tables + Hr(PHash_new) = Hr(HHash_two); +} // end: pids_config_history + + +static inline HST_t *pids_histget ( + struct pids_info *info, + int pid) +{ + int V = Hr(PHash_sav[_HASH_PID_(pid)]); + + while (-1 < V) { + if (Hr(PHist_sav[V].pid) == pid) + return &Hr(PHist_sav[V]); + V = Hr(PHist_sav[V].lnk); + } + return NULL; +} // end: pids_histget + + +static inline void pids_histput ( + struct pids_info *info, + unsigned this) +{ + int V = _HASH_PID_(Hr(PHist_new[this].pid)); + + Hr(PHist_new[this].lnk) = Hr(PHash_new[V]); + Hr(PHash_new[V] = this); +} // end: pids_histput + +#undef _HASH_PID_ + + +static inline int pids_make_hist ( + struct pids_info *info, + proc_t *p) +{ + TIC_t tics; + HST_t *h; + int slot = info->hist->num_tasks; + + if (slot + 1 >= Hr(HHist_siz)) { + Hr(HHist_siz) += NEWOLD_GROW; + Hr(PHist_sav) = realloc(Hr(PHist_sav), sizeof(HST_t) * Hr(HHist_siz)); + Hr(PHist_new) = realloc(Hr(PHist_new), sizeof(HST_t) * Hr(HHist_siz)); + if (!Hr(PHist_sav) || !Hr(PHist_new)) + return 0; + } + Hr(PHist_new[slot].pid) = p->tid; + Hr(PHist_new[slot].maj) = p->maj_flt; + Hr(PHist_new[slot].min) = p->min_flt; + Hr(PHist_new[slot].tics) = tics = (p->utime + p->stime); + + pids_histput(info, slot); + + if ((h = pids_histget(info, p->tid))) { + tics -= h->tics; + p->maj_delta = p->maj_flt - h->maj; + p->min_delta = p->min_flt - h->min; + } + /* here we're saving elapsed tics, which will include any + tasks not previously seen via that pids_histget() guy! */ + p->pcpu = tics; + + info->hist->num_tasks++; + return 1; +} // end: pids_make_hist + + +static inline void pids_toggle_history ( + struct pids_info *info) +{ + void *v; + + v = Hr(PHist_sav); + Hr(PHist_sav) = Hr(PHist_new); + Hr(PHist_new) = v; + + v = Hr(PHash_sav); + Hr(PHash_sav) = Hr(PHash_new); + Hr(PHash_new) = v; + memcpy(Hr(PHash_new), Hr(HHash_nul), sizeof(Hr(HHash_nul))); + + info->hist->num_tasks = 0; +} // end: pids_toggle_history + + +#ifdef UNREF_RPTHASH +static void pids_unref_rpthash ( + struct pids_info *info) +{ + int i, j, pop, total_occupied, maxdepth, maxdepth_sav, numdepth + , cross_foot, sz = HHASH_SIZE * (int)sizeof(int) + , hsz = (int)sizeof(HST_t) * Hr(HHist_siz); + int depths[HHASH_SIZE]; + + for (i = 0, total_occupied = 0, maxdepth = 0; i < HHASH_SIZE; i++) { + int V = Hr(PHash_new[i]); + j = 0; + if (-1 < V) { + ++total_occupied; + while (-1 < V) { + V = Hr(PHist_new[V].lnk); + if (-1 < V) j++; + } + } + depths[i] = j; + if (maxdepth < j) maxdepth = j; + } + maxdepth_sav = maxdepth; + + fprintf(stderr, + "\n History Memory Costs:" + "\n\tHST_t size = %d, total allocated = %d," + "\n\tthus PHist_new & PHist_sav consumed %dk (%d) total bytes." + "\n" + "\n\tTwo hash tables provide for %d entries each + 1 extra 'empty' image," + "\n\tthus %dk (%d) bytes per table for %dk (%d) total bytes." + "\n" + "\n\tGrand total = %dk (%d) bytes." + "\n" + "\n Hash Results Report:" + "\n\tTotal hashed = %d" + "\n\tLevel-0 hash entries = %d (%d%% occupied)" + "\n\tMax Depth = %d" + "\n\n" + , (int)sizeof(HST_t), Hr(HHist_siz) + , hsz / 1024, hsz + , HHASH_SIZE + , sz / 1024, sz, (sz * 3) / 1024, sz * 3 + , (hsz + (sz * 3)) / 1024, hsz + (sz * 3) + , info->hist->num_tasks + , total_occupied, (total_occupied * 100) / HHASH_SIZE + , maxdepth); + + if (total_occupied) { + for (pop = total_occupied, cross_foot = 0; maxdepth; maxdepth--) { + for (i = 0, numdepth = 0; i < HHASH_SIZE; i++) + if (depths[i] == maxdepth) ++numdepth; + if (numdepth) fprintf(stderr, + "\t %5d (%3d%%) hash table entries at depth %d\n" + , numdepth, (numdepth * 100) / total_occupied, maxdepth); + pop -= numdepth; + cross_foot += numdepth; + if (0 == pop && cross_foot == total_occupied) break; + } + if (pop) { + fprintf(stderr, "\t %5d (%3d%%) unchained entries (at depth 0)\n" + , pop, (pop * 100) / total_occupied); + cross_foot += pop; + } + fprintf(stderr, + "\t -----\n" + "\t %5d total entries occupied\n", cross_foot); + + if (maxdepth_sav > 1) { + fprintf(stderr, "\n PIDs at max depth: "); + for (i = 0; i < HHASH_SIZE; i++) + if (depths[i] == maxdepth_sav) { + j = Hr(PHash_new[i]); + fprintf(stderr, "\n\tpos %4d: %05d", i, Hr(PHist_new[j].pid)); + while (-1 < j) { + j = Hr(PHist_new[j].lnk); + if (-1 < j) fprintf(stderr, ", %05d", Hr(PHist_new[j].pid)); + } + } + fprintf(stderr, "\n"); + } + } +} // end: pids_unref_rpthash +#endif // UNREF_RPTHASH + +#undef Hr +#undef HHASH_SIZE + + +// ___ Standard Private Functions ||||||||||||||||||||||||||||||||||||||||||||| + +static inline int pids_assign_results ( + struct pids_info *info, + struct pids_stack *stack, + proc_t *p) +{ + struct pids_result *this = stack->head; + SET_t *that = &info->func_array[0]; + + info->seterr = 0; + while (*that) { + (*that)(info, this, p); + ++this; + ++that; + } + return !info->seterr; +} // end: pids_assign_results + + +static inline void pids_cleanup_stack ( + struct pids_result *this) +{ + for (;;) { + enum pids_item item = this->item; + if (item >= PIDS_logical_end) + break; + if (Item_table[item].freefunc) + Item_table[item].freefunc(this); + this->result.ull_int = 0; + ++this; + } +} // end: pids_cleanup_stack + + +static inline void pids_cleanup_stacks_all ( + struct pids_info *info) +{ + struct stacks_extent *ext = info->extents; + int i; + + while (ext) { + for (i = 0; ext->stacks[i]; i++) + pids_cleanup_stack(ext->stacks[i]->head); + ext = ext->next; + }; +} // end: pids_cleanup_stacks_all + + +#if 0 // not currently needed after 'fatal_proc_unmounted' was refactored + /* + * This routine exists in case we ever want to offer something like + * 'static' or 'invarient' results stacks. By unsplicing an extent + * from the info anchor it will be isolated from future reset/free. */ +static struct stacks_extent *pids_extent_cut ( + struct pids_info *info, + struct stacks_extent *ext) +{ + struct stacks_extent *p = info->extents; + + if (ext) { + if (ext == p) { + info->extents = p->next; + return ext; + } + do { + if (ext == p->next) { + p->next = p->next->next; + return ext; + } + p = p->next; + } while (p); + } + return NULL; +} // end: pids_extent_cut +#endif // ---------------------------------------------------------------- + + +static inline struct pids_result *pids_itemize_stack ( + struct pids_result *p, + int depth, + enum pids_item *items) +{ + struct pids_result *p_sav = p; + int i; + + for (i = 0; i < depth; i++) { + p->item = items[i]; + ++p; + } + return p_sav; +} // end: pids_itemize_stack + + +static void pids_itemize_stacks_all ( + struct pids_info *info) +{ + struct stacks_extent *ext = info->extents; + + while (ext) { + int i; + for (i = 0; ext->stacks[i]; i++) + pids_itemize_stack(ext->stacks[i]->head, info->maxitems, info->items); + ext = ext->next; + }; +} // end: pids_itemize_stacks_all + + +static inline int pids_items_check_failed ( + enum pids_item *items, + int numitems) +{ + int i; + + /* if an enum is passed instead of an address of one or more enums, ol' gcc + * will silently convert it to an address (possibly NULL). only clang will + * offer any sort of warning like the following: + * + * warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'enum pids_item *' + * if (procps_pids_new(&info, PIDS_noop, 3) < 0) + * ^~~~~~~~~~~~~~~~ + */ + if (numitems < 1 + || (void *)items < (void *)0x8000) // twice as big as our largest enum + return 1; + + for (i = 0; i < numitems; i++) { + // a pids_item is currently unsigned, but we'll protect our future + if (items[i] < 0) + return 1; + if (items[i] >= PIDS_logical_end) { + return 1; + } + } + return 0; +} // end: pids_items_check_failed + + +static inline void pids_libflags_set ( + struct pids_info *info) +{ + enum pids_item e; + int i; + + info->oldflags = info->history_yes = 0; + for (i = 0; i < info->maxitems; i++) { + if (((e = info->items[i])) >= PIDS_logical_end) + break; + info->oldflags |= Item_table[e].oldflags; + info->history_yes |= Item_table[e].needhist; + } + if (info->oldflags & f_either) { + if (!(info->oldflags & (f_stat | f_status))) + info->oldflags |= f_stat; + } + return; +} // end: pids_libflags_set + + +static inline void pids_oldproc_close ( + PROCTAB **this) +{ + if (*this != NULL) { + int errsav = errno; + closeproc(*this); + *this = NULL; + errno = errsav; + } +} // end: pids_oldproc_close + + +static inline int pids_oldproc_open ( + PROCTAB **this, + unsigned flags, + ...) +{ + va_list vl; + int *ids; + int num = 0; + + if (*this == NULL) { + va_start(vl, flags); + ids = va_arg(vl, int*); + if (flags & PROC_UID) num = va_arg(vl, int); + va_end(vl); + if (NULL == (*this = openproc(flags, ids, num))) + return 0; + } + return 1; +} // end: pids_oldproc_open + + +static int pids_prep_func_array ( + struct pids_info *info) +{ + int i; + + if (!(info->func_array = realloc(info->func_array, sizeof(SET_t) * info->maxitems))) + return 0; + for (i = 0; i < info->maxitems -1; i++) + info->func_array[i] = Item_table[info->items[i]].setsfunc; + info->func_array[i] = NULL; + return 1; +} // end: pids_prep_func_array + + +static inline int pids_proc_tally ( + struct pids_info *info, + struct pids_counts *counts, + proc_t *p) +{ + switch (p->state) { + case 'R': + ++counts->running; + break; + case 'D': // 'D' (disk sleep) + case 'S': + ++counts->sleeping; + break; + case 't': // 't' (tracing stop) + case 'T': + ++counts->stopped; + break; + case 'Z': + ++counts->zombied; + break; + default: + /* currently: 'I' (idle), + 'P' (parked), + 'X' (dead - actually 'dying' & probably never seen) + */ + ++counts->other; + break; + } + ++counts->total; + + if (info->history_yes) + return pids_make_hist(info, p); + return 1; +} // end: pids_proc_tally + + +/* + * pids_stacks_alloc(): + * + * Allocate and initialize one or more stacks each of which is anchored in an + * associated context structure. + * + * All such stacks will will have their result structures properly primed with + * 'items', while the result itself will be zeroed. + * + * Returns an array of pointers representing the 'heads' of each new stack. + */ +static struct stacks_extent *pids_stacks_alloc ( + struct pids_info *info, + int maxstacks) +{ + struct stacks_extent *p_blob; + struct pids_stack **p_vect; + struct pids_stack *p_head; + size_t vect_size, head_size, list_size, blob_size; + void *v_head, *v_list; + int i; + + vect_size = sizeof(void *) * maxstacks; // size of the addr vectors | + vect_size += sizeof(void *); // plus NULL addr delimiter | + head_size = sizeof(struct pids_stack); // size of that head struct | + list_size = sizeof(struct pids_result) * info->maxitems; // any single results stack | + blob_size = sizeof(struct stacks_extent); // the extent anchor itself | + blob_size += vect_size; // plus room for addr vects | + blob_size += head_size * maxstacks; // plus room for head thing | + blob_size += list_size * maxstacks; // plus room for our stacks | + + /* note: all of our memory is allocated in a single blob, facilitating a later free(). | + as a minimum, it is important that the result structures themselves always be | + contiguous for every stack since they are accessed through relative position. | */ + if (NULL == (p_blob = calloc(1, blob_size))) + return NULL; + + p_blob->next = info->extents; // push this extent onto... | + info->extents = p_blob; // ...some existing extents | + p_vect = (void *)p_blob + sizeof(struct stacks_extent); // prime our vector pointer | + p_blob->stacks = p_vect; // set actual vectors start | + v_head = (void *)p_vect + vect_size; // prime head pointer start | + v_list = v_head + (head_size * maxstacks); // prime our stacks pointer | + + for (i = 0; i < maxstacks; i++) { + p_head = (struct pids_stack *)v_head; + p_head->head = pids_itemize_stack((struct pids_result *)v_list, info->maxitems, info->items); + p_blob->stacks[i] = p_head; + v_list += list_size; + v_head += head_size; + } + p_blob->ext_numstacks = maxstacks; + return p_blob; +} // end: pids_stacks_alloc + + +static int pids_stacks_fetch ( + struct pids_info *info) +{ + #define n_alloc info->fetch.n_alloc + #define n_inuse info->fetch.n_inuse + #define n_saved info->fetch.n_alloc_save + struct stacks_extent *ext; + + // initialize stuff ----------------------------------- + if (!info->fetch.anchor) { + if (!(info->fetch.anchor = calloc(STACKS_INIT, sizeof(void *)))) + return -1; + if (!(ext = pids_stacks_alloc(info, STACKS_INIT))) + return -1; // here, errno was set to ENOMEM + memcpy(info->fetch.anchor, ext->stacks, sizeof(void *) * STACKS_INIT); + n_alloc = STACKS_INIT; + } + pids_toggle_history(info); + memset(&info->fetch.counts, 0, sizeof(struct pids_counts)); + + // iterate stuff -------------------------------------- + n_inuse = 0; + while (info->read_something(info->fetch_PT, &info->fetch_proc)) { + if (!(n_inuse < n_alloc)) { + n_alloc += STACKS_GROW; + if (!(info->fetch.anchor = realloc(info->fetch.anchor, sizeof(void *) * n_alloc)) + || (!(ext = pids_stacks_alloc(info, STACKS_GROW)))) + return -1; // here, errno was set to ENOMEM + memcpy(info->fetch.anchor + n_inuse, ext->stacks, sizeof(void *) * STACKS_GROW); + } + if (!pids_proc_tally(info, &info->fetch.counts, &info->fetch_proc)) + return -1; // here, errno was set to ENOMEM + if (!pids_assign_results(info, info->fetch.anchor[n_inuse++], &info->fetch_proc)) + return -1; // here, errno was set to ENOMEM + } + /* while the possibility is extremely remote, the readproc.c (read_something) | + simple_readproc and simple_readtask guys could have encountered this error | + in which case they would have returned a NULL, thus ending our while loop. | */ + if (errno == ENOMEM) + return -1; + + // finalize stuff ------------------------------------- + /* note: we go to this trouble of maintaining a duplicate of the consolidated | + extent stacks addresses represented as our 'anchor' since these ptrs | + are exposed to a user (um, not that we don't trust 'em or anything). | + plus, we can NULL delimit these ptrs which we couldn't do otherwise. | */ + if (n_saved < n_inuse + 1) { + n_saved = n_inuse + 1; + if (!(info->fetch.results.stacks = realloc(info->fetch.results.stacks, sizeof(void *) * n_saved))) + return -1; + } + memcpy(info->fetch.results.stacks, info->fetch.anchor, sizeof(void *) * n_inuse); + info->fetch.results.stacks[n_inuse] = NULL; + + return n_inuse; // callers beware, this might be zero ! + #undef n_alloc + #undef n_inuse + #undef n_saved +} // end: pids_stacks_fetch + + +// ___ Public Functions ||||||||||||||||||||||||||||||||||||||||||||||||||||||| + +// --- standard required functions -------------------------------------------- + +/* + * procps_pids_new(): + * + * @info: location of returned new structure + * + * Returns: < 0 on failure, 0 on success along with + * a pointer to a new context struct + */ +PROCPS_EXPORT int procps_pids_new ( + struct pids_info **info, + enum pids_item *items, + int numitems) +{ + struct pids_info *p; + int pgsz; + +#ifdef ITEMTABLE_DEBUG + int i, failed = 0; + for (i = 0; i < MAXTABLE(Item_table); i++) { + if (i != Item_table[i].enumnumb) { + fprintf(stderr, "%s: enum/table error: Item_table[%d] was %s, but its value is %d\n" + , __FILE__, i, Item_table[i].enum2str, Item_table[i].enumnumb); + failed = 1; + } + } + if (PIDS_SELECT_PID != PROC_PID) { + fprintf(stderr, "%s: header error: PIDS_SELECT_PID = 0x%04x, PROC_PID = 0x%04x\n" + , __FILE__, PIDS_SELECT_PID, PROC_PID); + failed = 1; + } + if (PIDS_SELECT_PID_THREADS != PIDS_SELECT_PID + 1) { + fprintf(stderr, "%s: header error: PIDS_SELECT_PID_THREADS = 0x%04x, should be 0x%04x\n" + , __FILE__, PIDS_SELECT_PID_THREADS, PIDS_SELECT_PID + 1); + failed = 1; + } + if (PIDS_SELECT_UID != PROC_UID) { + fprintf(stderr, "%s: header error: PIDS_SELECT_UID = 0x%04x, PROC_UID = 0x%04x\n" + , __FILE__, PIDS_SELECT_UID, PROC_UID); + failed = 1; + } + if (PIDS_SELECT_UID_THREADS != PIDS_SELECT_UID + 1) { + fprintf(stderr, "%s: header error: PIDS_SELECT_UID_THREADS = 0x%04x, should be 0x%04x\n" + , __FILE__, PIDS_SELECT_UID_THREADS, PIDS_SELECT_UID + 1); + failed = 1; + } + // our select() function & select enumerators assume the following ... + if (PIDS_FETCH_THREADS_TOO != 1) { + fprintf(stderr, "%s: header error: PIDS_FETCH_THREADS_TOO = %d, should be 1\n" + , __FILE__, PIDS_FETCH_THREADS_TOO); + failed = 1; + } + if (failed) _Exit(EXIT_FAILURE); +#endif + + if (info == NULL || *info != NULL) + return -EINVAL; + if (!(p = calloc(1, sizeof(struct pids_info)))) + return -ENOMEM; + + /* if we're without items or numitems, a later call to + procps_pids_reset() will become mandatory */ + if (items && numitems) { + if (pids_items_check_failed(items, numitems)) { + free(p); + return -EINVAL; + } + // allow for our PIDS_logical_end + p->maxitems = numitems + 1; + if (!(p->items = calloc(p->maxitems, sizeof(enum pids_item)))) { + free(p); + return -ENOMEM; + } + memcpy(p->items, items, sizeof(enum pids_item) * numitems); + p->items[numitems] = PIDS_logical_end; + pids_libflags_set(p); + if (!pids_prep_func_array(p)) + return -ENOMEM; + } + + if (!(p->hist = calloc(1, sizeof(struct history_info))) + || (!(p->hist->PHist_new = calloc(NEWOLD_INIT, sizeof(HST_t)))) + || (!(p->hist->PHist_sav = calloc(NEWOLD_INIT, sizeof(HST_t))))) { + free(p->items); + if (p->hist) { + free(p->hist->PHist_sav); // this & next might be NULL ... + free(p->hist->PHist_new); + free(p->hist); + } + free(p); + return -ENOMEM; + } + p->hist->HHist_siz = NEWOLD_INIT; + pids_config_history(p); + + pgsz = getpagesize(); + while (pgsz > 1024) { pgsz >>= 1; p->pgs2k_shift++; } + p->hertz = procps_hertz_get(); + + numa_init(); + + p->fetch.results.counts = &p->fetch.counts; + + p->refcount = 1; + *info = p; + return 0; +} // end: procps_pids_new + + +PROCPS_EXPORT int procps_pids_ref ( + struct pids_info *info) +{ + if (info == NULL) + return -EINVAL; + + info->refcount++; + return info->refcount; +} // end: procps_pids_ref + + +PROCPS_EXPORT int procps_pids_unref ( + struct pids_info **info) +{ + if (info == NULL || *info == NULL) + return -EINVAL; + + (*info)->refcount--; + + if ((*info)->refcount < 1) { +#ifdef UNREF_RPTHASH + pids_unref_rpthash(*info); +#endif + if ((*info)->extents) { + pids_cleanup_stacks_all(*info); + do { + struct stacks_extent *p = (*info)->extents; + (*info)->extents = (*info)->extents->next; + free(p); + } while ((*info)->extents); + } + if ((*info)->otherexts) { + struct stacks_extent *nextext, *ext = (*info)->otherexts; + while (ext) { + nextext = ext->next; + pids_cleanup_stack(ext->stacks[0]->head); + free(ext); + ext = nextext; + }; + } + if ((*info)->fetch.anchor) + free((*info)->fetch.anchor); + if ((*info)->fetch.results.stacks) + free((*info)->fetch.results.stacks); + + if ((*info)->items) + free((*info)->items); + if ((*info)->hist) { + free((*info)->hist->PHist_sav); + free((*info)->hist->PHist_new); + free((*info)->hist); + } + + if ((*info)->get_ext) + pids_oldproc_close(&(*info)->get_PT); + + if ((*info)->func_array) + free((*info)->func_array); + + numa_uninit(); + + free(*info); + *info = NULL; + return 0; + } + return (*info)->refcount; +} // end: procps_pids_unref + + +// --- variable interface functions ------------------------------------------- + +PROCPS_EXPORT struct pids_stack *fatal_proc_unmounted ( + struct pids_info *info, + int return_self) +{ + struct pids_fetch *fetched; + unsigned tid; + + /* this is very likely the *only* newlib function where the + context (pids_info) of NULL will ever be permitted */ + if (!look_up_our_self() + || (!return_self)) + return NULL; + + tid = getpid(); + if (!(fetched = procps_pids_select(info, &tid, 1, PIDS_SELECT_PID))) + return NULL; + return fetched->stacks[0]; +} // end: fatal_proc_unmounted + + +PROCPS_EXPORT struct pids_stack *procps_pids_get ( + struct pids_info *info, + enum pids_fetch_type which) +{ + double up_secs; + + errno = EINVAL; + if (info == NULL) + return NULL; + if (which != PIDS_FETCH_TASKS_ONLY && which != PIDS_FETCH_THREADS_TOO) + return NULL; + /* with items & numitems technically optional at 'new' time, it's + expected 'reset' will have been called -- but just in case ... */ + if (!info->maxitems) + return NULL; + + if (!info->get_ext) { + if (!(info->get_ext = pids_stacks_alloc(info, 1))) + return NULL; // here, errno was overridden with ENOMEM +fresh_start: + if (!pids_oldproc_open(&info->get_PT, info->oldflags)) + return NULL; // here, errno was overridden with ENOMEM/others + info->get_type = which; + info->read_something = which ? readeither : readproc; + } + + if (info->get_type != which) { + pids_oldproc_close(&info->get_PT); + goto fresh_start; + } + errno = 0; + + /* when in a namespace with proc mounted subset=pid, + we will be restricted to process information only */ + info->boot_tics = 0; + if (0 >= procps_uptime(&up_secs, NULL)) + info->boot_tics = up_secs * info->hertz; + + if (NULL == info->read_something(info->get_PT, &info->get_proc)) + return NULL; + if (!pids_assign_results(info, info->get_ext->stacks[0], &info->get_proc)) + return NULL; + return info->get_ext->stacks[0]; +} // end: procps_pids_get + + +/* procps_pids_reap(): + * + * Harvest all the available tasks/threads and provide the result + * stacks along with a summary of the information gathered. + * + * Returns: pointer to a pids_fetch struct on success, NULL on error. + */ +PROCPS_EXPORT struct pids_fetch *procps_pids_reap ( + struct pids_info *info, + enum pids_fetch_type which) +{ + double up_secs; + int rc; + + errno = EINVAL; + if (info == NULL) + return NULL; + if (which != PIDS_FETCH_TASKS_ONLY && which != PIDS_FETCH_THREADS_TOO) + return NULL; + /* with items & numitems technically optional at 'new' time, it's + expected 'reset' will have been called -- but just in case ... */ + if (!info->maxitems) + return NULL; + errno = 0; + + if (!pids_oldproc_open(&info->fetch_PT, info->oldflags)) + return NULL; + info->read_something = which ? readeither : readproc; + + /* when in a namespace with proc mounted subset=pid, + we will be restricted to process information only */ + info->boot_tics = 0; + if (0 >= procps_uptime(&up_secs, NULL)) + info->boot_tics = up_secs * info->hertz; + + rc = pids_stacks_fetch(info); + + pids_oldproc_close(&info->fetch_PT); + // we better have found at least 1 pid + return (rc > 0) ? &info->fetch.results : NULL; +} // end: procps_pids_reap + + +PROCPS_EXPORT int procps_pids_reset ( + struct pids_info *info, + enum pids_item *newitems, + int newnumitems) +{ + if (info == NULL || newitems == NULL) + return -EINVAL; + if (pids_items_check_failed(newitems, newnumitems)) + return -EINVAL; + + pids_cleanup_stacks_all(info); + + /* shame on this caller, they didn't change anything. and unless they have + altered the depth of the stacks we're not gonna change anything either! */ + if (info->maxitems == newnumitems + 1 + && !memcmp(info->items, newitems, sizeof(enum pids_item) * newnumitems)) + return 0; + + if (info->maxitems < newnumitems + 1) { + while (info->extents) { + struct stacks_extent *p = info->extents; + info->extents = p->next; + free(p); + }; + if (info->get_ext) { + pids_oldproc_close(&info->get_PT); + info->get_ext = NULL; + } + if (info->fetch.anchor) { + free(info->fetch.anchor); + info->fetch.anchor = NULL; + } + // allow for our PIDS_logical_end + info->maxitems = newnumitems + 1; + if (!(info->items = realloc(info->items, sizeof(enum pids_item) * info->maxitems))) + return -ENOMEM; + } + + memcpy(info->items, newitems, sizeof(enum pids_item) * newnumitems); + info->items[newnumitems] = PIDS_logical_end; + // account for above PIDS_logical_end + info->maxitems = newnumitems + 1; + + // if extents were freed above, this next guy will have no effect + // so we'll rely on pids_stacks_alloc() to itemize ... + pids_itemize_stacks_all(info); + pids_libflags_set(info); + if (!pids_prep_func_array(info)) + return -ENOMEM; + + return 0; +} // end: procps_pids_reset + + +/* procps_pids_select(): + * + * Harvest any processes matching the specified PID or UID and provide the + * result stacks along with a summary of the information gathered. + * + * Returns: pointer to a pids_fetch struct on success, NULL on error. + */ +PROCPS_EXPORT struct pids_fetch *procps_pids_select ( + struct pids_info *info, + unsigned *these, + int numthese, + enum pids_select_type which) +{ + unsigned ids[FILL_ID_MAX + 1]; + double up_secs; + int rc; + + errno = EINVAL; + if (info == NULL || these == NULL) + return NULL; + if (numthese < 1 || numthese > FILL_ID_MAX) + return NULL; + if ((which != PIDS_SELECT_PID && which != PIDS_SELECT_UID) + && ((which != PIDS_SELECT_PID_THREADS && which != PIDS_SELECT_UID_THREADS))) + return NULL; + /* with items & numitems technically optional at 'new' time, it's + expected 'reset' will have been called -- but just in case ... */ + if (!info->maxitems) + return NULL; + errno = 0; + + // this zero delimiter is really only needed with PIDS_SELECT_PID + memcpy(ids, these, sizeof(unsigned) * numthese); + ids[numthese] = 0; + + if (!pids_oldproc_open(&info->fetch_PT, (info->oldflags | which), ids, numthese)) + return NULL; + info->read_something = (which & PIDS_FETCH_THREADS_TOO) ? readeither : readproc; + + /* when in a namespace with proc mounted subset=pid, + we will be restricted to process information only */ + info->boot_tics = 0; + if (0 >= procps_uptime(&up_secs, NULL)) + info->boot_tics = up_secs * info->hertz; + + rc = pids_stacks_fetch(info); + + pids_oldproc_close(&info->fetch_PT); + // no guarantee any pids/uids were found + return (rc >= 0) ? &info->fetch.results : NULL; +} // end: procps_pids_select + + +/* + * procps_pids_sort(): + * + * Sort stacks anchored in the passed stack pointers array + * based on the designated sort enumerator and specified order. + * + * Returns those same addresses sorted. + * + * Note: all of the stacks must be homogeneous (of equal length and content). + */ +PROCPS_EXPORT struct pids_stack **procps_pids_sort ( + struct pids_info *info, + struct pids_stack *stacks[], + int numstacked, + enum pids_item sortitem, + enum pids_sort_order order) +{ + struct sort_parms parms; + struct pids_result *p; + int offset; + + errno = EINVAL; + if (info == NULL || stacks == NULL) + return NULL; + // a pids_item is currently unsigned, but we'll protect our future + if (sortitem < 0 || sortitem >= PIDS_logical_end) + return NULL; + if (order != PIDS_SORT_ASCEND && order != PIDS_SORT_DESCEND) + return NULL; + if (numstacked < 2) + return stacks; + + offset = 0; + p = stacks[0]->head; + for (;;) { + if (p->item == sortitem) + break; + ++offset; + if (offset >= info->maxitems) + return NULL; + if (p->item >= PIDS_logical_end) + return NULL; + ++p; + } + errno = 0; + + parms.offset = offset; + parms.order = order; + + qsort_r(stacks, numstacked, sizeof(void *), (QSR_t)Item_table[p->item].sortfunc, &parms); + return stacks; +} // end: procps_pids_sort + + +// --- special debugging function(s) ------------------------------------------ +/* + * The following isn't part of the normal programming interface. Rather, + * it exists to validate result types referenced in application programs. + * + * It's used only when: + * 1) the 'XTRA_PROCPS_DEBUG' has been defined, or + * 2) an #include of 'xtra-procps-debug.h' is used + */ + +PROCPS_EXPORT struct pids_result *xtra_pids_val ( + int relative_enum, + const char *typestr, + const struct pids_stack *stack, + struct pids_info *info, + const char *file, + int lineno) +{ + char *str; + int i; + + for (i = 0; stack->head[i].item < PIDS_logical_end; i++) + ; + if (relative_enum < 0 || relative_enum >= i) { + fprintf(stderr, "%s line %d: invalid relative_enum = %d, valid range = 0-%d\n" + , file, lineno, relative_enum, i-1); + return NULL; + } + str = Item_table[stack->head[relative_enum].item].type2str; + if (str[0] + && (strcmp(typestr, str))) { + fprintf(stderr, "%s line %d: was %s, expected %s\n", file, lineno, typestr, str); + } + return &stack->head[relative_enum]; + (void)info; +} // end: xtra_pids_val diff --git a/library/pwcache.c b/library/pwcache.c new file mode 100644 index 0000000..f75e207 --- /dev/null +++ b/library/pwcache.c @@ -0,0 +1,99 @@ +/* + * pwcache.c - memory cache passwd file handling + * + * Copyright © 2011-2023 Jim Warner + * Copyright © 2015-2023 Craig Small + * Copyright © 2002 Albert Cahalan + * + * Older version: + * Copyright © 1992-1998 Michael K. Johnson + * Note: most likely none of his code remains + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; 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 "pwcache.h" +#include "procps-private.h" + +// might as well fill cache lines... else we waste memory anyway + +#define HASHSIZE 64 /* power of 2 */ +#define HASH(x) ((x) & (HASHSIZE - 1)) + +static char ERRname[] = "?"; + +static __thread struct pwbuf { + struct pwbuf *next; + uid_t uid; + char name[P_G_SZ]; +} *pwhash[HASHSIZE]; + +char *pwcache_get_user(uid_t uid) { + struct pwbuf **p; + struct passwd *pw; + + p = &pwhash[HASH(uid)]; + while (*p) { + if ((*p)->uid == uid) + return((*p)->name); + p = &(*p)->next; + } + if (!(*p = (struct pwbuf *)malloc(sizeof(struct pwbuf)))) + return ERRname; + (*p)->uid = uid; + pw = getpwuid(uid); + if(!pw || strlen(pw->pw_name) >= P_G_SZ) + sprintf((*p)->name, "%u", uid); + else + strcpy((*p)->name, pw->pw_name); + + (*p)->next = NULL; + return((*p)->name); +} + +static __thread struct grpbuf { + struct grpbuf *next; + gid_t gid; + char name[P_G_SZ]; +} *grphash[HASHSIZE]; + +char *pwcache_get_group(gid_t gid) { + struct grpbuf **g; + struct group *gr; + + g = &grphash[HASH(gid)]; + while (*g) { + if ((*g)->gid == gid) + return((*g)->name); + g = &(*g)->next; + } + if (!(*g = (struct grpbuf *)malloc(sizeof(struct grpbuf)))) + return ERRname;; + (*g)->gid = gid; + gr = getgrgid(gid); + if (!gr || strlen(gr->gr_name) >= P_G_SZ) + sprintf((*g)->name, "%u", gid); + else + strcpy((*g)->name, gr->gr_name); + (*g)->next = NULL; + return((*g)->name); +} diff --git a/library/readproc.c b/library/readproc.c new file mode 100644 index 0000000..2dfe4c9 --- /dev/null +++ b/library/readproc.c @@ -0,0 +1,1627 @@ +/* + * readproc - interface to process table + * + * Copyright © 2002-2023 Craig Small + * Copyright © 2011-2023 Jim Warner + * Copyright © 1998-2010 Albert Cahalan + * Copyright © 2010-2011 Jan Görig + * Copyright © 1998 Michael K. Johnson + * Copyright © 1996 Charles L. Blake. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; 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 +#ifdef WITH_SYSTEMD +#include +#endif +#ifdef WITH_ELOGIND +#include +#endif + +#include "devname.h" +#include "escape.h" +#include "misc.h" +#include "pwcache.h" +#include "readproc.h" + +// sometimes it's easier to do this manually, w/o gcc helping +#ifdef PROF +extern void __cyg_profile_func_enter(void*,void*); +#define ENTER(x) __cyg_profile_func_enter((void*)x,(void*)x) +#define LEAVE(x) __cyg_profile_func_exit((void*)x,(void*)x) +#else +#define ENTER(x) +#define LEAVE(x) +#endif + +#ifdef FALSE_THREADS +#define IS_THREAD(q) ( q->tid != q->tgid ) +#endif + +// utility buffers of MAX_BUFSZ bytes each, available to +// any function following an openproc() call +static __thread char *src_buffer, + *dst_buffer; +#define MAX_BUFSZ 1024*64*2 + +// dynamic 'utility' buffer support for file2str() calls +struct utlbuf_s { + char *buf; // dynamically grown buffer + int siz; // current len of the above +} utlbuf_s; + +static int task_dir_missing; + + +// free any additional dynamically acquired storage associated with a proc_t +static inline void free_acquired (proc_t *p) { + /* + * here we free those items that might exist even when not explicitly | + * requested by our caller. it is expected that pid.c will then free | + * any remaining dynamic memory which might be dangling off a proc_t. | */ + if (p->cgname) free(p->cgname); + if (p->cgroup) free(p->cgroup); + if (p->cmd) free(p->cmd); + if (p->sd_mach) free(p->sd_mach); + if (p->sd_ouid) free(p->sd_ouid); + if (p->sd_seat) free(p->sd_seat); + if (p->sd_sess) free(p->sd_sess); + if (p->sd_slice) free(p->sd_slice); + if (p->sd_unit) free(p->sd_unit); + if (p->sd_uunit) free(p->sd_uunit); + if (p->supgid) free(p->supgid); + + memset(p, '\0', sizeof(proc_t)); +} + + +/////////////////////////////////////////////////////////////////////////// + +typedef struct status_table_struct { + unsigned char name[8]; // /proc/*/status field name + unsigned char len; // name length +#ifdef LABEL_OFFSET + long offset; // jump address offset +#else + void *addr; +#endif +} status_table_struct; + +#ifdef LABEL_OFFSET +#define F(x) {#x, sizeof(#x)-1, (long)(&&case_##x-&&base)}, +#else +#define F(x) {#x, sizeof(#x)-1, &&case_##x}, +#endif +#define NUL {"", 0, 0}, + +#define GPERF_TABLE_SIZE 128 + +// Derived from: +// gperf -7 --language=ANSI-C --key-positions=1,3,4 -C -n -c +// ( --key-positions verified by omission & reported "Computed positions" ) +// +// Suggested method: +// Grep this file for "case_", then strip those down to the name. +// Eliminate duplicates (due to #ifs), the ' case_' prefix and +// any c comments. Leave the colon and newline so that "Pid:\n", +// "Threads:\n", etc. would be lines, but no quote, no escape, etc. +// +// After a pipe through gperf, insert the resulting 'asso_values' +// into our 'asso' array. Then convert the gperf 'wordlist' array +// into our 'table' array by wrapping the string literals within +// the F macro and replacing empty strings with the NUL define. +// +// In the status_table_struct watch out for name size (grrr, expanding) +// and the number of entries. Currently, the table is padded to 128 +// entries and we therefore mask with 127. + +static int status2proc (char *S, proc_t *restrict P, int is_proc) { + long Threads = 0; + long Tgid = 0; + long Pid = 0; + + // 128 entries because we trust the kernel to use ASCII names + static const unsigned char asso[] = + { + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 6, 101, + 101, 101, 101, 101, 101, 45, 55, 25, 31, 50, + 50, 10, 0, 35, 101, 101, 21, 101, 30, 101, + 20, 36, 0, 5, 0, 40, 0, 0, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 30, 101, 15, + 0, 1, 101, 10, 101, 10, 101, 101, 101, 25, + 101, 40, 0, 101, 0, 50, 6, 40, 101, 1, + 35, 101, 101, 101, 101, 101, 101, 101 + }; + + static const status_table_struct table[GPERF_TABLE_SIZE] = { + F(VmHWM) + F(Threads) + NUL NUL NUL + F(VmRSS) + F(VmSwap) + NUL NUL NUL + F(Tgid) + F(VmStk) + NUL NUL NUL + F(VmSize) + F(Gid) + NUL NUL NUL + F(VmPTE) + F(VmPeak) + NUL NUL NUL + F(ShdPnd) + F(Pid) + NUL NUL NUL + F(PPid) + F(VmLib) + NUL NUL NUL + F(SigPnd) + F(VmLck) + NUL NUL NUL + F(SigCgt) + F(State) + NUL NUL NUL + F(CapPrm) + F(Uid) + NUL NUL NUL + F(SigIgn) + F(SigQ) + NUL NUL NUL + F(RssShmem) + F(Name) + NUL NUL NUL + F(CapInh) + F(VmData) + NUL NUL NUL + F(FDSize) + NUL NUL NUL NUL + F(SigBlk) + NUL NUL NUL NUL + F(CapEff) + NUL NUL NUL NUL + F(CapBnd) + NUL NUL NUL NUL + F(VmExe) + NUL NUL NUL NUL + F(Groups) + NUL NUL NUL NUL + F(RssAnon) + NUL NUL NUL NUL + F(RssFile) + }; + +#undef F +#undef NUL + +ENTER(0x220); + + goto base; + + for(;;){ + char *colon; + status_table_struct entry; + + // advance to next line + S = strchr(S, '\n'); + if(!S) break; // if no newline + S++; + + // examine a field name (hash and compare) + base: + if(!*S) break; + if((!S[0] || !S[1] || !S[2] || !S[3])) break; + entry = table[(GPERF_TABLE_SIZE -1) & (asso[S[3]&127] + asso[S[2]&127] + asso[S[0]&127])]; + colon = strchr(S, ':'); + if(!colon) break; + if(colon[1]!='\t') break; + if(colon-S != entry.len) continue; + if(memcmp(entry.name,S,colon-S)) continue; + + S = colon+2; // past the '\t' + +#ifdef LABEL_OFFSET + goto *(&&base + entry.offset); +#else + goto *entry.addr; +#endif + + case_Name: + { char buf[64], raw[64]; + unsigned u = 0; + while(u < sizeof(raw) - 1u){ + int c = *S++; + if(c=='\n') break; + if(c=='\0') break; // should never happen + if(c=='\\'){ + c = *S++; + if(c=='\n') break; // should never happen + if(!c) break; // should never happen + if(c=='n') c='\n'; // else we assume it is '\\' + } + raw[u++] = c; + } + raw[u] = '\0'; +#ifdef FALSE_THREADS + if (!IS_THREAD(P)) { +#endif + if (!P->cmd) { + escape_str(buf, raw, sizeof(buf)); + if (!(P->cmd = strdup(buf))) return 1; + } +#ifdef FALSE_THREADS + } +#endif + S--; // put back the '\n' or '\0' + continue; + } + case_ShdPnd: + memcpy(P->signal, S, 16); + P->signal[16] = '\0'; + continue; + case_SigBlk: + memcpy(P->blocked, S, 16); + P->blocked[16] = '\0'; + continue; + case_SigCgt: + memcpy(P->sigcatch, S, 16); + P->sigcatch[16] = '\0'; + continue; + case_SigIgn: + memcpy(P->sigignore, S, 16); + P->sigignore[16] = '\0'; + continue; + case_SigPnd: + memcpy(P->_sigpnd, S, 16); + P->_sigpnd[16] = '\0'; + continue; + case_State: + P->state = *S; + continue; + case_Tgid: + Tgid = strtol(S,&S,10); + continue; + case_Pid: + Pid = strtol(S,&S,10); + continue; + case_PPid: + P->ppid = strtol(S,&S,10); + continue; + case_Threads: + Threads = strtol(S,&S,10); + continue; + case_Uid: + P->ruid = strtol(S,&S,10); + P->euid = strtol(S,&S,10); + P->suid = strtol(S,&S,10); + P->fuid = strtol(S,&S,10); + continue; + case_Gid: + P->rgid = strtol(S,&S,10); + P->egid = strtol(S,&S,10); + P->sgid = strtol(S,&S,10); + P->fgid = strtol(S,&S,10); + continue; + case_VmData: + P->vm_data = (unsigned long)strtol(S,&S,10); + continue; + case_VmExe: + P->vm_exe = (unsigned long)strtol(S,&S,10); + continue; + case_VmLck: + P->vm_lock = (unsigned long)strtol(S,&S,10); + continue; + case_VmLib: + P->vm_lib = (unsigned long)strtol(S,&S,10); + continue; + case_VmRSS: + P->vm_rss = (unsigned long)strtol(S,&S,10); + continue; + case_RssAnon: // subset of VmRSS, linux-4.5 + P->vm_rss_anon = (unsigned long)strtol(S,&S,10); + continue; + case_RssFile: // subset of VmRSS, linux-4.5 + P->vm_rss_file = (unsigned long)strtol(S,&S,10); + continue; + case_RssShmem: // subset of VmRSS, linux-4.5 + P->vm_rss_shared = (unsigned long)strtol(S,&S,10); + continue; + case_VmSize: + P->vm_size = (unsigned long)strtol(S,&S,10); + continue; + case_VmStk: + P->vm_stack = (unsigned long)strtol(S,&S,10); + continue; + case_VmSwap: // Linux 2.6.34 + P->vm_swap = (unsigned long)strtol(S,&S,10); + continue; + case_Groups: + { char *ss = S, *nl = strchr(S, '\n'); + size_t j; + +#ifdef FALSE_THREADS + if (IS_THREAD(P)) continue; +#endif + while (' ' == *ss || '\t' == *ss) ss++; + if (ss >= nl) continue; + j = nl ? (size_t)(nl - ss) : strlen(ss); + if (j > 0 && j < INT_MAX) { + P->supgid = malloc(j+1); // +1 in case space disappears + if (!P->supgid) + return 1; + memcpy(P->supgid, ss, j); + if (' ' != P->supgid[--j]) ++j; + P->supgid[j] = '\0'; // whack the space or the newline + for ( ; j; j--) + if (' ' == P->supgid[j]) + P->supgid[j] = ','; + } + continue; + } + case_CapBnd: + case_CapEff: + case_CapInh: + case_CapPrm: + case_FDSize: + case_SigQ: + case_VmHWM: // 2005, peak VmRSS unless VmRSS is bigger + case_VmPTE: + case_VmPeak: // 2005, peak VmSize unless VmSize is bigger + continue; + } + +#if 0 + // recent kernels supply per-tgid pending signals + if(is_proc && *ShdPnd){ + memcpy(P->signal, ShdPnd, 16); + P->signal[16] = '\0'; + } +#endif + + // recent kernels supply per-tgid pending signals + if(!is_proc || !P->signal[0]){ + memcpy(P->signal, P->_sigpnd, 16); + P->signal[16] = '\0'; + } + + // Linux 2.4.13-pre1 to max 2.4.xx have a useless "Tgid" + // that is not initialized for built-in kernel tasks. + // Only 2.6.0 and above have "Threads" (nlwp) info. + + if(Threads){ + P->nlwp = Threads; + P->tgid = Tgid; // the POSIX PID value + P->tid = Pid; // the thread ID + }else{ + P->nlwp = 1; + P->tgid = Pid; + P->tid = Pid; + } + +#ifdef FALSE_THREADS + if (!IS_THREAD(P)) { +#endif + if (!P->supgid) { + P->supgid = strdup("-"); + if (!P->supgid) + return 1; + } +#ifdef FALSE_THREADS + } +#endif +LEAVE(0x220); + return 0; +} +#undef GPERF_TABLE_SIZE + + +static int supgrps_from_supgids (proc_t *p) { + char *g, *s; + int t; + +#ifdef FALSE_THREADS + if (IS_THREAD(p)) return 0; +#endif + if (!p->supgid || '-' == *p->supgid) + goto wrap_up; + + s = p->supgid; + t = 0; + do { + const int max = P_G_SZ+2; + char *end = NULL; + gid_t gid; + int len; + + while (',' == *s) ++s; + gid = strtol(s, &end, 10); + if (end <= s) break; + s = end; + g = pwcache_get_group(gid); + + if ((t >= INT_MAX - max) + || (!(p->supgrp = realloc(p->supgrp, t + max)))) + return 1; + + len = snprintf(p->supgrp+t, max, "%s%s", t ? "," : "", g); + if (len <= 0) (p->supgrp+t)[len = 0] = '\0'; + else if (len >= max) len = max-1; + t += len; + } while (*s); + +wrap_up: + if (!p->supgrp + && !(p->supgrp = strdup("-"))) + return 1; + return 0; +} + + +/////////////////////////////////////////////////////////////////////// + +static inline void oomscore2proc(const char *S, proc_t *restrict P) +{ + sscanf(S, "%d", &P->oom_score); +} + +static inline void oomadj2proc(const char *S, proc_t *restrict P) +{ + sscanf(S, "%d", &P->oom_adj); +} + + +/////////////////////////////////////////////////////////////////////// + +static int sd2proc (proc_t *restrict p) { +#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND) + char buf[64]; + uid_t uid; + + if (0 > sd_pid_get_machine_name(p->tid, &p->sd_mach)) { + if (!(p->sd_mach = strdup("-"))) + return 1; + } + if (0 > sd_pid_get_owner_uid(p->tid, &uid)) { + if (!(p->sd_ouid = strdup("-"))) + return 1; + } else { + snprintf(buf, sizeof(buf), "%d", (int)uid); + if (!(p->sd_ouid = strdup(buf))) + return 1; + } + if (0 > sd_pid_get_session(p->tid, &p->sd_sess)) { + if (!(p->sd_sess = strdup("-"))) + return 1; + if (!(p->sd_seat = strdup("-"))) + return 1; + } else { + if (0 > sd_session_get_seat(p->sd_sess, &p->sd_seat)) + if (!(p->sd_seat = strdup("-"))) + return 1; + } + if (0 > sd_pid_get_slice(p->tid, &p->sd_slice)) + if (!(p->sd_slice = strdup("-"))) + return 1; + if (0 > sd_pid_get_unit(p->tid, &p->sd_unit)) + if (!(p->sd_unit = strdup("-"))) + return 1; + if (0 > sd_pid_get_user_unit(p->tid, &p->sd_uunit)) + if (!(p->sd_uunit = strdup("-"))) + return 1; +#else + if (!(p->sd_mach = strdup("?"))) + return 1; + if (!(p->sd_ouid = strdup("?"))) + return 1; + if (!(p->sd_seat = strdup("?"))) + return 1; + if (!(p->sd_sess = strdup("?"))) + return 1; + if (!(p->sd_slice = strdup("?"))) + return 1; + if (!(p->sd_unit = strdup("?"))) + return 1; + if (!(p->sd_uunit = strdup("?"))) + return 1; +#endif + return 0; +} + + +/////////////////////////////////////////////////////////////////////// + +// Reads /proc/*/stat files, being careful not to trip over processes with +// names like ":-) 1 2 3 4 5 6". +static int stat2proc (const char *S, proc_t *restrict P) { + char buf[64], raw[64]; + size_t num; + char *tmp; + +ENTER(0x160); + + /* fill in default values for older kernels */ + P->processor = 0; + P->rtprio = -1; + P->sched = -1; + P->nlwp = 0; + + S = strchr(S, '('); + if (!S) return 0; + S++; + tmp = strrchr(S, ')'); + if (!tmp || !tmp[1]) return 0; +#ifdef FALSE_THREADS + if (!IS_THREAD(P)) { +#endif + if (!P->cmd) { + num = tmp - S; + memcpy(raw, S, num); + raw[num] = '\0'; + escape_str(buf, raw, sizeof(buf)); + if (!(P->cmd = strdup(buf))) return 1; + } +#ifdef FALSE_THREADS + } +#endif + S = tmp + 2; // skip ") " + + sscanf(S, + "%c " // state + "%d %d %d %d %d " // ppid, pgrp, sid, tty_nr, tty_pgrp + "%lu %lu %lu %lu %lu " // flags, min_flt, cmin_flt, maj_flt, cmaj_flt + "%llu %llu %llu %llu " // utime, stime, cutime, cstime + "%d %d " // priority, nice + "%d " // num_threads + "%lu " // 'alarm' == it_real_value (obsolete, always 0) + "%llu " // start_time + "%lu " // vsize + "%lu " // rss + "%lu %lu %lu %lu %lu %lu " // rsslim, start_code, end_code, start_stack, esp, eip + "%*s %*s %*s %*s " // pending, blocked, sigign, sigcatch <=== DISCARDED + "%lu %*u %*u " // 0 (former wchan), 0, 0 <=== Placeholders only + "%d %d " // exit_signal, task_cpu + "%d %d " // rt_priority, policy (sched) + "%llu %llu %llu", // blkio_ticks, gtime, cgtime + &P->state, + &P->ppid, &P->pgrp, &P->session, &P->tty, &P->tpgid, + &P->flags, &P->min_flt, &P->cmin_flt, &P->maj_flt, &P->cmaj_flt, + &P->utime, &P->stime, &P->cutime, &P->cstime, + &P->priority, &P->nice, + &P->nlwp, + &P->alarm, + &P->start_time, + &P->vsize, + &P->rss, + &P->rss_rlim, &P->start_code, &P->end_code, &P->start_stack, &P->kstk_esp, &P->kstk_eip, +/* P->signal, P->blocked, P->sigignore, P->sigcatch, */ /* can't use */ + &P->wchan, /* &P->nswap, &P->cnswap, */ /* nswap and cnswap dead for 2.4.xx and up */ +/* -- Linux 2.0.35 ends here -- */ + &P->exit_signal, &P->processor, /* 2.2.1 ends with "exit_signal" */ +/* -- Linux 2.2.8 to 2.5.17 end here -- */ + &P->rtprio, &P->sched, /* both added to 2.5.18 */ + &P->blkio_tics, &P->gtime, &P->cgtime + ); + + if(!P->nlwp) + P->nlwp = 1; + + return 0; +LEAVE(0x160); +} + + +///////////////////////////////////////////////////////////////////////// + +static void statm2proc(const char *s, proc_t *restrict P) { + sscanf(s, "%lu %lu %lu %lu %lu %lu %lu", + &P->size, &P->resident, &P->share, + &P->trs, &P->lrs, &P->drs, &P->dt); +} + +static void io2proc(const char *s, proc_t *restrict P) { + sscanf(s, "rchar: %lu wchar: %lu syscr: %lu syscw: %lu read_bytes: %lu write_bytes: %lu cancelled_write_bytes: %lu", + &P->rchar, &P->wchar, &P->syscr, + &P->syscw, &P->read_bytes, &P->write_bytes, &P->cancelled_write_bytes); +} + + // Assuming permissions have allowed the read of smaps_rollup, this + // guy will extract some %lu data. Considering the number of items, + // we are between small enough to use a sscanf and large enough for + // a search.h approach. Thus we roll (get it?) our own custom code. +static void smaps2proc (const char *s, proc_t *restrict P) { + #define enMAX (int)((sizeof(smaptab) / sizeof(smaptab[0]))) + // 1st proc_t data field + #define fZERO tid + // a smaptab entry generator + #define mkENT(F) { #F ":", -1, offsetof(proc_t, smap_ ## F) } + // make a target field + #define mkOBJ(X) ( (unsigned long *)((void *)&P->fZERO + smaptab[X].offs) ) + static struct { + const char *item; + int slen; + int offs; + } smaptab[] = { + /* Size smaps only, not rollup */ + /* KernelPageSize " */ + /* MMUPageSize " */ + mkENT(Rss), + mkENT(Pss), + mkENT(Pss_Anon), /* rollup only, not smaps */ + mkENT(Pss_File), /* " */ + mkENT(Pss_Shmem), /* " */ + mkENT(Shared_Clean), + mkENT(Shared_Dirty), + mkENT(Private_Clean), + mkENT(Private_Dirty), + mkENT(Referenced), + mkENT(Anonymous), + mkENT(LazyFree), + mkENT(AnonHugePages), + mkENT(ShmemPmdMapped), + mkENT(FilePmdMapped), + mkENT(Shared_Hugetlb), + mkENT(Private_Hugetlb), + mkENT(Swap), + mkENT(SwapPss), + mkENT(Locked) + /* THPeligible smaps only, not rollup */ + /* ProtectionKey " */ + /* VmFlags " */ + }; + char *head, *tail; + int i; + + if (smaptab[0].slen < 0) { + for (i = 0; i < enMAX; i++) + smaptab[i].slen = (int)strlen(smaptab[i].item); + } + for (i = 0; i < enMAX; i++) { + if (!(head = strstr(s, smaptab[i].item))) + continue; + head += smaptab[i].slen; + *mkOBJ(i) = strtoul(head, &tail, 10); + // saves some overhead BUT makes us dependent on current order + s = tail; + } + #undef enMAX + #undef fZERO + #undef mkENT + #undef mkOBJ +} + +static int file2str(const char *directory, const char *what, struct utlbuf_s *ub) { + #define buffGRW 1024 + char path[PROCPATHLEN]; + int fd, num, tot_read = 0, len; + + /* on first use we preallocate a buffer of minimum size to emulate + former 'local static' behavior -- even if this read fails, that + buffer will likely soon be used for another subdirectory anyway + ( besides, with the calloc call we will never need use memcpy ) */ + if (ub->buf) ub->buf[0] = '\0'; + else { + ub->buf = calloc(1, (ub->siz = buffGRW)); + if (!ub->buf) return -1; + } + len = snprintf(path, sizeof path, "%s/%s", directory, what); + if (len <= 0 || (size_t)len >= sizeof path) return -1; + if (-1 == (fd = open(path, O_RDONLY, 0))) return -1; + while (0 < (num = read(fd, ub->buf + tot_read, ub->siz - tot_read))) { + tot_read += num; + if (tot_read < ub->siz) break; + if (ub->siz >= INT_MAX - buffGRW) { + tot_read--; + break; + } + if (!(ub->buf = realloc(ub->buf, (ub->siz += buffGRW)))) { + close(fd); + return -1; + } + }; + ub->buf[tot_read] = '\0'; + close(fd); + if (tot_read < 1) return -1; + return tot_read; + #undef buffGRW +} + + +static char **file2strvec(const char *directory, const char *what) { + char buf[2048]; /* read buf bytes at a time */ + char *p, *rbuf = 0, *endbuf, **q, **ret, *strp; + int fd, tot = 0, n, c, end_of_file = 0; + int align; + + const int len = snprintf(buf, sizeof buf, "%s/%s", directory, what); + if(len <= 0 || (size_t)len >= sizeof buf) return NULL; + fd = open(buf, O_RDONLY, 0); + if(fd==-1) return NULL; + + /* read whole file into a memory buffer, allocating as we go */ + while ((n = read(fd, buf, sizeof buf - 1)) >= 0) { + if (n < (int)(sizeof buf - 1)) + end_of_file = 1; + if (n <= 0 && tot <= 0) { /* nothing read now, nothing read before */ + break; /* process died between our open and read */ + } + /* ARG_LEN is our guesstimated median length of a command-line argument + or environment variable (the minimum is 1, the maximum is 131072) */ + #define ARG_LEN 64 + if (tot >= INT_MAX / (ARG_LEN + (int)sizeof(char*)) * ARG_LEN - n) { + end_of_file = 1; /* integer overflow: null-terminate and break */ + n = 0; /* but tot > 0 */ + } + #undef ARG_LEN + if (end_of_file && + ((n > 0 && buf[n-1] != '\0') || /* last read char not null */ + (n <= 0 && rbuf && rbuf[tot-1] != '\0'))) /* last read char not null */ + + buf[n++] = '\0'; /* so append null-terminator */ + + if (n <= 0) break; /* unneeded (end_of_file = 1) but avoid realloc */ + rbuf = realloc(rbuf, tot + n); /* allocate more memory */ + if (!rbuf) { + close(fd); + return NULL; + } + memcpy(rbuf + tot, buf, n); /* copy buffer into it */ + tot += n; /* increment total byte ctr */ + if (end_of_file) + break; + } + close(fd); + if (n < 0 || tot <= 0) { /* error, or nothing read */ + if (rbuf) free(rbuf); + return NULL; /* read error */ + } + + rbuf[tot-1] = '\0'; /* belt and suspenders (the while loop did it, too) */ + endbuf = rbuf + tot; /* count space for pointers */ + align = (sizeof(char*)-1) - ((tot + sizeof(char*)-1) & (sizeof(char*)-1)); + c = sizeof(char*); /* one extra for NULL term */ + for (p = rbuf; p < endbuf; p++) { + if (!*p || *p == '\n') { + if (c >= INT_MAX - (tot + (int)sizeof(char*) + align)) break; + c += sizeof(char*); + } + if (*p == '\n') + *p = 0; + } + + rbuf = realloc(rbuf, tot + c + align); /* make room for ptrs AT END */ + if (!rbuf) return NULL; + endbuf = rbuf + tot; /* addr just past data buf */ + q = ret = (char**) (endbuf+align); /* ==> free(*ret) to dealloc */ + for (strp = p = rbuf; p < endbuf; p++) { + if (!*p) { /* NUL char implies that */ + if (c < 2 * (int)sizeof(char*)) break; + c -= sizeof(char*); + *q++ = strp; /* point ptrs to the strings */ + strp = p+1; /* next string -> next char */ + } + } + *q = 0; /* null ptr list terminator */ + return ret; +} + + + // this is the former under utilized 'read_cmdline', which has been + // generalized in support of these new libproc flags: + // PROC_EDITCGRPCVT, PROC_EDITCMDLCVT and PROC_EDITENVRCVT +static int read_unvectored(char *restrict const dst, unsigned sz, const char *whom, const char *what, char sep) { + char path[PROCPATHLEN]; + int fd, len; + unsigned n = 0; + + if(sz <= 0) return 0; + if(sz >= INT_MAX) sz = INT_MAX-1; + dst[0] = '\0'; + + len = snprintf(path, sizeof(path), "%s/%s", whom, what); + if(len <= 0 || (size_t)len >= sizeof(path)) return 0; + fd = open(path, O_RDONLY); + if(fd==-1) return 0; + + for(;;){ + ssize_t r = read(fd,dst+n,sz-n); + if(r==-1){ + if(errno==EINTR) continue; + break; + } + if(r<=0) break; // EOF + n += r; + if(n==sz) { // filled the buffer + --n; // make room for '\0' + break; + } + } + close(fd); + if(n){ + unsigned i = n; + while(i && dst[i-1]=='\0') --i; // skip trailing zeroes + while(i--) + if(dst[i]=='\n' || dst[i]=='\0') dst[i]=sep; + if(dst[n-1]==' ') dst[n-1]='\0'; + } + dst[n] = '\0'; + return n; +} + + +char **vectorize_this_str (const char *src) { + #define pSZ (sizeof(char*)) + char *cpy, **vec; + size_t adj, tot; + + tot = strlen(src) + 1; // prep for our vectors + if (tot < 1 || tot >= INT_MAX) tot = INT_MAX-1; // integer overflow? + adj = (pSZ-1) - ((tot + pSZ-1) & (pSZ-1)); // calc alignment bytes + cpy = calloc(1, tot + adj + (2 * pSZ)); // get new larger buffer + if (!cpy) return NULL; // oops, looks like ENOMEM + snprintf(cpy, tot, "%s", src); // duplicate their string + vec = (char**)(cpy + tot + adj); // prep pointer to pointers + *vec = cpy; // point 1st vector to string + *(vec+1) = NULL; // null ptr 'list' delimit + return vec; // ==> free(*vec) to dealloc + #undef pSZ +} + + + // This littl' guy just serves those true vectorized fields + // ( when a /proc source field didn't exist ) +static int vectorize_dash_rc (char ***vec) { + if (!(*vec = vectorize_this_str("-"))) + return 1; + return 0; +} + + + // This routine reads a 'cgroup' for the designated proc_t and + // guarantees the caller a valid proc_t.cgroup pointer. +static int fill_cgroup_cvt (const char *directory, proc_t *restrict p) { + #define vMAX ( MAX_BUFSZ - (int)(dst - dst_buffer) ) + char *src, *dst, *grp, *eob, *name; + int tot, x, len; + + *(dst = dst_buffer) = '\0'; // empty destination + tot = read_unvectored(src_buffer, MAX_BUFSZ, directory, "cgroup", '\0'); + for (src = src_buffer, eob = src_buffer + tot; src < eob; src += x) { + x = 1; // loop assist + if (!*src) continue; + x = strlen((grp = src)); + if ('/' == grp[x - 1]) continue; // skip empty root cgroups +#if 0 + grp += strspn(grp, "0123456789:"); // jump past group number +#endif + if (vMAX <= 1) break; + len = snprintf(dst, vMAX, "%s", (dst > dst_buffer) ? "," : ""); + if (len < 0 || len >= vMAX) break; + dst += len; + dst += escape_str(dst, grp, vMAX); + } + if (!(p->cgroup = strdup(dst_buffer[0] ? dst_buffer : "-"))) + return 1; + name = strstr(p->cgroup, ":name="); + if (name && *(name+6)) name += 6; else name = p->cgroup; + if (!(p->cgname = strdup(name))) + return 1; + return 0; + #undef vMAX +} + + + // This routine reads a 'cmdline' for the designated proc_t, "escapes" + // the result into a single string while guaranteeing the caller a + // valid proc_t.cmdline pointer. +static int fill_cmdline_cvt (const char *directory, proc_t *restrict p) { + #define uFLG ( ESC_BRACKETS | ESC_DEFUNCT ) + if (read_unvectored(src_buffer, MAX_BUFSZ, directory, "cmdline", ' ')) + escape_str(dst_buffer, src_buffer, MAX_BUFSZ); + else + escape_command(dst_buffer, p, MAX_BUFSZ, uFLG); + p->cmdline = strdup(dst_buffer[0] ? dst_buffer : "?"); + if (!p->cmdline) + return 1; + return 0; + #undef uFLG +} + + + // This routine reads an 'environ' for the designated proc_t and + // guarantees the caller a valid proc_t.environ pointer. +static int fill_environ_cvt (const char *directory, proc_t *restrict p) { + dst_buffer[0] = '\0'; + if (read_unvectored(src_buffer, MAX_BUFSZ, directory, "environ", ' ')) + escape_str(dst_buffer, src_buffer, MAX_BUFSZ); + p->environ = strdup(dst_buffer[0] ? dst_buffer : "-"); + if (!p->environ) + return 1; + return 0; +} + + + // Provide the means to value proc_t.lxcname (perhaps only with "-") while + // tracking all names already seen thus avoiding the overhead of repeating + // malloc() and free() calls. +static char *lxc_containers (const char *path) { + static __thread struct utlbuf_s ub = { NULL, 0 }; // util buffer for whole cgroup + static char lxc_none[] = "-"; + static char lxc_oops[] = "?"; // used when memory alloc fails + /* + try to locate the lxc delimiter eyecatcher somewhere in a task's cgroup + directory -- the following are from nested privileged plus unprivileged + containers, where the '/lxc/' delimiter precedes the container name ... + 10:cpuset:/lxc/lxc-P/lxc/lxc-P-nested + 10:cpuset:/user.slice/user-1000.slice/session-c2.scope/lxc/lxc-U/lxc/lxc-U-nested + + ... some minor complications are the potential addition of more cgroups + for a controller displacing the lxc name (normally last on a line), and + environments with unexpected /proc/##/cgroup ordering/contents as with: + 10:cpuset:/lxc/lxc-P/lxc/lxc-P-nested/MY-NEW-CGROUP + or + 2:name=systemd:/ + 1:cpuset,cpu,cpuacct,devices,freezer,net_cls,blkio,perf_event,net_prio:/lxc/lxc-P + */ + if (file2str(path, "cgroup", &ub) > 0) { + /* ouch, the next defaults could be changed at lxc ./configure time + ( and a changed 'lxc.cgroup.pattern' is only available to root ) */ + static const char *lxc_delm1 = "lxc.payload."; // with lxc-4.0.0 + static const char *lxc_delm2 = "lxc.payload/"; // thru lxc-3.2.1 + static const char *lxc_delm3 = "lxc/"; // thru lxc-3.0.3 + const char *delim; + char *p1; + + if ((p1 = strstr(ub.buf, (delim = lxc_delm1))) + || ((p1 = strstr(ub.buf, (delim = lxc_delm2))) + || ((p1 = strstr(ub.buf, (delim = lxc_delm3)))))) { + static __thread struct lxc_ele { + struct lxc_ele *next; + char *name; + } *anchor = NULL; + struct lxc_ele *ele = anchor; + int delim_len = strlen(delim); + char *p2; + + if ((p2 = strchr(p1, '\n'))) // isolate a controller's line + *p2 = '\0'; + do { // deal with nested containers + p2 = p1 + delim_len; + p1 = strstr(p2, delim); + } while (p1); + if ((p1 = strchr(p2, '/'))) // isolate name only substring + *p1 = '\0'; + while (ele) { // have we already seen a name + if (!strcmp(ele->name, p2)) + return ele->name; // return just a recycled name + ele = ele->next; + } + if (!(ele = (struct lxc_ele *)malloc(sizeof(struct lxc_ele)))) + return lxc_oops; + if (!(ele->name = strdup(p2))) { + free(ele); + return lxc_oops; + } + ele->next = anchor; // push the new container name + anchor = ele; + return ele->name; // return a new container name + } + } + return lxc_none; +} + + + // Provide the user id at login (or -1 if not available) +static int login_uid (const char *path) { + char buf[PROCPATHLEN]; + int fd, id, in; + + id = -1; + snprintf(buf, sizeof(buf), "%s/loginuid", path); + if ((fd = open(buf, O_RDONLY, 0)) != -1) { + in = read(fd, buf, sizeof(buf) - 1); + close(fd); + if (in > 0) { + buf[in] = '\0'; + id = atoi(buf); + } + } + return id; +} + + +static char *readlink_exe (const char *path){ + char buf[PROCPATHLEN]; + int in; + + snprintf(buf, sizeof(buf), "%s/exe", path); + in = (int)readlink(buf, src_buffer, MAX_BUFSZ-1); + if (in > 0) { + src_buffer[in] = '\0'; + escape_str(dst_buffer, src_buffer, MAX_BUFSZ); + return strdup(dst_buffer); + } + return strdup("-"); +} + + + // Provide the autogroup fields (or -1 if not available) +static void autogroup_fill (const char *path, proc_t *p) { + char buf[PROCPATHLEN]; + int fd, in; + + p->autogrp_id = -1; + snprintf(buf, sizeof(buf), "%s/autogroup", path); + if ((fd = open(buf, O_RDONLY, 0)) != -1) { + in = read(fd, buf, sizeof(buf) - 1); + close(fd); + if (in > 0) { + buf[in] = '\0'; + sscanf(buf, "/autogroup-%d nice %d" + , &p->autogrp_id, &p->autogrp_nice); + } + } +} + + +/////////////////////////////////////////////////////////////////////// + +/* These are some nice GNU C expression subscope "inline" functions. + * The can be used with arbitrary types and evaluate their arguments + * exactly once. + */ + +/* Test if item X of type T is present in the 0 terminated list L */ +# define XinL(T, X, L) ( { \ + T x = (X), *l = (L); \ + while (*l && *l != x) l++; \ + *l == x; \ + } ) + +/* Test if item X of type T is present in the list L of length N */ +# define XinLN(T, X, L, N) ( { \ + T x = (X), *l = (L); \ + int i = 0, n = (N); \ + while (i < n && l[i] != x) i++; \ + i < n && l[i] == x; \ + } ) + + +////////////////////////////////////////////////////////////////////////////////// +// This reads process info from /proc in the traditional way, for one process. +// The pid (tgid? tid?) is already in p, and a path to it in path, with some +// room to spare. +static proc_t *simple_readproc(PROCTAB *restrict const PT, proc_t *restrict const p) { + static __thread struct utlbuf_s ub = { NULL, 0 }; // buf for stat,statm,status + static __thread struct stat sb; // stat() buffer + char *restrict const path = PT->path; + unsigned flags = PT->flags; + int rc = 0; + + if (stat(path, &sb) == -1) /* no such dirent (anymore) */ + goto next_proc; + + if ((flags & PROC_UID) && !XinLN(uid_t, sb.st_uid, PT->uids, PT->nuid)) + goto next_proc; /* not one of the requested uids */ + + p->euid = sb.st_uid; /* need a way to get real uid */ + p->egid = sb.st_gid; /* need a way to get real gid */ + + if (flags & PROC_FILLSTAT) { // read /proc/#/stat + if (file2str(path, "stat", &ub) == -1) + goto next_proc; + rc += stat2proc(ub.buf, p); + } + + if (flags & PROC_FILLIO) { // read /proc/#/io + if (file2str(path, "io", &ub) != -1) + io2proc(ub.buf, p); + } + + if (flags & PROC_FILLSMAPS) { // read /proc/#/smaps_rollup + if (file2str(path, "smaps_rollup", &ub) != -1) + smaps2proc(ub.buf, p); + } + + if (flags & PROC_FILLMEM) { // read /proc/#/statm + if (file2str(path, "statm", &ub) != -1) + statm2proc(ub.buf, p); + } + + if (flags & PROC_FILLSTATUS) { // read /proc/#/status + if (file2str(path, "status", &ub) != -1){ + rc += status2proc(ub.buf, p, 1); + if (flags & (PROC_FILL_SUPGRP & ~PROC_FILLSTATUS)) + rc += supgrps_from_supgids(p); + if (flags & (PROC_FILL_OUSERS & ~PROC_FILLSTATUS)) { + p->ruser = pwcache_get_user(p->ruid); + p->suser = pwcache_get_user(p->suid); + p->fuser = pwcache_get_user(p->fuid); + } + if (flags & (PROC_FILL_OGROUPS & ~PROC_FILLSTATUS)) { + p->rgroup = pwcache_get_group(p->rgid); + p->sgroup = pwcache_get_group(p->sgid); + p->fgroup = pwcache_get_group(p->fgid); + } + } + } + + // if multithreaded, some values are crap + if(p->nlwp > 1) + p->wchan = ~0ul; + + /* some number->text resolving which is time consuming */ + /* ( names are cached, so memcpy to arrays was silly ) */ + if (flags & PROC_FILLUSR) + p->euser = pwcache_get_user(p->euid); + if (flags & PROC_FILLGRP) + p->egroup = pwcache_get_group(p->egid); + + if (flags & PROC_FILLENV) // read /proc/#/environ + if (!(p->environ_v = file2strvec(path, "environ"))) + rc += vectorize_dash_rc(&p->environ_v); + if (flags & PROC_EDITENVRCVT) + rc += fill_environ_cvt(path, p); + + if (flags & PROC_FILLARG) // read /proc/#/cmdline + if (!(p->cmdline_v = file2strvec(path, "cmdline"))) + rc += vectorize_dash_rc(&p->cmdline_v); + if (flags & PROC_EDITCMDLCVT) + rc += fill_cmdline_cvt(path, p); + + if ((flags & PROC_FILLCGROUP)) // read /proc/#/cgroup + if (!(p->cgroup_v = file2strvec(path, "cgroup"))) + rc += vectorize_dash_rc(&p->cgroup_v); + if (flags & PROC_EDITCGRPCVT) + rc += fill_cgroup_cvt(path, p); + + if (flags & PROC_FILLOOM) { + if (file2str(path, "oom_score", &ub) != -1) + oomscore2proc(ub.buf, p); + if (file2str(path, "oom_score_adj", &ub) != -1) + oomadj2proc(ub.buf, p); + } + + if (flags & PROC_FILLNS) // read /proc/#/ns/* + procps_ns_read_pid(p->tid, &(p->ns)); + + + if (flags & PROC_FILLSYSTEMD) // get sd-login.h stuff + rc += sd2proc(p); + + if (flags & PROC_FILL_LXC) // value the lxc name + p->lxcname = lxc_containers(path); + + if (flags & PROC_FILL_LUID) // value the login user id + p->luid = login_uid(path); + + if (flags & PROC_FILL_EXE) { + if (!(p->exe = readlink_exe(path))) + rc += 1; + } + + if (flags & PROC_FILLAUTOGRP) // value the 2 autogroup fields + autogroup_fill(path, p); + + // openproc() ensured that a ppid will be present when needed ... + if (rc == 0) { + if (PT->hide_kernel && (p->ppid == 2 || p->tid == 2)) { + free_acquired(p); + return NULL; + } + return p; + } + errno = ENOMEM; +next_proc: + return NULL; +} + + +////////////////////////////////////////////////////////////////////////////////// +// This reads /proc/*/task/* data, for one task. +// t is the POSIX thread (task group member, generally not the leader) +// path is a path to the task, with some room to spare. +static proc_t *simple_readtask(PROCTAB *restrict const PT, proc_t *restrict const t, char *restrict const path) { + static __thread struct utlbuf_s ub = { NULL, 0 }; // buf for stat,statm,status + static __thread struct stat sb; // stat() buffer + unsigned flags = PT->flags; + int rc = 0; + + if (stat(path, &sb) == -1) /* no such dirent (anymore) */ + goto next_task; + +// if ((flags & PROC_UID) && !XinLN(uid_t, sb.st_uid, PT->uids, PT->nuid)) +// goto next_task; /* not one of the requested uids */ + + t->euid = sb.st_uid; /* need a way to get real uid */ + t->egid = sb.st_gid; /* need a way to get real gid */ + + if (flags & PROC_FILLSTAT) { // read /proc/#/task/#/stat + if (file2str(path, "stat", &ub) == -1) + goto next_task; + rc += stat2proc(ub.buf, t); + } + + if (flags & PROC_FILLIO) { // read /proc/#/task/#/io + if (file2str(path, "io", &ub) != -1) + io2proc(ub.buf, t); + } + + if (flags & PROC_FILLSMAPS) { // read /proc/#/task/#/smaps_rollup + if (file2str(path, "smaps_rollup", &ub) != -1) + smaps2proc(ub.buf, t); + } + + if (flags & PROC_FILLMEM) { // read /proc/#/task/#/statm + if (file2str(path, "statm", &ub) != -1) + statm2proc(ub.buf, t); + } + + if (flags & PROC_FILLSTATUS) { // read /proc/#/task/#/status + if (file2str(path, "status", &ub) != -1) { + rc += status2proc(ub.buf, t, 0); + if (flags & (PROC_FILL_SUPGRP & ~PROC_FILLSTATUS)) + rc += supgrps_from_supgids(t); + if (flags & (PROC_FILL_OUSERS & ~PROC_FILLSTATUS)) { + t->ruser = pwcache_get_user(t->ruid); + t->suser = pwcache_get_user(t->suid); + t->fuser = pwcache_get_user(t->fuid); + } + if (flags & (PROC_FILL_OGROUPS & ~PROC_FILLSTATUS)) { + t->rgroup = pwcache_get_group(t->rgid); + t->sgroup = pwcache_get_group(t->sgid); + t->fgroup = pwcache_get_group(t->fgid); + } + } + } + + /* some number->text resolving which is time consuming */ + /* ( names are cached, so memcpy to arrays was silly ) */ + if (flags & PROC_FILLUSR) + t->euser = pwcache_get_user(t->euid); + if (flags & PROC_FILLGRP) + t->egroup = pwcache_get_group(t->egid); + +#ifdef FALSE_THREADS + if (!IS_THREAD(t)) { +#endif + if (flags & PROC_FILLARG) // read /proc/#/task/#/cmdline + if (!(t->cmdline_v = file2strvec(path, "cmdline"))) + rc += vectorize_dash_rc(&t->cmdline_v); + if (flags & PROC_EDITCMDLCVT) + rc += fill_cmdline_cvt(path, t); + + if (flags & PROC_FILLENV) // read /proc/#/task/#/environ + if (!(t->environ_v = file2strvec(path, "environ"))) + rc += vectorize_dash_rc(&t->environ_v); + if (flags & PROC_EDITENVRCVT) + rc += fill_environ_cvt(path, t); + + if ((flags & PROC_FILLCGROUP)) // read /proc/#/task/#/cgroup + if (!(t->cgroup_v = file2strvec(path, "cgroup"))) + rc += vectorize_dash_rc(&t->cgroup_v); + if (flags & PROC_EDITCGRPCVT) + rc += fill_cgroup_cvt(path, t); + + if (flags & PROC_FILLSYSTEMD) // get sd-login.h stuff + rc += sd2proc(t); + + if (flags & PROC_FILL_EXE) { + if (!(t->exe = readlink_exe(path))) + rc += 1; + } +#ifdef FALSE_THREADS + } +#endif + + if (flags & PROC_FILLOOM) { + if (file2str(path, "oom_score", &ub) != -1) + oomscore2proc(ub.buf, t); + if (file2str(path, "oom_score_adj", &ub) != -1) + oomadj2proc(ub.buf, t); + } + if (flags & PROC_FILLNS) // read /proc/#/task/#/ns/* + procps_ns_read_pid(t->tid, &(t->ns)); + + if (flags & PROC_FILL_LXC) + t->lxcname = lxc_containers(path); + + if (flags & PROC_FILL_LUID) + t->luid = login_uid(path); + + if (flags & PROC_FILLAUTOGRP) // value the 2 autogroup fields + autogroup_fill(path, t); + + // openproc() ensured that a ppid will be present when needed ... + if (rc == 0) { + if (PT->hide_kernel && (t->ppid == 2 || t->tid == 2)) { + free_acquired(t); + return NULL; + } + return t; + } + errno = ENOMEM; +next_task: + return NULL; +} + + +////////////////////////////////////////////////////////////////////////////////// +// This finds processes in /proc in the traditional way. +// Return non-zero on success. +static int simple_nextpid(PROCTAB *restrict const PT, proc_t *restrict const p) { + static __thread struct dirent *ent; /* dirent handle */ + char *restrict const path = PT->path; + for (;;) { + ent = readdir(PT->procfs); + if (!ent || !ent->d_name[0]) break; + if (*ent->d_name > '0' && *ent->d_name <= '9') { + errno = 0; + p->tgid = strtoul(ent->d_name, NULL, 10); + if (errno == 0) { + p->tid = p->tgid; + snprintf(path, PROCPATHLEN, "/proc/%d", p->tgid); + return 1; + } + } + } + return 0; +} + + +////////////////////////////////////////////////////////////////////////////////// +// This finds tasks in /proc/*/task/ in the traditional way. +// Return non-zero on success. +static int simple_nexttid(PROCTAB *restrict const PT, const proc_t *restrict const p, proc_t *restrict const t, char *restrict const path) { + static __thread struct dirent *ent; /* dirent handle */ + if(PT->taskdir_user != p->tgid){ + if(PT->taskdir){ + closedir(PT->taskdir); + } + // use "path" as some tmp space + snprintf(path, PROCPATHLEN, "/proc/%d/task", p->tgid); + PT->taskdir = opendir(path); + if(!PT->taskdir) return 0; + PT->taskdir_user = p->tgid; + } + for (;;) { + ent = readdir(PT->taskdir); + if(!ent || !ent->d_name[0]) return 0; + if(*ent->d_name > '0' && *ent->d_name <= '9') break; + } + t->tid = strtoul(ent->d_name, NULL, 10); + t->tgid = p->tgid; +//t->ppid = p->ppid; // cover for kernel behavior? we want both actually...? + snprintf(path, PROCPATHLEN, "/proc/%d/task/%.10s", p->tgid, ent->d_name); + return 1; +} + + +////////////////////////////////////////////////////////////////////////////////// +// This "finds" processes in a list that was given to openproc(). +// Return non-zero on success. (tgid is a real headache) +static int listed_nextpid (PROCTAB *PT, proc_t *p) { + static __thread struct utlbuf_s ub = { NULL, 0 }; + pid_t pid = *(PT->pids)++; + char *path = PT->path; + + if (pid) { + snprintf(path, PROCPATHLEN, "/proc/%d", pid); + p->tid = p->tgid = pid; // this tgid may be a huge fib | + + /* the 'status' directory is the only place where we find the | + task's real tgid. it's a bit expensive, but remember we're | + dealing with fewer processes, unlike the other 'next' guys | + (plus we need not parse the whole thing like status2proc)! | */ + + if (file2str(path, "status", &ub) != -1) { + char *str = strstr(ub.buf, "Tgid:"); + if (str) + p->tgid = atoi(str + 5); // this tgid is the proper one | + } + } + return pid; +} + + +////////////////////////////////////////////////////////////////////////////////// +/* readproc: return a pointer to a proc_t filled with requested info about the + * next process available matching the restriction set. If no more such + * processes are available, return a null pointer (boolean false). Use the + * passed buffer instead of allocating space if it is non-NULL. */ + +/* This is optimized so that if a PID list is given, only those files are + * searched for in /proc. If other lists are given in addition to the PID list, + * the same logic can follow through as for the no-PID list case. This is + * fairly complex, but it does try to not to do any unnecessary work. + */ +proc_t *readproc(PROCTAB *restrict const PT, proc_t *restrict p) { + proc_t *ret; + + free_acquired(p); + + for(;;){ + // fills in the path, plus p->tid and p->tgid + if (!PT->finder(PT,p)) goto out; + + // go read the process data + ret = PT->reader(PT,p); + if(ret) return ret; + } + +out: + return NULL; +} + + +////////////////////////////////////////////////////////////////////////////////// +// readeither: return a pointer to a proc_t filled with requested info about +// the next unique process or task available. If no more are available, +// return a null pointer (boolean false). +proc_t *readeither (PROCTAB *restrict const PT, proc_t *restrict x) { + static __thread proc_t skel_p; // skeleton proc_t, only uses tid + tgid + static __thread proc_t *new_p; // for process/task transitions + static __thread int canary; + char path[PROCPATHLEN]; + proc_t *ret; + + free_acquired(x); + + if (new_p) { + if (new_p->tid != canary) new_p = NULL; + goto next_task; + } + +next_proc: + new_p = NULL; + for (;;) { + // fills in the PT->path, plus skel_p.tid and skel_p.tgid + if (!PT->finder(PT,&skel_p)) goto end_procs; // simple_nextpid + if (!task_dir_missing) break; + if ((ret = PT->reader(PT,x))) return ret; // simple_readproc + } + +next_task: + // fills in our path, plus x->tid and x->tgid + if ((!(PT->taskfinder(PT,&skel_p,x,path))) // simple_nexttid + || (!(ret = PT->taskreader(PT,x,path)))) { // simple_readtask + goto next_proc; + } + if (!new_p) { + new_p = ret; + canary = new_p->tid; + } + return ret; + +end_procs: + return NULL; +} + + +////////////////////////////////////////////////////////////////////////////////// + +// initiate a process table scan +PROCTAB *openproc(unsigned flags, ...) { + va_list ap; + struct stat sbuf; + static __thread int did_stat; + static __thread int hide_kernel = -1; + PROCTAB *PT = calloc(1, sizeof(PROCTAB)); + + if (!PT) + return NULL; + if (hide_kernel < 0) + hide_kernel = (NULL != getenv("LIBPROC_HIDE_KERNEL")); + if (!did_stat){ + task_dir_missing = stat("/proc/self/task", &sbuf); + did_stat = 1; + } + PT->taskdir = NULL; + PT->taskdir_user = -1; + PT->taskfinder = simple_nexttid; + PT->taskreader = simple_readtask; + + PT->reader = simple_readproc; + if (flags & PROC_PID){ + PT->procfs = NULL; + PT->finder = listed_nextpid; + }else{ + PT->procfs = opendir("/proc"); + if (!PT->procfs) { free(PT); return NULL; } + PT->finder = simple_nextpid; + } + PT->flags = flags; + + va_start(ap, flags); + if (flags & PROC_PID) + PT->pids = va_arg(ap, pid_t*); + else if (flags & PROC_UID){ + PT->uids = va_arg(ap, uid_t*); + PT->nuid = va_arg(ap, int); + } + va_end(ap); + + if (hide_kernel > 0) { + PT->hide_kernel = 1; + // we'll need the ppid, ensure it's obtained via cheapest means ... + if (!(PT->flags & (PROC_FILLSTAT | PROC_FILLSTATUS))) + PT->flags |= PROC_FILLSTAT; + } + + if (!src_buffer + && !(src_buffer = malloc(MAX_BUFSZ))) { + closedir(PT->procfs); + free(PT); + return NULL; + } + if (!dst_buffer + && !(dst_buffer = malloc(MAX_BUFSZ))) { + closedir(PT->procfs); + free(src_buffer); + free(PT); + return NULL; + } + + return PT; +} + + +// terminate a process table scan +void closeproc(PROCTAB *PT) { + if (PT){ + if (PT->procfs) closedir(PT->procfs); + if (PT->taskdir) closedir(PT->taskdir); + memset(PT,'#',sizeof(PROCTAB)); + free(PT); + } +} + + +////////////////////////////////////////////////////////////////////////////////// +int look_up_our_self(void) { + struct utlbuf_s ub = { NULL, 0 }; + int rc = 0; + proc_t p; + + memset(&p, 0, sizeof(proc_t)); + if(file2str("/proc/self", "stat", &ub) == -1){ + fprintf(stderr, "Error, do this: mount -t proc proc /proc\n"); + _exit(47); + } + rc = stat2proc(ub.buf, &p); // parse /proc/self/stat + free_acquired(&p); + free(ub.buf); + return !rc; +} + +#undef IS_THREAD +#undef MAX_BUFSZ diff --git a/library/slabinfo.c b/library/slabinfo.c new file mode 100644 index 0000000..b87f353 --- /dev/null +++ b/library/slabinfo.c @@ -0,0 +1,1044 @@ +/* + * slabinfo.c - slab pools related definitions for libproc2 + * + * Copyright © 2015-2023 Jim Warner + * Copyright © 2015-2023 Craig Small + * Copyright © 2004-2006 Albert Cahalan + * Copyright © 2003 Chris Rivera + * Copyright © 2003 Fabian Frederick + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; 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 "procps-private.h" +#include "slabinfo.h" + + +#define SLABINFO_FILE "/proc/slabinfo" +#define SLABINFO_LINE_LEN 2048 +#define SLABINFO_NAME_LEN 128 + +#define STACKS_INCR 128 // amount reap stack allocations grow + +/* ---------------------------------------------------------------------------- + + this #define will be used to help ensure that our Item_table is synchronized | + with all the enumerators found in the associated header file. It is intended | + to only be defined locally (and temporarily) at some point prior to release! | */ +// #define ITEMTABLE_DEBUG //-------------------------------------------------- | +// ---------------------------------------------------------------------------- + + +/* + Because 'select' could, at most, return only node[0] values and since 'reap' | + would be forced to duplicate global slabs stuff in every node results stack, | + the following #define can be used to enforce strictly logical return values. | + select: allow only SLABINFO & SLABS items + reap: allow only SLABINFO & SLAB items + Without the #define, these functions always return something even if just 0. | + get: return only SLABS results, else 0 + select: return only SLABINFO & SLABS results, else zero + reap: return any requested, even when duplicated in each cache's stack */ +//#define ENFORCE_LOGICAL // ensure only logical items accepted by select/reap + + +struct slabs_summ { + unsigned int nr_objs; // number of objects, among all caches + unsigned int nr_active_objs; // number of active objects, among all caches + unsigned int nr_pages; // number of pages consumed by all objects + unsigned int nr_slabs; // number of slabs, among all caches + unsigned int nr_active_slabs; // number of active slabs, among all caches + unsigned int nr_caches; // number of caches + unsigned int nr_active_caches; // number of active caches + unsigned int avg_obj_size; // average object size + unsigned int min_obj_size; // size of smallest object + unsigned int max_obj_size; // size of largest object + unsigned long active_size; // size of all active objects + unsigned long total_size; // size of all objects +}; + +struct slabs_node { + char name[SLABINFO_NAME_LEN+1]; // name of this cache + unsigned long cache_size; // size of entire cache + unsigned int nr_objs; // number of objects in this cache + unsigned int nr_active_objs; // number of active objects + unsigned int obj_size; // size of each object + unsigned int objs_per_slab; // number of objects per slab + unsigned int pages_per_slab; // number of pages per slab + unsigned int nr_slabs; // number of slabs in this cache + unsigned int nr_active_slabs; // number of active slabs + unsigned int use; // percent full: total / active +}; + +struct slabs_hist { + struct slabs_summ new; + struct slabs_summ old; +}; + +struct stacks_extent { + int ext_numstacks; + struct stacks_extent *next; + struct slabinfo_stack **stacks; +}; + +struct ext_support { + int numitems; // includes 'logical_end' delimiter + enum slabinfo_item *items; // includes 'logical_end' delimiter + struct stacks_extent *extents; // anchor for these extents +#ifdef ENFORCE_LOGICAL + enum slabinfo_item lowest; // range of allowable enums + enum slabinfo_item highest; +#endif +}; + +struct fetch_support { + struct slabinfo_stack **anchor; // fetch consolidated extents + int n_alloc; // number of above pointers allocated + int n_inuse; // number of above pointers occupied + int n_alloc_save; // last known reap.stacks allocation + struct slabinfo_reaped results; // count + stacks for return to caller +}; + +struct slabinfo_info { + int refcount; + FILE *slabinfo_fp; + int nodes_alloc; // nodes alloc()ed + int nodes_used; // nodes using alloced memory + struct slabs_node *nodes; // first slabnode of this list + struct slabs_hist slabs; // new/old slabs_summ data + struct ext_support select_ext; // supports concurrent select/reap + struct ext_support fetch_ext; // supports concurrent select/reap + struct fetch_support fetch; // support for procps_slabinfo_reap + struct slabs_node nul_node; // used by slabinfo_get/select + struct slabinfo_result get_this; // used by slabinfo_get + time_t sav_secs; // used by slabinfo_get +}; + + +// ___ Results 'Set' Support |||||||||||||||||||||||||||||||||||||||||||||||||| + +#define setNAME(e) set_ ## e +#define setDECL(e) static void setNAME(e) \ + (struct slabinfo_result *R, struct slabs_hist *S, struct slabs_node *N) + +// regular assignment +#define REG_set(e,t,x) setDECL(e) { (void)N; R->result. t = S->new. x; } +#define NOD_set(e,t,x) setDECL(e) { (void)S; R->result. t = N-> x; } +// delta assignment +#define HST_set(e,t,x) setDECL(e) { (void)N; R->result. t = (signed long)S->new. x - S->old. x; } + +setDECL(SLABINFO_noop) { (void)R; (void)S; (void)N; } +setDECL(SLABINFO_extra) { (void)S; (void)N; R->result.ul_int = 0; } + +NOD_set(SLAB_NAME, str, name) +NOD_set(SLAB_NUM_OBJS, u_int, nr_objs) +NOD_set(SLAB_ACTIVE_OBJS, u_int, nr_active_objs) +NOD_set(SLAB_OBJ_SIZE, u_int, obj_size) +NOD_set(SLAB_OBJ_PER_SLAB, u_int, objs_per_slab) +NOD_set(SLAB_NUMS_SLABS, u_int, nr_slabs) +NOD_set(SLAB_ACTIVE_SLABS, u_int, nr_active_slabs) +NOD_set(SLAB_PAGES_PER_SLAB, u_int, pages_per_slab) +NOD_set(SLAB_PERCENT_USED, u_int, use) +NOD_set(SLAB_SIZE_TOTAL, ul_int, cache_size) + +REG_set(SLABS_CACHES_TOTAL, u_int, nr_caches) +REG_set(SLABS_CACHES_ACTIVE, u_int, nr_active_caches) +REG_set(SLABS_NUM_OBJS, u_int, nr_objs) +REG_set(SLABS_ACTIVE_OBJS, u_int, nr_active_objs) +REG_set(SLABS_OBJ_SIZE_AVG, u_int, avg_obj_size) +REG_set(SLABS_OBJ_SIZE_MIN, u_int, min_obj_size) +REG_set(SLABS_OBJ_SIZE_MAX, u_int, max_obj_size) +REG_set(SLABS_NUMS_SLABS, u_int, nr_slabs) +REG_set(SLABS_ACTIVE_SLABS, u_int, nr_active_slabs) +REG_set(SLABS_PAGES_TOTAL, u_int, nr_pages) +REG_set(SLABS_SIZE_ACTIVE, ul_int, active_size) +REG_set(SLABS_SIZE_TOTAL, ul_int, total_size) + +HST_set(SLABS_DELTA_CACHES_TOTAL, s_int, nr_caches) +HST_set(SLABS_DELTA_CACHES_ACTIVE, s_int, nr_active_caches) +HST_set(SLABS_DELTA_NUM_OBJS, s_int, nr_objs) +HST_set(SLABS_DELTA_ACTIVE_OBJS, s_int, nr_active_objs) +HST_set(SLABS_DELTA_OBJ_SIZE_AVG, s_int, avg_obj_size) +HST_set(SLABS_DELTA_OBJ_SIZE_MIN, s_int, min_obj_size) +HST_set(SLABS_DELTA_OBJ_SIZE_MAX, s_int, max_obj_size) +HST_set(SLABS_DELTA_NUMS_SLABS, s_int, nr_slabs) +HST_set(SLABS_DELTA_ACTIVE_SLABS, s_int, nr_active_slabs) +HST_set(SLABS_DELTA_PAGES_TOTAL, s_int, nr_pages) +HST_set(SLABS_DELTA_SIZE_ACTIVE, s_int, active_size) +HST_set(SLABS_DELTA_SIZE_TOTAL, s_int, total_size) + +#undef setDECL +#undef REG_set +#undef NOD_set +#undef HST_set + + +// ___ Sorting Support |||||||||||||||||||||||||||||||||||||||||||||||||||||||| + +struct sort_parms { + int offset; + enum slabinfo_sort_order order; +}; + +#define srtNAME(t) sort_slabinfo_ ## t +#define srtDECL(t) static int srtNAME(t) \ + (const struct slabinfo_stack **A, const struct slabinfo_stack **B, struct sort_parms *P) + +srtDECL(u_int) { + const struct slabinfo_result *a = (*A)->head + P->offset; \ + const struct slabinfo_result *b = (*B)->head + P->offset; \ + if ( a->result.u_int > b->result.u_int ) return P->order > 0 ? 1 : -1; \ + if ( a->result.u_int < b->result.u_int ) return P->order > 0 ? -1 : 1; \ + return 0; +} + +srtDECL(ul_int) { + const struct slabinfo_result *a = (*A)->head + P->offset; \ + const struct slabinfo_result *b = (*B)->head + P->offset; \ + if ( a->result.ul_int > b->result.ul_int ) return P->order > 0 ? 1 : -1; \ + if ( a->result.ul_int < b->result.ul_int ) return P->order > 0 ? -1 : 1; \ + return 0; +} + +srtDECL(str) { + const struct slabinfo_result *a = (*A)->head + P->offset; + const struct slabinfo_result *b = (*B)->head + P->offset; + return P->order * strcoll(a->result.str, b->result.str); +} + +srtDECL(noop) { \ + (void)A; (void)B; (void)P; \ + return 0; +} + +#undef srtDECL + + +// ___ Controlling Table |||||||||||||||||||||||||||||||||||||||||||||||||||||| + +typedef void (*SET_t)(struct slabinfo_result *, struct slabs_hist *, struct slabs_node *); +#ifdef ITEMTABLE_DEBUG +#define RS(e) (SET_t)setNAME(e), e, STRINGIFY(e) +#else +#define RS(e) (SET_t)setNAME(e) +#endif + +typedef int (*QSR_t)(const void *, const void *, void *); +#define QS(t) (QSR_t)srtNAME(t) + +#define TS(t) STRINGIFY(t) +#define TS_noop "" + + /* + * Need it be said? + * This table must be kept in the exact same order as + * those *enum slabinfo_item* guys ! */ +static struct { + SET_t setsfunc; // the actual result setting routine +#ifdef ITEMTABLE_DEBUG + int enumnumb; // enumerator (must match position!) + char *enum2str; // enumerator name as a char* string +#endif + QSR_t sortfunc; // sort cmp func for a specific type + char *type2str; // the result type as a string value +} Item_table[] = { +/* setsfunc sortfunc type2str + ------------------------------ ----------- ---------- */ + { RS(SLABINFO_noop), QS(noop), TS_noop }, + { RS(SLABINFO_extra), QS(ul_int), TS_noop }, + + { RS(SLAB_NAME), QS(str), TS(str) }, + { RS(SLAB_NUM_OBJS), QS(u_int), TS(u_int) }, + { RS(SLAB_ACTIVE_OBJS), QS(u_int), TS(u_int) }, + { RS(SLAB_OBJ_SIZE), QS(u_int), TS(u_int) }, + { RS(SLAB_OBJ_PER_SLAB), QS(u_int), TS(u_int) }, + { RS(SLAB_NUMS_SLABS), QS(u_int), TS(u_int) }, + { RS(SLAB_ACTIVE_SLABS), QS(u_int), TS(u_int) }, + { RS(SLAB_PAGES_PER_SLAB), QS(u_int), TS(u_int) }, + { RS(SLAB_PERCENT_USED), QS(u_int), TS(u_int) }, + { RS(SLAB_SIZE_TOTAL), QS(ul_int), TS(ul_int) }, + + { RS(SLABS_CACHES_TOTAL), QS(noop), TS(u_int) }, + { RS(SLABS_CACHES_ACTIVE), QS(noop), TS(u_int) }, + { RS(SLABS_NUM_OBJS), QS(noop), TS(u_int) }, + { RS(SLABS_ACTIVE_OBJS), QS(noop), TS(u_int) }, + { RS(SLABS_OBJ_SIZE_AVG), QS(noop), TS(u_int) }, + { RS(SLABS_OBJ_SIZE_MIN), QS(noop), TS(u_int) }, + { RS(SLABS_OBJ_SIZE_MAX), QS(noop), TS(u_int) }, + { RS(SLABS_NUMS_SLABS), QS(noop), TS(u_int) }, + { RS(SLABS_ACTIVE_SLABS), QS(noop), TS(u_int) }, + { RS(SLABS_PAGES_TOTAL), QS(noop), TS(u_int) }, + { RS(SLABS_SIZE_ACTIVE), QS(noop), TS(ul_int) }, + { RS(SLABS_SIZE_TOTAL), QS(noop), TS(ul_int) }, + + { RS(SLABS_DELTA_CACHES_TOTAL), QS(noop), TS(s_int) }, + { RS(SLABS_DELTA_CACHES_ACTIVE), QS(noop), TS(s_int) }, + { RS(SLABS_DELTA_NUM_OBJS), QS(noop), TS(s_int) }, + { RS(SLABS_DELTA_ACTIVE_OBJS), QS(noop), TS(s_int) }, + { RS(SLABS_DELTA_OBJ_SIZE_AVG), QS(noop), TS(s_int) }, + { RS(SLABS_DELTA_OBJ_SIZE_MIN), QS(noop), TS(s_int) }, + { RS(SLABS_DELTA_OBJ_SIZE_MAX), QS(noop), TS(s_int) }, + { RS(SLABS_DELTA_NUMS_SLABS), QS(noop), TS(s_int) }, + { RS(SLABS_DELTA_ACTIVE_SLABS), QS(noop), TS(s_int) }, + { RS(SLABS_DELTA_PAGES_TOTAL), QS(noop), TS(s_int) }, + { RS(SLABS_DELTA_SIZE_ACTIVE), QS(noop), TS(s_int) }, + { RS(SLABS_DELTA_SIZE_TOTAL), QS(noop), TS(s_int) }, +}; + + /* please note, + * this enum MUST be 1 greater than the highest value of any enum */ +enum slabinfo_item SLABINFO_logical_end = MAXTABLE(Item_table); + +#undef setNAME +#undef srtNAME +#undef RS +#undef QS + + +// ___ Private Functions |||||||||||||||||||||||||||||||||||||||||||||||||||||| +// --- slabnode specific support ---------------------------------------------- + +/* Alloc up more slabnode memory, if required + */ +static int alloc_slabnodes ( + struct slabinfo_info *info) +{ + struct slabs_node *new_nodes; + int new_count; + + if (info->nodes_used < info->nodes_alloc) + return 1; + /* Increment the allocated number of slabs */ + new_count = info->nodes_alloc * 5/4+30; + + new_nodes = realloc(info->nodes, sizeof(struct slabs_node) * new_count); + if (!new_nodes) + return 0; + info->nodes = new_nodes; + info->nodes_alloc = new_count; + return 1; +} // end: alloc_slabnodes + + +/* + * get_slabnode - allocate slab_info structures using a free list + * + * In the fast path, we simply return a node off the free list. In the slow + * list, we malloc() a new node. The free list is never automatically reaped, + * both for simplicity and because the number of slab caches is fairly + * constant. + */ +static int get_slabnode ( + struct slabinfo_info *info, + struct slabs_node **node) +{ + if (info->nodes_used == info->nodes_alloc) { + if (!alloc_slabnodes(info)) + return 0; // here, errno was set to ENOMEM + } + *node = &(info->nodes[info->nodes_used++]); + return 1; +} // end: get_slabnode + + +/* parse_slabinfo20: + * + * Actual parse routine for slabinfo 2.x (2.6 kernels) + * Note: difference between 2.0 and 2.1 is in the ": globalstat" part where version 2.1 + * has extra column . We don't use ": globalstat" part in both versions. + * + * Formats (we don't use "statistics" extensions) + * + * slabinfo - version: 2.1 + * # name \ + * : tunables \ + * : slabdata + * + * slabinfo - version: 2.1 (statistics) + * # name \ + * : tunables \ + * : slabdata \ + * : globalstat \ + * : cpustat + * + * slabinfo - version: 2.0 + * # name \ + * : tunables \ + * : slabdata + * + * slabinfo - version: 2.0 (statistics) + * # name \ + * : tunables \ + * : slabdata \ + * : globalstat \ + * : cpustat + */ +static int parse_slabinfo20 ( + struct slabinfo_info *info) +{ + struct slabs_node *node; + char buffer[SLABINFO_LINE_LEN]; + int page_size = getpagesize(); + struct slabs_summ *slabs = &(info->slabs.new); + + slabs->min_obj_size = INT_MAX; + slabs->max_obj_size = 0; + + while (fgets(buffer, SLABINFO_LINE_LEN, info->slabinfo_fp )) { + if (buffer[0] == '#') + continue; + + if (!get_slabnode(info, &node)) + return 1; // here, errno was set to ENOMEM + + if (sscanf(buffer, + "%" STRINGIFY(SLABINFO_NAME_LEN) "s" \ + "%u %u %u %u %u : tunables %*u %*u %*u : slabdata %u %u %*u", + node->name, + &node->nr_active_objs, &node->nr_objs, + &node->obj_size, &node->objs_per_slab, + &node->pages_per_slab, &node->nr_active_slabs, + &node->nr_slabs) < 8) { + errno = ERANGE; + return 1; + } + + if (!node->name[0]) + snprintf(node->name, sizeof(node->name), "%s", "unknown"); + + if (node->obj_size < slabs->min_obj_size) + slabs->min_obj_size = node->obj_size; + if (node->obj_size > slabs->max_obj_size) + slabs->max_obj_size = node->obj_size; + + /* cache_size is not accurate, it's the upper limit of memory used by this slab. + * When system using slub(most common case) is under high memory pressure, there + * are slab order fallbacks, which means pages_per_slab is not constant and may decrease. + */ + node->cache_size = (unsigned long)node->nr_slabs * node->pages_per_slab * page_size; + + if (node->nr_objs) { + node->use = (unsigned int)(100 * ((float)node->nr_active_objs / node->nr_objs)); + slabs->nr_active_caches++; + } else + node->use = 0; + + slabs->nr_objs += node->nr_objs; + slabs->nr_active_objs += node->nr_active_objs; + slabs->total_size += (unsigned long)node->nr_objs * node->obj_size; + slabs->active_size += (unsigned long)node->nr_active_objs * node->obj_size; + slabs->nr_pages += node->nr_slabs * node->pages_per_slab; + slabs->nr_slabs += node->nr_slabs; + slabs->nr_active_slabs += node->nr_active_slabs; + slabs->nr_caches++; + } + + if (slabs->nr_objs) + slabs->avg_obj_size = slabs->total_size / slabs->nr_objs; + + return 0; +} // end: parse_slabinfo20 + + +/* slabinfo_read_failed(): + * + * Read the data out of /proc/slabinfo putting the information + * into the supplied info container + * + * Returns: 0 on success, 1 on error + */ +static int slabinfo_read_failed ( + struct slabinfo_info *info) +{ + char line[SLABINFO_LINE_LEN]; + int major, minor; + + memcpy(&info->slabs.old, &info->slabs.new, sizeof(struct slabs_summ)); + memset(&(info->slabs.new), 0, sizeof(struct slabs_summ)); + if (!alloc_slabnodes(info)) + return 1; // here, errno was set to ENOMEM + + memset(info->nodes, 0, sizeof(struct slabs_node)*info->nodes_alloc); + info->nodes_used = 0; + + if (NULL == info->slabinfo_fp + && (info->slabinfo_fp = fopen(SLABINFO_FILE, "r")) == NULL) + return 1; + + if (fseek(info->slabinfo_fp, 0L, SEEK_SET) < 0) + return 1; + + /* Parse the version string */ + if (!fgets(line, SLABINFO_LINE_LEN, info->slabinfo_fp)) + return 1; + + if (2 != sscanf(line, "slabinfo - version: %d.%d", &major, &minor) + || (major != 2)) { + errno = ERANGE; + return 1; + } + + return parse_slabinfo20(info); +} // end: slabinfo_read_failed + + +// ___ Private Functions |||||||||||||||||||||||||||||||||||||||||||||||||||||| +// --- generalized support ---------------------------------------------------- + +static inline void slabinfo_assign_results ( + struct slabinfo_stack *stack, + struct slabs_hist *summ, + struct slabs_node *node) +{ + struct slabinfo_result *this = stack->head; + + for (;;) { + enum slabinfo_item item = this->item; + if (item >= SLABINFO_logical_end) + break; + Item_table[item].setsfunc(this, summ, node); + ++this; + } + return; +} // end: slabinfo_assign_results + + +static void slabinfo_extents_free_all ( + struct ext_support *this) +{ + while (this->extents) { + struct stacks_extent *p = this->extents; + this->extents = this->extents->next; + free(p); + }; +} // end: slabinfo_extents_free_all + + +static inline struct slabinfo_result *slabinfo_itemize_stack ( + struct slabinfo_result *p, + int depth, + enum slabinfo_item *items) +{ + struct slabinfo_result *p_sav = p; + int i; + + for (i = 0; i < depth; i++) { + p->item = items[i]; + ++p; + } + return p_sav; +} // end: slabinfo_itemize_stack + + +static inline int slabinfo_items_check_failed ( + struct ext_support *this, + enum slabinfo_item *items, + int numitems) +{ + int i; + + /* if an enum is passed instead of an address of one or more enums, ol' gcc + * will silently convert it to an address (possibly NULL). only clang will + * offer any sort of warning like the following: + * + * warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'enum slabinfo_item *' + * my_stack = procps_slabinfo_select(info, SLABINFO_noop, num); + * ^~~~~~~~~~~~~~~~ + */ + if (numitems < 1 + || (void *)items < (void *)(unsigned long)(2 * SLABINFO_logical_end)) + return 1; + + for (i = 0; i < numitems; i++) { +#ifdef ENFORCE_LOGICAL + if (items[i] == SLABINFO_noop + || (items[i] == SLABINFO_extra)) + continue; + if (items[i] < this->lowest + || (items[i] > this->highest)) + return 1; +#else + // a slabinfo_item is currently unsigned, but we'll protect our future + if (items[i] < 0) + return 1; + if (items[i] >= SLABINFO_logical_end) + return 1; + (void)this; +#endif + } + + return 0; +} // end: slabinfo_items_check_failed + + +/* + * slabinfo_stacks_alloc(): + * + * Allocate and initialize one or more stacks each of which is anchored in an + * associated context structure. + * + * All such stacks will have their result structures properly primed with + * 'items', while the result itself will be zeroed. + * + * Returns a stacks_extent struct anchoring the 'heads' of each new stack. + */ +static struct stacks_extent *slabinfo_stacks_alloc ( + struct ext_support *this, + int maxstacks) +{ + struct stacks_extent *p_blob; + struct slabinfo_stack **p_vect; + struct slabinfo_stack *p_head; + size_t vect_size, head_size, list_size, blob_size; + void *v_head, *v_list; + int i; + + vect_size = sizeof(void *) * maxstacks; // size of the addr vectors | + vect_size += sizeof(void *); // plus NULL addr delimiter | + head_size = sizeof(struct slabinfo_stack); // size of that head struct | + list_size = sizeof(struct slabinfo_result)*this->numitems; // any single results stack | + blob_size = sizeof(struct stacks_extent); // the extent anchor itself | + blob_size += vect_size; // plus room for addr vects | + blob_size += head_size * maxstacks; // plus room for head thing | + blob_size += list_size * maxstacks; // plus room for our stacks | + + /* note: all of our memory is allocated in one single blob, facilitating a later free(). | + as a minimum, it is important that those result structures themselves always be | + contiguous within each stack since they are accessed through relative position. | */ + if (NULL == (p_blob = calloc(1, blob_size))) + return NULL; + + p_blob->next = this->extents; // push this extent onto... | + this->extents = p_blob; // ...some existing extents | + p_vect = (void *)p_blob + sizeof(struct stacks_extent); // prime our vector pointer | + p_blob->stacks = p_vect; // set actual vectors start | + v_head = (void *)p_vect + vect_size; // prime head pointer start | + v_list = v_head + (head_size * maxstacks); // prime our stacks pointer | + + for (i = 0; i < maxstacks; i++) { + p_head = (struct slabinfo_stack *)v_head; + p_head->head = slabinfo_itemize_stack((struct slabinfo_result *)v_list, this->numitems, this->items); + p_blob->stacks[i] = p_head; + v_list += list_size; + v_head += head_size; + } + p_blob->ext_numstacks = maxstacks; + return p_blob; +} // end: slabinfo_stacks_alloc + + +static int slabinfo_stacks_fetch ( + struct slabinfo_info *info) +{ + #define n_alloc info->fetch.n_alloc + #define n_inuse info->fetch.n_inuse + #define n_saved info->fetch.n_alloc_save + struct stacks_extent *ext; + + // initialize stuff ----------------------------------- + if (!info->fetch.anchor) { + if (!(info->fetch.anchor = calloc(sizeof(void *), STACKS_INCR))) + return -1; + n_alloc = STACKS_INCR; + } + if (!info->fetch_ext.extents) { + if (!(ext = slabinfo_stacks_alloc(&info->fetch_ext, n_alloc))) + return -1; // here, errno was set to ENOMEM + memcpy(info->fetch.anchor, ext->stacks, sizeof(void *) * n_alloc); + } + + // iterate stuff -------------------------------------- + n_inuse = 0; + while (n_inuse < info->nodes_used) { + if (!(n_inuse < n_alloc)) { + n_alloc += STACKS_INCR; + if ((!(info->fetch.anchor = realloc(info->fetch.anchor, sizeof(void *) * n_alloc))) + || (!(ext = slabinfo_stacks_alloc(&info->fetch_ext, STACKS_INCR)))) + return -1; // here, errno was set to ENOMEM + memcpy(info->fetch.anchor + n_inuse, ext->stacks, sizeof(void *) * STACKS_INCR); + } + slabinfo_assign_results(info->fetch.anchor[n_inuse], &info->slabs, &info->nodes[n_inuse]); + ++n_inuse; + } + + // finalize stuff ------------------------------------- + /* note: we go to this trouble of maintaining a duplicate of the consolidated | + extent stacks addresses represented as our 'anchor' since these ptrs | + are exposed to a user (um, not that we don't trust 'em or anything). | + plus, we can NULL delimit these ptrs which we couldn't do otherwise. | */ + if (n_saved < n_inuse + 1) { + n_saved = n_inuse + 1; + if (!(info->fetch.results.stacks = realloc(info->fetch.results.stacks, sizeof(void *) * n_saved))) + return -1; + } + memcpy(info->fetch.results.stacks, info->fetch.anchor, sizeof(void *) * n_inuse); + info->fetch.results.stacks[n_inuse] = NULL; + info->fetch.results.total = n_inuse; + + return n_inuse; + #undef n_alloc + #undef n_inuse + #undef n_saved +} // end: slabinfo_stacks_fetch + + +static int slabinfo_stacks_reconfig_maybe ( + struct ext_support *this, + enum slabinfo_item *items, + int numitems) +{ + if (slabinfo_items_check_failed(this, items, numitems)) + return -1; + /* is this the first time or have things changed since we were last called? + if so, gotta' redo all of our stacks stuff ... */ + if (this->numitems != numitems + 1 + || memcmp(this->items, items, sizeof(enum slabinfo_item) * numitems)) { + // allow for our SLABINFO_logical_end + if (!(this->items = realloc(this->items, sizeof(enum slabinfo_item) * (numitems + 1)))) + return -1; + memcpy(this->items, items, sizeof(enum slabinfo_item) * numitems); + this->items[numitems] = SLABINFO_logical_end; + this->numitems = numitems + 1; + slabinfo_extents_free_all(this); + return 1; + } + return 0; +} // end: slabinfo_stacks_reconfig_maybe + + +// ___ Public Functions ||||||||||||||||||||||||||||||||||||||||||||||||||||||| + +// --- standard required functions -------------------------------------------- + +/* + * procps_slabinfo_new(): + * + * @info: location of returned new structure + * + * Returns: < 0 on failure, 0 on success along with + * a pointer to a new context struct + */ +PROCPS_EXPORT int procps_slabinfo_new ( + struct slabinfo_info **info) +{ + struct slabinfo_info *p; + +#ifdef ITEMTABLE_DEBUG + int i, failed = 0; + for (i = 0; i < MAXTABLE(Item_table); i++) { + if (i != Item_table[i].enumnumb) { + fprintf(stderr, "%s: enum/table error: Item_table[%d] was %s, but its value is %d\n" + , __FILE__, i, Item_table[i].enum2str, Item_table[i].enumnumb); + failed = 1; + } + } + if (failed) _Exit(EXIT_FAILURE); +#endif + + if (info == NULL || *info != NULL) + return -EINVAL; + if (!(p = calloc(1, sizeof(struct slabinfo_info)))) + return -ENOMEM; + +#ifdef ENFORCE_LOGICAL + p->select_ext.lowest = SLABS_CACHES_TOTAL; + p->select_ext.highest = SLABS_DELTA_SIZE_TOTAL; + p->fetch_ext.lowest = SLAB_NAME; + p->fetch_ext.highest = SLAB_SIZE_TOTAL; +#endif + + p->refcount = 1; + + /* do a priming read here for the following potential benefits: | + 1) see if that caller's permissions were sufficient (root) | + 2) make delta results potentially useful, even if 1st time | + 3) elimnate need for history distortions 1st time 'switch' | */ + if (slabinfo_read_failed(p)) { + procps_slabinfo_unref(&p); + return -errno; + } + + *info = p; + return 0; +} // end: procps_slabinfo_new + + +PROCPS_EXPORT int procps_slabinfo_ref ( + struct slabinfo_info *info) +{ + if (info == NULL) + return -EINVAL; + + info->refcount++; + return info->refcount; +} // end: procps_slabinfo_ref + + +PROCPS_EXPORT int procps_slabinfo_unref ( + struct slabinfo_info **info) +{ + if (info == NULL || *info == NULL) + return -EINVAL; + + (*info)->refcount--; + + if ((*info)->refcount < 1) { + int errno_sav = errno; + + if ((*info)->slabinfo_fp) { + fclose((*info)->slabinfo_fp); + (*info)->slabinfo_fp = NULL; + } + if ((*info)->select_ext.extents) + slabinfo_extents_free_all((&(*info)->select_ext)); + if ((*info)->select_ext.items) + free((*info)->select_ext.items); + + if ((*info)->fetch.anchor) + free((*info)->fetch.anchor); + if ((*info)->fetch.results.stacks) + free((*info)->fetch.results.stacks); + + if ((*info)->fetch_ext.extents) + slabinfo_extents_free_all(&(*info)->fetch_ext); + if ((*info)->fetch_ext.items) + free((*info)->fetch_ext.items); + + free((*info)->nodes); + + free(*info); + *info = NULL; + + errno = errno_sav; + return 0; + } + return (*info)->refcount; +} // end: procps_slabinfo_unref + + +// --- variable interface functions ------------------------------------------- + +PROCPS_EXPORT struct slabinfo_result *procps_slabinfo_get ( + struct slabinfo_info *info, + enum slabinfo_item item) +{ + time_t cur_secs; + + errno = EINVAL; + if (info == NULL) + return NULL; + if (item < 0 || item >= SLABINFO_logical_end) + return NULL; + errno = 0; + + /* we will NOT read the slabinfo file with every call - rather, we'll offer + a granularity of 1 second between reads ... */ + cur_secs = time(NULL); + if (1 <= cur_secs - info->sav_secs) { + if (slabinfo_read_failed(info)) + return NULL; + info->sav_secs = cur_secs; + } + + info->get_this.item = item; + // with 'get', we must NOT honor the usual 'noop' guarantee + info->get_this.result.ul_int = 0; + Item_table[item].setsfunc(&info->get_this, &info->slabs, &info->nul_node); + + return &info->get_this; +} // end: procps_slabinfo_get + + +/* procps_slabinfo_reap(): + * + * Harvest all the requested SLAB (individual nodes) information + * providing the result stacks along with the total number of nodes. + * + * Returns: pointer to a slabinfo_reaped struct on success, NULL on error. + */ +PROCPS_EXPORT struct slabinfo_reaped *procps_slabinfo_reap ( + struct slabinfo_info *info, + enum slabinfo_item *items, + int numitems) +{ + errno = EINVAL; + if (info == NULL || items == NULL) + return NULL; + if (0 > slabinfo_stacks_reconfig_maybe(&info->fetch_ext, items, numitems)) + return NULL; // here, errno may be overridden with ENOMEM + errno = 0; + + if (slabinfo_read_failed(info)) + return NULL; + if (0 > slabinfo_stacks_fetch(info)) + return NULL; + + return &info->fetch.results; +} // end: procps_slabinfo_reap + + +/* procps_slabinfo_select(): + * + * Obtain all the requested SLABS (global) information then return + * it in a single library provided results stack. + * + * Returns: pointer to a slabinfo_stack struct on success, NULL on error. + */ +PROCPS_EXPORT struct slabinfo_stack *procps_slabinfo_select ( + struct slabinfo_info *info, + enum slabinfo_item *items, + int numitems) +{ + errno = EINVAL; + if (info == NULL || items == NULL) + return NULL; + if (0 > slabinfo_stacks_reconfig_maybe(&info->select_ext, items, numitems)) + return NULL; // here, errno may be overridden with ENOMEM + errno = 0; + + if (!info->select_ext.extents + && (!slabinfo_stacks_alloc(&info->select_ext, 1))) + return NULL; + + if (slabinfo_read_failed(info)) + return NULL; + slabinfo_assign_results(info->select_ext.extents->stacks[0], &info->slabs, &info->nul_node); + + return info->select_ext.extents->stacks[0]; +} // end: procps_slabinfo_select + + +/* + * procps_slabinfo_sort(): + * + * Sort stacks anchored in the passed stack pointers array + * based on the designated sort enumerator and specified order. + * + * Returns those same addresses sorted. + * + * Note: all of the stacks must be homogeneous (of equal length and content). + */ +PROCPS_EXPORT struct slabinfo_stack **procps_slabinfo_sort ( + struct slabinfo_info *info, + struct slabinfo_stack *stacks[], + int numstacked, + enum slabinfo_item sortitem, + enum slabinfo_sort_order order) +{ + struct slabinfo_result *p; + struct sort_parms parms; + int offset; + + errno = EINVAL; + if (info == NULL || stacks == NULL) + return NULL; + // a slabinfo_item is currently unsigned, but we'll protect our future + if (sortitem < 0 || sortitem >= SLABINFO_logical_end) + return NULL; + if (order != SLABINFO_SORT_ASCEND && order != SLABINFO_SORT_DESCEND) + return NULL; + if (numstacked < 2) + return stacks; + + offset = 0; + p = stacks[0]->head; + for (;;) { + if (p->item == sortitem) + break; + ++offset; + if (p->item >= SLABINFO_logical_end) + return NULL; + ++p; + } + errno = 0; + + parms.offset = offset; + parms.order = order; + + qsort_r(stacks, numstacked, sizeof(void *), (QSR_t)Item_table[p->item].sortfunc, &parms); + return stacks; +} // end: procps_slabinfo_sort + + +// --- special debugging function(s) ------------------------------------------ +/* + * The following isn't part of the normal programming interface. Rather, + * it exists to validate result types referenced in application programs. + * + * It's used only when: + * 1) the 'XTRA_PROCPS_DEBUG' has been defined, or + * 2) an #include of 'xtra-procps-debug.h' is used + */ + +PROCPS_EXPORT struct slabinfo_result *xtra_slabinfo_get ( + struct slabinfo_info *info, + enum slabinfo_item actual_enum, + const char *typestr, + const char *file, + int lineno) +{ + struct slabinfo_result *r = procps_slabinfo_get(info, actual_enum); + + if (actual_enum < 0 || actual_enum >= SLABINFO_logical_end) { + fprintf(stderr, "%s line %d: invalid item = %d, type = %s\n" + , file, lineno, actual_enum, typestr); + } + if (r) { + char *str = Item_table[r->item].type2str; + if (str[0] + && (strcmp(typestr, str))) + fprintf(stderr, "%s line %d: was %s, expected %s\n", file, lineno, typestr, str); + } + return r; +} // end: xtra_slabinfo_get_ + + +PROCPS_EXPORT struct slabinfo_result *xtra_slabinfo_val ( + int relative_enum, + const char *typestr, + const struct slabinfo_stack *stack, + struct slabinfo_info *info, + const char *file, + int lineno) +{ + char *str; + int i; + + for (i = 0; stack->head[i].item < SLABINFO_logical_end; i++) + ; + if (relative_enum < 0 || relative_enum >= i) { + fprintf(stderr, "%s line %d: invalid relative_enum = %d, valid range = 0-%d\n" + , file, lineno, relative_enum, i-1); + return NULL; + } + str = Item_table[stack->head[relative_enum].item].type2str; + if (str[0] + && (strcmp(typestr, str))) { + fprintf(stderr, "%s line %d: was %s, expected %s\n", file, lineno, typestr, str); + } + return &stack->head[relative_enum]; + (void)info; +} // end: xtra_slabinfo_val diff --git a/library/stat.c b/library/stat.c new file mode 100644 index 0000000..131cad5 --- /dev/null +++ b/library/stat.c @@ -0,0 +1,1443 @@ +/* + * stat.c - cpu/numa related definitions for libproc2 + * + * Copyright © 2015-2023 Jim Warner + * Copyright © 2015-2023 Craig Small + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; 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 "numa.h" + +#include "procps-private.h" +#include "stat.h" + + +#define STAT_FILE "/proc/stat" +#define CORE_FILE "/proc/cpuinfo" + +#define CORE_BUFSIZ 1024 // buf size for line of /proc/cpuinfo +#define BUFFER_INCR 8192 // amount i/p buffer allocations grow +#define STACKS_INCR 64 // amount reap stack allocations grow +#define NEWOLD_INCR 64 // amount jiffs hist allocations grow + +#define ECORE_BEGIN 10 // PRETEND_E_CORES begin at this cpu# + +/* ------------------------------------------------------------------------- + + this provision just does what its name sugggests - it will create several | + E-Core cpus for testing that STAT_TIC_ID_CORE & STAT_TIC_TYPE_CORE stuff! |*/ +// #define PRETEND_E_CORES //----------------------------------------------- | +// ------------------------------------------------------------------------- + + +/* ------------------------------------------------------------------------- + + this provision can be used to ensure that our Item_table was synchronized | + with those enumerators found in the associated header file. It's intended | + to only be used locally (& temporarily) at some point prior to a release! | */ +// #define ITEMTABLE_DEBUG //----------------------------------------------- | +// ------------------------------------------------------------------------- + + +/* ------------------------------------------------------------------------- + + because 'reap' would be forced to duplicate the global SYS stuff in every | + TIC type results stack, the following #define can be used to enforce that | + only STAT_noop and STAT_extra plus all the STAT_TIC items will be allowed | */ +//#define ENFORCE_LOGICAL // ensure only logical items are accepted by reap | +// ------------------------------------------------------------------------- + + +/* --------------------------------------------------------------------------+ + this next define is equivalent to the master top's CPU_ZEROTICS provision | + except that here in newlib we'll take an opposite approach to our default | */ +//#define CPU_IDLE_FORCED // show as 100% idle if fewer ticks than expected | +// --------------------------------------------------------------------------+ + +#ifdef CPU_IDLE_FORCED + /* this is the % used in establishing a ticks threshold below which some | + cpu will be treated 'idle' rather than reflect misleading tick values | */ +#define TICS_THRESHOLD ( 100 / 20 ) +#endif + +struct stat_jifs { + unsigned long long user, nice, system, idle, iowait, irq, sirq, stolen, guest, gnice; + unsigned long long xusr, xsys, xidl, xbsy, xtot; +}; + +struct stat_core { + int id; + int type; // 2 = p-core, 1 = e-core, 0 = unsure + int thread_1; + int thread_2; + struct stat_core *next; +}; + +struct stat_data { + unsigned long intr; + unsigned long ctxt; + unsigned long btime; + unsigned long procs_created; + unsigned long procs_blocked; + unsigned long procs_running; +}; + +struct hist_sys { + struct stat_data new; + struct stat_data old; +}; + +struct hist_tic { + int id; + int numa_node; + int count; + struct stat_jifs new; + struct stat_jifs old; +#ifdef CPU_IDLE_FORCED + unsigned long edge; // only valued/valid with cpu summary +#endif + struct stat_core *core; + int saved_id; +}; + +struct stacks_extent { + int ext_numstacks; + struct stacks_extent *next; + struct stat_stack **stacks; +}; + +struct item_support { + int num; // includes 'logical_end' delimiter + enum stat_item *enums; // includes 'logical_end' delimiter +}; + +struct ext_support { + struct item_support *items; // how these stacks are configured + struct stacks_extent *extents; // anchor for these extents +}; + +struct tic_support { + int n_alloc; // number of below structs allocated + int n_inuse; // number of below structs occupied + struct hist_tic *tics; // actual new/old jiffies +}; + +struct reap_support { + int total; // independently obtained # of cpus/nodes + struct ext_support fetch; // extents plus items details + struct tic_support hist; // cpu and node jiffies management + int n_alloc; // last known anchor pointers allocation + struct stat_stack **anchor; // reapable stacks (consolidated extents) + int n_alloc_save; // last known results.stacks allocation + struct stat_reap result; // summary + stacks returned to caller +}; + +struct stat_info { + int refcount; + FILE *stat_fp; + char *stat_buf; // grows to accommodate all /proc/stat + int stat_buf_size; // current size for the above stat_buf + int cpu_count_hwm; // if changed, triggers new cores scan + struct hist_sys sys_hist; // SYS type management + struct hist_tic cpu_hist; // TIC type management for cpu summary + struct reap_support cpus; // TIC type management for real cpus + struct reap_support nodes; // TIC type management for numa nodes + struct ext_support cpu_summary; // supports /proc/stat line #1 results + struct ext_support select; // support for 'procps_stat_select()' + struct stat_reaped results; // for return to caller after a reap + struct stat_result get_this; // for return to caller after a get + struct item_support reap_items; // items used for reap (shared among 3) + struct item_support select_items; // items unique to select + time_t sav_secs; // used by procps_stat_get to limit i/o + struct stat_core *cores; // linked list, also linked from hist_tic +}; + +// ___ Results 'Set' Support |||||||||||||||||||||||||||||||||||||||||||||||||| + +#define setNAME(e) set_stat_ ## e +#define setDECL(e) static void setNAME(e) \ + (struct stat_result *R, struct hist_sys *S, struct hist_tic *T) + +// regular assignment +#define TIC_set(e,t,x) setDECL(e) { \ + (void)S; R->result. t = T->new. x; } +#define SYS_set(e,t,x) setDECL(e) { \ + (void)T; R->result. t = S->new. x; } +// delta assignment +#define TICsetH(e,t,x) setDECL(e) { \ + (void)S; R->result. t = ( T->new. x - T->old. x ); \ + if (R->result. t < 0) R->result. t = 0; } +#define SYSsetH(e,t,x) setDECL(e) { \ + (void)T; R->result. t = ( S->new. x - S->old. x ); } + +setDECL(noop) { (void)R; (void)S; (void)T; } +setDECL(extra) { (void)S; (void)T; R->result.ull_int = 0; } + +setDECL(TIC_ID) { (void)S; R->result.s_int = T->id; } +setDECL(TIC_ID_CORE) { (void)S; R->result.s_int = (T->core) ? T->core->id : -1; } +setDECL(TIC_NUMA_NODE) { (void)S; R->result.s_int = T->numa_node; } +setDECL(TIC_NUM_CONTRIBUTORS) { (void)S; R->result.s_int = T->count; } +setDECL(TIC_TYPE_CORE) { (void)S; R->result.s_int = (T->core) ? T->core->type : 0; } + +TIC_set(TIC_USER, ull_int, user) +TIC_set(TIC_NICE, ull_int, nice) +TIC_set(TIC_SYSTEM, ull_int, system) +TIC_set(TIC_IDLE, ull_int, idle) +TIC_set(TIC_IOWAIT, ull_int, iowait) +TIC_set(TIC_IRQ, ull_int, irq) +TIC_set(TIC_SOFTIRQ, ull_int, sirq) +TIC_set(TIC_STOLEN, ull_int, stolen) +TIC_set(TIC_GUEST, ull_int, guest) +TIC_set(TIC_GUEST_NICE, ull_int, gnice) + +TICsetH(TIC_DELTA_USER, sl_int, user) +TICsetH(TIC_DELTA_NICE, sl_int, nice) +TICsetH(TIC_DELTA_SYSTEM, sl_int, system) +TICsetH(TIC_DELTA_IDLE, sl_int, idle) +TICsetH(TIC_DELTA_IOWAIT, sl_int, iowait) +TICsetH(TIC_DELTA_IRQ, sl_int, irq) +TICsetH(TIC_DELTA_SOFTIRQ, sl_int, sirq) +TICsetH(TIC_DELTA_STOLEN, sl_int, stolen) +TICsetH(TIC_DELTA_GUEST, sl_int, guest) +TICsetH(TIC_DELTA_GUEST_NICE, sl_int, gnice) + +TIC_set(TIC_SUM_USER, ull_int, xusr) +TIC_set(TIC_SUM_SYSTEM, ull_int, xsys) +TIC_set(TIC_SUM_IDLE, ull_int, xidl) +TIC_set(TIC_SUM_BUSY, ull_int, xbsy) +TIC_set(TIC_SUM_TOTAL, ull_int, xtot) + +TICsetH(TIC_SUM_DELTA_USER, sl_int, xusr) +TICsetH(TIC_SUM_DELTA_SYSTEM, sl_int, xsys) +TICsetH(TIC_SUM_DELTA_IDLE, sl_int, xidl) +TICsetH(TIC_SUM_DELTA_BUSY, sl_int, xbsy) +TICsetH(TIC_SUM_DELTA_TOTAL, sl_int, xtot) + +SYS_set(SYS_CTX_SWITCHES, ul_int, ctxt) +SYS_set(SYS_INTERRUPTS, ul_int, intr) +SYS_set(SYS_PROC_BLOCKED, ul_int, procs_blocked) +SYS_set(SYS_PROC_CREATED, ul_int, procs_created) +SYS_set(SYS_PROC_RUNNING, ul_int, procs_running) +SYS_set(SYS_TIME_OF_BOOT, ul_int, btime) + +SYSsetH(SYS_DELTA_CTX_SWITCHES, s_int, ctxt) +SYSsetH(SYS_DELTA_INTERRUPTS, s_int, intr) +SYSsetH(SYS_DELTA_PROC_BLOCKED, s_int, procs_blocked) +SYSsetH(SYS_DELTA_PROC_CREATED, s_int, procs_created) +SYSsetH(SYS_DELTA_PROC_RUNNING, s_int, procs_running) + +#undef setDECL +#undef TIC_set +#undef SYS_set +#undef TICsetH +#undef SYSsetH + + +// ___ Sorting Support |||||||||||||||||||||||||||||||||||||||||||||||||||||||| + +struct sort_parms { + int offset; + enum stat_sort_order order; +}; + +#define srtNAME(t) sort_stat_ ## t +#define srtDECL(t) static int srtNAME(t) \ + (const struct stat_stack **A, const struct stat_stack **B, struct sort_parms *P) + +srtDECL(s_int) { + const struct stat_result *a = (*A)->head + P->offset; \ + const struct stat_result *b = (*B)->head + P->offset; \ + return P->order * (a->result.s_int - b->result.s_int); +} + +srtDECL(sl_int) { + const struct stat_result *a = (*A)->head + P->offset; \ + const struct stat_result *b = (*B)->head + P->offset; \ + return P->order * (a->result.sl_int - b->result.sl_int); +} + +srtDECL(ul_int) { + const struct stat_result *a = (*A)->head + P->offset; \ + const struct stat_result *b = (*B)->head + P->offset; \ + if ( a->result.ul_int > b->result.ul_int ) return P->order > 0 ? 1 : -1; \ + if ( a->result.ul_int < b->result.ul_int ) return P->order > 0 ? -1 : 1; \ + return 0; +} + +srtDECL(ull_int) { + const struct stat_result *a = (*A)->head + P->offset; \ + const struct stat_result *b = (*B)->head + P->offset; \ + if ( a->result.ull_int > b->result.ull_int ) return P->order > 0 ? 1 : -1; \ + if ( a->result.ull_int < b->result.ull_int ) return P->order > 0 ? -1 : 1; \ + return 0; +} + +srtDECL(noop) { \ + (void)A; (void)B; (void)P; \ + return 0; +} + +#undef srtDECL + + +// ___ Controlling Table |||||||||||||||||||||||||||||||||||||||||||||||||||||| + +typedef void (*SET_t)(struct stat_result *, struct hist_sys *, struct hist_tic *); +#ifdef ITEMTABLE_DEBUG +#define RS(e) (SET_t)setNAME(e), STAT_ ## e, STRINGIFY(STAT_ ## e) +#else +#define RS(e) (SET_t)setNAME(e) +#endif + +typedef int (*QSR_t)(const void *, const void *, void *); +#define QS(t) (QSR_t)srtNAME(t) + +#define TS(t) STRINGIFY(t) +#define TS_noop "" + + /* + * Need it be said? + * This table must be kept in the exact same order as + * those 'enum stat_item' guys ! */ +static struct { + SET_t setsfunc; // the actual result setting routine +#ifdef ITEMTABLE_DEBUG + int enumnumb; // enumerator (must match position!) + char *enum2str; // enumerator name as a char* string +#endif + QSR_t sortfunc; // sort cmp func for a specific type + char *type2str; // the result type as a string value +} Item_table[] = { +/* setsfunc sortfunc type2str + --------------------------- ------------ ----------- */ + { RS(noop), QS(noop), TS_noop }, + { RS(extra), QS(ull_int), TS_noop }, + + { RS(TIC_ID), QS(s_int), TS(s_int) }, + { RS(TIC_ID_CORE), QS(s_int), TS(s_int) }, + { RS(TIC_NUMA_NODE), QS(s_int), TS(s_int) }, + { RS(TIC_NUM_CONTRIBUTORS), QS(s_int), TS(s_int) }, + { RS(TIC_TYPE_CORE), QS(s_int), TS(s_int) }, + { RS(TIC_USER), QS(ull_int), TS(ull_int) }, + { RS(TIC_NICE), QS(ull_int), TS(ull_int) }, + { RS(TIC_SYSTEM), QS(ull_int), TS(ull_int) }, + { RS(TIC_IDLE), QS(ull_int), TS(ull_int) }, + { RS(TIC_IOWAIT), QS(ull_int), TS(ull_int) }, + { RS(TIC_IRQ), QS(ull_int), TS(ull_int) }, + { RS(TIC_SOFTIRQ), QS(ull_int), TS(ull_int) }, + { RS(TIC_STOLEN), QS(ull_int), TS(ull_int) }, + { RS(TIC_GUEST), QS(ull_int), TS(ull_int) }, + { RS(TIC_GUEST_NICE), QS(ull_int), TS(ull_int) }, + + { RS(TIC_DELTA_USER), QS(sl_int), TS(sl_int) }, + { RS(TIC_DELTA_NICE), QS(sl_int), TS(sl_int) }, + { RS(TIC_DELTA_SYSTEM), QS(sl_int), TS(sl_int) }, + { RS(TIC_DELTA_IDLE), QS(sl_int), TS(sl_int) }, + { RS(TIC_DELTA_IOWAIT), QS(sl_int), TS(sl_int) }, + { RS(TIC_DELTA_IRQ), QS(sl_int), TS(sl_int) }, + { RS(TIC_DELTA_SOFTIRQ), QS(sl_int), TS(sl_int) }, + { RS(TIC_DELTA_STOLEN), QS(sl_int), TS(sl_int) }, + { RS(TIC_DELTA_GUEST), QS(sl_int), TS(sl_int) }, + { RS(TIC_DELTA_GUEST_NICE), QS(sl_int), TS(sl_int) }, + + { RS(TIC_SUM_USER), QS(ull_int), TS(ull_int) }, + { RS(TIC_SUM_SYSTEM), QS(ull_int), TS(ull_int) }, + { RS(TIC_SUM_IDLE), QS(ull_int), TS(ull_int) }, + { RS(TIC_SUM_BUSY), QS(ull_int), TS(ull_int) }, + { RS(TIC_SUM_TOTAL), QS(ull_int), TS(ull_int) }, + + { RS(TIC_SUM_DELTA_USER), QS(sl_int), TS(sl_int) }, + { RS(TIC_SUM_DELTA_SYSTEM), QS(sl_int), TS(sl_int) }, + { RS(TIC_SUM_DELTA_IDLE), QS(sl_int), TS(sl_int) }, + { RS(TIC_SUM_DELTA_BUSY), QS(sl_int), TS(sl_int) }, + { RS(TIC_SUM_DELTA_TOTAL), QS(sl_int), TS(sl_int) }, + + { RS(SYS_CTX_SWITCHES), QS(ul_int), TS(ul_int) }, + { RS(SYS_INTERRUPTS), QS(ul_int), TS(ul_int) }, + { RS(SYS_PROC_BLOCKED), QS(ul_int), TS(ul_int) }, + { RS(SYS_PROC_CREATED), QS(ul_int), TS(ul_int) }, + { RS(SYS_PROC_RUNNING), QS(ul_int), TS(ul_int) }, + { RS(SYS_TIME_OF_BOOT), QS(ul_int), TS(ul_int) }, + + { RS(SYS_DELTA_CTX_SWITCHES), QS(s_int), TS(s_int) }, + { RS(SYS_DELTA_INTERRUPTS), QS(s_int), TS(s_int) }, + { RS(SYS_DELTA_PROC_BLOCKED), QS(s_int), TS(s_int) }, + { RS(SYS_DELTA_PROC_CREATED), QS(s_int), TS(s_int) }, + { RS(SYS_DELTA_PROC_RUNNING), QS(s_int), TS(s_int) }, +}; + + /* please note, + * 1st enum MUST be kept in sync with highest TIC type + * 2nd enum MUST be 1 greater than the highest value of any enum */ +#ifdef ENFORCE_LOGICAL +enum stat_item STAT_TIC_highest = STAT_TIC_DELTA_GUEST_NICE; +#endif +enum stat_item STAT_logical_end = MAXTABLE(Item_table); + +#undef setNAME +#undef srtNAME +#undef RS +#undef QS + + +// ___ Private Functions |||||||||||||||||||||||||||||||||||||||||||||||||||||| + +static inline void stat_assign_results ( + struct stat_stack *stack, + struct hist_sys *sys_hist, + struct hist_tic *tic_hist) +{ + struct stat_result *this = stack->head; + + for (;;) { + enum stat_item item = this->item; + if (item >= STAT_logical_end) + break; + Item_table[item].setsfunc(this, sys_hist, tic_hist); + ++this; + } + return; +} // end: stat_assign_results + + +#define E_CORE 1 +#define P_CORE 2 +#define VACANT -1 + +static int stat_core_add ( + struct stat_info *info, + int a_core, + int a_cpu) +{ + struct stat_core *last = NULL, *core = info->cores; + + while (core) { + if (core->id == a_core) { + if (a_cpu == core->thread_1 + || (a_cpu == core->thread_2)) + return 1; + core->thread_2 = a_cpu; + core->type = P_CORE; + return 1; + } + last = core; + core = core->next; + } + if (!(core = calloc(1, sizeof(struct stat_core)))) + return 0; + if (last) last->next = core; + else info->cores = core; + core->id = a_core; + core->thread_1 = a_cpu; + core->thread_2 = VACANT; + return 1; +} // end: stat_core_add + + +static void stat_cores_check ( + struct stat_info *info) +{ + struct stat_core *core; +#ifndef PRETEND_E_CORES + int p_core = 0; + + core = info->cores; + while (core) { + if (core->type == P_CORE) { + p_core = 1; + break; + } + core = core->next; + } + if (p_core) { + core = info->cores; + do { + if (core->thread_2 == VACANT) + core->type = E_CORE; + } while ((core = core->next)); + } +#else + core = info->cores; + while (core) { + core->type = P_CORE; + if (core->thread_1 > ECORE_BEGIN + || (core->thread_2 > ECORE_BEGIN)) + core->type = E_CORE; + core = core->next; + } +#endif +} // end: stat_cores_check + +#undef E_CORE +#undef P_CORE +#undef VACANT + + +static void stat_cores_link ( + struct stat_info *info, + struct hist_tic *this) +{ + struct stat_core *core = info->cores; + + while (core) { + if (this->id == core->thread_1 + || (this->id == core->thread_2)) { + this->core = core; + break; + } + core = core->next; + } +} // end: stat_cores_link + + +static int stat_cores_verify ( + struct stat_info *info) +{ + char buf[CORE_BUFSIZ]; + int a_cpu, a_core; + FILE *fp; + + // be tolerant of a missing CORE_FILE ... + if (!(fp = fopen(CORE_FILE, "r"))) + return 1; + for (;;) { + if (NULL == fgets(buf, sizeof(buf), fp)) + break; + if (buf[0] != 'p') continue; + if (!strstr(buf, "processor")) + continue; + sscanf(buf, "processor : %d", &a_cpu); + for (;;) { + // be tolerant of missing empty line on last processor entry ... + if (NULL == fgets(buf, sizeof(buf), fp)) + goto wrap_up; + // be tolerant of a missing 'core id' on any processor entry ... + if (buf[0] == '\n') { + a_core = a_cpu; + break; + } + if (buf[0] != 'c') continue; + if (!strstr(buf, "core id")) + continue; + sscanf(buf, "core id : %d", &a_core); + break; + } + if (!stat_core_add(info, a_core, a_cpu)) { + fclose(fp); + return 0; + } + } +wrap_up: + fclose(fp); + stat_cores_check(info); + return 1; +} // end: stat_cores_verify + + +static inline void stat_derive_unique ( + struct hist_tic *this) +{ + /* note: we calculate these derived values in a manner consistent with + the calculations for cgroup accounting, as nearly as possible + ( see linux sources: ./kernel/cgroup/rstat.c, root_cgroup_cputime ) */ + this->new.xusr + = this->new.user + + this->new.nice; + this->new.xsys + = this->new.system + + this->new.irq + + this->new.sirq; + this->new.xidl + = this->new.idle + + this->new.iowait; + this->new.xtot + = this->new.xusr + this->new.xsys + this->new.xidl + + this->new.stolen + + this->new.guest + + this->new.gnice; + this->new.xbsy + = this->new.xtot - this->new.xidl; + + // don't distort deltas when cpus are taken offline or brought online + if (this->new.xusr < this->old.xusr + || (this->new.xsys < this->old.xsys) + || (this->new.xidl < this->old.xidl) + || (this->new.xbsy < this->old.xbsy) + || (this->new.xtot < this->old.xtot)) + memcpy(&this->old, &this->new, sizeof(struct stat_jifs)); +} // end: stat_derive_unique + + +static void stat_extents_free_all ( + struct ext_support *this) +{ + while (this->extents) { + struct stacks_extent *p = this->extents; + this->extents = this->extents->next; + free(p); + }; +} // end: stat_extents_free_all + + +static inline struct stat_result *stat_itemize_stack ( + struct stat_result *p, + int depth, + enum stat_item *items) +{ + struct stat_result *p_sav = p; + int i; + + for (i = 0; i < depth; i++) { + p->item = items[i]; + ++p; + } + return p_sav; +} // end: stat_itemize_stack + + +static inline int stat_items_check_failed ( + int numitems, + enum stat_item *items) +{ + int i; + + /* if an enum is passed instead of an address of one or more enums, ol' gcc + * will silently convert it to an address (possibly NULL). only clang will + * offer any sort of warning like the following: + * + * warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'enum stat_item *' + * my_stack = procps_stat_select(info, STAT_noop, num); + * ^~~~~~~~~~~~~~~~ + */ + if (numitems < 1 + || (void *)items < (void *)(unsigned long)(2 * STAT_logical_end)) + return 1; + + for (i = 0; i < numitems; i++) { + // a stat_item is currently unsigned, but we'll protect our future + if (items[i] < 0) + return 1; + if (items[i] >= STAT_logical_end) { + return 1; + } + } + return 0; +} // end: stat_items_check_failed + + +static int stat_make_numa_hist ( + struct stat_info *info) +{ + struct hist_tic *cpu_ptr, *nod_ptr; + int i, node; + + /* are numa nodes dynamic like online cpus can be? + ( and be careful, this libnuma call returns the highest node id in use, ) + ( NOT an actual number of nodes - some of those 'slots' might be unused ) */ + if (!(info->nodes.total = numa_max_node() + 1)) + return 0; + + if (info->nodes.hist.n_alloc == 0 + || (info->nodes.total >= info->nodes.hist.n_alloc)) { + info->nodes.hist.n_alloc = info->nodes.total + NEWOLD_INCR; + info->nodes.hist.tics = realloc(info->nodes.hist.tics, info->nodes.hist.n_alloc * sizeof(struct hist_tic)); + if (info->nodes.hist.tics == NULL) + return -ENOMEM; + } + + // forget all of the prior node statistics & anticipate unassigned slots + memset(info->nodes.hist.tics, 0, info->nodes.hist.n_alloc * sizeof(struct hist_tic)); + nod_ptr = info->nodes.hist.tics; + for (i = 0; i < info->nodes.total; i++) { + nod_ptr->numa_node = STAT_NODE_INVALID; + nod_ptr->id = i; + ++nod_ptr; + } + + // spin thru each cpu and value the jiffs for it's numa node + for (i = 0; i < info->cpus.hist.n_inuse; i++) { + cpu_ptr = info->cpus.hist.tics + i; + if (-1 < (node = numa_node_of_cpu(cpu_ptr->id))) { + nod_ptr = info->nodes.hist.tics + node; + nod_ptr->new.user += cpu_ptr->new.user; nod_ptr->old.user += cpu_ptr->old.user; + nod_ptr->new.nice += cpu_ptr->new.nice; nod_ptr->old.nice += cpu_ptr->old.nice; + nod_ptr->new.system += cpu_ptr->new.system; nod_ptr->old.system += cpu_ptr->old.system; + nod_ptr->new.idle += cpu_ptr->new.idle; nod_ptr->old.idle += cpu_ptr->old.idle; + nod_ptr->new.iowait += cpu_ptr->new.iowait; nod_ptr->old.iowait += cpu_ptr->old.iowait; + nod_ptr->new.irq += cpu_ptr->new.irq; nod_ptr->old.irq += cpu_ptr->old.irq; + nod_ptr->new.sirq += cpu_ptr->new.sirq; nod_ptr->old.sirq += cpu_ptr->old.sirq; + nod_ptr->new.stolen += cpu_ptr->new.stolen; nod_ptr->old.stolen += cpu_ptr->old.stolen; + nod_ptr->new.guest += cpu_ptr->new.guest; nod_ptr->old.guest += cpu_ptr->old.guest; + nod_ptr->new.gnice += cpu_ptr->new.gnice; nod_ptr->old.gnice += cpu_ptr->old.gnice; + + nod_ptr->new.xusr += cpu_ptr->new.xusr; nod_ptr->old.xusr += cpu_ptr->old.xusr; + nod_ptr->new.xsys += cpu_ptr->new.xsys; nod_ptr->old.xsys += cpu_ptr->old.xsys; + nod_ptr->new.xidl += cpu_ptr->new.xidl; nod_ptr->old.xidl += cpu_ptr->old.xidl; + nod_ptr->new.xbsy += cpu_ptr->new.xbsy; nod_ptr->old.xbsy += cpu_ptr->old.xbsy; + nod_ptr->new.xtot += cpu_ptr->new.xtot; nod_ptr->old.xtot += cpu_ptr->old.xtot; + + cpu_ptr->numa_node = nod_ptr->numa_node = node; + nod_ptr->count++; ; + } + } + info->nodes.hist.n_inuse = info->nodes.total; + return info->nodes.hist.n_inuse; +} // end: stat_make_numa_hist + + +static int stat_read_failed ( + struct stat_info *info) +{ + struct hist_tic *sum_ptr, *cpu_ptr; + char *bp, *b; + int i, rc, num, tot_read; + unsigned long long llnum; + + if (!info->cpus.hist.n_alloc) { + info->cpus.hist.tics = calloc(NEWOLD_INCR, sizeof(struct hist_tic)); + if (!(info->cpus.hist.tics)) + return 1; + info->cpus.hist.n_alloc = NEWOLD_INCR; + info->cpus.hist.n_inuse = 0; + } + + if (!info->stat_fp + && (!(info->stat_fp = fopen(STAT_FILE, "r")))) + return 1; + fflush(info->stat_fp); + rewind(info->stat_fp); + + #define maxSIZ info->stat_buf_size + #define curSIZ ( maxSIZ - tot_read ) + #define curPOS ( info->stat_buf + tot_read ) + /* we slurp in the entire directory thus avoiding repeated calls to fread, | + especially for a massively parallel environment. additionally, each cpu | + line is then frozen in time rather than changing until we get around to | + accessing it. this helps to minimize (not eliminate) some distortions. | */ + tot_read = 0; + while ((0 < (num = fread(curPOS, 1, curSIZ, info->stat_fp)))) { + tot_read += num; + if (tot_read < maxSIZ) + break; + maxSIZ += BUFFER_INCR; + if (!(info->stat_buf = realloc(info->stat_buf, maxSIZ))) + return 1; + }; + #undef maxSIZ + #undef curSIZ + #undef curPOS + + if (!feof(info->stat_fp)) { + errno = EIO; + return 1; + } + info->stat_buf[tot_read] = '\0'; + bp = info->stat_buf; + + sum_ptr = &info->cpu_hist; + // remember summary from last time around + memcpy(&sum_ptr->old, &sum_ptr->new, sizeof(struct stat_jifs)); + + sum_ptr->id = STAT_SUMMARY_ID; // mark as summary + sum_ptr->numa_node = STAT_NODE_INVALID; // mark as invalid + + // now value the cpu summary tics from line #1 +#ifdef __CYGWIN__ + if (4 > sscanf(bp, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu" +#else + if (8 > sscanf(bp, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu" +#endif + , &sum_ptr->new.user, &sum_ptr->new.nice, &sum_ptr->new.system + , &sum_ptr->new.idle, &sum_ptr->new.iowait, &sum_ptr->new.irq + , &sum_ptr->new.sirq, &sum_ptr->new.stolen + , &sum_ptr->new.guest, &sum_ptr->new.gnice)) { + errno = ERANGE; + return 1; + } + stat_derive_unique(sum_ptr); +#ifdef CPU_IDLE_FORCED + /* if any cpu accumulated substantially fewer tics than what is expected | + we'll force it to be treated as 'idle' so as not to return misleading | + statistics (and that sum_ptr->count also serves as first time switch) | */ + if (sum_ptr->count) sum_ptr->edge = + ((sum_ptr->new.xtot - sum_ptr->old.xtot) / sum_ptr->count) / TICS_THRESHOLD; +#endif + + i = 0; +reap_em_again: + cpu_ptr = info->cpus.hist.tics + i; // adapt to relocated if reap_em_again + + do { + static int once_sw; + + bp = 1 + strchr(bp, '\n'); + // remember this cpu from last time around + memcpy(&cpu_ptr->old, &cpu_ptr->new, sizeof(struct stat_jifs)); + // next can be overridden under 'stat_make_numa_hist' + cpu_ptr->numa_node = STAT_NODE_INVALID; + cpu_ptr->count = 1; + +#ifdef __CYGWIN__ + if (4 > (rc = sscanf(bp, "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu" +#else + if (8 > (rc = sscanf(bp, "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu" +#endif + , &cpu_ptr->id + , &cpu_ptr->new.user, &cpu_ptr->new.nice, &cpu_ptr->new.system + , &cpu_ptr->new.idle, &cpu_ptr->new.iowait, &cpu_ptr->new.irq + , &cpu_ptr->new.sirq, &cpu_ptr->new.stolen + , &cpu_ptr->new.guest, &cpu_ptr->new.gnice))) { + break; // we must tolerate cpus taken offline + } + stat_derive_unique(cpu_ptr); + + // force a one time core link for cpu0 (if possible) ... + if (!once_sw) + once_sw = cpu_ptr->saved_id = -1; + + /* this happens if cpus are taken offline/brought back online + so we better force the proper current core association ... */ + if (cpu_ptr->saved_id != cpu_ptr->id) { + cpu_ptr->saved_id = cpu_ptr->id; + cpu_ptr->core = NULL; + stat_cores_link(info, cpu_ptr); + } + +#ifdef CPU_IDLE_FORCED + // first time through (that priming read) sum_ptr->edge will be zero | + if (cpu_ptr->new.xtot < sum_ptr->edge) { + cpu_ptr->old.xtot = cpu_ptr->old.xbsy = cpu_ptr->old.xidl = cpu_ptr->old.xusr = cpu_ptr->old.xsys + = cpu_ptr->new.xbsy = cpu_ptr->new.xusr = cpu_ptr->new.xsys = 0; + cpu_ptr->new.xtot = cpu_ptr->new.xidl = 1; + } +#endif + ++cpu_ptr; + ++i; + } while (i < info->cpus.hist.n_alloc); + + if (i == info->cpus.hist.n_alloc && rc >= 8) { + info->cpus.hist.n_alloc += NEWOLD_INCR; + info->cpus.hist.tics = realloc(info->cpus.hist.tics, info->cpus.hist.n_alloc * sizeof(struct hist_tic)); + if (!(info->cpus.hist.tics)) + return 1; + goto reap_em_again; + } + + info->cpus.total = info->cpus.hist.n_inuse = sum_ptr->count = i; + /* whoa, if a new cpu was brought online, we better + ensure that no new cores have now become visible */ + if (info->cpu_count_hwm < info->cpus.total) { + /* next means it's not the first time, so we'll re-verify. + otherwise, procps_stat_new() already setup any cores so + that they could be linked above during tics processing. */ + if (info->cpu_count_hwm) { + if (!stat_cores_verify(info)) + return 1; + } + info->cpu_count_hwm = info->cpus.total; + } + + // remember sys_hist stuff from last time around + memcpy(&info->sys_hist.old, &info->sys_hist.new, sizeof(struct stat_data)); + + llnum = 0; + if ((b = strstr(bp, "intr "))) + sscanf(b, "intr %llu", &llnum); + info->sys_hist.new.intr = llnum; + + llnum = 0; + if ((b = strstr(bp, "ctxt "))) + sscanf(b, "ctxt %llu", &llnum); + info->sys_hist.new.ctxt = llnum; + + llnum = 0; + if ((b = strstr(bp, "btime "))) + sscanf(b, "btime %llu", &llnum); + info->sys_hist.new.btime = llnum; + + llnum = 0; + if ((b = strstr(bp, "processes "))) + sscanf(b, "processes %llu", &llnum); + info->sys_hist.new.procs_created = llnum; + + llnum = 0; + if ((b = strstr(bp, "procs_blocked "))) + sscanf(b, "procs_blocked %llu", &llnum); + info->sys_hist.new.procs_blocked = llnum; + + llnum = 0; + if ((b = strstr(bp, "procs_running "))) + sscanf(b, "procs_running %llu", &llnum); + if (llnum) + llnum--; //exclude itself + info->sys_hist.new.procs_running = llnum; + + return 0; +} // end: stat_read_failed + + +/* + * stat_stacks_alloc(): + * + * Allocate and initialize one or more stacks each of which is anchored in an + * associated context structure. + * + * All such stacks will have their result structures properly primed with + * 'items', while the result itself will be zeroed. + * + * Returns a stack_extent struct anchoring the 'heads' of each new stack. + */ +static struct stacks_extent *stat_stacks_alloc ( + struct ext_support *this, + int maxstacks) +{ + struct stacks_extent *p_blob; + struct stat_stack **p_vect; + struct stat_stack *p_head; + size_t vect_size, head_size, list_size, blob_size; + void *v_head, *v_list; + int i; + + vect_size = sizeof(void *) * maxstacks; // size of the addr vectors | + vect_size += sizeof(void *); // plus NULL addr delimiter | + head_size = sizeof(struct stat_stack); // size of that head struct | + list_size = sizeof(struct stat_result) * this->items->num; // any single results stack | + blob_size = sizeof(struct stacks_extent); // the extent anchor itself | + blob_size += vect_size; // plus room for addr vects | + blob_size += head_size * maxstacks; // plus room for head thing | + blob_size += list_size * maxstacks; // plus room for our stacks | + + /* note: all of our memory is allocated in one single blob, facilitating a later free(). | + as a minimum, it is important that those result structures themselves always be | + contiguous within each stack since they are accessed through relative position. | */ + if (NULL == (p_blob = calloc(1, blob_size))) + return NULL; + + p_blob->next = this->extents; // push this extent onto... | + this->extents = p_blob; // ...some existing extents | + p_vect = (void *)p_blob + sizeof(struct stacks_extent); // prime our vector pointer | + p_blob->stacks = p_vect; // set actual vectors start | + v_head = (void *)p_vect + vect_size; // prime head pointer start | + v_list = v_head + (head_size * maxstacks); // prime our stacks pointer | + + for (i = 0; i < maxstacks; i++) { + p_head = (struct stat_stack *)v_head; + p_head->head = stat_itemize_stack((struct stat_result *)v_list, this->items->num, this->items->enums); + p_blob->stacks[i] = p_head; + v_list += list_size; + v_head += head_size; + } + p_blob->ext_numstacks = maxstacks; + return p_blob; +} // end: stat_stacks_alloc + + +static int stat_stacks_fetch ( + struct stat_info *info, + struct reap_support *this) +{ + #define n_alloc this->n_alloc + #define n_inuse this->hist.n_inuse + #define n_saved this->n_alloc_save + struct stacks_extent *ext; + int i; + + // initialize stuff ----------------------------------- + if (!this->anchor) { + if (!(this->anchor = calloc(sizeof(void *), STACKS_INCR))) + return -1; + n_alloc = STACKS_INCR; + } + if (!this->fetch.extents) { + if (!(ext = stat_stacks_alloc(&this->fetch, n_alloc))) + return -1; // here, errno was set to ENOMEM + memcpy(this->anchor, ext->stacks, sizeof(void *) * n_alloc); + } + + // iterate stuff -------------------------------------- + for (i = 0; i < n_inuse; i++) { + if (!(i < n_alloc)) { + n_alloc += STACKS_INCR; + if ((!(this->anchor = realloc(this->anchor, sizeof(void *) * n_alloc))) + || (!(ext = stat_stacks_alloc(&this->fetch, STACKS_INCR)))) + return -1; // here, errno was set to ENOMEM + memcpy(this->anchor + i, ext->stacks, sizeof(void *) * STACKS_INCR); + } + stat_assign_results(this->anchor[i], &info->sys_hist, &this->hist.tics[i]); + } + + // finalize stuff ------------------------------------- + /* note: we go to this trouble of maintaining a duplicate of the consolidated | + extent stacks addresses represented as our 'anchor' since these ptrs | + are exposed to a user (um, not that we don't trust 'em or anything). | + plus, we can NULL delimit these ptrs which we couldn't do otherwise. | */ + if (n_saved < i + 1) { + n_saved = i + 1; + if (!(this->result.stacks = realloc(this->result.stacks, sizeof(void *) * n_saved))) + return -1; + } + memcpy(this->result.stacks, this->anchor, sizeof(void *) * i); + this->result.stacks[i] = NULL; + this->result.total = i; + + // callers beware, this might be zero (maybe no libnuma.so) ... + return this->result.total; + #undef n_alloc + #undef n_inuse + #undef n_saved +} // end: stat_stacks_fetch + + +static int stat_stacks_reconfig_maybe ( + struct ext_support *this, + enum stat_item *items, + int numitems) +{ + if (stat_items_check_failed(numitems, items)) + return -1; + /* is this the first time or have things changed since we were last called? + if so, gotta' redo all of our stacks stuff ... */ + if (this->items->num != numitems + 1 + || memcmp(this->items->enums, items, sizeof(enum stat_item) * numitems)) { + // allow for our STAT_logical_end + if (!(this->items->enums = realloc(this->items->enums, sizeof(enum stat_item) * (numitems + 1)))) + return -1; + memcpy(this->items->enums, items, sizeof(enum stat_item) * numitems); + this->items->enums[numitems] = STAT_logical_end; + this->items->num = numitems + 1; + stat_extents_free_all(this); + return 1; + } + return 0; +} // end: stat_stacks_reconfig_maybe + + +static struct stat_stack *stat_update_single_stack ( + struct stat_info *info, + struct ext_support *this) +{ + if (!this->extents + && !(stat_stacks_alloc(this, 1))) + return NULL; + + stat_assign_results(this->extents->stacks[0], &info->sys_hist, &info->cpu_hist); + + return this->extents->stacks[0]; +} // end: stat_update_single_stack + + + +// ___ Public Functions ||||||||||||||||||||||||||||||||||||||||||||||||||||||| + +// --- standard required functions -------------------------------------------- + +/* + * procps_stat_new: + * + * Create a new container to hold the stat information + * + * The initial refcount is 1, and needs to be decremented + * to release the resources of the structure. + * + * Returns: < 0 on failure, 0 on success along with + * a pointer to a new context struct + */ +PROCPS_EXPORT int procps_stat_new ( + struct stat_info **info) +{ + struct stat_info *p; + +#ifdef ITEMTABLE_DEBUG + int i, failed = 0; + for (i = 0; i < MAXTABLE(Item_table); i++) { + if (i != Item_table[i].enumnumb) { + fprintf(stderr, "%s: enum/table error: Item_table[%d] was %s, but its value is %d\n" + , __FILE__, i, Item_table[i].enum2str, Item_table[i].enumnumb); + failed = 1; + } + } + if (failed) _Exit(EXIT_FAILURE); +#endif + + if (info == NULL || *info != NULL) + return -EINVAL; + if (!(p = calloc(1, sizeof(struct stat_info)))) + return -ENOMEM; + if (!(p->stat_buf = calloc(1, BUFFER_INCR))) { + free(p); + return -ENOMEM; + } + p->stat_buf_size = BUFFER_INCR; + p->refcount = 1; + + p->results.cpus = &p->cpus.result; + p->results.numa = &p->nodes.result; + + // these 3 are for reap, sharing a single set of items + p->cpu_summary.items = p->cpus.fetch.items = p->nodes.fetch.items = &p->reap_items; + + // the select guy has its own set of items + p->select.items = &p->select_items; + + numa_init(); + + // identify the current P-cores and E-cores, if any + if (!stat_cores_verify(p)) { + procps_stat_unref(&p); + return -errno; + } + + /* do a priming read here for the following potential benefits: | + 1) ensure there will be no problems with subsequent access | + 2) make delta results potentially useful, even if 1st time | + 3) elimnate need for history distortions 1st time 'switch' | */ + if (stat_read_failed(p)) { + procps_stat_unref(&p); + return -errno; + } + + *info = p; + return 0; +} // end :procps_stat_new + + +PROCPS_EXPORT int procps_stat_ref ( + struct stat_info *info) +{ + if (info == NULL) + return -EINVAL; + + info->refcount++; + return info->refcount; +} // end: procps_stat_ref + + +PROCPS_EXPORT int procps_stat_unref ( + struct stat_info **info) +{ + if (info == NULL || *info == NULL) + return -EINVAL; + + (*info)->refcount--; + + if ((*info)->refcount < 1) { + int errno_sav = errno; + + if ((*info)->stat_fp) + fclose((*info)->stat_fp); + if ((*info)->stat_buf) + free((*info)->stat_buf); + + if ((*info)->cpus.anchor) + free((*info)->cpus.anchor); + if ((*info)->cpus.result.stacks) + free((*info)->cpus.result.stacks); + if ((*info)->cpus.hist.tics) + free((*info)->cpus.hist.tics); + if ((*info)->cpus.fetch.extents) + stat_extents_free_all(&(*info)->cpus.fetch); + + if ((*info)->nodes.anchor) + free((*info)->nodes.anchor); + if ((*info)->nodes.result.stacks) + free((*info)->nodes.result.stacks); + if ((*info)->nodes.hist.tics) + free((*info)->nodes.hist.tics); + if ((*info)->nodes.fetch.extents) + stat_extents_free_all(&(*info)->nodes.fetch); + + if ((*info)->cpu_summary.extents) + stat_extents_free_all(&(*info)->cpu_summary); + + if ((*info)->select.extents) + stat_extents_free_all(&(*info)->select); + + if ((*info)->reap_items.enums) + free((*info)->reap_items.enums); + if ((*info)->select_items.enums) + free((*info)->select_items.enums); + + if ((*info)->cores) { + struct stat_core *next, *this = (*info)->cores; + while (this) { + next = this->next; + free(this); + this = next; + }; + } + + numa_uninit(); + + free(*info); + *info = NULL; + + errno = errno_sav; + return 0; + } + return (*info)->refcount; +} // end: procps_stat_unref + + +// --- variable interface functions ------------------------------------------- + +PROCPS_EXPORT struct stat_result *procps_stat_get ( + struct stat_info *info, + enum stat_item item) +{ + time_t cur_secs; + + errno = EINVAL; + if (info == NULL) + return NULL; + if (item < 0 || item >= STAT_logical_end) + return NULL; + errno = 0; + + /* we will NOT read the source file with every call - rather, we'll offer + a granularity of 1 second between reads ... */ + cur_secs = time(NULL); + if (1 <= cur_secs - info->sav_secs) { + if (stat_read_failed(info)) + return NULL; + info->sav_secs = cur_secs; + } + + info->get_this.item = item; + // with 'get', we must NOT honor the usual 'noop' guarantee + info->get_this.result.ull_int = 0; + Item_table[item].setsfunc(&info->get_this, &info->sys_hist, &info->cpu_hist); + + return &info->get_this; +} // end: procps_stat_get + + +/* procps_stat_reap(): + * + * Harvest all the requested NUMA NODE and/or CPU information providing the + * result stacks along with totals and the cpu summary. + * + * Returns: pointer to a stat_reaped struct on success, NULL on error. + */ +PROCPS_EXPORT struct stat_reaped *procps_stat_reap ( + struct stat_info *info, + enum stat_reap_type what, + enum stat_item *items, + int numitems) +{ + int rc; + + errno = EINVAL; + if (info == NULL || items == NULL) + return NULL; + if (what != STAT_REAP_CPUS_ONLY && what != STAT_REAP_NUMA_NODES_TOO) + return NULL; + +#ifdef ENFORCE_LOGICAL +{ int i; + // those STAT_SYS_type enum's make sense only to 'select' ... + for (i = 0; i < numitems; i++) { + if (items[i] > STAT_TIC_highest) + return NULL; + } +} +#endif + if (0 > (rc = stat_stacks_reconfig_maybe(&info->cpu_summary, items, numitems))) + return NULL; // here, errno may be overridden with ENOMEM + if (rc) { + stat_extents_free_all(&info->cpus.fetch); + stat_extents_free_all(&info->nodes.fetch); + } + errno = 0; + + if (stat_read_failed(info)) + return NULL; + info->results.summary = stat_update_single_stack(info, &info->cpu_summary); + + /* unlike the other 'reap' functions, provides for two separate | + stacks pointer arrays exposed to callers. Thus, to keep our promise | + of NULL delimit we must ensure a minimal array for the optional one | */ + if (!info->nodes.result.stacks + && (!(info->nodes.result.stacks = malloc(sizeof(void *))))) + return NULL; + info->nodes.result.total = 0; + info->nodes.result.stacks[0] = NULL; + + switch (what) { + case STAT_REAP_CPUS_ONLY: + if (0 > stat_stacks_fetch(info, &info->cpus)) + return NULL; + break; + case STAT_REAP_NUMA_NODES_TOO: + /* note: if we're doing numa at all, we must do this numa history | + before we build (fetch) cpu stacks since that stat_read_failed | + guy always marks (temporarily) all the cpu node ids as invalid | */ + if (0 > stat_make_numa_hist(info)) + return NULL; + if (0 > stat_stacks_fetch(info, &info->nodes)) + return NULL; + if (0 > stat_stacks_fetch(info, &info->cpus)) + return NULL; + break; + default: + return NULL; + }; + + return &info->results; +} // end: procps_stat_reap + + +/* procps_stat_select(): + * + * Harvest all the requested TIC and/or SYS information then return + * it in a results stack. + * + * Returns: pointer to a stat_stack struct on success, NULL on error. + */ +PROCPS_EXPORT struct stat_stack *procps_stat_select ( + struct stat_info *info, + enum stat_item *items, + int numitems) +{ + errno = EINVAL; + if (info == NULL || items == NULL) + return NULL; + if (0 > stat_stacks_reconfig_maybe(&info->select, items, numitems)) + return NULL; // here, errno may be overridden with ENOMEM + errno = 0; + + if (stat_read_failed(info)) + return NULL; + + return stat_update_single_stack(info, &info->select); +} // end: procps_stat_select + + +/* + * procps_stat_sort(): + * + * Sort stacks anchored in the passed stack pointers array + * based on the designated sort enumerator and specified order. + * + * Returns those same addresses sorted. + * + * Note: all of the stacks must be homogeneous (of equal length and content). + */ +PROCPS_EXPORT struct stat_stack **procps_stat_sort ( + struct stat_info *info, + struct stat_stack *stacks[], + int numstacked, + enum stat_item sortitem, + enum stat_sort_order order) +{ + struct stat_result *p; + struct sort_parms parms; + int offset; + + errno = EINVAL; + if (info == NULL || stacks == NULL) + return NULL; + // a stat_item is currently unsigned, but we'll protect our future + if (sortitem < 0 || sortitem >= STAT_logical_end) + return NULL; + if (order != STAT_SORT_ASCEND && order != STAT_SORT_DESCEND) + return NULL; + if (numstacked < 2) + return stacks; + + offset = 0; + p = stacks[0]->head; + for (;;) { + if (p->item == sortitem) + break; + ++offset; + if (p->item >= STAT_logical_end) + return NULL; + ++p; + } + errno = 0; + + parms.offset = offset; + parms.order = order; + + qsort_r(stacks, numstacked, sizeof(void *), (QSR_t)Item_table[p->item].sortfunc, &parms); + return stacks; +} // end: procps_stat_sort + + +// --- special debugging function(s) ------------------------------------------ +/* + * The following isn't part of the normal programming interface. Rather, + * it exists to validate result types referenced in application programs. + * + * It's used only when: + * 1) the 'XTRA_PROCPS_DEBUG' has been defined, or + * 2) an #include of 'xtra-procps-debug.h' is used + */ + +PROCPS_EXPORT struct stat_result *xtra_stat_get ( + struct stat_info *info, + enum stat_item actual_enum, + const char *typestr, + const char *file, + int lineno) +{ + struct stat_result *r = procps_stat_get(info, actual_enum); + + if (actual_enum < 0 || actual_enum >= STAT_logical_end) { + fprintf(stderr, "%s line %d: invalid item = %d, type = %s\n" + , file, lineno, actual_enum, typestr); + } + if (r) { + char *str = Item_table[r->item].type2str; + if (str[0] + && (strcmp(typestr, str))) + fprintf(stderr, "%s line %d: was %s, expected %s\n", file, lineno, typestr, str); + } + return r; +} // end: xtra_stat_get_ + + +PROCPS_EXPORT struct stat_result *xtra_stat_val ( + int relative_enum, + const char *typestr, + const struct stat_stack *stack, + struct stat_info *info, + const char *file, + int lineno) +{ + char *str; + int i; + + for (i = 0; stack->head[i].item < STAT_logical_end; i++) + ; + if (relative_enum < 0 || relative_enum >= i) { + fprintf(stderr, "%s line %d: invalid relative_enum = %d, valid range = 0-%d\n" + , file, lineno, relative_enum, i-1); + return NULL; + } + str = Item_table[stack->head[relative_enum].item].type2str; + if (str[0] + && (strcmp(typestr, str))) { + fprintf(stderr, "%s line %d: was %s, expected %s\n", file, lineno, typestr, str); + } + return &stack->head[relative_enum]; + (void)info; +} // end: xtra_stat_val diff --git a/library/sysinfo.c b/library/sysinfo.c new file mode 100644 index 0000000..35a9922 --- /dev/null +++ b/library/sysinfo.c @@ -0,0 +1,167 @@ +/* + * File for parsing top-level /proc entities. + * + * Copyright © 2011-2023 Jim Warner + * Copyright © 2011-2023 Craig Small + * Copyright © 1998-2008 Albert Cahalan + * Copyright © 1992-1998 Michael K. Johnson + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; 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 __CYGWIN__ +#include +#endif +#include "misc.h" +#include "procps-private.h" + + +#define LOADAVG_FILE "/proc/loadavg" + +/* evals 'x' twice */ +#define SET_IF_DESIRED(x,y) do{ if(x) *(x) = (y); }while(0) + +/* return minimum of two values */ +#ifndef __CYGWIN__ +#define MIN(x,y) ((x) < (y) ? (x) : (y)) +#endif + +/* + * procps_hertz_get: + * + * + * Some values in /proc are expressed in units of 1/HZ seconds, where HZ + * is the kernel clock tick rate. One of these units is called a jiffy. + * The HZ value used in the kernel may vary according to hacker desire. + * + * On some architectures, the kernel provides an ELF note to indicate + * HZ. + * + * Returns: + * The discovered or assumed hertz value + */ +PROCPS_EXPORT long procps_hertz_get(void) +{ + long hz; + +#ifdef _SC_CLK_TCK + if ((hz = sysconf(_SC_CLK_TCK)) > 0) + return hz; +#endif +#ifdef HZ + return(HZ); +#endif + /* Last resort, assume 100 */ + return 100; +} + +/* + * procps_loadavg: + * @av1: location to store 1 minute load average + * @av5: location to store 5 minute load average + * @av15: location to store 15 minute load average + * + * Find the 1,5 and 15 minute load average of the system + * + * Returns: 0 on success <0 on error + */ +PROCPS_EXPORT int procps_loadavg( + double *restrict av1, + double *restrict av5, + double *restrict av15) +{ + double avg_1=0, avg_5=0, avg_15=0; + locale_t tmplocale; + int retval=0; + FILE *fp; + + if ((fp = fopen(LOADAVG_FILE, "r")) == NULL) + return -errno; + + tmplocale = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0); + uselocale(tmplocale); + if (fscanf(fp, "%lf %lf %lf", &avg_1, &avg_5, &avg_15) < 3) + retval = -ERANGE; + + fclose(fp); + uselocale(LC_GLOBAL_LOCALE); + freelocale(tmplocale); + SET_IF_DESIRED(av1, avg_1); + SET_IF_DESIRED(av5, avg_5); + SET_IF_DESIRED(av15, avg_15); + return retval; +} + +///////////////////////////////////////////////////////////////////////////// + +#define PROCFS_PID_MAX "/proc/sys/kernel/pid_max" +#define DEFAULT_PID_LENGTH 5 + +/* + * procps_pid_length + * + * Return the length of the maximum possible pid. + * + * Returns either the strlen of PROCFS_PID_MAX or the + * best-guess DEFAULT_PID_LENGTH + */ +PROCPS_EXPORT unsigned int procps_pid_length(void) +{ + FILE *fp; + char pidbuf[24]; + static __thread int pid_length=0; + + if (pid_length) + return pid_length; + + pid_length = DEFAULT_PID_LENGTH; + if ((fp = fopen(PROCFS_PID_MAX, "r")) != NULL) { + if (fgets(pidbuf, sizeof(pidbuf), fp) != NULL) { + pid_length = strlen(pidbuf); + if (pidbuf[pid_length-1] == '\n') + --pid_length; + } + fclose(fp); + } + return pid_length; +} + +/////////////////////////////////////////////////////////////////////////// + +/* procps_cpu_count: + * + * Returns the number of CPUs that are currently online. + * + */ +long procps_cpu_count(void) +{ + long cpus; + + cpus = sysconf(_SC_NPROCESSORS_ONLN); + if (cpus < 1) + return 1; + return cpus; +} + diff --git a/library/tests/test_Itemtables.c b/library/tests/test_Itemtables.c new file mode 100644 index 0000000..4204700 --- /dev/null +++ b/library/tests/test_Itemtables.c @@ -0,0 +1,91 @@ +/* + * libprocps - Library to read proc filesystem + * Tests for Item_table/enumerator synchronization + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +#include "diskstats.h" +#include "meminfo.h" +#include "pids.h" +#include "slabinfo.h" +#include "stat.h" +#include "vmstat.h" + +#include "tests.h" + +static int check_diskstats (void *data) { + struct diskstats_info *ctx = NULL; + testname = "Itemtable check, diskstats"; + if (0 == procps_diskstats_new(&ctx)) + procps_diskstats_unref(&ctx); + return 1; +} + +static int check_meminfo (void *data) { + struct meminfo_info *ctx = NULL; + testname = "Itemtable check, meminfo"; + if (0 == procps_meminfo_new(&ctx)) + procps_meminfo_unref(&ctx); + return 1; +} + +static int check_pids (void *data) { + struct pids_info *ctx = NULL; + testname = "Itemtable check, pids"; + if (0 == procps_pids_new(&ctx, NULL, 0)) + procps_pids_unref(&ctx); + return 1; +} + +static int check_slabinfo (void *data) { + struct slabinfo_info *ctx = NULL; + testname = "Itemtable check, slabinfo"; + if (0 == procps_slabinfo_new(&ctx)) + procps_slabinfo_unref(&ctx); + return 1; +} + +static int check_stat (void *data) { + struct stat_info *ctx = NULL; + testname = "Itemtable check, stat"; + if (0 == procps_stat_new(&ctx)) + procps_stat_unref(&ctx); + return 1; +} + +static int check_vmstat (void *data) { + struct vmstat_info *ctx = NULL; + testname = "Itemtable check, vmstat"; + if (0 == procps_vmstat_new(&ctx)) + procps_vmstat_unref(&ctx); + return 1; +} + +static TestFunction test_funcs[] = { + check_diskstats, + check_meminfo, + check_pids, + check_slabinfo, + check_stat, + check_vmstat, + NULL +}; + +int main (void) { + return run_tests(test_funcs, NULL); +} diff --git a/library/tests/test_namespace.c b/library/tests/test_namespace.c new file mode 100644 index 0000000..2c55c4f --- /dev/null +++ b/library/tests/test_namespace.c @@ -0,0 +1,76 @@ +/* + * libprocps - Library to read proc filesystem + * Tests for namespace library calls + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include +#include +#include + +#include "misc.h" +#include "tests.h" + +int check_name_minus(void *data) +{ + testname = "procps_ns_get_name() negative id"; + return (procps_ns_get_name(-1) == NULL); +} + +int check_name_over(void *data) +{ + testname = "procps_ns_get_name() id over limit"; + return (procps_ns_get_name(999) == NULL); +} + +int check_name_ipc(void *data) +{ + testname = "procps_ns_get_name() ipc"; + return (strcmp(procps_ns_get_name(PROCPS_NS_IPC),"ipc")==0); +} + +int check_id_null(void *data) +{ + testname = "procps_ns_get_id(NULL)"; + return (procps_ns_get_id(NULL) < 0); +} + +int check_id_unfound(void *data) +{ + testname = "procps_ns_get_id(unknown)"; + return (procps_ns_get_id("foobar") < 0); +} + +int check_id_mnt(void *data) +{ + testname = "procps_ns_get_id(mnt)"; + return (procps_ns_get_id("mnt") == PROCPS_NS_MNT); +} + +TestFunction test_funcs[] = { + check_name_minus, + check_name_over, + check_name_ipc, + check_id_null, + check_id_unfound, + check_id_mnt, + NULL +}; + +int main(int argc, char *argv[]) +{ + return run_tests(test_funcs, NULL); +} + diff --git a/library/tests/test_pids.c b/library/tests/test_pids.c new file mode 100644 index 0000000..eda0b73 --- /dev/null +++ b/library/tests/test_pids.c @@ -0,0 +1,75 @@ +/* + * libprocps - Library to read proc filesystem + * Tests for pids library calls + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include +#include +#include + +#include "pids.h" +#include "tests.h" + +enum pids_item items[] = { PIDS_ID_PID, PIDS_ID_PID }; +enum pids_item items2[] = { PIDS_ID_PID, PIDS_VM_RSS }; + +int check_pids_new_nullinfo(void *data) +{ + testname = "procps_pids_new() info=NULL returns -EINVAL"; + return (procps_pids_new(NULL, items, 0) == -EINVAL); +} + +int check_pids_new_toomany(void *data) +{ + struct pids_info *info; + testname = "procps_pids_new() too many items returns -EINVAL"; + return (procps_pids_new(&info, items, 1) == -EINVAL); +} + +int check_pids_new_and_unref(void *data) +{ + struct pids_info *info = NULL; + testname = "procps_pids new then unref"; + return ( (procps_pids_new(&info, items, 2) == 0) && + (procps_pids_unref(&info) == 0) && + info == NULL); +} + +int check_fatal_proc_unmounted(void *data) +{ + struct pids_info *info = NULL; + struct pids_stack *stack; + testname = "check_fatal_proc_unmounted"; + + return ( (procps_pids_new(&info, items2, 2) == 0) && + ( (stack = fatal_proc_unmounted(info, 1)) != NULL) && + ( PIDS_VAL(0, s_int, stack, info) > 0) && + ( PIDS_VAL(1, ul_int, stack, info) > 0)); +} + +TestFunction test_funcs[] = { + check_pids_new_nullinfo, + // skipped, ask Jim check_pids_new_toomany, + check_pids_new_and_unref, + check_fatal_proc_unmounted, + NULL }; + +int main(int argc, char *argv[]) +{ + return run_tests(test_funcs, NULL); +} + + diff --git a/library/tests/test_sysinfo.c b/library/tests/test_sysinfo.c new file mode 100644 index 0000000..8390ccd --- /dev/null +++ b/library/tests/test_sysinfo.c @@ -0,0 +1,64 @@ +/* + * libprocps - Library to read proc filesystem + * Tests for sysinfo library calls + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include +#include + +#include "misc.h" +#include "tests.h" + +int check_hertz(void *data) +{ + long hz; + testname = "procps_hertz_get()"; + + hz = procps_hertz_get(); + return (hz > 0); +} + +int check_loadavg(void *data) +{ + double a,b,c; + testname = "procps_loadavg()"; + + if (procps_loadavg(&a, &b, &c) == 0) + return 1; + return (a>0 && b>0 && c>0); +} + +int check_loadavg_null(void *data) +{ + testname = "procps_loadavg() with NULLs"; + if (procps_loadavg(NULL, NULL, NULL) == 0) + return 1; + return 0; +} + +TestFunction test_funcs[] = { + check_hertz, + check_loadavg, + check_loadavg_null, + NULL, +}; + +int main(int argc, char *argv[]) +{ + return run_tests(test_funcs, NULL); +} + + diff --git a/library/tests/test_uptime.c b/library/tests/test_uptime.c new file mode 100644 index 0000000..35d3e2e --- /dev/null +++ b/library/tests/test_uptime.c @@ -0,0 +1,97 @@ +/* + * libprocps - Library to read proc filesystem + * Tests for version library calls + * + * Copyright 2016 Craig Small + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include +#include + +#include "misc.h" +#include "tests.h" + +int check_uptime(void *data) +{ + testname = "procps_uptime()"; + double up=0, idle=0; + int rc; + rc = procps_uptime(&up, &idle); + return (rc == 0 && up > 0 && idle > 0); +} + +int check_uptime_nullup(void *data) +{ + double idle=0; + int rc; + testname = "procps_uptime() (up=NULL)"; + rc = procps_uptime(NULL, &idle); + return (rc == 0 && idle > 0); +} + +int check_uptime_nullidle(void *data) +{ + double up=0; + int rc; + testname = "procps_uptime() (idle=NULL)"; + rc = procps_uptime(&up, NULL); + return (rc == 0 && up > 0); +} + +int check_uptime_nullall(void *data) +{ + int rc; + testname = "procps_uptime() (up,idle=NULL)"; + rc = procps_uptime(NULL, NULL); + return (rc == 0); +} + +int check_uptime_sprint(void *data) +{ + char *str; + testname = "procps_uptime_sprint()"; + + str = procps_uptime_sprint(); + + return (str != NULL && str[0] != '\0'); +} + +int check_uptime_sprint_short(void *data) +{ + char *str; + testname = "procps_uptime_sprint_short()"; + + str = procps_uptime_sprint_short(); + + return (str != NULL && str[0] != '\0'); +} + +TestFunction test_funcs[] = { + check_uptime, + check_uptime_nullup, + check_uptime_nullidle, + check_uptime_nullall, + check_uptime_sprint, + check_uptime_sprint_short, + NULL, +}; + +int main(int argc, char *argv[]) +{ + return run_tests(test_funcs, NULL); +} + + diff --git a/library/tests/test_version.c b/library/tests/test_version.c new file mode 100644 index 0000000..f2f5e1f --- /dev/null +++ b/library/tests/test_version.c @@ -0,0 +1,72 @@ +/* + * libprocps - Library to read proc filesystem + * Tests for version library calls + * + * Copyright 2016 Craig Small + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include +#include + +#include "misc.h" +#include "tests.h" + +int check_linux_version(void *data) +{ + testname = "procps_linux_version()"; + return (procps_linux_version() > 0); +} + +int check_conversion(void *data) +{ + testname = "LINUX_VERSION macro"; + struct testvals { + int retval; + int major, minor, patch; + }; + + struct testvals *tv; + struct testvals tvs[] = { + { 132096, 2, 4, 0 }, + { 132635, 2, 6, 27 }, + { 199936, 3, 13, 0 }, + { 263426, 4, 5, 2 }, + { 0, 0, 0, 0} + }; + + for (tv=tvs; tv->major != 0; tv++) + { + if (LINUX_VERSION(tv->major, tv->minor, tv->patch) != tv->retval) { + fprintf(stderr, "Failed %d != %d\n", LINUX_VERSION(tv->major, tv->minor, + tv->patch), tv->retval); + return 0; + } + } + return 1; +} + +TestFunction test_funcs[] = { + check_conversion, + check_linux_version, + NULL +}; + +int main(int argc, char *argv[]) +{ + return run_tests(test_funcs, NULL); +} + + diff --git a/library/uptime.c b/library/uptime.c new file mode 100644 index 0000000..1826343 --- /dev/null +++ b/library/uptime.c @@ -0,0 +1,268 @@ +/* + * uptime - uptime related functions - part of libproc2 + * + * Copyright © 2015-2023 Craig Small + * Copyright © 2015-2023 Jim Warner + * Copyright © 1998-2003 Albert Cahalan + * Copyright © 1992-1998 Michael K. Johnson + * Copyright © 1993 J. Cowley + * Copyright © ???? Larry Greenfield + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; 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 WITH_SYSTEMD +#include +#include +#endif +#ifdef WITH_ELOGIND +#include +#include +#endif + +#include "misc.h" +#include "procps-private.h" + +#define UPTIME_FILE "/proc/uptime" + +static __thread char upbuf[256]; +static __thread char shortbuf[256]; + +static int count_users(void) +{ + int numuser = 0; + struct utmp *ut; + +#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND) + if (sd_booted() > 0) + return sd_get_sessions(NULL); +#endif + + setutent(); + while ((ut = getutent())) { + if ((ut->ut_type == USER_PROCESS) && (ut->ut_name[0] != '\0')) + numuser++; + } + endutent(); + + return numuser; +} + +/* + * uptime: + * + * Find the uptime and idle time of the system. + * These numbers are found in /proc/uptime + * Unlike other procps functions this closes the file each time + * Either uptime_secs or idle_secs can be null + * + * Returns: 0 on success and <0 on failure + */ +PROCPS_EXPORT int procps_uptime( + double *restrict uptime_secs, + double *restrict idle_secs) +{ + double up=0, idle=0; + locale_t tmplocale; + FILE *fp; + int rc; + + if ((fp = fopen(UPTIME_FILE, "r")) == NULL) + return -errno; + + tmplocale = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0); + uselocale(tmplocale); + rc = fscanf(fp, "%lf %lf", &up, &idle); + fclose(fp); + uselocale(LC_GLOBAL_LOCALE); + freelocale(tmplocale); + + if (uptime_secs) + *uptime_secs = up; + if (idle_secs) + *idle_secs = idle; + + if (rc < 2) + return -ERANGE; + return 0; +} + +/* + * procps_uptime_sprint: + * + * Print current time in nice format + * + * Returns a statically allocated upbuf or NULL on error + */ +PROCPS_EXPORT char *procps_uptime_sprint(void) +{ + int upminutes, uphours, updays, users; + int pos; + time_t realseconds; + struct tm realtime; + double uptime_secs, idle_secs; + double av1, av5, av15; + + upbuf[0] = '\0'; + if (time(&realseconds) < 0) + return upbuf; + localtime_r(&realseconds, &realtime); + + if (procps_uptime(&uptime_secs, &idle_secs) < 0) + return upbuf; + + updays = ((int) uptime_secs / (60*60*24)); + uphours = ((int) uptime_secs / (60*60)) % 24; + upminutes = ((int) uptime_secs / (60)) % 60; + + pos = sprintf(upbuf, " %02d:%02d:%02d up ", + realtime.tm_hour, realtime.tm_min, realtime.tm_sec); + + if (updays) + pos += sprintf(upbuf + pos, "%d %s, ", updays, (updays > 1) ? "days" : "day"); + + if (uphours) + pos += sprintf(upbuf + pos, "%2d:%02d, ", uphours, upminutes); + else + pos += sprintf(upbuf + pos, "%d min, ", upminutes); + + users = count_users(); + procps_loadavg(&av1, &av5, &av15); + + if (users < 0) + pos += sprintf(upbuf + pos, " ? "); + else + pos += sprintf(upbuf + pos, "%2d ", users); + + pos += sprintf(upbuf + pos, "%s, load average: %.2f, %.2f, %.2f", + users > 1 ? "users" : "user", + av1, av5, av15); + + return upbuf; +} + +/* + * procps_uptime_sprint_short: + * + * Print current time in nice format + * + * Returns a statically allocated buffer or NULL on error + */ +PROCPS_EXPORT char *procps_uptime_sprint_short(void) +{ + int updecades, upyears, upweeks, updays, uphours = 0, upminutes = 0; + int pos = 3; + int comma = 0; + double uptime_secs, idle_secs; + + shortbuf[0] = '\0'; + if (procps_uptime(&uptime_secs, &idle_secs) < 0) + return shortbuf; + + if (uptime_secs>60*60*24*365*10) { + updecades = (int) uptime_secs / (60*60*24*365*10); + uptime_secs -= updecades*60*60*24*365*10; + } + else { + updecades = 0; + } + if (uptime_secs>60*60*24*365) { + upyears = (int) uptime_secs / (60*60*24*365); + uptime_secs -= upyears*60*60*24*365; + } + else { + upyears = 0; + } + if (uptime_secs>60*60*24*7) { + upweeks = (int) uptime_secs / (60*60*24*7); + uptime_secs -= upweeks*60*60*24*7; + } + else { + upweeks = 0; + } + if (uptime_secs>60*60*24) { + updays = (int) uptime_secs / (60*60*24); + uptime_secs -= updays*60*60*24; + } + else { + updays = 0; + } + if (uptime_secs>60*60) { + uphours = (int) uptime_secs / (60*60); + uptime_secs -= uphours*60*60; + } + if (uptime_secs>60) { + upminutes = (int) uptime_secs / 60; + uptime_secs -= upminutes*60; + } + /*updecades = (int) uptime_secs / (60*60*24*365*10); + upyears = ((int) uptime_secs / (60*60*24*365)) % 10; + upweeks = ((int) uptime_secs / (60*60*24*7)) % 52; + updays = ((int) uptime_secs / (60*60*24)) % 7; + uphours = ((int) uptime_secs / (60*60)) % 24; + upminutes = ((int) uptime_secs / (60)) % 60; +*/ + strcat(shortbuf, "up "); + + if (updecades) { + pos += sprintf(shortbuf + pos, "%d %s", + updecades, updecades > 1 ? "decades" : "decade"); + comma += 1; + } + + if (upyears) { + pos += sprintf(shortbuf + pos, "%s%d %s", + comma > 0 ? ", " : "", upyears, + upyears > 1 ? "years" : "year"); + comma += 1; + } + + if (upweeks) { + pos += sprintf(shortbuf + pos, "%s%d %s", + comma > 0 ? ", " : "", upweeks, + upweeks > 1 ? "weeks" : "week"); + comma += 1; + } + + if (updays) { + pos += sprintf(shortbuf + pos, "%s%d %s", + comma > 0 ? ", " : "", updays, + updays > 1 ? "days" : "day"); + comma += 1; + } + + if (uphours) { + pos += sprintf(shortbuf + pos, "%s%d %s", + comma > 0 ? ", " : "", uphours, + uphours > 1 ? "hours" : "hour"); + comma += 1; + } + + if (upminutes || (!upminutes && uptime_secs < 60)) { + pos += sprintf(shortbuf + pos, "%s%d %s", + comma > 0 ? ", " : "", upminutes, + upminutes != 1 ? "minutes" : "minute"); + comma += 1; + } + return shortbuf; +} diff --git a/library/version.c b/library/version.c new file mode 100644 index 0000000..eab3404 --- /dev/null +++ b/library/version.c @@ -0,0 +1,71 @@ +/* + * libproc2 - Library to read proc filesystem + * + * Copyright © 2002-2023 Craig Small + * Copyright © 2013-2023 Jim Warner + * Copyright © 2011-2012 Sami Kerola + * Copyright © 2002-2003 Albert Cahalan + * Copyright © 1996 Charles Blake + * Copyright © 1995 Martin Schulze + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include +#include +#include "misc.h" +#include "procps-private.h" + +#ifdef __CYGWIN__ +#define PROCFS_OSRELEASE "/proc/version" +#define PROCFS_OSPATTERN "%*s version %u.%u.%u" +#else +#define PROCFS_OSRELEASE "/proc/sys/kernel/osrelease" +#define PROCFS_OSPATTERN "%u.%u.%u" +#endif + +/* + * procps_linux_version + * + * Return the current running Linux version release as shown in + * the procps filesystem. + * + * There are three ways you can get OS release: + * 1) /proc/sys/kernel/osrelease - returns correct version of procfs + * 2) /proc/version - returns version of kernel e.g. BSD this is wrong + * 3) uname and uts.release - same as /proc/version field #3 + * + * Returns: version as an integer + * Negative value means an error + */ +PROCPS_EXPORT int procps_linux_version(void) +{ + FILE *fp; + char buf[256]; + unsigned int x = 0, y = 0, z = 0; + int version_string_depth; + + if ((fp = fopen(PROCFS_OSRELEASE, "r")) == NULL) + return -errno; + if (fgets(buf, 256, fp) == NULL) { + fclose(fp); + return -EIO; + } + fclose(fp); + version_string_depth = sscanf(buf, PROCFS_OSPATTERN, &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 */ + return -ERANGE; + return LINUX_VERSION(x,y,z); +} diff --git a/library/vmstat.c b/library/vmstat.c new file mode 100644 index 0000000..f9ae715 --- /dev/null +++ b/library/vmstat.c @@ -0,0 +1,1513 @@ +/* + * vmstat.c - virtual memory related definitions for libproc2 + * + * Copyright © 2015-2023 Jim Warner + * Copyright © 2015-2023 Craig Small + * Copyright © 2003 Albert Cahalan + * Copyright © 1996 Charles Blake + * Copyright © 1995 Martin Schulze + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; 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 "procps-private.h" +#include "vmstat.h" + + +#define VMSTAT_FILE "/proc/vmstat" +#define VMSTAT_BUFF 8192 + +/* ------------------------------------------------------------- + + this provision can be used to help ensure that our Item_table | + was synchronized with the enumerators found in the associated | + header file. It's intended to be used locally (& temporarily) | + at least once at some point prior to publishing new releases! | */ +// #define ITEMTABLE_DEBUG //----------------------------------- | +// ------------------------------------------------------------- + + +/* + * Perhaps someday we'll all learn what is in these fields. But | + * that might require available linux documentation progressing | + * beyond a state that was acknowledged in the following thread | + * + * http://www.spinics.net/lists/linux-man/msg09096.html + */ +struct vmstat_data { + unsigned long allocstall_dma; + unsigned long allocstall_dma32; + unsigned long allocstall_high; + unsigned long allocstall_movable; + unsigned long allocstall_normal; + unsigned long balloon_deflate; + unsigned long balloon_inflate; + unsigned long balloon_migrate; + unsigned long compact_daemon_free_scanned; + unsigned long compact_daemon_migrate_scanned; + unsigned long compact_daemon_wake; + unsigned long compact_fail; + unsigned long compact_free_scanned; + unsigned long compact_isolated; + unsigned long compact_migrate_scanned; + unsigned long compact_stall; + unsigned long compact_success; + unsigned long drop_pagecache; + unsigned long drop_slab; + unsigned long htlb_buddy_alloc_fail; + unsigned long htlb_buddy_alloc_success; + unsigned long kswapd_high_wmark_hit_quickly; + unsigned long kswapd_inodesteal; + unsigned long kswapd_low_wmark_hit_quickly; + unsigned long nr_active_anon; + unsigned long nr_active_file; + unsigned long nr_anon_pages; + unsigned long nr_anon_transparent_hugepages; + unsigned long nr_bounce; + unsigned long nr_dirtied; + unsigned long nr_dirty; + unsigned long nr_dirty_background_threshold; + unsigned long nr_dirty_threshold; + unsigned long nr_file_hugepages; + unsigned long nr_file_pages; + unsigned long nr_file_pmdmapped; + unsigned long nr_foll_pin_acquired; + unsigned long nr_foll_pin_released; + unsigned long nr_free_cma; + unsigned long nr_free_pages; + unsigned long nr_inactive_anon; + unsigned long nr_inactive_file; + unsigned long nr_isolated_anon; + unsigned long nr_isolated_file; + unsigned long nr_kernel_misc_reclaimable; + unsigned long nr_kernel_stack; + unsigned long nr_mapped; + unsigned long nr_mlock; + unsigned long nr_page_table_pages; + unsigned long nr_shadow_call_stack; + unsigned long nr_shmem; + unsigned long nr_shmem_hugepages; + unsigned long nr_shmem_pmdmapped; + unsigned long nr_slab_reclaimable; + unsigned long nr_slab_unreclaimable; +/* nr_tlb_local_flush_all; CONFIG_DEBUG_TLBFLUSH only */ +/* nr_tlb_local_flush_one; CONFIG_DEBUG_TLBFLUSH only */ +/* nr_tlb_remote_flush; CONFIG_DEBUG_TLBFLUSH only */ +/* nr_tlb_remote_flush_received; CONFIG_DEBUG_TLBFLUSH only */ + unsigned long nr_unevictable; + unsigned long nr_unstable; + unsigned long nr_vmscan_immediate_reclaim; + unsigned long nr_vmscan_write; + unsigned long nr_writeback; + unsigned long nr_writeback_temp; + unsigned long nr_written; + unsigned long nr_zone_active_anon; + unsigned long nr_zone_active_file; + unsigned long nr_zone_inactive_anon; + unsigned long nr_zone_inactive_file; + unsigned long nr_zone_unevictable; + unsigned long nr_zone_write_pending; + unsigned long nr_zspages; + unsigned long numa_foreign; + unsigned long numa_hint_faults; + unsigned long numa_hint_faults_local; + unsigned long numa_hit; + unsigned long numa_huge_pte_updates; + unsigned long numa_interleave; + unsigned long numa_local; + unsigned long numa_miss; + unsigned long numa_other; + unsigned long numa_pages_migrated; + unsigned long numa_pte_updates; + unsigned long oom_kill; + unsigned long pageoutrun; + unsigned long pgactivate; + unsigned long pgalloc_dma; + unsigned long pgalloc_dma32; + unsigned long pgalloc_high; + unsigned long pgalloc_movable; + unsigned long pgalloc_normal; + unsigned long pgdeactivate; + unsigned long pgfault; + unsigned long pgfree; + unsigned long pginodesteal; + unsigned long pglazyfree; + unsigned long pglazyfreed; + unsigned long pgmajfault; + unsigned long pgmigrate_fail; + unsigned long pgmigrate_success; + unsigned long pgpgin; + unsigned long pgpgout; + unsigned long pgrefill; + unsigned long pgrotated; + unsigned long pgscan_anon; + unsigned long pgscan_direct; + unsigned long pgscan_direct_throttle; + unsigned long pgscan_file; + unsigned long pgscan_kswapd; + unsigned long pgskip_dma; + unsigned long pgskip_dma32; + unsigned long pgskip_high; + unsigned long pgskip_movable; + unsigned long pgskip_normal; + unsigned long pgsteal_anon; + unsigned long pgsteal_direct; + unsigned long pgsteal_file; + unsigned long pgsteal_kswapd; + unsigned long pswpin; + unsigned long pswpout; + unsigned long slabs_scanned; + unsigned long swap_ra; + unsigned long swap_ra_hit; + unsigned long thp_collapse_alloc; + unsigned long thp_collapse_alloc_failed; + unsigned long thp_deferred_split_page; + unsigned long thp_fault_alloc; + unsigned long thp_fault_fallback; + unsigned long thp_fault_fallback_charge; + unsigned long thp_file_alloc; + unsigned long thp_file_fallback; + unsigned long thp_file_fallback_charge; + unsigned long thp_file_mapped; + unsigned long thp_split_page; + unsigned long thp_split_page_failed; + unsigned long thp_split_pmd; + unsigned long thp_split_pud; + unsigned long thp_swpout; + unsigned long thp_swpout_fallback; + unsigned long thp_zero_page_alloc; + unsigned long thp_zero_page_alloc_failed; + unsigned long unevictable_pgs_cleared; + unsigned long unevictable_pgs_culled; + unsigned long unevictable_pgs_mlocked; + unsigned long unevictable_pgs_munlocked; + unsigned long unevictable_pgs_rescued; + unsigned long unevictable_pgs_scanned; + unsigned long unevictable_pgs_stranded; +/* vmacache_find_calls; CONFIG_DEBUG_VM_VMACACHE only */ +/* vmacache_find_hits; CONFIG_DEBUG_VM_VMACACHE only */ + unsigned long workingset_activate; + unsigned long workingset_nodereclaim; + unsigned long workingset_nodes; + unsigned long workingset_refault; + unsigned long workingset_restore; + unsigned long zone_reclaim_failed; +}; + +struct vmstat_hist { + struct vmstat_data new; + struct vmstat_data old; +}; + +struct stacks_extent { + int ext_numstacks; + struct stacks_extent *next; + struct vmstat_stack **stacks; +}; + +struct vmstat_info { + int refcount; + int vmstat_fd; + struct vmstat_hist hist; + int numitems; + enum vmstat_item *items; + struct stacks_extent *extents; + struct hsearch_data hashtab; + struct vmstat_result get_this; + time_t sav_secs; +}; + + +// ___ Results 'Set' Support |||||||||||||||||||||||||||||||||||||||||||||||||| + +#define setNAME(e) set_vmstat_ ## e +#define setDECL(e) static void setNAME(e) \ + (struct vmstat_result *R, struct vmstat_hist *H) + +// regular assignment +#define REG_set(e,x) setDECL(e) { R->result.ul_int = H->new. x; } +// delta assignment +#define HST_set(e,x) setDECL(e) { R->result.sl_int = ( H->new. x - H->old. x ); } + +setDECL(noop) { (void)R; (void)H; } +setDECL(extra) { (void)H; R->result.ul_int = 0; } + +REG_set(ALLOCSTALL_DMA, allocstall_dma) +REG_set(ALLOCSTALL_DMA32, allocstall_dma32) +REG_set(ALLOCSTALL_HIGH, allocstall_high) +REG_set(ALLOCSTALL_MOVABLE, allocstall_movable) +REG_set(ALLOCSTALL_NORMAL, allocstall_normal) +REG_set(BALLOON_DEFLATE, balloon_deflate) +REG_set(BALLOON_INFLATE, balloon_inflate) +REG_set(BALLOON_MIGRATE, balloon_migrate) +REG_set(COMPACT_DAEMON_FREE_SCANNED, compact_daemon_free_scanned) +REG_set(COMPACT_DAEMON_MIGRATE_SCANNED, compact_daemon_migrate_scanned) +REG_set(COMPACT_DAEMON_WAKE, compact_daemon_wake) +REG_set(COMPACT_FAIL, compact_fail) +REG_set(COMPACT_FREE_SCANNED, compact_free_scanned) +REG_set(COMPACT_ISOLATED, compact_isolated) +REG_set(COMPACT_MIGRATE_SCANNED, compact_migrate_scanned) +REG_set(COMPACT_STALL, compact_stall) +REG_set(COMPACT_SUCCESS, compact_success) +REG_set(DROP_PAGECACHE, drop_pagecache) +REG_set(DROP_SLAB, drop_slab) +REG_set(HTLB_BUDDY_ALLOC_FAIL, htlb_buddy_alloc_fail) +REG_set(HTLB_BUDDY_ALLOC_SUCCESS, htlb_buddy_alloc_success) +REG_set(KSWAPD_HIGH_WMARK_HIT_QUICKLY, kswapd_high_wmark_hit_quickly) +REG_set(KSWAPD_INODESTEAL, kswapd_inodesteal) +REG_set(KSWAPD_LOW_WMARK_HIT_QUICKLY, kswapd_low_wmark_hit_quickly) +REG_set(NR_ACTIVE_ANON, nr_active_anon) +REG_set(NR_ACTIVE_FILE, nr_active_file) +REG_set(NR_ANON_PAGES, nr_anon_pages) +REG_set(NR_ANON_TRANSPARENT_HUGEPAGES, nr_anon_transparent_hugepages) +REG_set(NR_BOUNCE, nr_bounce) +REG_set(NR_DIRTIED, nr_dirtied) +REG_set(NR_DIRTY, nr_dirty) +REG_set(NR_DIRTY_BACKGROUND_THRESHOLD, nr_dirty_background_threshold) +REG_set(NR_DIRTY_THRESHOLD, nr_dirty_threshold) +REG_set(NR_FILE_HUGEPAGES, nr_file_hugepages) +REG_set(NR_FILE_PAGES, nr_file_pages) +REG_set(NR_FILE_PMDMAPPED, nr_file_pmdmapped) +REG_set(NR_FOLL_PIN_ACQUIRED, nr_foll_pin_acquired) +REG_set(NR_FOLL_PIN_RELEASED, nr_foll_pin_released) +REG_set(NR_FREE_CMA, nr_free_cma) +REG_set(NR_FREE_PAGES, nr_free_pages) +REG_set(NR_INACTIVE_ANON, nr_inactive_anon) +REG_set(NR_INACTIVE_FILE, nr_inactive_file) +REG_set(NR_ISOLATED_ANON, nr_isolated_anon) +REG_set(NR_ISOLATED_FILE, nr_isolated_file) +REG_set(NR_KERNEL_MISC_RECLAIMABLE, nr_kernel_misc_reclaimable) +REG_set(NR_KERNEL_STACK, nr_kernel_stack) +REG_set(NR_MAPPED, nr_mapped) +REG_set(NR_MLOCK, nr_mlock) +REG_set(NR_PAGE_TABLE_PAGES, nr_page_table_pages) +REG_set(NR_SHADOW_CALL_STACK, nr_shadow_call_stack) +REG_set(NR_SHMEM, nr_shmem) +REG_set(NR_SHMEM_HUGEPAGES, nr_shmem_hugepages) +REG_set(NR_SHMEM_PMDMAPPED, nr_shmem_pmdmapped) +REG_set(NR_SLAB_RECLAIMABLE, nr_slab_reclaimable) +REG_set(NR_SLAB_UNRECLAIMABLE, nr_slab_unreclaimable) +REG_set(NR_UNEVICTABLE, nr_unevictable) +REG_set(NR_UNSTABLE, nr_unstable) +REG_set(NR_VMSCAN_IMMEDIATE_RECLAIM, nr_vmscan_immediate_reclaim) +REG_set(NR_VMSCAN_WRITE, nr_vmscan_write) +REG_set(NR_WRITEBACK, nr_writeback) +REG_set(NR_WRITEBACK_TEMP, nr_writeback_temp) +REG_set(NR_WRITTEN, nr_written) +REG_set(NR_ZONE_ACTIVE_ANON, nr_zone_active_anon) +REG_set(NR_ZONE_ACTIVE_FILE, nr_zone_active_file) +REG_set(NR_ZONE_INACTIVE_ANON, nr_zone_inactive_anon) +REG_set(NR_ZONE_INACTIVE_FILE, nr_zone_inactive_file) +REG_set(NR_ZONE_UNEVICTABLE, nr_zone_unevictable) +REG_set(NR_ZONE_WRITE_PENDING, nr_zone_write_pending) +REG_set(NR_ZSPAGES, nr_zspages) +REG_set(NUMA_FOREIGN, numa_foreign) +REG_set(NUMA_HINT_FAULTS, numa_hint_faults) +REG_set(NUMA_HINT_FAULTS_LOCAL, numa_hint_faults_local) +REG_set(NUMA_HIT, numa_hit) +REG_set(NUMA_HUGE_PTE_UPDATES, numa_huge_pte_updates) +REG_set(NUMA_INTERLEAVE, numa_interleave) +REG_set(NUMA_LOCAL, numa_local) +REG_set(NUMA_MISS, numa_miss) +REG_set(NUMA_OTHER, numa_other) +REG_set(NUMA_PAGES_MIGRATED, numa_pages_migrated) +REG_set(NUMA_PTE_UPDATES, numa_pte_updates) +REG_set(OOM_KILL, oom_kill) +REG_set(PAGEOUTRUN, pageoutrun) +REG_set(PGACTIVATE, pgactivate) +REG_set(PGALLOC_DMA, pgalloc_dma) +REG_set(PGALLOC_DMA32, pgalloc_dma32) +REG_set(PGALLOC_HIGH, pgalloc_high) +REG_set(PGALLOC_MOVABLE, pgalloc_movable) +REG_set(PGALLOC_NORMAL, pgalloc_normal) +REG_set(PGDEACTIVATE, pgdeactivate) +REG_set(PGFAULT, pgfault) +REG_set(PGFREE, pgfree) +REG_set(PGINODESTEAL, pginodesteal) +REG_set(PGLAZYFREE, pglazyfree) +REG_set(PGLAZYFREED, pglazyfreed) +REG_set(PGMAJFAULT, pgmajfault) +REG_set(PGMIGRATE_FAIL, pgmigrate_fail) +REG_set(PGMIGRATE_SUCCESS, pgmigrate_success) +REG_set(PGPGIN, pgpgin) +REG_set(PGPGOUT, pgpgout) +REG_set(PGREFILL, pgrefill) +REG_set(PGROTATED, pgrotated) +REG_set(PGSCAN_ANON, pgscan_anon) +REG_set(PGSCAN_DIRECT, pgscan_direct) +REG_set(PGSCAN_DIRECT_THROTTLE, pgscan_direct_throttle) +REG_set(PGSCAN_FILE, pgscan_file) +REG_set(PGSCAN_KSWAPD, pgscan_kswapd) +REG_set(PGSKIP_DMA, pgskip_dma) +REG_set(PGSKIP_DMA32, pgskip_dma32) +REG_set(PGSKIP_HIGH, pgskip_high) +REG_set(PGSKIP_MOVABLE, pgskip_movable) +REG_set(PGSKIP_NORMAL, pgskip_normal) +REG_set(PGSTEAL_ANON, pgsteal_anon) +REG_set(PGSTEAL_DIRECT, pgsteal_direct) +REG_set(PGSTEAL_FILE, pgsteal_file) +REG_set(PGSTEAL_KSWAPD, pgsteal_kswapd) +REG_set(PSWPIN, pswpin) +REG_set(PSWPOUT, pswpout) +REG_set(SLABS_SCANNED, slabs_scanned) +REG_set(SWAP_RA, swap_ra) +REG_set(SWAP_RA_HIT, swap_ra_hit) +REG_set(THP_COLLAPSE_ALLOC, thp_collapse_alloc) +REG_set(THP_COLLAPSE_ALLOC_FAILED, thp_collapse_alloc_failed) +REG_set(THP_DEFERRED_SPLIT_PAGE, thp_deferred_split_page) +REG_set(THP_FAULT_ALLOC, thp_fault_alloc) +REG_set(THP_FAULT_FALLBACK, thp_fault_fallback) +REG_set(THP_FAULT_FALLBACK_CHARGE, thp_fault_fallback_charge) +REG_set(THP_FILE_ALLOC, thp_file_alloc) +REG_set(THP_FILE_FALLBACK, thp_file_fallback) +REG_set(THP_FILE_FALLBACK_CHARGE, thp_file_fallback_charge) +REG_set(THP_FILE_MAPPED, thp_file_mapped) +REG_set(THP_SPLIT_PAGE, thp_split_page) +REG_set(THP_SPLIT_PAGE_FAILED, thp_split_page_failed) +REG_set(THP_SPLIT_PMD, thp_split_pmd) +REG_set(THP_SPLIT_PUD, thp_split_pud) +REG_set(THP_SWPOUT, thp_swpout) +REG_set(THP_SWPOUT_FALLBACK, thp_swpout_fallback) +REG_set(THP_ZERO_PAGE_ALLOC, thp_zero_page_alloc) +REG_set(THP_ZERO_PAGE_ALLOC_FAILED, thp_zero_page_alloc_failed) +REG_set(UNEVICTABLE_PGS_CLEARED, unevictable_pgs_cleared) +REG_set(UNEVICTABLE_PGS_CULLED, unevictable_pgs_culled) +REG_set(UNEVICTABLE_PGS_MLOCKED, unevictable_pgs_mlocked) +REG_set(UNEVICTABLE_PGS_MUNLOCKED, unevictable_pgs_munlocked) +REG_set(UNEVICTABLE_PGS_RESCUED, unevictable_pgs_rescued) +REG_set(UNEVICTABLE_PGS_SCANNED, unevictable_pgs_scanned) +REG_set(UNEVICTABLE_PGS_STRANDED, unevictable_pgs_stranded) +REG_set(WORKINGSET_ACTIVATE, workingset_activate) +REG_set(WORKINGSET_NODERECLAIM, workingset_nodereclaim) +REG_set(WORKINGSET_NODES, workingset_nodes) +REG_set(WORKINGSET_REFAULT, workingset_refault) +REG_set(WORKINGSET_RESTORE, workingset_restore) +REG_set(ZONE_RECLAIM_FAILED, zone_reclaim_failed) + +HST_set(DELTA_ALLOCSTALL_DMA, allocstall_dma) +HST_set(DELTA_ALLOCSTALL_DMA32, allocstall_dma32) +HST_set(DELTA_ALLOCSTALL_HIGH, allocstall_high) +HST_set(DELTA_ALLOCSTALL_MOVABLE, allocstall_movable) +HST_set(DELTA_ALLOCSTALL_NORMAL, allocstall_normal) +HST_set(DELTA_BALLOON_DEFLATE, balloon_deflate) +HST_set(DELTA_BALLOON_INFLATE, balloon_inflate) +HST_set(DELTA_BALLOON_MIGRATE, balloon_migrate) +HST_set(DELTA_COMPACT_DAEMON_FREE_SCANNED, compact_daemon_free_scanned) +HST_set(DELTA_COMPACT_DAEMON_MIGRATE_SCANNED, compact_daemon_migrate_scanned) +HST_set(DELTA_COMPACT_DAEMON_WAKE, compact_daemon_wake) +HST_set(DELTA_COMPACT_FAIL, compact_fail) +HST_set(DELTA_COMPACT_FREE_SCANNED, compact_free_scanned) +HST_set(DELTA_COMPACT_ISOLATED, compact_isolated) +HST_set(DELTA_COMPACT_MIGRATE_SCANNED, compact_migrate_scanned) +HST_set(DELTA_COMPACT_STALL, compact_stall) +HST_set(DELTA_COMPACT_SUCCESS, compact_success) +HST_set(DELTA_DROP_PAGECACHE, drop_pagecache) +HST_set(DELTA_DROP_SLAB, drop_slab) +HST_set(DELTA_HTLB_BUDDY_ALLOC_FAIL, htlb_buddy_alloc_fail) +HST_set(DELTA_HTLB_BUDDY_ALLOC_SUCCESS, htlb_buddy_alloc_success) +HST_set(DELTA_KSWAPD_HIGH_WMARK_HIT_QUICKLY, kswapd_high_wmark_hit_quickly) +HST_set(DELTA_KSWAPD_INODESTEAL, kswapd_inodesteal) +HST_set(DELTA_KSWAPD_LOW_WMARK_HIT_QUICKLY, kswapd_low_wmark_hit_quickly) +HST_set(DELTA_NR_ACTIVE_ANON, nr_active_anon) +HST_set(DELTA_NR_ACTIVE_FILE, nr_active_file) +HST_set(DELTA_NR_ANON_PAGES, nr_anon_pages) +HST_set(DELTA_NR_ANON_TRANSPARENT_HUGEPAGES, nr_anon_transparent_hugepages) +HST_set(DELTA_NR_BOUNCE, nr_bounce) +HST_set(DELTA_NR_DIRTIED, nr_dirtied) +HST_set(DELTA_NR_DIRTY, nr_dirty) +HST_set(DELTA_NR_DIRTY_BACKGROUND_THRESHOLD, nr_dirty_background_threshold) +HST_set(DELTA_NR_DIRTY_THRESHOLD, nr_dirty_threshold) +HST_set(DELTA_NR_FILE_HUGEPAGES, nr_file_hugepages) +HST_set(DELTA_NR_FILE_PAGES, nr_file_pages) +HST_set(DELTA_NR_FILE_PMDMAPPED, nr_file_pmdmapped) +HST_set(DELTA_NR_FOLL_PIN_ACQUIRED, nr_foll_pin_acquired) +HST_set(DELTA_NR_FOLL_PIN_RELEASED, nr_foll_pin_released) +HST_set(DELTA_NR_FREE_CMA, nr_free_cma) +HST_set(DELTA_NR_FREE_PAGES, nr_free_pages) +HST_set(DELTA_NR_INACTIVE_ANON, nr_inactive_anon) +HST_set(DELTA_NR_INACTIVE_FILE, nr_inactive_file) +HST_set(DELTA_NR_ISOLATED_ANON, nr_isolated_anon) +HST_set(DELTA_NR_ISOLATED_FILE, nr_isolated_file) +HST_set(DELTA_NR_KERNEL_MISC_RECLAIMABLE, nr_kernel_misc_reclaimable) +HST_set(DELTA_NR_KERNEL_STACK, nr_kernel_stack) +HST_set(DELTA_NR_MAPPED, nr_mapped) +HST_set(DELTA_NR_MLOCK, nr_mlock) +HST_set(DELTA_NR_PAGE_TABLE_PAGES, nr_page_table_pages) +HST_set(DELTA_NR_SHADOW_CALL_STACK, nr_shadow_call_stack) +HST_set(DELTA_NR_SHMEM, nr_shmem) +HST_set(DELTA_NR_SHMEM_HUGEPAGES, nr_shmem_hugepages) +HST_set(DELTA_NR_SHMEM_PMDMAPPED, nr_shmem_pmdmapped) +HST_set(DELTA_NR_SLAB_RECLAIMABLE, nr_slab_reclaimable) +HST_set(DELTA_NR_SLAB_UNRECLAIMABLE, nr_slab_unreclaimable) +HST_set(DELTA_NR_UNEVICTABLE, nr_unevictable) +HST_set(DELTA_NR_UNSTABLE, nr_unstable) +HST_set(DELTA_NR_VMSCAN_IMMEDIATE_RECLAIM, nr_vmscan_immediate_reclaim) +HST_set(DELTA_NR_VMSCAN_WRITE, nr_vmscan_write) +HST_set(DELTA_NR_WRITEBACK, nr_writeback) +HST_set(DELTA_NR_WRITEBACK_TEMP, nr_writeback_temp) +HST_set(DELTA_NR_WRITTEN, nr_written) +HST_set(DELTA_NR_ZONE_ACTIVE_ANON, nr_zone_active_anon) +HST_set(DELTA_NR_ZONE_ACTIVE_FILE, nr_zone_active_file) +HST_set(DELTA_NR_ZONE_INACTIVE_ANON, nr_zone_inactive_anon) +HST_set(DELTA_NR_ZONE_INACTIVE_FILE, nr_zone_inactive_file) +HST_set(DELTA_NR_ZONE_UNEVICTABLE, nr_zone_unevictable) +HST_set(DELTA_NR_ZONE_WRITE_PENDING, nr_zone_write_pending) +HST_set(DELTA_NR_ZSPAGES, nr_zspages) +HST_set(DELTA_NUMA_FOREIGN, numa_foreign) +HST_set(DELTA_NUMA_HINT_FAULTS, numa_hint_faults) +HST_set(DELTA_NUMA_HINT_FAULTS_LOCAL, numa_hint_faults_local) +HST_set(DELTA_NUMA_HIT, numa_hit) +HST_set(DELTA_NUMA_HUGE_PTE_UPDATES, numa_huge_pte_updates) +HST_set(DELTA_NUMA_INTERLEAVE, numa_interleave) +HST_set(DELTA_NUMA_LOCAL, numa_local) +HST_set(DELTA_NUMA_MISS, numa_miss) +HST_set(DELTA_NUMA_OTHER, numa_other) +HST_set(DELTA_NUMA_PAGES_MIGRATED, numa_pages_migrated) +HST_set(DELTA_NUMA_PTE_UPDATES, numa_pte_updates) +HST_set(DELTA_OOM_KILL, oom_kill) +HST_set(DELTA_PAGEOUTRUN, pageoutrun) +HST_set(DELTA_PGACTIVATE, pgactivate) +HST_set(DELTA_PGALLOC_DMA, pgalloc_dma) +HST_set(DELTA_PGALLOC_DMA32, pgalloc_dma32) +HST_set(DELTA_PGALLOC_HIGH, pgalloc_high) +HST_set(DELTA_PGALLOC_MOVABLE, pgalloc_movable) +HST_set(DELTA_PGALLOC_NORMAL, pgalloc_normal) +HST_set(DELTA_PGDEACTIVATE, pgdeactivate) +HST_set(DELTA_PGFAULT, pgfault) +HST_set(DELTA_PGFREE, pgfree) +HST_set(DELTA_PGINODESTEAL, pginodesteal) +HST_set(DELTA_PGLAZYFREE, pglazyfree) +HST_set(DELTA_PGLAZYFREED, pglazyfreed) +HST_set(DELTA_PGMAJFAULT, pgmajfault) +HST_set(DELTA_PGMIGRATE_FAIL, pgmigrate_fail) +HST_set(DELTA_PGMIGRATE_SUCCESS, pgmigrate_success) +HST_set(DELTA_PGPGIN, pgpgin) +HST_set(DELTA_PGPGOUT, pgpgout) +HST_set(DELTA_PGREFILL, pgrefill) +HST_set(DELTA_PGROTATED, pgrotated) +HST_set(DELTA_PGSCAN_ANON, pgscan_anon) +HST_set(DELTA_PGSCAN_DIRECT, pgscan_direct) +HST_set(DELTA_PGSCAN_DIRECT_THROTTLE, pgscan_direct_throttle) +HST_set(DELTA_PGSCAN_FILE, pgscan_file) +HST_set(DELTA_PGSCAN_KSWAPD, pgscan_kswapd) +HST_set(DELTA_PGSKIP_DMA, pgskip_dma) +HST_set(DELTA_PGSKIP_DMA32, pgskip_dma32) +HST_set(DELTA_PGSKIP_HIGH, pgskip_high) +HST_set(DELTA_PGSKIP_MOVABLE, pgskip_movable) +HST_set(DELTA_PGSKIP_NORMAL, pgskip_normal) +HST_set(DELTA_PGSTEAL_ANON, pgsteal_anon) +HST_set(DELTA_PGSTEAL_DIRECT, pgsteal_direct) +HST_set(DELTA_PGSTEAL_FILE, pgsteal_file) +HST_set(DELTA_PGSTEAL_KSWAPD, pgsteal_kswapd) +HST_set(DELTA_PSWPIN, pswpin) +HST_set(DELTA_PSWPOUT, pswpout) +HST_set(DELTA_SLABS_SCANNED, slabs_scanned) +HST_set(DELTA_SWAP_RA, swap_ra) +HST_set(DELTA_SWAP_RA_HIT, swap_ra_hit) +HST_set(DELTA_THP_COLLAPSE_ALLOC, thp_collapse_alloc) +HST_set(DELTA_THP_COLLAPSE_ALLOC_FAILED, thp_collapse_alloc_failed) +HST_set(DELTA_THP_DEFERRED_SPLIT_PAGE, thp_deferred_split_page) +HST_set(DELTA_THP_FAULT_ALLOC, thp_fault_alloc) +HST_set(DELTA_THP_FAULT_FALLBACK, thp_fault_fallback) +HST_set(DELTA_THP_FAULT_FALLBACK_CHARGE, thp_fault_fallback_charge) +HST_set(DELTA_THP_FILE_ALLOC, thp_file_alloc) +HST_set(DELTA_THP_FILE_FALLBACK, thp_file_fallback) +HST_set(DELTA_THP_FILE_FALLBACK_CHARGE, thp_file_fallback_charge) +HST_set(DELTA_THP_FILE_MAPPED, thp_file_mapped) +HST_set(DELTA_THP_SPLIT_PAGE, thp_split_page) +HST_set(DELTA_THP_SPLIT_PAGE_FAILED, thp_split_page_failed) +HST_set(DELTA_THP_SPLIT_PMD, thp_split_pmd) +HST_set(DELTA_THP_SPLIT_PUD, thp_split_pud) +HST_set(DELTA_THP_SWPOUT, thp_swpout) +HST_set(DELTA_THP_SWPOUT_FALLBACK, thp_swpout_fallback) +HST_set(DELTA_THP_ZERO_PAGE_ALLOC, thp_zero_page_alloc) +HST_set(DELTA_THP_ZERO_PAGE_ALLOC_FAILED, thp_zero_page_alloc_failed) +HST_set(DELTA_UNEVICTABLE_PGS_CLEARED, unevictable_pgs_cleared) +HST_set(DELTA_UNEVICTABLE_PGS_CULLED, unevictable_pgs_culled) +HST_set(DELTA_UNEVICTABLE_PGS_MLOCKED, unevictable_pgs_mlocked) +HST_set(DELTA_UNEVICTABLE_PGS_MUNLOCKED, unevictable_pgs_munlocked) +HST_set(DELTA_UNEVICTABLE_PGS_RESCUED, unevictable_pgs_rescued) +HST_set(DELTA_UNEVICTABLE_PGS_SCANNED, unevictable_pgs_scanned) +HST_set(DELTA_UNEVICTABLE_PGS_STRANDED, unevictable_pgs_stranded) +HST_set(DELTA_WORKINGSET_ACTIVATE, workingset_activate) +HST_set(DELTA_WORKINGSET_NODERECLAIM, workingset_nodereclaim) +HST_set(DELTA_WORKINGSET_NODES, workingset_nodes) +HST_set(DELTA_WORKINGSET_REFAULT, workingset_refault) +HST_set(DELTA_WORKINGSET_RESTORE, workingset_restore) +HST_set(DELTA_ZONE_RECLAIM_FAILED, zone_reclaim_failed) + +#undef setDECL +#undef REG_set +#undef HST_set + + +// ___ Controlling Table |||||||||||||||||||||||||||||||||||||||||||||||||||||| + +typedef void (*SET_t)(struct vmstat_result *, struct vmstat_hist *); +#ifdef ITEMTABLE_DEBUG +#define RS(e) (SET_t)setNAME(e), VMSTAT_ ## e, STRINGIFY(VMSTAT_ ## e) +#else +#define RS(e) (SET_t)setNAME(e) +#endif + +#define TS(t) STRINGIFY(t) +#define TS_noop "" + + /* + * Need it be said? + * This table must be kept in the exact same order as + * those 'enum vmstat_item' guys ! */ +static struct { + SET_t setsfunc; // the actual result setting routine +#ifdef ITEMTABLE_DEBUG + int enumnumb; // enumerator (must match position!) + char *enum2str; // enumerator name as a char* string +#endif + char *type2str; // the result type as a string value +} Item_table[] = { +/* setsfunc type2str + ----------------------------------------- ---------- */ + { RS(noop), TS_noop }, + { RS(extra), TS_noop }, + + { RS(ALLOCSTALL_DMA), TS(ul_int) }, + { RS(ALLOCSTALL_DMA32), TS(ul_int) }, + { RS(ALLOCSTALL_HIGH), TS(ul_int) }, + { RS(ALLOCSTALL_MOVABLE), TS(ul_int) }, + { RS(ALLOCSTALL_NORMAL), TS(ul_int) }, + { RS(BALLOON_DEFLATE), TS(ul_int) }, + { RS(BALLOON_INFLATE), TS(ul_int) }, + { RS(BALLOON_MIGRATE), TS(ul_int) }, + { RS(COMPACT_DAEMON_FREE_SCANNED), TS(ul_int) }, + { RS(COMPACT_DAEMON_MIGRATE_SCANNED), TS(ul_int) }, + { RS(COMPACT_DAEMON_WAKE), TS(ul_int) }, + { RS(COMPACT_FAIL), TS(ul_int) }, + { RS(COMPACT_FREE_SCANNED), TS(ul_int) }, + { RS(COMPACT_ISOLATED), TS(ul_int) }, + { RS(COMPACT_MIGRATE_SCANNED), TS(ul_int) }, + { RS(COMPACT_STALL), TS(ul_int) }, + { RS(COMPACT_SUCCESS), TS(ul_int) }, + { RS(DROP_PAGECACHE), TS(ul_int) }, + { RS(DROP_SLAB), TS(ul_int) }, + { RS(HTLB_BUDDY_ALLOC_FAIL), TS(ul_int) }, + { RS(HTLB_BUDDY_ALLOC_SUCCESS), TS(ul_int) }, + { RS(KSWAPD_HIGH_WMARK_HIT_QUICKLY), TS(ul_int) }, + { RS(KSWAPD_INODESTEAL), TS(ul_int) }, + { RS(KSWAPD_LOW_WMARK_HIT_QUICKLY), TS(ul_int) }, + { RS(NR_ACTIVE_ANON), TS(ul_int) }, + { RS(NR_ACTIVE_FILE), TS(ul_int) }, + { RS(NR_ANON_PAGES), TS(ul_int) }, + { RS(NR_ANON_TRANSPARENT_HUGEPAGES), TS(ul_int) }, + { RS(NR_BOUNCE), TS(ul_int) }, + { RS(NR_DIRTIED), TS(ul_int) }, + { RS(NR_DIRTY), TS(ul_int) }, + { RS(NR_DIRTY_BACKGROUND_THRESHOLD), TS(ul_int) }, + { RS(NR_DIRTY_THRESHOLD), TS(ul_int) }, + { RS(NR_FILE_HUGEPAGES), TS(ul_int) }, + { RS(NR_FILE_PAGES), TS(ul_int) }, + { RS(NR_FILE_PMDMAPPED), TS(ul_int) }, + { RS(NR_FOLL_PIN_ACQUIRED), TS(ul_int) }, + { RS(NR_FOLL_PIN_RELEASED), TS(ul_int) }, + { RS(NR_FREE_CMA), TS(ul_int) }, + { RS(NR_FREE_PAGES), TS(ul_int) }, + { RS(NR_INACTIVE_ANON), TS(ul_int) }, + { RS(NR_INACTIVE_FILE), TS(ul_int) }, + { RS(NR_ISOLATED_ANON), TS(ul_int) }, + { RS(NR_ISOLATED_FILE), TS(ul_int) }, + { RS(NR_KERNEL_MISC_RECLAIMABLE), TS(ul_int) }, + { RS(NR_KERNEL_STACK), TS(ul_int) }, + { RS(NR_MAPPED), TS(ul_int) }, + { RS(NR_MLOCK), TS(ul_int) }, + { RS(NR_PAGE_TABLE_PAGES), TS(ul_int) }, + { RS(NR_SHADOW_CALL_STACK), TS(ul_int) }, + { RS(NR_SHMEM), TS(ul_int) }, + { RS(NR_SHMEM_HUGEPAGES), TS(ul_int) }, + { RS(NR_SHMEM_PMDMAPPED), TS(ul_int) }, + { RS(NR_SLAB_RECLAIMABLE), TS(ul_int) }, + { RS(NR_SLAB_UNRECLAIMABLE), TS(ul_int) }, + { RS(NR_UNEVICTABLE), TS(ul_int) }, + { RS(NR_UNSTABLE), TS(ul_int) }, + { RS(NR_VMSCAN_IMMEDIATE_RECLAIM), TS(ul_int) }, + { RS(NR_VMSCAN_WRITE), TS(ul_int) }, + { RS(NR_WRITEBACK), TS(ul_int) }, + { RS(NR_WRITEBACK_TEMP), TS(ul_int) }, + { RS(NR_WRITTEN), TS(ul_int) }, + { RS(NR_ZONE_ACTIVE_ANON), TS(ul_int) }, + { RS(NR_ZONE_ACTIVE_FILE), TS(ul_int) }, + { RS(NR_ZONE_INACTIVE_ANON), TS(ul_int) }, + { RS(NR_ZONE_INACTIVE_FILE), TS(ul_int) }, + { RS(NR_ZONE_UNEVICTABLE), TS(ul_int) }, + { RS(NR_ZONE_WRITE_PENDING), TS(ul_int) }, + { RS(NR_ZSPAGES), TS(ul_int) }, + { RS(NUMA_FOREIGN), TS(ul_int) }, + { RS(NUMA_HINT_FAULTS), TS(ul_int) }, + { RS(NUMA_HINT_FAULTS_LOCAL), TS(ul_int) }, + { RS(NUMA_HIT), TS(ul_int) }, + { RS(NUMA_HUGE_PTE_UPDATES), TS(ul_int) }, + { RS(NUMA_INTERLEAVE), TS(ul_int) }, + { RS(NUMA_LOCAL), TS(ul_int) }, + { RS(NUMA_MISS), TS(ul_int) }, + { RS(NUMA_OTHER), TS(ul_int) }, + { RS(NUMA_PAGES_MIGRATED), TS(ul_int) }, + { RS(NUMA_PTE_UPDATES), TS(ul_int) }, + { RS(OOM_KILL), TS(ul_int) }, + { RS(PAGEOUTRUN), TS(ul_int) }, + { RS(PGACTIVATE), TS(ul_int) }, + { RS(PGALLOC_DMA), TS(ul_int) }, + { RS(PGALLOC_DMA32), TS(ul_int) }, + { RS(PGALLOC_HIGH), TS(ul_int) }, + { RS(PGALLOC_MOVABLE), TS(ul_int) }, + { RS(PGALLOC_NORMAL), TS(ul_int) }, + { RS(PGDEACTIVATE), TS(ul_int) }, + { RS(PGFAULT), TS(ul_int) }, + { RS(PGFREE), TS(ul_int) }, + { RS(PGINODESTEAL), TS(ul_int) }, + { RS(PGLAZYFREE), TS(ul_int) }, + { RS(PGLAZYFREED), TS(ul_int) }, + { RS(PGMAJFAULT), TS(ul_int) }, + { RS(PGMIGRATE_FAIL), TS(ul_int) }, + { RS(PGMIGRATE_SUCCESS), TS(ul_int) }, + { RS(PGPGIN), TS(ul_int) }, + { RS(PGPGOUT), TS(ul_int) }, + { RS(PGREFILL), TS(ul_int) }, + { RS(PGROTATED), TS(ul_int) }, + { RS(PGSCAN_ANON), TS(ul_int) }, + { RS(PGSCAN_DIRECT), TS(ul_int) }, + { RS(PGSCAN_DIRECT_THROTTLE), TS(ul_int) }, + { RS(PGSCAN_FILE), TS(ul_int) }, + { RS(PGSCAN_KSWAPD), TS(ul_int) }, + { RS(PGSKIP_DMA), TS(ul_int) }, + { RS(PGSKIP_DMA32), TS(ul_int) }, + { RS(PGSKIP_HIGH), TS(ul_int) }, + { RS(PGSKIP_MOVABLE), TS(ul_int) }, + { RS(PGSKIP_NORMAL), TS(ul_int) }, + { RS(PGSTEAL_ANON), TS(ul_int) }, + { RS(PGSTEAL_DIRECT), TS(ul_int) }, + { RS(PGSTEAL_FILE), TS(ul_int) }, + { RS(PGSTEAL_KSWAPD), TS(ul_int) }, + { RS(PSWPIN), TS(ul_int) }, + { RS(PSWPOUT), TS(ul_int) }, + { RS(SLABS_SCANNED), TS(ul_int) }, + { RS(SWAP_RA), TS(ul_int) }, + { RS(SWAP_RA_HIT), TS(ul_int) }, + { RS(THP_COLLAPSE_ALLOC), TS(ul_int) }, + { RS(THP_COLLAPSE_ALLOC_FAILED), TS(ul_int) }, + { RS(THP_DEFERRED_SPLIT_PAGE), TS(ul_int) }, + { RS(THP_FAULT_ALLOC), TS(ul_int) }, + { RS(THP_FAULT_FALLBACK), TS(ul_int) }, + { RS(THP_FAULT_FALLBACK_CHARGE), TS(ul_int) }, + { RS(THP_FILE_ALLOC), TS(ul_int) }, + { RS(THP_FILE_FALLBACK), TS(ul_int) }, + { RS(THP_FILE_FALLBACK_CHARGE), TS(ul_int) }, + { RS(THP_FILE_MAPPED), TS(ul_int) }, + { RS(THP_SPLIT_PAGE), TS(ul_int) }, + { RS(THP_SPLIT_PAGE_FAILED), TS(ul_int) }, + { RS(THP_SPLIT_PMD), TS(ul_int) }, + { RS(THP_SPLIT_PUD), TS(ul_int) }, + { RS(THP_SWPOUT), TS(ul_int) }, + { RS(THP_SWPOUT_FALLBACK), TS(ul_int) }, + { RS(THP_ZERO_PAGE_ALLOC), TS(ul_int) }, + { RS(THP_ZERO_PAGE_ALLOC_FAILED), TS(ul_int) }, + { RS(UNEVICTABLE_PGS_CLEARED), TS(ul_int) }, + { RS(UNEVICTABLE_PGS_CULLED), TS(ul_int) }, + { RS(UNEVICTABLE_PGS_MLOCKED), TS(ul_int) }, + { RS(UNEVICTABLE_PGS_MUNLOCKED), TS(ul_int) }, + { RS(UNEVICTABLE_PGS_RESCUED), TS(ul_int) }, + { RS(UNEVICTABLE_PGS_SCANNED), TS(ul_int) }, + { RS(UNEVICTABLE_PGS_STRANDED), TS(ul_int) }, + { RS(WORKINGSET_ACTIVATE), TS(ul_int) }, + { RS(WORKINGSET_NODERECLAIM), TS(ul_int) }, + { RS(WORKINGSET_NODES), TS(ul_int) }, + { RS(WORKINGSET_REFAULT), TS(ul_int) }, + { RS(WORKINGSET_RESTORE), TS(ul_int) }, + { RS(ZONE_RECLAIM_FAILED), TS(ul_int) }, + + { RS(DELTA_ALLOCSTALL_DMA), TS(sl_int) }, + { RS(DELTA_ALLOCSTALL_DMA32), TS(sl_int) }, + { RS(DELTA_ALLOCSTALL_HIGH), TS(sl_int) }, + { RS(DELTA_ALLOCSTALL_MOVABLE), TS(sl_int) }, + { RS(DELTA_ALLOCSTALL_NORMAL), TS(sl_int) }, + { RS(DELTA_BALLOON_DEFLATE), TS(sl_int) }, + { RS(DELTA_BALLOON_INFLATE), TS(sl_int) }, + { RS(DELTA_BALLOON_MIGRATE), TS(sl_int) }, + { RS(DELTA_COMPACT_DAEMON_FREE_SCANNED), TS(sl_int) }, + { RS(DELTA_COMPACT_DAEMON_MIGRATE_SCANNED), TS(sl_int) }, + { RS(DELTA_COMPACT_DAEMON_WAKE), TS(sl_int) }, + { RS(DELTA_COMPACT_FAIL), TS(sl_int) }, + { RS(DELTA_COMPACT_FREE_SCANNED), TS(sl_int) }, + { RS(DELTA_COMPACT_ISOLATED), TS(sl_int) }, + { RS(DELTA_COMPACT_MIGRATE_SCANNED), TS(sl_int) }, + { RS(DELTA_COMPACT_STALL), TS(sl_int) }, + { RS(DELTA_COMPACT_SUCCESS), TS(sl_int) }, + { RS(DELTA_DROP_PAGECACHE), TS(sl_int) }, + { RS(DELTA_DROP_SLAB), TS(sl_int) }, + { RS(DELTA_HTLB_BUDDY_ALLOC_FAIL), TS(sl_int) }, + { RS(DELTA_HTLB_BUDDY_ALLOC_SUCCESS), TS(sl_int) }, + { RS(DELTA_KSWAPD_HIGH_WMARK_HIT_QUICKLY), TS(sl_int) }, + { RS(DELTA_KSWAPD_INODESTEAL), TS(sl_int) }, + { RS(DELTA_KSWAPD_LOW_WMARK_HIT_QUICKLY), TS(sl_int) }, + { RS(DELTA_NR_ACTIVE_ANON), TS(sl_int) }, + { RS(DELTA_NR_ACTIVE_FILE), TS(sl_int) }, + { RS(DELTA_NR_ANON_PAGES), TS(sl_int) }, + { RS(DELTA_NR_ANON_TRANSPARENT_HUGEPAGES), TS(sl_int) }, + { RS(DELTA_NR_BOUNCE), TS(sl_int) }, + { RS(DELTA_NR_DIRTIED), TS(sl_int) }, + { RS(DELTA_NR_DIRTY), TS(sl_int) }, + { RS(DELTA_NR_DIRTY_BACKGROUND_THRESHOLD), TS(sl_int) }, + { RS(DELTA_NR_DIRTY_THRESHOLD), TS(sl_int) }, + { RS(DELTA_NR_FILE_HUGEPAGES), TS(sl_int) }, + { RS(DELTA_NR_FILE_PAGES), TS(sl_int) }, + { RS(DELTA_NR_FILE_PMDMAPPED), TS(sl_int) }, + { RS(DELTA_NR_FOLL_PIN_ACQUIRED), TS(sl_int) }, + { RS(DELTA_NR_FOLL_PIN_RELEASED), TS(sl_int) }, + { RS(DELTA_NR_FREE_CMA), TS(sl_int) }, + { RS(DELTA_NR_FREE_PAGES), TS(sl_int) }, + { RS(DELTA_NR_INACTIVE_ANON), TS(sl_int) }, + { RS(DELTA_NR_INACTIVE_FILE), TS(sl_int) }, + { RS(DELTA_NR_ISOLATED_ANON), TS(sl_int) }, + { RS(DELTA_NR_ISOLATED_FILE), TS(sl_int) }, + { RS(DELTA_NR_KERNEL_MISC_RECLAIMABLE), TS(sl_int) }, + { RS(DELTA_NR_KERNEL_STACK), TS(sl_int) }, + { RS(DELTA_NR_MAPPED), TS(sl_int) }, + { RS(DELTA_NR_MLOCK), TS(sl_int) }, + { RS(DELTA_NR_PAGE_TABLE_PAGES), TS(sl_int) }, + { RS(DELTA_NR_SHADOW_CALL_STACK), TS(sl_int) }, + { RS(DELTA_NR_SHMEM), TS(sl_int) }, + { RS(DELTA_NR_SHMEM_HUGEPAGES), TS(sl_int) }, + { RS(DELTA_NR_SHMEM_PMDMAPPED), TS(sl_int) }, + { RS(DELTA_NR_SLAB_RECLAIMABLE), TS(sl_int) }, + { RS(DELTA_NR_SLAB_UNRECLAIMABLE), TS(sl_int) }, + { RS(DELTA_NR_UNEVICTABLE), TS(sl_int) }, + { RS(DELTA_NR_UNSTABLE), TS(sl_int) }, + { RS(DELTA_NR_VMSCAN_IMMEDIATE_RECLAIM), TS(sl_int) }, + { RS(DELTA_NR_VMSCAN_WRITE), TS(sl_int) }, + { RS(DELTA_NR_WRITEBACK), TS(sl_int) }, + { RS(DELTA_NR_WRITEBACK_TEMP), TS(sl_int) }, + { RS(DELTA_NR_WRITTEN), TS(sl_int) }, + { RS(DELTA_NR_ZONE_ACTIVE_ANON), TS(sl_int) }, + { RS(DELTA_NR_ZONE_ACTIVE_FILE), TS(sl_int) }, + { RS(DELTA_NR_ZONE_INACTIVE_ANON), TS(sl_int) }, + { RS(DELTA_NR_ZONE_INACTIVE_FILE), TS(sl_int) }, + { RS(DELTA_NR_ZONE_UNEVICTABLE), TS(sl_int) }, + { RS(DELTA_NR_ZONE_WRITE_PENDING), TS(sl_int) }, + { RS(DELTA_NR_ZSPAGES), TS(sl_int) }, + { RS(DELTA_NUMA_FOREIGN), TS(sl_int) }, + { RS(DELTA_NUMA_HINT_FAULTS), TS(sl_int) }, + { RS(DELTA_NUMA_HINT_FAULTS_LOCAL), TS(sl_int) }, + { RS(DELTA_NUMA_HIT), TS(sl_int) }, + { RS(DELTA_NUMA_HUGE_PTE_UPDATES), TS(sl_int) }, + { RS(DELTA_NUMA_INTERLEAVE), TS(sl_int) }, + { RS(DELTA_NUMA_LOCAL), TS(sl_int) }, + { RS(DELTA_NUMA_MISS), TS(sl_int) }, + { RS(DELTA_NUMA_OTHER), TS(sl_int) }, + { RS(DELTA_NUMA_PAGES_MIGRATED), TS(sl_int) }, + { RS(DELTA_NUMA_PTE_UPDATES), TS(sl_int) }, + { RS(DELTA_OOM_KILL), TS(sl_int) }, + { RS(DELTA_PAGEOUTRUN), TS(sl_int) }, + { RS(DELTA_PGACTIVATE), TS(sl_int) }, + { RS(DELTA_PGALLOC_DMA), TS(sl_int) }, + { RS(DELTA_PGALLOC_DMA32), TS(sl_int) }, + { RS(DELTA_PGALLOC_HIGH), TS(sl_int) }, + { RS(DELTA_PGALLOC_MOVABLE), TS(sl_int) }, + { RS(DELTA_PGALLOC_NORMAL), TS(sl_int) }, + { RS(DELTA_PGDEACTIVATE), TS(sl_int) }, + { RS(DELTA_PGFAULT), TS(sl_int) }, + { RS(DELTA_PGFREE), TS(sl_int) }, + { RS(DELTA_PGINODESTEAL), TS(sl_int) }, + { RS(DELTA_PGLAZYFREE), TS(sl_int) }, + { RS(DELTA_PGLAZYFREED), TS(sl_int) }, + { RS(DELTA_PGMAJFAULT), TS(sl_int) }, + { RS(DELTA_PGMIGRATE_FAIL), TS(sl_int) }, + { RS(DELTA_PGMIGRATE_SUCCESS), TS(sl_int) }, + { RS(DELTA_PGPGIN), TS(sl_int) }, + { RS(DELTA_PGPGOUT), TS(sl_int) }, + { RS(DELTA_PGREFILL), TS(sl_int) }, + { RS(DELTA_PGROTATED), TS(sl_int) }, + { RS(DELTA_PGSCAN_ANON), TS(sl_int) }, + { RS(DELTA_PGSCAN_DIRECT), TS(sl_int) }, + { RS(DELTA_PGSCAN_DIRECT_THROTTLE), TS(sl_int) }, + { RS(DELTA_PGSCAN_FILE), TS(sl_int) }, + { RS(DELTA_PGSCAN_KSWAPD), TS(sl_int) }, + { RS(DELTA_PGSKIP_DMA), TS(sl_int) }, + { RS(DELTA_PGSKIP_DMA32), TS(sl_int) }, + { RS(DELTA_PGSKIP_HIGH), TS(sl_int) }, + { RS(DELTA_PGSKIP_MOVABLE), TS(sl_int) }, + { RS(DELTA_PGSKIP_NORMAL), TS(sl_int) }, + { RS(DELTA_PGSTEAL_ANON), TS(sl_int) }, + { RS(DELTA_PGSTEAL_DIRECT), TS(sl_int) }, + { RS(DELTA_PGSTEAL_FILE), TS(sl_int) }, + { RS(DELTA_PGSTEAL_KSWAPD), TS(sl_int) }, + { RS(DELTA_PSWPIN), TS(sl_int) }, + { RS(DELTA_PSWPOUT), TS(sl_int) }, + { RS(DELTA_SLABS_SCANNED), TS(sl_int) }, + { RS(DELTA_SWAP_RA), TS(sl_int) }, + { RS(DELTA_SWAP_RA_HIT), TS(sl_int) }, + { RS(DELTA_THP_COLLAPSE_ALLOC), TS(sl_int) }, + { RS(DELTA_THP_COLLAPSE_ALLOC_FAILED), TS(sl_int) }, + { RS(DELTA_THP_DEFERRED_SPLIT_PAGE), TS(sl_int) }, + { RS(DELTA_THP_FAULT_ALLOC), TS(sl_int) }, + { RS(DELTA_THP_FAULT_FALLBACK), TS(sl_int) }, + { RS(DELTA_THP_FAULT_FALLBACK_CHARGE), TS(sl_int) }, + { RS(DELTA_THP_FILE_ALLOC), TS(sl_int) }, + { RS(DELTA_THP_FILE_FALLBACK), TS(sl_int) }, + { RS(DELTA_THP_FILE_FALLBACK_CHARGE), TS(sl_int) }, + { RS(DELTA_THP_FILE_MAPPED), TS(sl_int) }, + { RS(DELTA_THP_SPLIT_PAGE), TS(sl_int) }, + { RS(DELTA_THP_SPLIT_PAGE_FAILED), TS(sl_int) }, + { RS(DELTA_THP_SPLIT_PMD), TS(sl_int) }, + { RS(DELTA_THP_SPLIT_PUD), TS(sl_int) }, + { RS(DELTA_THP_SWPOUT), TS(sl_int) }, + { RS(DELTA_THP_SWPOUT_FALLBACK), TS(sl_int) }, + { RS(DELTA_THP_ZERO_PAGE_ALLOC), TS(sl_int) }, + { RS(DELTA_THP_ZERO_PAGE_ALLOC_FAILED), TS(sl_int) }, + { RS(DELTA_UNEVICTABLE_PGS_CLEARED), TS(sl_int) }, + { RS(DELTA_UNEVICTABLE_PGS_CULLED), TS(sl_int) }, + { RS(DELTA_UNEVICTABLE_PGS_MLOCKED), TS(sl_int) }, + { RS(DELTA_UNEVICTABLE_PGS_MUNLOCKED), TS(sl_int) }, + { RS(DELTA_UNEVICTABLE_PGS_RESCUED), TS(sl_int) }, + { RS(DELTA_UNEVICTABLE_PGS_SCANNED), TS(sl_int) }, + { RS(DELTA_UNEVICTABLE_PGS_STRANDED), TS(sl_int) }, + { RS(DELTA_WORKINGSET_ACTIVATE), TS(sl_int) }, + { RS(DELTA_WORKINGSET_NODERECLAIM), TS(sl_int) }, + { RS(DELTA_WORKINGSET_NODES), TS(sl_int) }, + { RS(DELTA_WORKINGSET_REFAULT), TS(sl_int) }, + { RS(DELTA_WORKINGSET_RESTORE), TS(sl_int) }, + { RS(DELTA_ZONE_RECLAIM_FAILED), TS(sl_int) }, +}; + + /* please note, + * this enum MUST be 1 greater than the highest value of any enum */ +enum vmstat_item VMSTAT_logical_end = MAXTABLE(Item_table); + +#undef setNAME +#undef RS + + +// ___ Private Functions |||||||||||||||||||||||||||||||||||||||||||||||||||||| + +static inline void vmstat_assign_results ( + struct vmstat_stack *stack, + struct vmstat_hist *hist) +{ + struct vmstat_result *this = stack->head; + + for (;;) { + enum vmstat_item item = this->item; + if (item >= VMSTAT_logical_end) + break; + Item_table[item].setsfunc(this, hist); + ++this; + } + return; +} // end: vmstat_assign_results + + +static void vmstat_extents_free_all ( + struct vmstat_info *info) +{ + while (info->extents) { + struct stacks_extent *p = info->extents; + info->extents = info->extents->next; + free(p); + }; +} // end: vmstat_extents_free_all + + +static inline struct vmstat_result *vmstat_itemize_stack ( + struct vmstat_result *p, + int depth, + enum vmstat_item *items) +{ + struct vmstat_result *p_sav = p; + int i; + + for (i = 0; i < depth; i++) { + p->item = items[i]; + ++p; + } + return p_sav; +} // end: vmstat_itemize_stack + + +static inline int vmstat_items_check_failed ( + int numitems, + enum vmstat_item *items) +{ + int i; + + /* if an enum is passed instead of an address of one or more enums, ol' gcc + * will silently convert it to an address (possibly NULL). only clang will + * offer any sort of warning like the following: + * + * warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'enum vmstat_item *' + * my_stack = procps_vmstat_select(info, VMSTAT_noop, num); + * ^~~~~~~~~~~~~~~~ + */ + if (numitems < 1 + || (void *)items < (void *)(unsigned long)(2 * VMSTAT_logical_end)) + return 1; + + for (i = 0; i < numitems; i++) { + // a vmstat_item is currently unsigned, but we'll protect our future + if (items[i] < 0) + return 1; + if (items[i] >= VMSTAT_logical_end) + return 1; + } + + return 0; +} // end: vmstat_items_check_failed + + +static int vmstat_make_hash_failed ( + struct vmstat_info *info) +{ + #define htVAL(f) e.key = STRINGIFY(f); e.data = &info->hist.new. f; \ + if (!hsearch_r(e, ENTER, &ep, &info->hashtab)) return 1; + ENTRY e, *ep; + size_t n; + + n = sizeof(struct vmstat_data) / sizeof(unsigned long); + // we'll follow the hsearch recommendation of an extra 25% + if (!hcreate_r(n + (n / 4), &info->hashtab)) + return 1; + + htVAL(allocstall_dma) + htVAL(allocstall_dma32) + htVAL(allocstall_high) + htVAL(allocstall_movable) + htVAL(allocstall_normal) + htVAL(balloon_deflate) + htVAL(balloon_inflate) + htVAL(balloon_migrate) + htVAL(compact_daemon_free_scanned) + htVAL(compact_daemon_migrate_scanned) + htVAL(compact_daemon_wake) + htVAL(compact_fail) + htVAL(compact_free_scanned) + htVAL(compact_isolated) + htVAL(compact_migrate_scanned) + htVAL(compact_stall) + htVAL(compact_success) + htVAL(drop_pagecache) + htVAL(drop_slab) + htVAL(htlb_buddy_alloc_fail) + htVAL(htlb_buddy_alloc_success) + htVAL(kswapd_high_wmark_hit_quickly) + htVAL(kswapd_inodesteal) + htVAL(kswapd_low_wmark_hit_quickly) + htVAL(nr_active_anon) + htVAL(nr_active_file) + htVAL(nr_anon_pages) + htVAL(nr_anon_transparent_hugepages) + htVAL(nr_bounce) + htVAL(nr_dirtied) + htVAL(nr_dirty) + htVAL(nr_dirty_background_threshold) + htVAL(nr_dirty_threshold) + htVAL(nr_file_hugepages) + htVAL(nr_file_pages) + htVAL(nr_file_pmdmapped) + htVAL(nr_foll_pin_acquired) + htVAL(nr_foll_pin_released) + htVAL(nr_free_cma) + htVAL(nr_free_pages) + htVAL(nr_inactive_anon) + htVAL(nr_inactive_file) + htVAL(nr_isolated_anon) + htVAL(nr_isolated_file) + htVAL(nr_kernel_misc_reclaimable) + htVAL(nr_kernel_stack) + htVAL(nr_mapped) + htVAL(nr_mlock) + htVAL(nr_page_table_pages) + htVAL(nr_shadow_call_stack) + htVAL(nr_shmem) + htVAL(nr_shmem_hugepages) + htVAL(nr_shmem_pmdmapped) + htVAL(nr_slab_reclaimable) + htVAL(nr_slab_unreclaimable) + htVAL(nr_unevictable) + htVAL(nr_unstable) + htVAL(nr_vmscan_immediate_reclaim) + htVAL(nr_vmscan_write) + htVAL(nr_writeback) + htVAL(nr_writeback_temp) + htVAL(nr_written) + htVAL(nr_zone_active_anon) + htVAL(nr_zone_active_file) + htVAL(nr_zone_inactive_anon) + htVAL(nr_zone_inactive_file) + htVAL(nr_zone_unevictable) + htVAL(nr_zone_write_pending) + htVAL(nr_zspages) + htVAL(numa_foreign) + htVAL(numa_hint_faults) + htVAL(numa_hint_faults_local) + htVAL(numa_hit) + htVAL(numa_huge_pte_updates) + htVAL(numa_interleave) + htVAL(numa_local) + htVAL(numa_miss) + htVAL(numa_other) + htVAL(numa_pages_migrated) + htVAL(numa_pte_updates) + htVAL(oom_kill) + htVAL(pageoutrun) + htVAL(pgactivate) + htVAL(pgalloc_dma) + htVAL(pgalloc_dma32) + htVAL(pgalloc_high) + htVAL(pgalloc_movable) + htVAL(pgalloc_normal) + htVAL(pgdeactivate) + htVAL(pgfault) + htVAL(pgfree) + htVAL(pginodesteal) + htVAL(pglazyfree) + htVAL(pglazyfreed) + htVAL(pgmajfault) + htVAL(pgmigrate_fail) + htVAL(pgmigrate_success) + htVAL(pgpgin) + htVAL(pgpgout) + htVAL(pgrefill) + htVAL(pgrotated) + htVAL(pgscan_anon) + htVAL(pgscan_direct) + htVAL(pgscan_direct_throttle) + htVAL(pgscan_file) + htVAL(pgscan_kswapd) + htVAL(pgskip_dma) + htVAL(pgskip_dma32) + htVAL(pgskip_high) + htVAL(pgskip_movable) + htVAL(pgskip_normal) + htVAL(pgsteal_anon) + htVAL(pgsteal_direct) + htVAL(pgsteal_file) + htVAL(pgsteal_kswapd) + htVAL(pswpin) + htVAL(pswpout) + htVAL(slabs_scanned) + htVAL(swap_ra) + htVAL(swap_ra_hit) + htVAL(thp_collapse_alloc) + htVAL(thp_collapse_alloc_failed) + htVAL(thp_deferred_split_page) + htVAL(thp_fault_alloc) + htVAL(thp_fault_fallback) + htVAL(thp_fault_fallback_charge) + htVAL(thp_file_alloc) + htVAL(thp_file_fallback) + htVAL(thp_file_fallback_charge) + htVAL(thp_file_mapped) + htVAL(thp_split_page) + htVAL(thp_split_page_failed) + htVAL(thp_split_pmd) + htVAL(thp_split_pud) + htVAL(thp_swpout) + htVAL(thp_swpout_fallback) + htVAL(thp_zero_page_alloc) + htVAL(thp_zero_page_alloc_failed) + htVAL(unevictable_pgs_cleared) + htVAL(unevictable_pgs_culled) + htVAL(unevictable_pgs_mlocked) + htVAL(unevictable_pgs_munlocked) + htVAL(unevictable_pgs_rescued) + htVAL(unevictable_pgs_scanned) + htVAL(unevictable_pgs_stranded) + htVAL(workingset_activate) + htVAL(workingset_nodereclaim) + htVAL(workingset_nodes) + htVAL(workingset_refault) + htVAL(workingset_restore) + htVAL(zone_reclaim_failed) + + return 0; + #undef htVAL +} // end: vmstat_make_hash_failed + + +/* + * vmstat_read_failed(): + * + * Read the data out of /proc/vmstat putting the information + * into the supplied info structure + */ +static int vmstat_read_failed ( + struct vmstat_info *info) +{ + char buf[VMSTAT_BUFF]; + char *head, *tail; + int size; + unsigned long *valptr; + + // remember history from last time around + memcpy(&info->hist.old, &info->hist.new, sizeof(struct vmstat_data)); + // clear out the soon to be 'current' values + memset(&info->hist.new, 0, sizeof(struct vmstat_data)); + +#ifndef __CYGWIN__ /* /proc/vmstat does not exist */ + if (-1 == info->vmstat_fd + && (-1 == (info->vmstat_fd = open(VMSTAT_FILE, O_RDONLY)))) + return 1; + + if (lseek(info->vmstat_fd, 0L, SEEK_SET) == -1) + return 1; + + for (;;) { + if ((size = read(info->vmstat_fd, buf, sizeof(buf)-1)) < 0) { + if (errno == EINTR || errno == EAGAIN) + continue; + return 1; + } + break; + } + if (size == 0) { + errno = EIO; + return 1; + } + buf[size] = '\0'; + + head = buf; + + for (;;) { + static __thread ENTRY e; // keep coverity off our backs (e.data) + ENTRY *ep; + + if (!(tail = strchr(head, ' '))) + break; + *tail = '\0'; + valptr = NULL; + + e.key = head; + if (hsearch_r(e, FIND, &ep, &info->hashtab)) + valptr = ep->data; + head = tail + 1; + if (valptr) + *valptr = strtoul(head, NULL, 10); + + if (!(tail = strchr(head, '\n'))) + break; + head = tail + 1; + } +#endif /* !__CYGWIN__ */ + return 0; +} // end: vmstat_read_failed + + +/* + * vmstat_stacks_alloc(): + * + * Allocate and initialize one or more stacks each of which is anchored in an + * associated context structure. + * + * All such stacks will have their result structures properly primed with + * 'items', while the result itself will be zeroed. + * + * Returns a stacks_extent struct anchoring the 'heads' of each new stack. + */ +static struct stacks_extent *vmstat_stacks_alloc ( + struct vmstat_info *info, + int maxstacks) +{ + struct stacks_extent *p_blob; + struct vmstat_stack **p_vect; + struct vmstat_stack *p_head; + size_t vect_size, head_size, list_size, blob_size; + void *v_head, *v_list; + int i; + + vect_size = sizeof(void *) * maxstacks; // size of the addr vectors | + vect_size += sizeof(void *); // plus NULL addr delimiter | + head_size = sizeof(struct vmstat_stack); // size of that head struct | + list_size = sizeof(struct vmstat_result)*info->numitems; // any single results stack | + blob_size = sizeof(struct stacks_extent); // the extent anchor itself | + blob_size += vect_size; // plus room for addr vects | + blob_size += head_size * maxstacks; // plus room for head thing | + blob_size += list_size * maxstacks; // plus room for our stacks | + + /* note: all of our memory is allocated in a single blob, facilitating a later free(). | + as a minimum, it is important that the result structures themselves always be | + contiguous for every stack since they are accessed through relative position. | */ + if (NULL == (p_blob = calloc(1, blob_size))) + return NULL; + + p_blob->next = info->extents; // push this extent onto... | + info->extents = p_blob; // ...some existing extents | + p_vect = (void *)p_blob + sizeof(struct stacks_extent); // prime our vector pointer | + p_blob->stacks = p_vect; // set actual vectors start | + v_head = (void *)p_vect + vect_size; // prime head pointer start | + v_list = v_head + (head_size * maxstacks); // prime our stacks pointer | + + for (i = 0; i < maxstacks; i++) { + p_head = (struct vmstat_stack *)v_head; + p_head->head = vmstat_itemize_stack((struct vmstat_result *)v_list, info->numitems, info->items); + p_blob->stacks[i] = p_head; + v_list += list_size; + v_head += head_size; + } + p_blob->ext_numstacks = maxstacks; + return p_blob; +} // end: vmstat_stacks_alloc + + +// ___ Public Functions ||||||||||||||||||||||||||||||||||||||||||||||||||||||| + +// --- standard required functions -------------------------------------------- + +/* + * procps_vmstat_new: + * + * Create a new container to hold the stat information + * + * The initial refcount is 1, and needs to be decremented + * to release the resources of the structure. + * + * Returns: < 0 on failure, 0 on success along with + * a pointer to a new context struct + */ +PROCPS_EXPORT int procps_vmstat_new ( + struct vmstat_info **info) +{ + struct vmstat_info *p; + +#ifdef ITEMTABLE_DEBUG + int i, failed = 0; + for (i = 0; i < MAXTABLE(Item_table); i++) { + if (i != Item_table[i].enumnumb) { + fprintf(stderr, "%s: enum/table error: Item_table[%d] was %s, but its value is %d\n" + , __FILE__, i, Item_table[i].enum2str, Item_table[i].enumnumb); + failed = 1; + } + } + if (failed) _Exit(EXIT_FAILURE); +#endif + + if (info == NULL || *info != NULL) + return -EINVAL; + if (!(p = calloc(1, sizeof(struct vmstat_info)))) + return -ENOMEM; + + p->refcount = 1; + p->vmstat_fd = -1; + + if (vmstat_make_hash_failed(p)) { + free(p); + return -errno; + } + + /* do a priming read here for the following potential benefits: | + 1) ensure there will be no problems with subsequent access | + 2) make delta results potentially useful, even if 1st time | + 3) elimnate need for history distortions 1st time 'switch' | */ + if (vmstat_read_failed(p)) { + procps_vmstat_unref(&p); + return -errno; + } + + *info = p; + return 0; +} // end: procps_vmstat_new + + +PROCPS_EXPORT int procps_vmstat_ref ( + struct vmstat_info *info) +{ + if (info == NULL) + return -EINVAL; + + info->refcount++; + return info->refcount; +} // end: procps_vmstat_ref + + +PROCPS_EXPORT int procps_vmstat_unref ( + struct vmstat_info **info) +{ + if (info == NULL || *info == NULL) + return -EINVAL; + + (*info)->refcount--; + + if ((*info)->refcount < 1) { + int errno_sav = errno; + + if ((*info)->vmstat_fd != -1) + close((*info)->vmstat_fd); + + if ((*info)->extents) + vmstat_extents_free_all((*info)); + if ((*info)->items) + free((*info)->items); + hdestroy_r(&(*info)->hashtab); + + free(*info); + *info = NULL; + + errno = errno_sav; + return 0; + } + return (*info)->refcount; +} // end: procps_vmstat_unref + + +// --- variable interface functions ------------------------------------------- + +PROCPS_EXPORT struct vmstat_result *procps_vmstat_get ( + struct vmstat_info *info, + enum vmstat_item item) +{ + time_t cur_secs; + + errno = EINVAL; + if (info == NULL) + return NULL; + if (item < 0 || item >= VMSTAT_logical_end) + return NULL; + errno = 0; + + /* we will NOT read the vmstat file with every call - rather, we'll offer + a granularity of 1 second between reads ... */ + cur_secs = time(NULL); + if (1 <= cur_secs - info->sav_secs) { + if (vmstat_read_failed(info)) + return NULL; + info->sav_secs = cur_secs; + } + + info->get_this.item = item; + // with 'get', we must NOT honor the usual 'noop' guarantee + info->get_this.result.ul_int = 0; + Item_table[item].setsfunc(&info->get_this, &info->hist); + + return &info->get_this; +} // end: procps_vmstat_get + + +/* procps_vmstat_select(): + * + * Harvest all the requested /proc/vmstat information then return + * it in a results stack. + * + * Returns: pointer to a vmstat_stack struct on success, NULL on error. + */ +PROCPS_EXPORT struct vmstat_stack *procps_vmstat_select ( + struct vmstat_info *info, + enum vmstat_item *items, + int numitems) +{ + errno = EINVAL; + if (info == NULL || items == NULL) + return NULL; + if (vmstat_items_check_failed(numitems, items)) + return NULL; + errno = 0; + + /* is this the first time or have things changed since we were last called? + if so, gotta' redo all of our stacks stuff ... */ + if (info->numitems != numitems + 1 + || memcmp(info->items, items, sizeof(enum vmstat_item) * numitems)) { + // allow for our VMSTAT_logical_end + if (!(info->items = realloc(info->items, sizeof(enum vmstat_item) * (numitems + 1)))) + return NULL; + memcpy(info->items, items, sizeof(enum vmstat_item) * numitems); + info->items[numitems] = VMSTAT_logical_end; + info->numitems = numitems + 1; + if (info->extents) + vmstat_extents_free_all(info); + } + if (!info->extents + && (!vmstat_stacks_alloc(info, 1))) + return NULL; + + if (vmstat_read_failed(info)) + return NULL; + vmstat_assign_results(info->extents->stacks[0], &info->hist); + + return info->extents->stacks[0]; +} // end: procps_vmstat_select + + +// --- special debugging function(s) ------------------------------------------ +/* + * The following isn't part of the normal programming interface. Rather, + * it exists to validate result types referenced in application programs. + * + * It's used only when: + * 1) the 'XTRA_PROCPS_DEBUG' has been defined, or + * 2) an #include of 'xtra-procps-debug.h' is used + */ + +PROCPS_EXPORT struct vmstat_result *xtra_vmstat_get ( + struct vmstat_info *info, + enum vmstat_item actual_enum, + const char *typestr, + const char *file, + int lineno) +{ + struct vmstat_result *r = procps_vmstat_get(info, actual_enum); + + if (actual_enum < 0 || actual_enum >= VMSTAT_logical_end) { + fprintf(stderr, "%s line %d: invalid item = %d, type = %s\n" + , file, lineno, actual_enum, typestr); + } + if (r) { + char *str = Item_table[r->item].type2str; + if (str[0] + && (strcmp(typestr, str))) + fprintf(stderr, "%s line %d: was %s, expected %s\n", file, lineno, typestr, str); + } + return r; +} // end: xtra_vmstat_get_ + + +PROCPS_EXPORT struct vmstat_result *xtra_vmstat_val ( + int relative_enum, + const char *typestr, + const struct vmstat_stack *stack, + struct vmstat_info *info, + const char *file, + int lineno) +{ + char *str; + int i; + + for (i = 0; stack->head[i].item < VMSTAT_logical_end; i++) + ; + if (relative_enum < 0 || relative_enum >= i) { + fprintf(stderr, "%s line %d: invalid relative_enum = %d, valid range = 0-%d\n" + , file, lineno, relative_enum, i-1); + return NULL; + } + str = Item_table[stack->head[relative_enum].item].type2str; + if (str[0] + && (strcmp(typestr, str))) { + fprintf(stderr, "%s line %d: was %s, expected %s\n", file, lineno, typestr, str); + } + return &stack->head[relative_enum]; + (void)info; +} // end: xtra_vmstat_val diff --git a/library/wchan.c b/library/wchan.c new file mode 100644 index 0000000..d342fef --- /dev/null +++ b/library/wchan.c @@ -0,0 +1,54 @@ +/* + * wchan.c - kernel symbol handling + * + * Copyright © 2015-2023 Jim Warner + * Copyright © 1998-2003 Albert Cahalan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; 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 "wchan.h" // to verify prototype + + +const char *lookup_wchan (int pid) { + static __thread char buf[64]; + const char *ret = buf; + ssize_t num; + int fd; + + snprintf(buf, sizeof buf, "/proc/%d/wchan", pid); + fd = open(buf, O_RDONLY); + if (fd==-1) return "?"; + + num = read(fd, buf, sizeof buf - 1); + close(fd); + + if (num<1) return "?"; // allow for "0" + buf[num] = '\0'; + + if (buf[0]=='0' && buf[1]=='\0') return "-"; + + // lame ppc64 has a '.' in front of every name + if (*ret=='.') ret++; + while(*ret=='_') ret++; + + return ret; +} diff --git a/local/Makefile.am b/local/Makefile.am new file mode 100644 index 0000000..9f97890 --- /dev/null +++ b/local/Makefile.am @@ -0,0 +1,10 @@ +dist_noinst_HEADERS = \ + c.h \ + fileutils.h \ + nls.h \ + procio.h \ + rpmatch.h \ + signals.h \ + strutils.h \ + tests.h \ + xalloc.h diff --git a/local/Makefile.in b/local/Makefile.in new file mode 100644 index 0000000..b03992d --- /dev/null +++ b/local/Makefile.in @@ -0,0 +1,553 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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 = local +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(dist_noinst_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +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 +HEADERS = $(dist_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)` +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEJAGNU = @DEJAGNU@ +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@ +ELOGIND_CFLAGS = @ELOGIND_CFLAGS@ +ELOGIND_LIBS = @ELOGIND_LIBS@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +HARDEN_CFLAGS = @HARDEN_CFLAGS@ +HARDEN_LDFLAGS = @HARDEN_LDFLAGS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +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@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NCURSES_CFLAGS = @NCURSES_CFLAGS@ +NCURSES_LIBS = @NCURSES_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PO4A = @PO4A@ +POSUB = @POSUB@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@ +SYSTEMD_LIBS = @SYSTEMD_LIBS@ +USE_NLS = @USE_NLS@ +USE_PO4A = @USE_PO4A@ +VERSION = @VERSION@ +WITH_COLORWATCH = @WITH_COLORWATCH@ +WITH_WATCH8BIT = @WITH_WATCH8BIT@ +XGETTEXT = @XGETTEXT@ +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@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrbin_execdir = @usrbin_execdir@ +dist_noinst_HEADERS = \ + c.h \ + fileutils.h \ + nls.h \ + procio.h \ + rpmatch.h \ + signals.h \ + strutils.h \ + tests.h \ + xalloc.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) --foreign local/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign local/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__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + 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 + +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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(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: +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-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: 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 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/local/c.h b/local/c.h new file mode 100644 index 0000000..2471209 --- /dev/null +++ b/local/c.h @@ -0,0 +1,162 @@ +/* + * This header was copied from util-linux at fall 2011. + */ + +/* + * Fundamental C definitions. + */ + +#ifndef PROCPS_NG_C_H +#define PROCPS_NG_C_H + +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_ERROR_H +#include +#else +#include +#endif + +/* + * Compiler specific stuff + */ +#ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +# else +# define __GNUC_PREREQ(maj, min) 0 +# endif +#endif + +/* + * Function attributes + */ +#ifndef __ul_alloc_size +# if __GNUC_PREREQ (4, 3) +# define __ul_alloc_size(s) __attribute__((alloc_size(s))) +# else +# define __ul_alloc_size(s) +# endif +#endif + +#ifndef __ul_calloc_size +# if __GNUC_PREREQ (4, 3) +# define __ul_calloc_size(n, s) __attribute__((alloc_size(n, s))) +# else +# define __ul_calloc_size(n, s) +# endif +#endif + +/* + * Misc + */ +#ifndef PATH_MAX +# define PATH_MAX 4096 +#endif + +#ifndef TRUE +# define TRUE 1 +#endif + +#ifndef FALSE +# define FALSE 0 +#endif + +/* + * Program name. + */ +#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME +# ifdef HAVE___PROGNAME +extern char *__progname; +# define program_invocation_short_name __progname +# else +# ifdef HAVE_GETEXECNAME +# define program_invocation_short_name \ + prog_inv_sh_nm_from_file(getexecname(), 0) +# else +# define program_invocation_short_name \ + prog_inv_sh_nm_from_file(__FILE__, 1) +# endif +static char prog_inv_sh_nm_buf[256]; +static inline char *prog_inv_sh_nm_from_file(char *f, char stripext) +{ + char *t; + + if ((t = strrchr(f, '/')) != NULL) + t++; + else + t = f; + + strncpy(prog_inv_sh_nm_buf, t, sizeof(prog_inv_sh_nm_buf) - 1); + prog_inv_sh_nm_buf[sizeof(prog_inv_sh_nm_buf) - 1] = '\0'; + + if (stripext && (t = strrchr(prog_inv_sh_nm_buf, '.')) != NULL) + *t = '\0'; + + return prog_inv_sh_nm_buf; +} +# endif +#endif + +/* + * Error printing. + */ +#ifndef HAVE_ERROR_H +/* Emulate the error() function from glibc */ +__attribute__((__format__(__printf__, 3, 4))) +static void error(int status, int errnum, const char *format, ...) +{ + va_list argp; + fprintf(stderr, "%s: ", program_invocation_short_name); + va_start(argp, format); + vfprintf(stderr, format, argp); + va_end(argp); + if (errnum != 0) + fprintf(stderr, ": %s", strerror(errnum)); + fprintf(stderr, "\n"); + if (status != 0) + exit(status); +} + +/* Emulate the error_at_line() function from glibc */ +__attribute__((__format__(__printf__, 5, 6))) +static void error_at_line(int status, int errnum, const char *filename, + unsigned int linenum, const char *format, ...) +{ + va_list argp; + fprintf(stderr, "%s:%s:%u: ", program_invocation_short_name, + filename, linenum); + va_start(argp, format); + vfprintf(stderr, format, argp); + va_end(argp); + if (errnum != 0) + fprintf(stderr, ": error code %d", errnum); + fprintf(stderr, "\n"); + if (status != 0) + exit(status); +} +#endif +#define xwarn(...) error(0, errno, __VA_ARGS__) +#define xwarnx(...) error(0, 0, __VA_ARGS__) +#define xerr(STATUS, ...) error(STATUS, errno, __VA_ARGS__) +#define xerrx(STATUS, ...) error(STATUS, 0, __VA_ARGS__) + +/* + * Constant strings for usage() functions. + */ +#define USAGE_HEADER _("\nUsage:\n") +#define USAGE_OPTIONS _("\nOptions:\n") +#define USAGE_SEPARATOR _("\n") +#define USAGE_HELP _(" -h, --help display this help and exit\n") +#define USAGE_VERSION _(" -V, --version output version information and exit\n") +#define USAGE_MAN_TAIL(_man) _("\nFor more details see %s.\n"), _man + +#define PROCPS_NG_VERSION _("%s from %s\n"), program_invocation_short_name, PACKAGE_STRING + +#endif /* PROCPS_NG_C_H */ diff --git a/local/fileutils.c b/local/fileutils.c new file mode 100644 index 0000000..14c7452 --- /dev/null +++ b/local/fileutils.c @@ -0,0 +1,45 @@ +#include +#ifdef HAVE_ERROR_H +# include +#endif +#ifdef HAVE_STDIO_EXT_H +# include +#else +/* FIXME: use a more portable definition of __fpending() (from gnulib?) */ +# include +# define __fpending(fp) ((fp)->_p - (fp)->_bf._base) +#endif +#include +#include + +#include "nls.h" +#include "fileutils.h" +#ifndef HAVE_ERROR_H +# include "c.h" /* for error() emulation */ +#endif + +int close_stream(FILE * stream) +{ + const int some_pending = (__fpending(stream) != 0); + const int prev_fail = (ferror(stream) != 0); + const int fclose_fail = (fclose(stream) != 0); + if (prev_fail || (fclose_fail && (some_pending || errno != EBADF))) { + if (!fclose_fail && errno != EPIPE) + errno = 0; + return EOF; + } + return 0; +} + +/* Use atexit(); */ +void close_stdout(void) +{ + if (close_stream(stdout) != 0 && !(errno == EPIPE)) { + char const *write_error = _("write error"); + error(0, errno, "%s", write_error); + _exit(EXIT_FAILURE); + } + + if (close_stream(stderr) != 0) + _exit(EXIT_FAILURE); +} diff --git a/local/fileutils.h b/local/fileutils.h new file mode 100644 index 0000000..cfab570 --- /dev/null +++ b/local/fileutils.h @@ -0,0 +1,7 @@ +#ifndef PROCPS_NG_FILEUTILS +#define PROCPS_NG_FILEUTILS + +int close_stream(FILE * stream); +void close_stdout(void); + +#endif diff --git a/local/git-version-gen b/local/git-version-gen new file mode 100755 index 0000000..171767f --- /dev/null +++ b/local/git-version-gen @@ -0,0 +1,181 @@ +#!/bin/sh +# Print a version string. +scriptversion=2011-02-19.19; # UTC + +# Copyright (C) 2007-2011 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 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 . + +# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. +# It may be run two ways: +# - from a git repository in which the "git describe" command below +# produces useful output (thus requiring at least one signed tag) +# - from a non-git-repo directory containing a .tarball-version file, which +# presumes this script is invoked like "./git-version-gen .tarball-version". + +# In order to use intra-version strings in your project, you will need two +# separate generated version string files: +# +# .tarball-version - present only in a distribution tarball, and not in +# a checked-out repository. Created with contents that were learned at +# the last time autoconf was run, and used by git-version-gen. Must not +# be present in either $(srcdir) or $(builddir) for git-version-gen to +# give accurate answers during normal development with a checked out tree, +# but must be present in a tarball when there is no version control system. +# Therefore, it cannot be used in any dependencies. GNUmakefile has +# hooks to force a reconfigure at distribution time to get the value +# correct, without penalizing normal development with extra reconfigures. +# +# .version - present in a checked-out repository and in a distribution +# tarball. Usable in dependencies, particularly for files that don't +# want to depend on config.h but do want to track version changes. +# Delete this file prior to any autoconf run where you want to rebuild +# files to pick up a version string change; and leave it stale to +# minimize rebuild time after unrelated changes to configure sources. +# +# It is probably wise to add these two files to .gitignore, so that you +# don't accidentally commit either generated file. +# +# Use the following line in your configure.ac, so that $(VERSION) will +# automatically be up-to-date each time configure is run (and note that +# since configure.ac no longer includes a version string, Makefile rules +# should not depend on configure.ac for version updates). +# +# AC_INIT([GNU project], +# m4_esyscmd([build-aux/git-version-gen .tarball-version]), +# [bug-project@example]) +# +# Then use the following lines in your Makefile.am, so that .version +# will be present for dependencies, and so that .tarball-version will +# exist in distribution tarballs. +# +# BUILT_SOURCES = $(top_srcdir)/.version +# $(top_srcdir)/.version: +# echo $(VERSION) > $@-t && mv $@-t $@ +# dist-hook: +# echo $(VERSION) > $(distdir)/.tarball-version + +case $# in + 1|2) ;; + *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version" \ + '[TAG-NORMALIZATION-SED-SCRIPT]' + exit 1;; +esac + +tarball_version_file=$1 +tag_sed_script="${2:-s/x/x/}" +nl=' +' + +# Avoid meddling by environment variable of the same name. +v= +v_from_git= + +# First see if there is a tarball-only version file. +# then try "git describe", then default. +if test -f $tarball_version_file +then + v=`cat $tarball_version_file` || v= + case $v in + *$nl*) v= ;; # reject multi-line output + [0-9]*) ;; + *) v= ;; + esac + test -z "$v" \ + && echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2 +fi + +if test -n "$v" +then + : # use $v +# Otherwise, if there is at least one git commit involving the working +# directory, and "git describe" output looks sensible, use that to +# derive a version string. +elif test "`git log -1 --pretty=format:x . 2>&1`" = x \ + && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ + || git describe --abbrev=4 HEAD 2>/dev/null` \ + && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \ + && case $v in + v[0-9]*) ;; + *) (exit 1) ;; + esac +then + # Is this a new git that lists number of commits since the last + # tag or the previous older version that did not? + # Newer: v6.10-77-g0f8faeb + # Older: v6.10-g0f8faeb + case $v in + *-rc[0-9]) ;; # release candidate + *-*-*) : git describe is okay three part flavor ;; + *-*) + : git describe is older two part flavor + # Recreate the number of commits and rewrite such that the + # result is the same as if we were using the newer version + # of git describe. + vtag=`echo "$v" | sed 's/-.*//'` + commit_list=`git rev-list "$vtag"..HEAD 2>/dev/null` \ + || { commit_list=failed; + echo "$0: WARNING: git rev-list failed" 1>&2; } + numcommits=`echo "$commit_list" | wc -l` + v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; + test "$commit_list" = failed && v=UNKNOWN + ;; + esac + + case $v in + *-rc[0-9]) + # Remove the "g" in git describe's output string, to save a byte. + v=`echo "$v" | sed 's/\(.*\)-g/\1-/'`; + ;; + *) + # Change the first '-' to a '.', so version-comparing tools work properly. + # Remove the "g" in git describe's output string, to save a byte. + v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; + ;; + esac + v_from_git=1 +else + v=UNKNOWN +fi + +v=`echo "$v" |sed 's/^v//'` + +# Test whether to append the "-dirty" suffix only if the version +# string we're using came from git. I.e., skip the test if it's "UNKNOWN" +# or if it came from .tarball-version. +if test -n "$v_from_git"; then + # Don't declare a version "dirty" merely because a time stamp has changed. + git update-index --refresh > /dev/null 2>&1 + + dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty= + case "$dirty" in + '') ;; + *) # Append the suffix only if there isn't one already. + case $v in + *-dirty) ;; + *) v="$v-dirty" ;; + esac ;; + esac +fi + +# Omit the trailing newline, so that m4_esyscmd can use the result directly. +echo "$v" | tr -d "$nl" + +# 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/local/nls.h b/local/nls.h new file mode 100644 index 0000000..f5abe05 --- /dev/null +++ b/local/nls.h @@ -0,0 +1,114 @@ +/* + * This header was copied from util-linux at fall 2011. + */ + +#ifndef PROCPS_NG_NLS_H +#define PROCPS_NG_NLS_H + +/* programs issuing textdomain() need PACKAGE string */ +#include "config.h" + +/* programs issuing bindtextdomain() also need LOCALEDIR string */ +#ifndef LOCALEDIR +#define LOCALEDIR "/usr/share/locale" +#endif + +#ifdef HAVE_LOCALE_H +# include +#else +# undef setlocale +# define setlocale(Category, Locale) /* empty */ +#endif + +#ifdef ENABLE_NLS +# include +# define _(Text) gettext (Text) +# ifdef gettext_noop +# define N_(String) gettext_noop (String) +# else +# define N_(String) (String) +# endif +# define P_(Singular, Plural, n) ngettext (Singular, Plural, n) +#else +# undef bindtextdomain +# define bindtextdomain(Domain, Directory) /* empty */ +# undef textdomain +# define textdomain(Domain) /* empty */ +# define _(Text) (Text) +# define N_(Text) (Text) +# define P_(Singular, Plural, n) ((n) == 1 ? (Singular) : (Plural)) +#endif /* ENABLE_NLS */ + +#ifdef HAVE_LANGINFO_H +# include +#else + +typedef int nl_item; +extern char *langinfo_fallback(nl_item item); + +# define nl_langinfo langinfo_fallback + +enum { + CODESET = 1, + RADIXCHAR, + THOUSEP, + D_T_FMT, + D_FMT, + T_FMT, + T_FMT_AMPM, + AM_STR, + PM_STR, + + DAY_1, + DAY_2, + DAY_3, + DAY_4, + DAY_5, + DAY_6, + DAY_7, + + ABDAY_1, + ABDAY_2, + ABDAY_3, + ABDAY_4, + ABDAY_5, + ABDAY_6, + ABDAY_7, + + MON_1, + MON_2, + MON_3, + MON_4, + MON_5, + MON_6, + MON_7, + MON_8, + MON_9, + MON_10, + MON_11, + MON_12, + + ABMON_1, + ABMON_2, + ABMON_3, + ABMON_4, + ABMON_5, + ABMON_6, + ABMON_7, + ABMON_8, + ABMON_9, + ABMON_10, + ABMON_11, + ABMON_12, + + ERA_D_FMT, + ERA_D_T_FMT, + ERA_T_FMT, + ALT_DIGITS, + CRNCYSTR, + YESEXPR, + NOEXPR +}; + +#endif /* !HAVE_LANGINFO_H */ +#endif /* PROCPS_NG_NLS_H */ diff --git a/local/procio.c b/local/procio.c new file mode 100644 index 0000000..bbd7c84 --- /dev/null +++ b/local/procio.c @@ -0,0 +1,292 @@ +/* + * procio.c -- Replace stdio for read and write on files below + * proc to be able to read and write large buffers as well. + * + * Copyright (C) 2017 Werner Fink + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef _GNU_SOURCE +# define _GNU_SOURCE +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct pcookie { + char *buf; + size_t count; + size_t length; + off_t offset; + int fd; + int delim; + int final:1; +} pcookie_t; + +static ssize_t proc_read(void *, char *, size_t); +static ssize_t proc_write(void *, const char *, size_t); +static int proc_close(void *); + +__extension__ +static cookie_io_functions_t procio = { + .read = proc_read, + .write = proc_write, + .seek = NULL, + .close = proc_close, +}; + +FILE *fprocopen(const char *path, const char *mode) +{ + pcookie_t *cookie = NULL; + FILE *handle = NULL; + mode_t flags = 0; + size_t len = 0; + int c, delim; + + if (!mode || !(len = strlen(mode))) { + errno = EINVAL; + goto out; + } + + /* No append mode possible */ + switch (mode[0]) { + case 'r': + flags |= O_RDONLY; + break; + case 'w': + flags |= O_WRONLY|O_TRUNC; + break; + default: + errno = EINVAL; + goto out; + } + + delim = ','; /* default delimeter is the comma */ + for (c = 1; c < len; c++) { + switch (mode[c]) { + case '\0': + break; + case '+': + errno = EINVAL; + goto out; + case 'e': + flags |= O_CLOEXEC; + continue; + case 'b': + case 'm': + case 'x': + /* ignore this */ + continue; + default: + if (mode[c] == ' ' || (mode[c] >= ',' && mode[c] <= '.') || mode[c] == ':') + delim = mode[c]; + else { + errno = EINVAL; + goto out; + } + break; + } + break; + } + + cookie = (pcookie_t *)malloc(sizeof(pcookie_t)); + if (!cookie) + goto out; + cookie->count = BUFSIZ; + cookie->buf = (char *)malloc(cookie->count); + if (!cookie->buf) { + int errsv = errno; + free(cookie); + errno = errsv; + goto out; + } + cookie->final = 0; + cookie->offset = 0; + cookie->length = 0; + cookie->delim = delim; + + cookie->fd = openat(AT_FDCWD, path, flags); + if (cookie->fd < 0) { + int errsv = errno; + free(cookie->buf); + free(cookie); + errno = errsv; + goto out; + } + + handle = fopencookie(cookie, mode, procio); + if (!handle) { + int errsv = errno; + close(cookie->fd); + free(cookie->buf); + free(cookie); + errno = errsv; + goto out; + } +out: + return handle; +} + +static +ssize_t proc_read(void *c, char *buf, size_t count) +{ + pcookie_t *cookie = c; + ssize_t len = -1; + void *ptr; + + if (cookie->count < count) { + ptr = realloc(cookie->buf, count); + if (!ptr) + goto out; + cookie->buf = ptr; + cookie->count = count; + } + + while (!cookie->final) { + len = read(cookie->fd, cookie->buf, cookie->count); + + if (len <= 0) { + if (len == 0) { + /* EOF */ + cookie->final = 1; + cookie->buf[cookie->length] = '\0'; + break; + } + goto out; /* error or done */ + } + + cookie->length = len; + + if (cookie->length < cookie->count) + continue; + + /* Likly to small buffer here */ + + lseek(cookie->fd, 0, SEEK_SET); /* reset for a retry */ + + ptr = realloc(cookie->buf, cookie->count += BUFSIZ); + if (!ptr) + goto out; + cookie->buf = ptr; + } + + len = count; + if (cookie->length - cookie->offset < len) + len = cookie->length - cookie->offset; + + if (len < 0) + len = 0; + + if (len) { + (void)memcpy(buf, cookie->buf+cookie->offset, len); + cookie->offset += len; + } else + len = EOF; +out: + return len; +} + +#define LINELEN 4096 + +static +ssize_t proc_write(void *c, const char *buf, size_t count) +{ + pcookie_t *cookie = c; + ssize_t len = -1; + void *ptr; + + if (!count) { + len = 0; + goto out; + } + + /* NL is the final input */ + cookie->final = memrchr(buf, '\n', count) ? 1 : 0; + + while (cookie->count < cookie->offset + count) { + ptr = realloc(cookie->buf, cookie->count += count); + if (!ptr) + goto out; + cookie->buf = ptr; + } + + len = count; + (void)memcpy(cookie->buf+cookie->offset, buf, count); + cookie->offset += count; + + if (cookie->final) { + len = write(cookie->fd, cookie->buf, cookie->offset); + if (len < 0 && errno == EINVAL) { + size_t offset; + off_t amount; + char *token; + /* + * Oops buffer might be to large, split buffer into + * pieces at delimeter if provided + */ + if (!cookie->delim) + goto out; /* Hey dude?! */ + offset = 0; + do { + token = NULL; + if (cookie->offset > LINELEN) + token = (char*)memrchr(cookie->buf+offset, cookie->delim, LINELEN); + else + token = (char*)memrchr(cookie->buf+offset, '\n', cookie->offset); + if (token) + *token = '\n'; + else { + errno = EINVAL; + len = -1; + goto out; /* Wrong/Missing delimeter? */ + } + if (offset > 0) + lseek(cookie->fd, 1, SEEK_CUR); + + amount = token-(cookie->buf+offset)+1; + ptr = cookie->buf+offset; + + len = write(cookie->fd, ptr, amount); + if (len < 1 || len >= cookie->offset) + break; + + offset += len; + cookie->offset -= len; + + } while (cookie->offset > 0); + } + if (len > 0) + len = count; + } +out: + return len; +} + +static +int proc_close(void *c) +{ + pcookie_t *cookie = c; + close(cookie->fd); + free(cookie->buf); + free(cookie); + return 0; +} diff --git a/local/procio.h b/local/procio.h new file mode 100644 index 0000000..043506a --- /dev/null +++ b/local/procio.h @@ -0,0 +1,6 @@ +#ifndef PROCPS_PROC_PROCIO_H +#define PROCPS_PROC_PROCIO_H + +FILE *fprocopen(const char *path, const char *mode); + +#endif diff --git a/local/rpmatch.h b/local/rpmatch.h new file mode 100644 index 0000000..2541aa3 --- /dev/null +++ b/local/rpmatch.h @@ -0,0 +1,9 @@ +#ifndef PROCPS_NG_RPMATCH_H +#define PROCPS_NG_RPMATCH_H + +#ifndef HAVE_RPMATCH +#define rpmatch(r) \ + (*r == 'y' || *r == 'Y' ? 1 : *r == 'n' || *r == 'N' ? 0 : -1) +#endif + +#endif /* PROCPS_NG_RPMATCH_H */ diff --git a/local/signals.c b/local/signals.c new file mode 100644 index 0000000..caff420 --- /dev/null +++ b/local/signals.c @@ -0,0 +1,316 @@ +/* + * signals.c - signal name, and number, conversions + * Copyright 1998-2003 by Albert Cahalan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; 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 "signals.h" +#include "c.h" + +/* Linux signals: + * + * SIGSYS is required by Unix98. + * SIGEMT is part of SysV, BSD, and ancient UNIX tradition. + * + * They are provided by these Linux ports: alpha, mips, sparc, and sparc64. + * You get SIGSTKFLT and SIGUNUSED instead on i386, m68k, ppc, and arm. + * (this is a Linux & libc bug -- both must be fixed) + * + * Total garbage: SIGIO SIGINFO SIGIOT SIGCLD + * (popular ones are handled as aliases) + * SIGLOST + * (except on the Hurd; reused to mean a server died) + * Nearly garbage: SIGSTKFLT SIGUNUSED (nothing else to fill slots) + */ + +/* Linux 2.3.29 replaces SIGUNUSED with the standard SIGSYS signal */ +#ifndef SIGSYS +# warning Standards require that define SIGSYS +# define SIGSYS SIGUNUSED +#endif + +/* If we see both, it is likely SIGSTKFLT (junk) was replaced. */ +#ifdef SIGEMT +# undef SIGSTKFLT +#endif + +#ifndef SIGRTMIN +# warning Standards require that define SIGRTMIN; assuming 32 +# define SIGRTMIN 32 +#endif + +/* It seems the SPARC libc does not know the kernel supports SIGPWR. */ +#if defined(__linux__) && !defined(SIGPWR) +# warning Your header files lack SIGPWR. (assuming it is number 29) +# define SIGPWR 29 +#endif + +typedef struct mapstruct { + const char *name; + int num; +} mapstruct; + + +static const mapstruct sigtable[] = { + {"ABRT", SIGABRT}, /* IOT */ + {"ALRM", SIGALRM}, + {"BUS", SIGBUS}, + {"CHLD", SIGCHLD}, /* CLD */ + {"CONT", SIGCONT}, +#ifdef SIGEMT + {"EMT", SIGEMT}, +#endif + {"FPE", SIGFPE}, + {"HUP", SIGHUP}, + {"ILL", SIGILL}, + {"INT", SIGINT}, + {"KILL", SIGKILL}, +#if defined(__GNU__) + {"LOST", SIGLOST}, /* Hurd-specific */ +#endif + {"PIPE", SIGPIPE}, + {"POLL", SIGPOLL}, /* IO */ + {"PROF", SIGPROF}, +#ifdef SIGPWR + {"PWR", SIGPWR}, +#endif + {"QUIT", SIGQUIT}, + {"SEGV", SIGSEGV}, +#ifdef SIGSTKFLT + {"STKFLT", SIGSTKFLT}, +#endif + {"STOP", SIGSTOP}, + {"SYS", SIGSYS}, /* UNUSED */ + {"TERM", SIGTERM}, + {"TRAP", SIGTRAP}, + {"TSTP", SIGTSTP}, + {"TTIN", SIGTTIN}, + {"TTOU", SIGTTOU}, + {"URG", SIGURG}, + {"USR1", SIGUSR1}, + {"USR2", SIGUSR2}, + {"VTALRM", SIGVTALRM}, + {"WINCH", SIGWINCH}, + {"XCPU", SIGXCPU}, + {"XFSZ", SIGXFSZ} +}; + + +#define number_of_signals (sizeof(sigtable)/sizeof(mapstruct)) + +#define XJOIN(a, b) JOIN(a, b) +#define JOIN(a, b) a##b +#define STATIC_ASSERT(x) typedef int XJOIN(static_assert_on_line_,__LINE__)[(x) ? 1 : -1] + +/* sanity check */ +#if defined(__linux__) +STATIC_ASSERT(number_of_signals == 31); +#elif defined(__FreeBSD_kernel__) || defined(__FreeBSD__) +STATIC_ASSERT(number_of_signals == 30); +#elif defined(__GNU__) +STATIC_ASSERT(number_of_signals == 31); +#elif defined(__CYGWIN__) +STATIC_ASSERT(number_of_signals == 31); +#else +# warning Unknown operating system; assuming number_of_signals is correct +#endif + +static int compare_signal_names(const void *a, const void *b){ + return strcasecmp( ((const mapstruct*)a)->name, ((const mapstruct*)b)->name ); +} + + +const char *get_sigtable_name(int row) +{ + if (row < 0 || row >= number_of_signals) + return NULL; + return sigtable[row].name; +} + +const int get_sigtable_num(int row) +{ + if (row < 0 || row >= number_of_signals) + return -1; + return sigtable[row].num; +} + +/* return -1 on failure */ +int signal_name_to_number(const char *restrict name){ + long val; + int offset; + + /* clean up name */ + if(!strncasecmp(name,"SIG",3)) + name += 3; + + if(!strcasecmp(name,"CLD")) + return SIGCHLD; + if(!strcasecmp(name,"IO")) + return SIGPOLL; + if(!strcasecmp(name,"IOT")) + return SIGABRT; + /* search the table */ + { + const mapstruct ms = {name,0}; + const mapstruct *restrict const ptr = bsearch( + &ms, + sigtable, + number_of_signals, + sizeof(mapstruct), + compare_signal_names); + if(ptr) + return ptr->num; + } + + if(!strcasecmp(name,"RTMIN")) + return SIGRTMIN; + if(!strcasecmp(name,"EXIT")) + return 0; + if(!strcasecmp(name,"NULL")) + return 0; + + offset = 0; + if(!strncasecmp(name,"RTMIN+",6)) { + name += 6; + offset = SIGRTMIN; + } + + /* not found, so try as a number */ + { + char *endp; + val = strtol(name,&endp,10); + if(*endp || endp==name) + return -1; /* not valid */ + } + if(val<0 || val+SIGRTMIN>127) + return -1; /* not valid */ + return val+offset; +} + +const char *signal_number_to_name(int signo) +{ + static char buf[32]; + int n = number_of_signals; + signo &= 0x7f; /* need to process exit values too */ + while (n--) { + if(sigtable[n].num==signo) + return sigtable[n].name; + } + if (signo == SIGRTMIN) + return "RTMIN"; + if (signo) + sprintf(buf, "RTMIN+%d", signo-SIGRTMIN); + else + strcpy(buf,"0"); /* AIX has NULL; Solaris has EXIT */ + return buf; +} + +int skill_sig_option(int *argc, char **argv) +{ + int i; + int signo = -1; + for (i = 1; i < *argc; i++) { + if (argv[i][0] == '-') { + signo = signal_name_to_number(argv[i] + 1); + if (-1 < signo) { + memmove(argv + i, argv + i + 1, + sizeof(char *) * (*argc - i)); + (*argc)--; + return signo; + } + } + } + return signo; +} + + +/* strtosig is similar to print_given_signals() with exception, that + * this function takes a string, and converts it to a signal name or + * a number string depending on which way a round conversion is + * queried. Non-existing signals return NULL. Notice that the + * returned string should be freed after use. + */ +char *strtosig(const char *restrict s) +{ + char *converted = NULL, *copy, *p, *endp; + int i, numsignal = 0; + + copy = strdup(s); + if (!copy) + xerrx(EXIT_FAILURE, "cannot duplicate string"); + for (p = copy; *p != '\0'; p++) + *p = toupper(*p); + p = copy; + if (p[0] == 'S' && p[1] == 'I' && p[2] == 'G') + p += 3; + if (isdigit(*p)){ + numsignal = strtol(s,&endp,10); + if(*endp || endp==s){ + free(p); + return NULL; /* not valid */ + } + } + if (numsignal){ + for (i = 0; i < number_of_signals; i++){ + if (numsignal == get_sigtable_num(i)){ + converted = strdup(get_sigtable_name(i)); + break; + } + } + } else { + for (i = 0; i < number_of_signals; i++){ + if (strcmp(p, get_sigtable_name(i)) == 0){ + converted = malloc(12); + if (converted) + snprintf(converted, 12, "%d", sigtable[i].num); + break; + } + } + } + free(copy); + return converted; +} + +void unix_print_signals(void) +{ + int pos = 0; + int i = 0; + while(++i <= number_of_signals){ + if(i-1) printf("%c", (pos>73)?(pos=0,'\n'):(pos++,' ') ); + pos += printf("%s", signal_number_to_name(i)); + } + printf("\n"); +} + +void pretty_print_signals(void) +{ + int i = 0; + while(++i <= number_of_signals){ + int n; + n = printf("%2d %s", i, signal_number_to_name(i)); + if(n>0 && i%7) + printf("%s", " \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + n); + else + printf("\n"); + } + if((i-1)%7) printf("\n"); +} + diff --git a/local/signals.h b/local/signals.h new file mode 100644 index 0000000..db23e9f --- /dev/null +++ b/local/signals.h @@ -0,0 +1,33 @@ +#ifndef PROC_SIG_H +#define PROC_SIG_H +/* + * Copyright 1998-2003 by Albert Cahalan; all rights resered. + * This file may be used subject to the terms and conditions of the + * GNU Library General Public License Version 2, or any later version + * at your option, as published by the Free Software Foundation. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + */ + +extern const int number_of_signals; + +extern const char *get_sigtable_name(int row); + +extern const int get_sigtable_num(int row); + +/* return -1 on failure */ +extern int signal_name_to_number(const char *__restrict name); + +extern const char *signal_number_to_name(int signo); + +extern int skill_sig_option(int *argc, char **argv); + +extern char *strtosig(const char *restrict s); + +extern void pretty_print_signals(void); + +extern void unix_print_signals(void); + +#endif diff --git a/local/strutils.c b/local/strutils.c new file mode 100644 index 0000000..e5245db --- /dev/null +++ b/local/strutils.c @@ -0,0 +1,123 @@ +/* + * strutils.c - various string routines shared by commands + * This file was copied from util-linux at fall 2011. + * + * Copyright (C) 2010 Karel Zak + * Copyright (C) 2010 Davidlohr Bueso + * + * 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. + */ + +#include +#include + +#include "c.h" +#include "strutils.h" + +/* + * same as strtol(3) but exit on failure instead of returning crap + */ +long strtol_or_err(const char *str, const char *errmesg) +{ + long num; + char *end = NULL; + + if (str != NULL && *str != '\0') { + errno = 0; + num = strtol(str, &end, 10); + if (errno == 0 && str != end && end != NULL && *end == '\0') + return num; + } + error(EXIT_FAILURE, errno, "%s: '%s'", errmesg, str); + return 0; +} + +/* + * same as strtod(3) but exit on failure instead of returning crap + */ +double strtod_or_err(const char *str, const char *errmesg) +{ + double num; + char *end = NULL; + + if (str != NULL && *str != '\0') { + errno = 0; + num = strtod(str, &end); + if (errno == 0 && str != end && end != NULL && *end == '\0') + return num; + } + error(EXIT_FAILURE, errno, "%s: '%s'", errmesg, str); + return 0; +} + +/* + * Covert a string into a double in a non-locale aware way. + * This means the decimal point can be either . or , + * Also means you cannot use the other for thousands separator + * + * Exits on failure like its other _or_err cousins + */ +double strtod_nol_or_err(char *str, const char *errmesg) +{ + double num; + const char *cp, *radix; + double mult; + int negative = 0; + + if (str != NULL && *str != '\0') { + num = 0.0; + cp = str; + /* strip leading spaces */ + while (isspace(*cp)) + cp++; + + /* get sign */ + if (*cp == '-') { + negative = 1; + cp++; + } else if (*cp == '+') + cp++; + + /* find radix */ + radix = cp; + mult=0.1; + while(isdigit(*radix)) { + radix++; + mult *= 10; + } + while(isdigit(*cp)) { + num += (*cp - '0') * mult; + mult /= 10; + cp++; + } + /* got the integers */ + if (*cp == '\0') + return (negative?-num:num); + if (*cp != '.' && *cp != ',') + error(EXIT_FAILURE, EINVAL, "%s: '%s'", errmesg, str); + + cp++; + mult = 0.1; + while(isdigit(*cp)) { + num += (*cp - '0') * mult; + mult /= 10; + cp++; + } + if (*cp == '\0') + return (negative?-num:num); + } + error(EXIT_FAILURE, errno, "%s: '%s'", errmesg, str); + return 0; +} diff --git a/local/strutils.h b/local/strutils.h new file mode 100644 index 0000000..85a6192 --- /dev/null +++ b/local/strutils.h @@ -0,0 +1,12 @@ +/* + * This header was copied from util-linux at fall 2011. + */ + +#ifndef PROCPS_NG_STRUTILS +#define PROCPS_NG_STRUTILS + +extern long strtol_or_err(const char *str, const char *errmesg); +extern double strtod_or_err(const char *str, const char *errmesg); +double strtod_nol_or_err(char *str, const char *errmesg); + +#endif diff --git a/local/strverscmp.c b/local/strverscmp.c new file mode 100644 index 0000000..e71ecd0 --- /dev/null +++ b/local/strverscmp.c @@ -0,0 +1,158 @@ +/* Compare strings while treating digits characters numerically. + Copyright (C) 1997, 2002, 2005 Free Software Foundation, Inc. + This file is part of the libiberty library. + Contributed by Jean-François Bignolles , 1997. + + Libiberty is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + Libiberty is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. */ + +/* #include "libiberty.h" */ +/* #include "safe-ctype.h" */ +#include + +/* +@deftypefun int strverscmp (const char *@var{s1}, const char *@var{s2}) +The @code{strverscmp} function compares the string @var{s1} against +@var{s2}, considering them as holding indices/version numbers. Return +value follows the same conventions as found in the @code{strverscmp} +function. In fact, if @var{s1} and @var{s2} contain no digits, +@code{strverscmp} behaves like @code{strcmp}. + +Basically, we compare strings normally (character by character), until +we find a digit in each string - then we enter a special comparison +mode, where each sequence of digits is taken as a whole. If we reach the +end of these two parts without noticing a difference, we return to the +standard comparison mode. There are two types of numeric parts: +"integral" and "fractional" (those begin with a '0'). The types +of the numeric parts affect the way we sort them: + +@itemize @bullet +@item +integral/integral: we compare values as you would expect. + +@item +fractional/integral: the fractional part is less than the integral one. +Again, no surprise. + +@item +fractional/fractional: the things become a bit more complex. +If the common prefix contains only leading zeroes, the longest part is less +than the other one; else the comparison behaves normally. +@end itemize + +@smallexample +strverscmp ("no digit", "no digit") + @result{} 0 // @r{same behavior as strcmp.} +strverscmp ("item#99", "item#100") + @result{} <0 // @r{same prefix, but 99 < 100.} +strverscmp ("alpha1", "alpha001") + @result{} >0 // @r{fractional part inferior to integral one.} +strverscmp ("part1_f012", "part1_f01") + @result{} >0 // @r{two fractional parts.} +strverscmp ("foo.009", "foo.0") + @result{} <0 // @r{idem, but with leading zeroes only.} +@end smallexample + +This function is especially useful when dealing with filename sorting, +because filenames frequently hold indices/version numbers. +@end deftypefun + +*/ + +/* states: S_N: normal, S_I: comparing integral part, S_F: comparing + fractional parts, S_Z: idem but with leading Zeroes only */ +#define S_N 0x0 +#define S_I 0x4 +#define S_F 0x8 +#define S_Z 0xC + +/* result_type: CMP: return diff; LEN: compare using len_diff/diff */ +#define CMP 2 +#define LEN 3 + + +/* Compare S1 and S2 as strings holding indices/version numbers, + returning less than, equal to or greater than zero if S1 is less than, + equal to or greater than S2 (for more info, see the Glibc texinfo doc). */ + +int +strverscmp (const char *s1, const char *s2) +{ + const unsigned char *p1 = (const unsigned char *) s1; + const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + int state; + int diff; + + /* Symbol(s) 0 [1-9] others (padding) + Transition (10) 0 (01) d (00) x (11) - */ + static const unsigned int next_state[] = + { + /* state x d 0 - */ + /* S_N */ S_N, S_I, S_Z, S_N, + /* S_I */ S_N, S_I, S_I, S_I, + /* S_F */ S_N, S_F, S_F, S_F, + /* S_Z */ S_N, S_F, S_Z, S_Z + }; + + static const int result_type[] = + { + /* state x/x x/d x/0 x/- d/x d/d d/0 d/- + 0/x 0/d 0/0 0/- -/x -/d -/0 -/- */ + + /* S_N */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, + CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, + /* S_I */ CMP, -1, -1, CMP, +1, LEN, LEN, CMP, + +1, LEN, LEN, CMP, CMP, CMP, CMP, CMP, + /* S_F */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, + CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, + /* S_Z */ CMP, +1, +1, CMP, -1, CMP, CMP, CMP, + -1, CMP, CMP, CMP + }; + + if (p1 == p2) + return 0; + + c1 = *p1++; + c2 = *p2++; + /* Hint: '0' is a digit too. */ + state = S_N | ((c1 == '0') + (isdigit (c1) != 0)); + + while ((diff = c1 - c2) == 0 && c1 != '\0') + { + state = next_state[state]; + c1 = *p1++; + c2 = *p2++; + state |= (c1 == '0') + (isdigit (c1) != 0); + } + + state = result_type[state << 2 | (((c2 == '0') + (isdigit (c2) != 0)))]; + + switch (state) + { + case CMP: + return diff; + + case LEN: + while (isdigit (*p1++)) + if (!isdigit (*p2++)) + return 1; + + return isdigit (*p2) ? -1 : diff; + + default: + return state; + } +} diff --git a/local/tests.h b/local/tests.h new file mode 100644 index 0000000..324cc22 --- /dev/null +++ b/local/tests.h @@ -0,0 +1,29 @@ + +#ifndef PROCPS_NG_TESTS_H +#define PROCPS_NG_TESTS_H + +#include + +typedef int (*TestFunction)(void *data); + +char *testname; + + +static inline int run_tests(TestFunction *list, void *data) +{ + int i; + TestFunction current; + + for (i=0; list[i] != NULL; i++) { + testname = NULL; + current = list[i]; + if (!current(data)) { + fprintf(stderr, "FAIL: %s\n", testname); + return EXIT_FAILURE; + } else { + fprintf(stderr, "PASS: %s\n", testname); + } + } + return EXIT_SUCCESS; +} +#endif diff --git a/local/xalloc.h b/local/xalloc.h new file mode 100644 index 0000000..a804689 --- /dev/null +++ b/local/xalloc.h @@ -0,0 +1,60 @@ +/* + * This header was copied from util-linux at fall 2011. + */ + +/* + * General memory allocation wrappers for malloc, realloc, calloc + * and strdup. + */ + +#ifndef PROCPS_NG_XALLOC_H +#define PROCPS_NG_XALLOC_H + +#include +#include + +#include "c.h" + +#ifndef XALLOC_EXIT_CODE +# define XALLOC_EXIT_CODE EXIT_FAILURE +#endif + +static inline __ul_alloc_size(1) +void *xmalloc(const size_t size) +{ + void *ret = malloc(size); + if (!ret && size) + xerrx(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size); + return ret; +} + +static inline __ul_alloc_size(2) +void *xrealloc(void *ptr, const size_t size) +{ + void *ret = realloc(ptr, size); + if (!ret && size) + xerrx(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size); + return ret; +} + +static inline __ul_calloc_size(1, 2) +void *xcalloc(const size_t nelems, const size_t size) +{ + void *ret = calloc(nelems, size); + if (!ret && size && nelems) + xerrx(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", nelems*size); + return ret; +} + +static inline char *xstrdup(const char *str) +{ + char *ret; + if (!str) + return NULL; + ret = strdup(str); + if (!ret) + xerrx(XALLOC_EXIT_CODE, "cannot duplicate string"); + return ret; +} + +#endif /* PROCPS_NG_XALLOC_H */ diff --git a/ltmain.sh b/ltmain.sh new file mode 100755 index 0000000..9b12fbb --- /dev/null +++ b/ltmain.sh @@ -0,0 +1,11448 @@ +#! /usr/bin/env sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2019-02-19.15 + +# libtool (GNU libtool) 2.4.7 +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996-2019, 2021-2022 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.7 Debian-2.4.7-5" +package_revision=2.4.7 + + +## ------ ## +## 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=2019-02-19.15; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. + +# Please report bugs or propose patches to: +# + + +## ------ ## +## 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 +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +# 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 + + +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + + +## ------------------------- ## +## 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" + +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + + +## ----------------- ## +## 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='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_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_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_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () +{ + $debug_cmd + + $require_check_ifs_backslash + + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break + fi + + # Quote for eval. + case $func_quote_portable_result in + *[\\\`\"\$]*) + # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string + # contains the shell wildcard characters. + case $check_ifs_backshlash_broken$func_quote_portable_result in + :*|*[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + done + IFS=$func_quote_portable_old_IFS + ;; + *) ;; + esac + break + done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result 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. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_portable_result=\"$func_quote_portable_result\" + ;; + esac +} + + +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + ;; + *) + printf -v func_quotefast_eval_result %q "$1" + ;; + esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi + + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; + esac + + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result + ;; + esac +} + + +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done +} + + +# 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_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_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_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_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 + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. + +# Please report bugs or propose patches to: +# + +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC + + +## ------ ## +## 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 '# Copyright'. +# +# 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 in 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 +# in the main code. A hook is just a list of function names 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 hook functions to be called by +# FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It's 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 + + _G_rc_run_hooks=false + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook functions." ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi + done +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# args_changed=false +# +# # 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=: +# args_changed=: +# ;; +# # 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 +# args_changed=: +# ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; +# esac +# done +# +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi +# } +# 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_add_hook func_validate_options my_option_validation +# +# You'll also 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_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} + + +# 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 + + _G_options_quoted=false + + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done + + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_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 propagate 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+"$@"} + func_propagate_result func_run_hooks func_options_prep +} + + +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () +{ + $debug_cmd + + _G_parse_options_requote=false + # 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+"$@"} + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi + + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break + + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" >&2 + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; + + --warnings|--warning|-W) + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi + 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 + ;; + + --) _G_parse_options_requote=: ; break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; + esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi + done + + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi +} + + +# 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+"$@"} + func_propagate_result func_run_hooks func_validate_options + + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE +} + + + +## ----------------- ## +## 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#*=} + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi + }' +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. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. +func_version () +{ + $debug_cmd + + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk + } + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt + } + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" + + exit $? +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: + +# Set a version string. +scriptversion='(GNU libtool) 2.4.7' + + +# 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 $scriptversion Debian-2.4.7-5 + 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= + + _G_rc_lt_options_prep=: + + _G_rc_lt_options_prep=: + + # 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 + ;; + *) + _G_rc_lt_options_prep=false + ;; + esac + + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result + fi +} +func_add_hook func_options_prep libtool_options_prep + + +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () +{ + $debug_cmd + + _G_rc_lt_parse_options=false + + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_match_lt_parse_options=: + _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 + _G_match_lt_parse_options=false + break + ;; + esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: + done + + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result + fi +} +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 eval ${1+"$@"} + libtool_validate_options_result=$func_quote_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_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_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_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_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 + -Xcompiler 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 + -Wa,FLAG + -Xassembler FLAG pass linker-specific FLAG directly to the assembler + -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_arg pretty "$nonopt" + install_prog="$func_quote_arg_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_arg pretty "$arg" + func_append install_prog "$func_quote_arg_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_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" + if test -n "$arg2"; then + func_quote_arg pretty "$arg2" + fi + func_append install_shared_prog " $func_quote_arg_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_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_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_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_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\"" + + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result + $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_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_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 + ;; + xassembler) + func_append compiler_flags " -Xassembler $qarg" + prev= + func_append compile_command " -Xassembler $qarg" + func_append finalize_command " -Xassembler $qarg" + 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* | *-*-midnightbsd*) + # 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* | *-*-midnightbsd*) + # 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 + ;; + # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. + -pthread) + case $host in + *solaris2*) ;; + *) + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + ;; + esac + continue + ;; + -mt|-mthreads|-kthread|-Kthread|-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_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_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_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xassembler) + prev=xassembler + continue + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_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 + # -specs=* GCC specs files + # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC + # -static-* direct GCC to link specific libraries statically + # -fcilkplus Cilk Plus language extension features for C/C++ + # -Wa,* Pass flags directly to the assembler + -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=*| \ + -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus|-Wa,*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_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_arg pretty "$arg" + arg=$func_quote_arg_result + fi + ;; + + # Some other compiler flag. + -* | +*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_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_arg pretty "$arg" + arg=$func_quote_arg_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%" + test "X$link_all_deplibs" != Xno && libs="$libs $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" + 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 + elif test prog != "$linkmode" && test lib != "$linkmode"; then + func_fatal_error "'$lib' is not a convenience library" + fi + 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|midnightbsd-elf|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 + ;; + *) + func_fatal_configuration "$modename: unknown library version type '$version_type'" + ;; + 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 | midnightbsd-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* | *-*-midnightbsd*) + # 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_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_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_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_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_arg pretty "$var_value" + relink_command="$var=$func_quote_arg_result; export $var; $relink_command" + fi + done + func_quote eval cd "`pwd`" + func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" + relink_command=$func_quote_arg_unquoted_result + 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_arg pretty,unquoted "$var_value" + relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + func_quote eval cd "`pwd`" + relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + func_quote_arg pretty,unquoted "$relink_command" + relink_command=$func_quote_arg_unquoted_result + 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..a374f03 --- /dev/null +++ b/m4/gettext.m4 @@ -0,0 +1,487 @@ +# gettext.m4 serial 28 (gettext-0.13) +dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +dnl Macro to add for using GNU gettext. + +dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). +dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The +dnl default (if it is not specified or empty) is 'no-libtool'. +dnl INTLSYMBOL should be 'external' for packages with no intl directory, +dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. +dnl If INTLSYMBOL is 'use-libtool', then a libtool library +dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, +dnl depending on --{enable,disable}-{shared,static} and on the presence of +dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library +dnl $(top_builddir)/intl/libintl.a will be created. +dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext +dnl implementations (in libc or libintl) without the ngettext() function +dnl will be ignored. If NEEDSYMBOL is specified and is +dnl 'need-formatstring-macros', then GNU gettext implementations that don't +dnl support the ISO C 99 formatstring macros will be ignored. +dnl INTLDIR is used to find the intl libraries. If empty, +dnl the value `$(top_builddir)/intl/' is used. +dnl +dnl The result of the configuration is one of three cases: +dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled +dnl and used. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 2) GNU gettext has been found in the system's C library. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 3) No internationalization, always use English msgid. +dnl Catalog format: none +dnl Catalog extension: none +dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. +dnl The use of .gmo is historical (it was needed to avoid overwriting the +dnl GNU format catalogs when building on a platform with an X/Open gettext), +dnl but we keep it in order not to force irrelevant filename changes on the +dnl maintainers. +dnl +AC_DEFUN([AM_GNU_GETTEXT], +[ + dnl Argument checking. + ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , + [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT +])])])])]) + ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , + [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT +])])])]) + define(gt_included_intl, ifelse([$1], [external], [no], [yes])) + define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) + + AC_REQUIRE([AM_PO_SUBDIRS])dnl + ifelse(gt_included_intl, yes, [ + AC_REQUIRE([AM_INTL_SUBDIR])dnl + ]) + + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Sometimes libintl requires libiconv, so first search for libiconv. + dnl Ideally we would do this search only after the + dnl if test "$USE_NLS" = "yes"; then + dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then + dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT + dnl the configure script would need to contain the same shell code + dnl again, outside any 'if'. There are two solutions: + dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. + dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. + dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not + dnl documented, we avoid it. + ifelse(gt_included_intl, yes, , [ + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + ]) + + dnl Set USE_NLS. + AM_NLS + + ifelse(gt_included_intl, yes, [ + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + ]) + LIBINTL= + LTLIBINTL= + POSUB= + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + ifelse(gt_included_intl, yes, [ + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH(included-gettext, + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + ]) + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If GNU gettext is available we use this. Else we have + dnl to fall back to GNU NLS library. + + dnl Add a version number to the cache macros. + define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) + define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) + define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) + + AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, + [AC_TRY_LINK([#include +]ifelse([$2], [need-formatstring-macros], +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +], [])[extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings;], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], + gt_cv_func_gnugettext_libc=yes, + gt_cv_func_gnugettext_libc=no)]) + + if test "$gt_cv_func_gnugettext_libc" != "yes"; then + dnl Sometimes libintl requires libiconv, so first search for libiconv. + ifelse(gt_included_intl, yes, , [ + AM_ICONV_LINK + ]) + dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL + dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) + dnl because that would add "-liconv" to LIBINTL and LTLIBINTL + dnl even if libiconv doesn't exist. + AC_LIB_LINKFLAGS_BODY([intl]) + AC_CACHE_CHECK([for GNU gettext in libintl], + gt_cv_func_gnugettext_libintl, + [gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + dnl Now see whether libintl exists and does not depend on libiconv. + AC_TRY_LINK([#include +]ifelse([$2], [need-formatstring-macros], +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +], [])[extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias ();], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], + gt_cv_func_gnugettext_libintl=yes, + gt_cv_func_gnugettext_libintl=no) + dnl Now see whether libintl exists and depends on libiconv. + if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include +]ifelse([$2], [need-formatstring-macros], +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +], [])[extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias ();], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], + [LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + gt_cv_func_gnugettext_libintl=yes + ]) + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS"]) + fi + + dnl If an already present or preinstalled GNU gettext() is found, + dnl use it. But if this macro is used in GNU gettext, and GNU + dnl gettext is already preinstalled in libintl, we update this + dnl libintl. (Cf. the install rule in intl/Makefile.in.) + if test "$gt_cv_func_gnugettext_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + dnl Reset the values set by searching for libintl. + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + ifelse(gt_included_intl, yes, [ + if test "$gt_use_preinstalled_gnugettext" != "yes"; then + dnl GNU gettext is not found in the C library. + dnl Fall back on included GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" + LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + 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 "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + AC_DEFINE(ENABLE_NLS, 1, + [Define to 1 if translation of program messages to the user's native language + is requested.]) + else + USE_NLS=no + fi + fi + + AC_MSG_CHECKING([whether to use NLS]) + AC_MSG_RESULT([$USE_NLS]) + if test "$USE_NLS" = "yes"; then + AC_MSG_CHECKING([where the gettext function comes from]) + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext_libintl" = "yes"; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + AC_MSG_RESULT([$gt_source]) + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext_libintl" = "yes"; then + AC_MSG_CHECKING([how to link with libintl]) + AC_MSG_RESULT([$LIBINTL]) + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) + fi + + dnl For backward compatibility. Some packages may be using this. + AC_DEFINE(HAVE_GETTEXT, 1, + [Define if the GNU gettext() function is already present or preinstalled.]) + AC_DEFINE(HAVE_DCGETTEXT, 1, + [Define if the GNU dcgettext() function is already present or preinstalled.]) + fi + + dnl We need to process the po/ directory. + POSUB=po + fi + + ifelse(gt_included_intl, yes, [ + dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL + dnl to 'yes' because some of the testsuite requires it. + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then + BUILD_INCLUDED_LIBINTL=yes + fi + + dnl Make all variables we use known to autoconf. + AC_SUBST(BUILD_INCLUDED_LIBINTL) + AC_SUBST(USE_INCLUDED_LIBINTL) + AC_SUBST(CATOBJEXT) + + dnl For backward compatibility. Some configure.ins may be using this. + nls_cv_header_intl= + nls_cv_header_libgt= + + dnl For backward compatibility. Some Makefiles may be using this. + DATADIRNAME=share + AC_SUBST(DATADIRNAME) + + dnl For backward compatibility. Some Makefiles may be using this. + INSTOBJEXT=.mo + AC_SUBST(INSTOBJEXT) + + dnl For backward compatibility. Some Makefiles may be using this. + GENCAT=gencat + AC_SUBST(GENCAT) + + dnl For backward compatibility. Some Makefiles may be using this. + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + AC_SUBST(INTLOBJS) + + dnl Enable libtool support if the surrounding package wishes it. + INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix + AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) + ]) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLLIBS="$LIBINTL" + AC_SUBST(INTLLIBS) + + dnl Make all documented variables known to autoconf. + AC_SUBST(LIBINTL) + AC_SUBST(LTLIBINTL) + AC_SUBST(POSUB) +]) + + +dnl Checks for all prerequisites of the intl subdirectory, +dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, +dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. +AC_DEFUN([AM_INTL_SUBDIR], +[ + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_MKINSTALLDIRS])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_ISC_POSIX])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_C_CONST])dnl + AC_REQUIRE([bh_C_SIGNED])dnl + AC_REQUIRE([AC_C_INLINE])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl + AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl + AC_REQUIRE([gt_TYPE_WCHAR_T])dnl + AC_REQUIRE([gt_TYPE_WINT_T])dnl + AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([jm_AC_HEADER_STDINT_H]) + AC_REQUIRE([gt_TYPE_INTMAX_T]) + AC_REQUIRE([gt_PRINTF_POSIX]) + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + AC_REQUIRE([jm_GLIBC21])dnl + AC_REQUIRE([gt_INTDIV0])dnl + AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl + AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl + AC_REQUIRE([gt_INTTYPES_PRI])dnl + AC_REQUIRE([gl_XSIZE])dnl + + AC_CHECK_TYPE([ptrdiff_t], , + [AC_DEFINE([ptrdiff_t], [long], + [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) + ]) + AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ +stdlib.h string.h unistd.h sys/param.h]) + AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \ +mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ +strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ +__fsetlocking]) + + dnl Use the _snprintf function only if it is declared (because on NetBSD it + dnl is defined as a weak alias of snprintf; we prefer to use the latter). + gt_CHECK_DECL(_snprintf, [#include ]) + gt_CHECK_DECL(_snwprintf, [#include ]) + + dnl Use the *_unlocked functions only if they are declared. + dnl (because some of them were defined without being declared in Solaris + dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built + dnl on Solaris 2.5.1 to run on Solaris 2.6). + dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. + gt_CHECK_DECL(feof_unlocked, [#include ]) + gt_CHECK_DECL(fgets_unlocked, [#include ]) + gt_CHECK_DECL(getc_unlocked, [#include ]) + + case $gt_cv_func_printf_posix in + *yes) HAVE_POSIX_PRINTF=1 ;; + *) HAVE_POSIX_PRINTF=0 ;; + esac + AC_SUBST([HAVE_POSIX_PRINTF]) + if test "$ac_cv_func_asprintf" = yes; then + HAVE_ASPRINTF=1 + else + HAVE_ASPRINTF=0 + fi + AC_SUBST([HAVE_ASPRINTF]) + if test "$ac_cv_func_snprintf" = yes; then + HAVE_SNPRINTF=1 + else + HAVE_SNPRINTF=0 + fi + AC_SUBST([HAVE_SNPRINTF]) + if test "$ac_cv_func_wprintf" = yes; then + HAVE_WPRINTF=1 + else + HAVE_WPRINTF=0 + fi + AC_SUBST([HAVE_WPRINTF]) + + AM_ICONV + AM_LANGINFO_CODESET + if test $ac_cv_header_locale_h = yes; then + AM_LC_MESSAGES + fi + + dnl intl/plural.c is generated from intl/plural.y. It requires bison, + dnl because plural.y uses bison specific features. It requires at least + dnl bison-1.26 because earlier versions generate a plural.c that doesn't + dnl compile. + dnl bison is only needed for the maintainer (who touches plural.y). But in + dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put + dnl the rule in general Makefile. Now, some people carelessly touch the + dnl files or have a broken "make" program, hence the plural.c rule will + dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not + dnl present or too old. + AC_CHECK_PROGS([INTLBISON], [bison]) + if test -z "$INTLBISON"; then + ac_verc_fail=yes + else + dnl Found it, now check the version. + AC_MSG_CHECKING([version of bison]) +changequote(<<,>>)dnl + ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) +changequote([,])dnl + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + esac + AC_MSG_RESULT([$ac_prog_version]) + fi + if test $ac_verc_fail = yes; then + INTLBISON=: + fi +]) + + +dnl gt_CHECK_DECL(FUNC, INCLUDES) +dnl Check whether a function is declared. +AC_DEFUN([gt_CHECK_DECL], +[ + AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1, + [AC_TRY_COMPILE([$2], [ +#ifndef $1 + char *p = (char *) $1; +#endif +], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)]) + if test $ac_cv_have_decl_$1 = yes; then + gt_value=1 + else + gt_value=0 + fi + AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value], + [Define to 1 if you have the declaration of `$1', and to 0 if you don't.]) +]) + + +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) diff --git a/m4/iconv.m4 b/m4/iconv.m4 new file mode 100644 index 0000000..c5f3579 --- /dev/null +++ b/m4/iconv.m4 @@ -0,0 +1,103 @@ +# iconv.m4 serial AM4 (gettext-0.11.3) +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], +[ + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([iconv]) +]) + +AC_DEFUN([AM_ICONV_LINK], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + + dnl Add $INCICONV to CPPFLAGS before performing the following checks, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. The first + dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + am_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) + + AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_func_iconv=yes) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_lib_iconv=yes + am_cv_func_iconv=yes) + LIBS="$am_save_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + AC_MSG_RESULT([$LIBICONV]) + else + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV + dnl either. + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + AC_SUBST(LIBICONV) + AC_SUBST(LTLIBICONV) +]) + +AC_DEFUN([AM_ICONV], +[ + AM_ICONV_LINK + if test "$am_cv_func_iconv" = yes; then + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL(am_cv_proto_iconv, [ + AC_TRY_COMPILE([ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([$]{ac_t:- + }[$]am_cv_proto_iconv) + AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + [Define as const if the declaration of iconv() needs const.]) + fi +]) diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4 new file mode 100644 index 0000000..38aeaec --- /dev/null +++ b/m4/lib-ld.m4 @@ -0,0 +1,112 @@ +# lib-ld.m4 serial 3 (gettext-0.13) +dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl Subroutines of libtool.m4, +dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision +dnl with libtool.m4. + +dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +AC_DEFUN([AC_LIB_PROG_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]* | [A-Za-z]:[\\/]*)] + [re_direlt='/[^/][^/]*/\.\./'] + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(acl_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$acl_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_LIB_PROG_LD_GNU +]) diff --git a/m4/lib-link.m4 b/m4/lib-link.m4 new file mode 100644 index 0000000..eeb200d --- /dev/null +++ b/m4/lib-link.m4 @@ -0,0 +1,551 @@ +# lib-link.m4 serial 4 (gettext-0.12) +dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and +dnl augments the CPPFLAGS variable. +AC_DEFUN([AC_LIB_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + ac_cv_lib[]Name[]_libs="$LIB[]NAME" + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" + ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ]) + LIB[]NAME="$ac_cv_lib[]Name[]_libs" + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" + INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the + dnl results of this search when this library appears as a dependency. + HAVE_LIB[]NAME=yes + undefine([Name]) + undefine([NAME]) +]) + +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) +dnl searches for libname and the libraries corresponding to explicit and +dnl implicit dependencies, together with the specified include files and +dnl the ability to compile and link the specified testcode. If found, it +dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and +dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + + dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, + dnl because if the user has installed lib[]Name and not disabled its use + dnl via --without-lib[]Name-prefix, he wants to use it. + ac_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + + AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIB[]NAME" + AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) + LIBS="$ac_save_LIBS" + ]) + if test "$ac_cv_lib[]Name" = yes; then + HAVE_LIB[]NAME=yes + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) + AC_MSG_CHECKING([how to link with lib[]$1]) + AC_MSG_RESULT([$LIB[]NAME]) + else + HAVE_LIB[]NAME=no + dnl If $LIB[]NAME didn't lead to a usable library, we don't need + dnl $INC[]NAME either. + CPPFLAGS="$ac_save_CPPFLAGS" + LIB[]NAME= + LTLIB[]NAME= + fi + AC_SUBST([HAVE_LIB]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + undefine([Name]) + undefine([NAME]) +]) + +dnl Determine the platform dependent parameters needed to use rpath: +dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, +dnl hardcode_direct, hardcode_minus_L. +AC_DEFUN([AC_LIB_RPATH], +[ + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE(rpath, + [ --disable-rpath do not hardcode runtime library paths], + :, enable_rpath=yes) +]) + +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +AC_DEFUN([AC_LIB_LINKFLAGS_BODY], +[ + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib$1-prefix], +[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib + --without-lib$1-prefix don't search for lib$1 in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi +]) + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Using breadth-first-seach. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dnl Handle this in the next round. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" + done + fi +]) + +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, +dnl unless already present in VAR. +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes +dnl contains two or three consecutive elements that belong together. +AC_DEFUN([AC_LIB_APPENDTOVAR], +[ + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done +]) diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4 new file mode 100644 index 0000000..8aff5a9 --- /dev/null +++ b/m4/lib-prefix.m4 @@ -0,0 +1,155 @@ +# lib-prefix.m4 serial 3 (gettext-0.13) +dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't +dnl require excessive bracketing. +ifdef([AC_HELP_STRING], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], +[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) + +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed +dnl to access previously installed libraries. The basic assumption is that +dnl a user will want packages to use other packages he previously installed +dnl with the same --prefix option. +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate +dnl libraries, but is otherwise very convenient. +AC_DEFUN([AC_LIB_PREFIX], +[ + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib-prefix], +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi +]) + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi + fi + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi +]) + +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, +dnl acl_final_exec_prefix, containing the values to which $prefix and +dnl $exec_prefix will expand at the end of the configure script. +AC_DEFUN([AC_LIB_PREPARE_PREFIX], +[ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the +dnl variables prefix and exec_prefix bound to the values they will have +dnl at the end of the configure script. +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], +[ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" +]) diff --git a/m4/libtool.m4 b/m4/libtool.m4 new file mode 100644 index 0000000..e7b6833 --- /dev/null +++ b/m4/libtool.m4 @@ -0,0 +1,8427 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 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 59 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_DECL_FILECMD])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 and +# ICC, which need '.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 +# 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 $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS 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*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _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], +[m4_require([_LT_DECL_SED])dnl +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 `$FILECMD 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 `$FILECMD conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `$FILECMD 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 `$FILECMD conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `$FILECMD conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `$FILECMD 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 `$FILECMD conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `$FILECMD 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 `$FILECMD 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} +_LT_DECL([], [AR], [1], [The archiver]) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], + [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* | midnightbsd* | 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 -z "$STRIP"; then + AC_MSG_RESULT([no]) +else + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac + fi +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* | *,icl*) + # Native MSVC or ICC + 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 and ICC 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* | midnightbsd*) + # 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 + + # 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="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # 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='$FILECMD -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* | midnightbsd*) + 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=$FILECMD + 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=$FILECMD + 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* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=$FILECMD + 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++ or ICC, + # 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 + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && 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* | midnightbsd*) + # 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* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | 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' + ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _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 == "L") || (\$ 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* | icl*) + _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 + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + 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++ and ICC port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++ or Intel C++ Compiler. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=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 + _LT_TAGVAR(file_list_spec, $1)='@' + ;; + + 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(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _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* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $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 == "L") || (\$ 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++ or Intel C++ Compiler. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl* | icl*) + # Native MSVC or ICC + _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 and ICC 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* | midnightbsd*) + _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 + _LT_TAGVAR(link_all_deplibs, $1)=no + 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' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + ;; + esac + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | 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 + _LT_TAGVAR(file_list_spec, $1)='@' + ;; + + 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* | ,icl* | no,icl*) + # Native MSVC or ICC + # 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 + _LT_TAGVAR(file_list_spec, $1)='@' + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + 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* | midnightbsd*) + # 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_FILECMD +# ---------------- +# Check for a file(cmd) program that can be used to detect file type and magic +m4_defun([_LT_DECL_FILECMD], +[AC_CHECK_TOOL([FILECMD], [file], [:]) +_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) +])# _LD_DECL_FILECMD + +# _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..b0b5e9c --- /dev/null +++ b/m4/ltoptions.m4 @@ -0,0 +1,437 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 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..902508b --- /dev/null +++ b/m4/ltsugar.m4 @@ -0,0 +1,124 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 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..b155d0a --- /dev/null +++ b/m4/ltversion.m4 @@ -0,0 +1,24 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004, 2011-2019, 2021-2022 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 4245 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.7]) +m4_define([LT_PACKAGE_REVISION], [2.4.7]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.7' +macro_revision='2.4.7' +_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..0f7a875 --- /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-2019, 2021-2022 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..36bc493 --- /dev/null +++ b/m4/nls.m4 @@ -0,0 +1,49 @@ +# nls.m4 serial 1 (gettext-0.12) +dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +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_DEFUN([AM_NLS], +[ + AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) +]) + +AC_DEFUN([AM_MKINSTALLDIRS], +[ + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but $(top_srcdir). + dnl Try to locate it. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + case "$ac_aux_dir" in + /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; + *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; + esac + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) +]) diff --git a/m4/po.m4 b/m4/po.m4 new file mode 100644 index 0000000..e161998 --- /dev/null +++ b/m4/po.m4 @@ -0,0 +1,426 @@ +# po.m4 serial 3 (gettext-0.14) +dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +dnl Checks for all prerequisites of the po subdirectory. +AC_DEFUN([AM_PO_SUBDIRS], +[ + AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_MKINSTALLDIRS])dnl + AC_REQUIRE([AM_NLS])dnl + + dnl Perform the following tests also if --disable-nls has been given, + dnl because they are needed for "make dist" to work. + + dnl Search for GNU msgfmt in the PATH. + dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. + dnl The second test excludes FreeBSD msgfmt. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + + dnl Search for GNU xgettext 0.12 or newer in the PATH. + dnl The first test excludes Solaris xgettext and early GNU xgettext versions. + dnl The second test excludes FreeBSD xgettext. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + + dnl Search for GNU msgmerge 0.11 or newer in the PATH. + AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, + [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) + + dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. + dnl Test whether we really found GNU msgfmt. + if test "$GMSGFMT" != ":"; then + dnl If it is no GNU msgfmt we define it as : so that the + dnl Makefiles still can work. + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + AC_MSG_RESULT( + [found $GMSGFMT program is not GNU msgfmt; ignore it]) + GMSGFMT=":" + fi + fi + + dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + fi + + AC_OUTPUT_COMMANDS([ + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done], + [# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + ]) +]) + +dnl Postprocesses a Makefile in a directory containing PO files. +AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], +[ + # When this code is run, in config.status, two variables have already been + # set: + # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, + # - LINGUAS is the value of the environment variable LINGUAS at configure + # time. + +changequote(,)dnl + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + # Find a way to echo strings without interpreting backslash. + if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then + gt_echo='echo' + else + if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then + gt_echo='printf %s\n' + else + echo_func () { + cat < "$ac_file.tmp" + if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then + # Add dependencies that cannot be formulated as a simple suffix rule. + for lang in $ALL_LINGUAS; do + frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` + cat >> "$ac_file.tmp" < /dev/null; then + # Add dependencies that cannot be formulated as a simple suffix rule. + for lang in $ALL_LINGUAS; do + frobbedlang=`echo $lang | sed -e 's/_/-/g'` + cat >> "$ac_file.tmp" <> "$ac_file.tmp" <, 1996. + +# Search path for a program which passes the given test. + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN([AM_PATH_PROG_WITH_TEST], +[ +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + [[\\/]]* | ?:[[\\/]]*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in ifelse([$5], , $PATH, [$5]); do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + 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/man/free.1 b/man/free.1 new file mode 100644 index 0000000..cfe9509 --- /dev/null +++ b/man/free.1 @@ -0,0 +1,169 @@ +.\" +.\" Copyright (c) 2011-2023 Craig Small +.\" Copyright (c) 2013-2023 Jim Warner +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 2002-2003 Albert Cahalan +.\" Copyright (c) 1993 Matt Welsh +.\" +.\" 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. +.\" +.\" +.TH FREE 1 "2023-05-02" "procps-ng" "User Commands" +.SH NAME +free \- Display amount of free and used memory in the system +.SH SYNOPSIS +.B free +.RI [ options ] +.SH DESCRIPTION +.B free +displays the total amount of free and used physical and swap memory in the +system, as well as the buffers and caches used by the kernel. The +information is gathered by parsing /proc/meminfo. The displayed +columns are: +.TP +\fBtotal\fR +Total usable memory (MemTotal and SwapTotal in /proc/meminfo). This includes +the physical and swap memory minus a few reserved bits and kernel binary code. +.TP +\fBused\fR +Used or unavailable memory (calculated as \fBtotal\fR - \fBavailable\fR) +.TP +\fBfree\fR +Unused memory (MemFree and SwapFree in /proc/meminfo) +.TP +\fBshared\fR +Memory used (mostly) by tmpfs (Shmem in /proc/meminfo) +.TP +\fBbuffers\fR +Memory used by kernel buffers (Buffers in /proc/meminfo) +.TP +\fBcache\fR +Memory used by the page cache and slabs (Cached and SReclaimable in /proc/meminfo) +.TP +\fBbuff/cache\fR +Sum of \fBbuffers\fR and \fBcache\fR +.TP +\fBavailable\fR +Estimation of how much memory is available for starting +new applications, without swapping. Unlike the data +provided by the \fBcache\fR or \fBfree\fR fields, +this field takes into account page cache and also that +not all reclaimable memory slabs will be reclaimed +due to items being in use (MemAvailable in /proc/meminfo, available on +kernels 3.14, emulated on kernels 2.6.27+, otherwise the same as \fBfree\fR) +.SH OPTIONS +.TP +\fB\-b\fR, \fB\-\-bytes\fR +Display the amount of memory in bytes. +.TP +\fB\-k\fR, \fB\-\-kibi\fR +Display the amount of memory in kibibytes. This is the default. +.TP +\fB\-m\fR, \fB\-\-mebi\fR +Display the amount of memory in mebibytes. +.TP +\fB\-g\fR, \fB\-\-gibi\fR +Display the amount of memory in gibibytes. +.TP +\fB\-\-tebi\fR +Display the amount of memory in tebibytes. +.TP +\fB\-\-pebi\fR +Display the amount of memory in pebibytes. +.TP +\fB\-\-kilo\fR +Display the amount of memory in kilobytes. Implies --si. +.TP +\fB\-\-mega\fR +Display the amount of memory in megabytes. Implies --si. +.TP +\fB\-\-giga\fR +Display the amount of memory in gigabytes. Implies --si. +.TP +\fB\-\-tera\fR +Display the amount of memory in terabytes. Implies --si. +.TP +\fB\-\-peta\fR +Display the amount of memory in petabytes. Implies --si. +.TP +\fB\-h\fR, \fB\-\-human\fP +Show all output fields automatically scaled to shortest three digit unit and +display the units of print out. Following units are used. +.sp +.nf + B = bytes + Ki = kibibyte + Mi = mebibyte + Gi = gibibyte + Ti = tebibyte + Pi = pebibyte +.fi +.sp +If unit is missing, and you have exbibyte of RAM or swap, the number is in +tebibytes and columns might not be aligned with header. +.TP +\fB\-w\fR, \fB\-\-wide\fR +Switch to the wide mode. The wide mode produces lines longer +than 80 characters. In this mode \fBbuffers\fR and \fBcache\fR +are reported in two separate columns. +.TP +\fB\-c\fR, \fB\-\-count\fR \fIcount\fR +Display the result +.I count +times. Requires the +.B \-s +option. +.TP +\fB\-l\fR, \fB\-\-lohi\fR +Show detailed low and high memory statistics. +.TP +\fB\-L\fR, \fB\-\-line\fR +Show output on a single line, often used with the +.B \-s +option to show memory statistics repeatedly. +.TP +\fB\-s\fR, \fB\-\-seconds\fR \fIdelay\fR +Continuously display the result \fIdelay\fR seconds +apart. You may actually specify any floating point number for +\fIdelay\fR using either . or , for decimal point. +.BR usleep (3) +is used for microsecond resolution delay times. +.TP +\fB\-\-si\fR +Use kilo, mega, giga etc (power of 1000) instead of kibi, mebi, gibi (power +of 1024). +.TP +\fB\-t\fR, \fB\-\-total\fR +Display a line showing the column totals. +.TP +\fB\-v\fR, \fB\-\-committed\fR +Display a line showing the memory commit limit and amount of committed/uncommitted +memory. The \fBtotal\fR column on this line will display the memory commit +limit. This line is relevant if memory overcommit is disabled. +.TP +\fB\-\-help\fR +Print help. +.TP +\fB\-V\fR, \fB\-\-version\fR +Display version information. +.PD +.SH FILES +.TP +/proc/meminfo +memory information +.PD +.SH BUGS +The value for the \fBshared\fR column is not available from kernels before +2.6.32 and is displayed as zero. +.TP +Please send bug reports to +.UR procps@freelists.org +.UE +.SH "SEE ALSO" +.BR ps (1), +.BR slabtop (1), +.BR top "(1), +.BR vmstat (8). diff --git a/man/kill.1 b/man/kill.1 new file mode 100644 index 0000000..b74717c --- /dev/null +++ b/man/kill.1 @@ -0,0 +1,110 @@ +.\" +.\" Copyright (c) 2002-2023 Craig Small +.\" Copyright (c) 2011-2023 Jim Warner +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 1998-2003 Albert Cahalan +.\" +.\" 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. +.\" +.TH KILL 1 "2023-01-16" "procps-ng" "User Commands" +.SH NAME +kill \- send a signal to a process +.SH SYNOPSIS +.B kill +[options] [...] +.SH DESCRIPTION +The default signal for kill is TERM. Use +.B \-l +or +.B \-L +to list available signals. Particularly useful signals include HUP, +INT, KILL, STOP, CONT, and 0. Alternate signals may be specified in +three ways: +.BR \-9 ", " \-SIGKILL +or +.BR \-KILL . +Negative PID values may be used to choose whole process groups; see +the PGID column in ps command output. A PID of +.B \-1 +is special; it indicates all processes except the kill process itself +and init. +.SH OPTIONS +.TP +.B [...] +Send signal to every listed. +.TP +.B \- +.TQ +.B \-s +.TQ +.B \-\-signal +Specify the +.B signal +to be sent. The signal can be specified by using name or number. +The behavior of signals is explained in +.BR signal (7) +manual page. +.TP +\fB\-q\fR, \fB\-\-queue \fIvalue\fP +Use +.BR sigqueue (3) +rather than +.BR kill (2) +and the value argument is used to specify +an integer to be sent with the signal. If the receiving process has +installed a handler for this signal using the SA_SIGINFO flag to +.BR sigaction (2), +then it can obtain this data via the si_value field of the +siginfo_t structure. +.TP +\fB\-l\fR, \fB\-\-list\fR [\fIsignal\fR] +List signal names. This option has optional argument, which +will convert signal number to signal name, or other way round. +.TP +.BR \-L , \ \-\-table +List signal names in a nice table. +.TP +.PD +.SH NOTES +Your shell (command line interpreter) may have a built-in kill +command. You may need to run the command described here as /bin/kill +to solve the conflict. +.SH EXAMPLES +.TP +.B kill \-9 \-1 +Kill all processes you can kill. +.TP +.B kill \-l 11 +Translate number 11 into a signal name. +.TP +.B kill -L +List the available signal choices in a nice table. +.TP +.B kill 123 543 2341 3453 +Send the default signal, SIGTERM, to all those processes. +.SH "SEE ALSO" +.BR kill (2), +.BR killall (1), +.BR nice (1), +.BR pkill (1), +.BR renice (1), +.BR signal (7), +.BR sigqueue (3), +.BR skill (1) +.SH STANDARDS +This command meets appropriate standards. The +.B \-L +flag is Linux-specific. +.SH AUTHOR +.UR albert@users.sf.net +Albert Cahalan +.UE +wrote kill in 1999 to replace a bsdutils one that was not standards +compliant. The util-linux one might also work correctly. +.SH "REPORTING BUGS" +Please send bug reports to +.UR procps@freelists.org +.UE diff --git a/man/pgrep.1 b/man/pgrep.1 new file mode 100644 index 0000000..41d9ac0 --- /dev/null +++ b/man/pgrep.1 @@ -0,0 +1,334 @@ +.\" +.\" Copyright (c) 2004-2023 Craig Small +.\" Copyright (c) 2013-2023 Jim Warner +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 2002-2004 Albert Cahalan +.\" Copyright (c) 2000 Kjetil Torgrim Homme +.\" +.\" 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. +.\" +.TH PGREP "1" "2023-01-16" "procps-ng" "User Commands" +.SH NAME +pgrep, pkill, pidwait \- look up, signal, or wait for processes based on name and other attributes +.SH SYNOPSIS +.B pgrep +[options] pattern +.br +.B pkill +[options] pattern +.br +.B pidwait +[options] pattern +.SH DESCRIPTION +.B pgrep +looks through the currently running processes and lists the process IDs which +match the selection criteria to stdout. All the criteria have to match. +For example, +.IP +$ pgrep \-u root sshd +.PP +will only list the processes called +.B sshd +AND owned by +.BR root . +On the other hand, +.IP +$ pgrep \-u root,daemon +.PP +will list the processes owned by +.B root +OR +.BR daemon . +.PP +.B pkill +will send the specified signal (by default +.BR SIGTERM ) +to each process instead of listing them on stdout. +.PP +.B pidwait +will wait for each process instead of listing them on stdout. +.SH OPTIONS +.TP +\fB\-\fR\fIsignal\fP +.TQ +\fB\-\-signal\fR \fIsignal\fR +Defines the signal to send to each matched process. Either the numeric or +the symbolic signal name can be used. In +.B pgrep +or +.B pidwait +mode only the long option can be used and has no effect unless used in conjunction with +\fB\-\-require\-handler\fR to filter to processes with a userspace signal +handler present for a particular signal. + +.TP +\fB\-c\fR, \fB\-\-count\fR +Suppress normal output; instead print a count of matching processes. When +count does not match anything, e.g. returns zero, the command will return +non-zero value. Note that for pkill and pidwait, the count is the number of +matching processes, not the processes that were successfully signaled or waited +for. +.TP +\fB\-d\fR, \fB\-\-delimiter\fR \fIdelimiter\fP +Sets the string used to delimit each process ID in the output (by default a +newline). +.RB ( pgrep +only.) +.TP +\fB\-e\fR, \fB\-\-echo\fR +Display name and PID of the process being killed. +.RB ( pkill +only.) +.TP +\fB\-f\fR, \fB\-\-full\fR +The +.I pattern +is normally only matched against the process name. When +.B \-f +is set, the full command line is used. +.TP +\fB\-g\fR, \fB\-\-pgroup\fR \fIpgrp\fP,... +Only match processes in the process group IDs listed. Process group 0 is +translated into +.BR pgrep 's, +.BR pkill 's, +or +.BR pidwait 's +own process group. +.TP +\fB\-G\fR, \fB\-\-group\fR \fIgid\fP,... +Only match processes whose real group ID is listed. Either the numerical or +symbolical value may be used. +.TP +\fB\-i\fR, \fB\-\-ignore\-case\fR +Match processes case-insensitively. +.TP +\fB\-l\fR, \fB\-\-list\-name\fR +List the process name as well as the process ID. +.RB ( pgrep +only.) +.TP +\fB\-a\fR, \fB\-\-list\-full\fR +List the full command line as well as the process ID. +.RB ( pgrep +only.) +.TP +\fB\-n\fR, \fB\-\-newest\fR +Select only the newest (most recently started) of the matching processes. +.TP +\fB\-o\fR, \fB\-\-oldest\fR +Select only the oldest (least recently started) of the matching processes. +.TP +\fB\-O\fR, \fB\-\-older\fR \fIsecs\fP +Select processes older than secs. +.TP +\fB\-P\fR, \fB\-\-parent\fR \fIppid\fP,... +Only match processes whose parent process ID is listed. +.TP +\fB\-s\fR, \fB\-\-session\fR \fIsid\fP,... +Only match processes whose process session ID is listed. Session ID 0 +is translated into +.BR pgrep 's, +.BR pkill 's, +or +.BR pidwait 's +own session ID. +.TP +\fB\-t\fR, \fB\-\-terminal\fR \fIterm\fP,... +Only match processes whose controlling terminal is listed. The terminal name +should be specified without the "/dev/" prefix. +.TP +\fB\-u\fR, \fB\-\-euid\fR \fIeuid\fP,... +Only match processes whose effective user ID is listed. Either the numerical +or symbolical value may be used. +.TP +\fB\-U\fR, \fB\-\-uid\fR \fIuid\fP,... +Only match processes whose real user ID is listed. Either the numerical or +symbolical value may be used. +.TP +\fB\-v\fR, \fB\-\-inverse\fR\fR +Negates the matching. This option is usually used in +.BR pgrep 's +or +.BR pidwait 's +context. In +.BR pkill 's +context the short option is disabled to avoid accidental usage of the option. +.TP +\fB\-w\fR, \fB\-\-lightweight\fR\fR +Shows all thread ids instead of pids in +.BR pgrep 's +or +.BR pidwait 's +context. In +.BR pkill 's +context this option is disabled. +.TP +\fB\-x\fR, \fB\-\-exact\fR\fR +Only match processes whose names (or command lines if \fB\-f\fR is specified) +.B exactly +match the +.IR pattern . +.TP +\fB\-F\fR, \fB\-\-pidfile\fR \fIfile\fR +Read \fIPID\fRs from \fIfile\fR. This option is more useful for +.B pkill +or +.B pidwait +than +.BR pgrep . +.TP +\fB\-L\fR, \fB\-\-logpidfile\fR +Fail if pidfile (see \fB\-F\fR) not locked. +.TP +\fB\-r\fR, \fB\-\-runstates\fR \fID,R,S,Z,\fP... +Match only processes which match the process state. +.TP +\fB\-A\fR, \fB\-\-ignore-ancestors\fR\fR +Ignore all ancestors of +.BR pgrep , +.BR pkill , +or +.BR pidwait . +For example, this can be useful when elevating with +.BR sudo +or similar tools. +.TP +\fB\-H\fR, \fB\-\-require\-handler\fR\fR +Only match processes with a userspace signal handler present for the signal to +be sent. +.TP +\fB\-\-cgroup \fIname\fP,... +Match on provided control group (cgroup) v2 name. See +.BR cgroups (8) +.TP +\fB\-\-ns \fIpid\fP +Match processes that belong to the same namespaces. Required to run as +root to match processes from other users. See \fB\-\-nslist\fR for how to +limit which namespaces to match. +.TP +\fB\-\-nslist \fIname\fP,... +Match only the provided namespaces. Available namespaces: +ipc, mnt, net, pid, user, uts. +.TP +\fB\-q\fR, \fB\-\-queue \fIvalue\fP +Use +.BR sigqueue (3) +rather than +.BR kill (2) +and the value argument is used to specify +an integer to be sent with the signal. If the receiving process has +installed a handler for this signal using the SA_SIGINFO flag to +.BR sigaction (2), +then it can obtain this data via the si_value field of the +siginfo_t structure. +.TP +\fB\-V\fR, \fB\-\-version\fR +Display version information and exit. +.TP +\fB\-h\fR, \fB\-\-help\fR +Display help and exit. +.PD +.SH OPERANDS +.TP +.I pattern +Specifies an Extended Regular Expression for matching against the process +names or command lines. +.SH EXAMPLES +Example 1: Find the process ID of the +.B named +daemon: +.IP +$ pgrep \-u root named +.PP +Example 2: Make +.B syslog +reread its configuration file: +.IP +$ pkill \-HUP syslogd +.PP +Example 3: Give detailed information on all +.B xterm +processes: +.IP +$ ps \-fp $(pgrep \-d, \-x xterm) +.PP +Example 4: Make all +.B chrome +processes run nicer: +.IP +$ renice +4 $(pgrep chrome) +.SH "EXIT STATUS" +.PD 0 +.TP +0 +One or more processes matched the criteria. For +.B pkill +and +.BR pidwait , +one or more +processes must also have been successfully signalled or waited for. +.TP +1 +No processes matched or none of them could be signalled. +.TP +2 +Syntax error in the command line. +.TP +3 +Fatal error: out of memory etc. +.PD +.SH NOTES +The process name used for matching is limited to the 15 characters present in +the output of /proc/\fIpid\fP/stat. Use the \fB\-f\fR option to match against the +complete command line, /proc/\fIpid\fP/cmdline. Threads may not have the +same process name as the parent process but will have the same command line. +.PP +The running +.BR pgrep , +.BR pkill , +or +.B pidwait +process will never report itself as a +match. +.PP +The +.B \-O \-\-older +option will silently fail if \fI/proc\fR is mounted with the \fIsubset=pid\fR option. +.SH BUGS +The options +.B \-n +and +.B \-o +and +.B \-v +can not be combined. Let +me know if you need to do this. +.PP +Defunct processes are reported. +.PP +.B pidwait +requires the +.BR pidfd_open (2) +system call which first appeared in Linux 5.3. +.SH "SEE ALSO" +.BR ps (1), +.BR regex (7), +.BR signal (7), +.BR sigqueue (3), +.BR killall (1), +.BR skill (1), +.BR kill (1), +.BR kill (2), +.BR cgroups (8). +.SH AUTHOR +.UR kjetilho@ifi.uio.no +Kjetil Torgrim Homme +.UE +.SH "REPORTING BUGS" +Please send bug reports to +.UR procps@freelists.org +.UE diff --git a/man/pidof.1 b/man/pidof.1 new file mode 100644 index 0000000..479b4b5 --- /dev/null +++ b/man/pidof.1 @@ -0,0 +1,82 @@ +.\" +.\" Copyright (c) 2018-2023 Jim Warner +.\" Copyright (c) 2019-2023 Craig Small +.\" Copyright (c) 2013 Jaromir Capik +.\" Copyright (c) 1998 Miquel van Smoorenburg +.\" +.\" 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. +.\" +.\" +.TH PIDOF 1 "2023-01-16" "" "User Commands" +.SH NAME +pidof \- find the process ID of a running program +.SH SYNOPSIS +.B pidof +.RB [ \-s ] +.RB [ \-c ] +.RB [ \-q ] +.RB [ \-w ] +.RB [ \-x ] +.RB [ \-o +.IR omitpid[,omitpid...]... ] +.RB [ \-t ] +.RB [ \-S +.IR separator ] +.I program +.IB [ program... ] +.SH DESCRIPTION +.B Pidof +finds the process id's (pids) of the named programs. It prints those +id's on the standard output. +.SH OPTIONS +.IP \fB\-s\fP +Single shot - this instructs the program to only return one \fIpid\fP. +.IP \fB\-c\fP +Only return process ids that are running with the same root directory. +This option is ignored for non-root users, as they will be unable to check +the current root directory of processes they do not own. +.IP \fB\-q\fP +Quiet mode, suppress any output and only sets the exit status accordingly. +.IP \fB\-w\fP +Show also processes that do not have visible command line (e.g. kernel +worker threads). +.IP \fB\-x\fP +Scripts too - this causes the program to also return process id's of +shells running the named scripts. +.IP "\fB-o\fP \fIomitpid\fP" +Tells \fBpidof\fP to omit processes with that process id. The special +pid \fB%PPID\fP can be used to name the parent process of the \fBpidof\fP +program, in other words the calling shell or shell script. +.IP \fB\-t\fP +Shows all thread ids instead of pids. +.IP "\fB-S\fP \fIseparator\fP" +Use \fIseparator\fP as a separator put between pids. Used only when +more than one pids are printed for the program. +The \fB\-d\fR option is an alias for this option for sysvinit +.B pidof +compatibility. +.SH "EXIT STATUS" +.TP +.B 0 +At least one program was found with the requested name. +.TP +.B 1 +No program was found with the requested name. + +.SH BUGS +When using the \fB\-x\fP option, +.B pidof +only has a simple method for detecting scripts and will miss scripts that, +for example, use env. This limitation is due to how the scripts look in +the proc filesystem. + +.SH SEE ALSO +.BR pgrep (1), +.BR pkill (1) +.SH AUTHOR +.UR jcapik@redhat.com +Jaromir Capik +.UE diff --git a/man/pidwait.1 b/man/pidwait.1 new file mode 100644 index 0000000..0e94b52 --- /dev/null +++ b/man/pidwait.1 @@ -0,0 +1 @@ +.so man1/pgrep.1 diff --git a/man/pkill.1 b/man/pkill.1 new file mode 100644 index 0000000..0e94b52 --- /dev/null +++ b/man/pkill.1 @@ -0,0 +1 @@ +.so man1/pgrep.1 diff --git a/man/pmap.1 b/man/pmap.1 new file mode 100644 index 0000000..6954158 --- /dev/null +++ b/man/pmap.1 @@ -0,0 +1,100 @@ +.\" +.\" Copyright (c) 2011-2023 Craig Small +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 2013 Jaromir Capik +.\" Copyright (c) 1998-2002 Albert Cahalan +.\" +.\" 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. +.\" +.\" +.\" (The preceding line is a note to broken versions of man to tell +.\" them to pre-process this man page with tbl) +.\" Man page for pmap. +.\" Licensed under version 2 of the GNU General Public License. +.\" Written by Albert Cahalan. +.\" +.TH PMAP "1" "2020-06-04" "procps-ng" "User Commands" +.SH NAME +pmap \- report memory map of a process +.SH SYNOPSIS +.B pmap +[\fIoptions\fR] \fIpid\fR [...] +.SH DESCRIPTION +The +.B pmap +command reports the memory map of a process or processes. +.SH OPTIONS +.TP +\fB\-x\fR, \fB\-\-extended\fR +Show the extended format. +.TP +\fB\-d\fR, \fB\-\-device\fR +Show the device format. +.TP +\fB\-q\fR, \fB\-\-quiet\fR +Do not display some header or footer lines. +.TP +\fB\-A\fR, \fB\-\-range\fR \fIlow\fR,\fIhigh\fR +Limit results to the given range to +.I low +and +.I high +address range. Notice that the low and high arguments are single string +separated with comma. +.TP +\fB\-X\fR +Show even more details than the \fB\-x\fR option. WARNING: format changes +according to \fI/proc/PID/smaps\fR +.TP +\fB\-XX\fR +Show everything the kernel provides +.TP +\fB\-p\fR, \fB\-\-show\-path\fR +Show full path to files in the mapping column +.TP +\fB\-c\fR, \fB\-\-read\-rc\fR +Read the default configuration +.TP +\fB\-C\fR, \fB\-\-read\-rc\-from\fR \fIfile\fR +Read the configuration from \fIfile\fR +.TP +\fB\-n\fR, \fB\-\-create\-rc\fR +Create new default configuration +.TP +\fB\-N\fR, \fB\-\-create\-rc\-to\fR \fIfile\fR +Create new configuration to \fIfile\fR +.TP +\fB\-h\fR, \fB\-\-help\fR +Display help text and exit. +.TP +\fB\-V\fR, \fB\-\-version\fR +Display version information and exit. +.SH "EXIT STATUS" +.PP +.RS +.PD 0 +.TP +.B 0 +Success. +.TP +.B 1 +Failure. +.TP +.B 42 +Did not find all processes asked for. +.PD +.RE +.SH "SEE ALSO" +.BR ps (1), +.BR pgrep (1) +.SH STANDARDS +No standards apply, but +.B pmap +looks an awful lot like a SunOS command. +.SH "REPORTING BUGS" +Please send bug reports to +.UR procps@freelists.org +.UE diff --git a/man/procps.3 b/man/procps.3 new file mode 100644 index 0000000..4e07a92 --- /dev/null +++ b/man/procps.3 @@ -0,0 +1,185 @@ +.\" +.\" Copyright (c) 2020-2023 Jim Warner +.\" Copyright (c) 2020-2023 Craig Small +.\" +.\" This manual is free software; you can redistribute it and/or +.\" modify it under the terms of the GNU Lesser General Public +.\" License as published by the Free Software Foundation; either +.\" version 2.1 of the License, or (at your option) any later version. +.\" +.\" +.TH PROCPS 3 "August 2022" "libproc2" +.\" Please adjust this date whenever revising the manpage. +.\" +.nh +.SH NAME +procps \- API to access system level information in the /proc filesystem + +.SH SYNOPSIS +Five distinct interfaces are represented in this synopsis and named after +the files they access in the /proc pseudo filesystem: +.BR diskstats ", " meminfo ", " slabinfo ", " stat " and " vmstat . + +.nf +.RS +4 +#include + +.RI "int\fB procps_new \fR (struct info **" info ); +.RI "int\fB procps_ref \fR (struct info *" info ); +.RI "int\fB procps_unref\fR (struct info **" info ); + +.RB "struct result *" procps_get " (" +.RI " struct info *" info , +.RI "[ const char *" name ", ] \fBdiskstats\fR api only" +.RI " enum item " item ); + +.RB "struct stack *" procps_select " (" +.RI " struct info *" info , +.RI "[ const char *" name ", ] \fBdiskstats\fR api only" +.RI " enum item *" items , +.RI " int " numitems ); + +.RB "struct reaped *" procps_reap " (" +.RI " struct info *" info , +.RI "[ enum reap_type " what ", ] \fBstat\fR api only" +.RI " enum item *" items , +.RI " int " numitems ); + +.RB "struct stack **" procps_sort " (" +.RI " struct info *" info , +.RI " struct stack *" stacks [], +.RI " int " numstacked , +.RI " enum item " sortitem , +.RI " enum sort_order " order ); + +.fi + +The above functions and structures are generic but the specific +\fBnamed_interface\fR would also be part of any identifiers. +For example, `procps_new' would actually be `procps_\fBmeminfo\fR_new' +and `info' would really be `\fBdiskstats\fR_info', etc. + +The same \fBnamed_interface\fR is used in each header file name with +an appended `.h' suffix. + +Link with \fI\-lproc2\fP. + +.SH DESCRIPTION +.SS Overview +Central to these interfaces is a simple `result' +structure reflecting an `item' plus its value (in a union +with standard C language types as members). +All `result' structures are automatically allocated and +provided by the library. + +By specifying an array of `items', these structures can be +organized as a `stack', potentially yielding many results +with a single function call. +Thus, a `stack' can be viewed as a variable length record +whose content and order is determined solely by the user. + +As part of each interface there are two unique enumerators. +The `noop' and `extra' items exist to hold user values. +They are never set by the library, but the `extra' +result will be zeroed with each library interaction. + +The \fBnamed_interface\fR header file will be an essential +document during user program development. +There you will find available items, their return type +(the `result' struct member name) and the source for such values. +Additional enumerators and structures are also documented there. + +.SS Usage +The following would be a typical sequence of calls to +these interfaces. + +.nf +.RB "1. " procps_new() +.RB "2. " procps_get() ", " procps_select() " or " procps_reap() +.RB "3. " procps_unref() +.fi + +The \fBget\fR function is used to retrieve a `result' structure for +a single `item'. +Alternatively, a \fBGET\fR macro is available when only the return +value is of interest. + +The \fBselect\fR function can retrieve multiple `result' structures +in a single `stack'. + +For unpredictable variable outcomes, the \fBdiskstats\fR, \fBslabinfo\fR +and \fBstat\fR interfaces export a \fBreap\fR function. +It is used to retrieve multiple `stacks' each containing multiple +`result' structures. +Optionally, a user may choose to \fBsort\fR those results. + +To exploit any `stack', and access individual `result' structures, +a \fIrelative_enum\fR is required as shown in the \fBVAL\fR macro +defined in the header file. +Such values could be hard coded as: 0 through numitems-1. +However, this need is typically satisfied by creating your own +enumerators corresponding to the order of the `items' array. + +.SS Caveats +The \fBnew\fR, \fBref\fR, \fBunref\fR, \fBget\fR and \fBselect\fR +functions are available in all five interfaces. + +For the \fBnew\fR and \fBunref\fR functions, the address of an \fIinfo\fR +struct pointer must be supplied. +With \fBnew\fR it must have been initialized to NULL. +With \fBunref\fR it will be reset to NULL if the reference count reaches zero. + +In the case of the \fBdiskstats\fR interface, a \fIname\fR parameter +on the \fBget\fR and \fBselect\fR functions identifies a disk or +partition name + +For the \fBstat\fR interface, a \fIwhat\fR parameter on the \fBreap\fR +function identifies whether data for just CPUs or both CPUs and NUMA +nodes is to be gathered. + +When using the \fBsort\fR function, the parameters \fIstacks\fR and +\fInumstacked\fR would normally be those returned in the `reaped' +structure. + +.SH RETURN VALUE +.SS Functions Returning an `int' +An error will be indicated by a negative number that +is always the inverse of some well known errno.h value. + +Success is indicated by a zero return value. +However, the \fBref\fR and \fBunref\fR functions return +the current \fIinfo\fR structure reference count. + +.SS Functions Returning an `address' +An error will be indicated by a NULL return pointer +with the reason found in the formal errno value. + +Success is indicated by a pointer to the named structure. + +.SH DEBUGGING +To aid in program development, there is a provision that can +help ensure `result' member references agree with library +expectations. +It assumes that a supplied macro in the header file is +used to access the `result' value. + +This feature can be activated through either of the following +methods and any discrepancies will be written to \fBstderr\fR. + +.IP 1) 3 +Add CFLAGS='-DXTRA_PROCPS_DEBUG' to any other ./configure +options employed. + +.IP 2) 3 +Add #include to any program +\fIafter\fR the named interface includes. + +.PP +This verification feature incurs substantial overhead. +Therefore, it is important that it \fInot\fR be activated +for a production/release build. + +.SH SEE ALSO +.BR procps_misc (3), +.BR procps_pids (3), +.BR proc (5). diff --git a/man/procps_misc.3 b/man/procps_misc.3 new file mode 100644 index 0000000..bc42aac --- /dev/null +++ b/man/procps_misc.3 @@ -0,0 +1,156 @@ +.\" +.\" Copyright (c) 2020-2023 Jim Warner +.\" Copyright (c) 2020-2023 Craig Small +.\" +.\" This manual is free software; you can redistribute it and/or +.\" modify it under the terms of the GNU Lesser General Public +.\" License as published by the Free Software Foundation; either +.\" version 2.1 of the License, or (at your option) any later version. +.\" +.\" +.TH PROCPS_MISC 3 "August 2022" "libproc2" +.\" Please adjust this date whenever revising the manpage. +.\" +.nh +.SH NAME +procps_misc \- API for miscellaneous information in the /proc filesystem +.SH SYNOPSIS +.nf +.B #include +.PP +Platform Particulars +.RS 4 +.PP +.RB "long " procps_cpu_count " (void); +.RB "long " procps_hertz_get " (void); +.RB "unsigned int " procps_pid_length " (void); +.RB "int " procps_linux_version " (void); +.RE +.PP +Runtime Particulars +.PP +.RS 4 +.RI "int \fB procps_loadavg\fR (double *" av1 ", double *" av5 ", double *" av15 ");" +.RI "int \fB procps_uptime\fR (double *" uptime_secs ", double *" idle_secs ");" +.RB "char *" procps_uptime_sprint " (void);" +.RB "char *" procps_uptime_sprint_short " (void);" +.RE +.PP +Namespace Particulars +.PP +.RS 4 +.RI "int \fB procps_ns_get_id\fR (const char *" name ");" +.RI "const char\fB *procps_ns_get_name\fR (int " id ");" +.RI "int \fB procps_ns_read_pid\fR (int " pid ", struct procps_ns *" nsp ");" +.RE + +Link with \fI\-lproc2\fP. + +.SH DESCRIPTION +.BR procps_cpu_count () +returns the number of CPUs that are currently online as +.BI sysconf( _SC_NPROCESSORS_ONLY ) +or an assumed \fI1\fR. + +.BR procps_hertz_get () +returns the number of clock ticks per second as +.BI sysconf( _SC_CLK_TCK ) +or an assumed \fI100\fR. +Dividing tics by this value yields seconds. + +.BR procps_pid_length () +returns the maximum string length for a PID on the system. For example, if the largest +possible PID value on was 123, then the length would be 3. If the file +\fI/proc/sys/kernel/pid_max\fR is unreadable, the value is assumed to be \fI5\fR. + +.BR procps_linux_version () +returns the current Linux version as an encoded integer. On non-Linux systems that +have an emulated proc filesystem this function returns the version of the +Linux emulation instead. +The version consists of three positive integers representing the major, +minor and patch levels. +The following macros are provided for encoding a given Linux version or +separating out the components of the current version. +.RS 4 +.PP +LINUX_VERSION(\ major\ ,\ minor\ ,\ patch\ ) +.PP +LINUX_VERSION_MAJOR(\ ver\ ) +.PP +LINUX_VERSION_MINOR(\ ver\ ) +.PP +LINUX_VERSION_PATCH(\ ver\ ) +.RE + +.BR procps_loadavg () +fetches the system load average and puts the 1, 5 and 15 minute averages into +location(s) specified by any pointer which is not \fINULL\fR. + +.BR procps_uptime () +returns uptime and/or idle seconds into location(s) specified by any pointer +which is not \fINULL\fR. +The \fBsprint\fR varieties return a human-readable string in one of two forms. +.RS 4 +.PP +HH:MM:SS up HH:MM, # users, load average: 1, 5, 15 MM averages +.PP +up HH, MM +.RE + +.BR procps_ns_get_id () +returns the integer id (enum namespace_type) of the namespace for the given namespace \fIname\fR. + +.BR procps_ns_get_name () +returns the name of the namespace for the given \fIid\fR (enum namespace_type). + +.BR procps_ns_read_pid () +returns the inodes for the namespaces of the given process in the +procps_ns structure pointed to by \fInsp\fR. +Those inodes will appear in the order proscribed by enum namespace_type. +.PP +.RS 4 +.nf +enum namespace_type { + PROCPS_NS_CGROUP, + PROCPS_NS_IPC, + PROCPS_NS_MNT, + PROCPS_NS_NET, + PROCPS_NS_PID, + PROCPS_NS_TIME, + PROCPS_NS_USER, + PROCPS_NS_UTS +}; +.fi +.RE + + +.SH RETURN VALUE +.SS Functions Returning an `int' or `long' +An error will be indicated by a negative number that +is always the inverse of some well known errno.h value. + +.SS Functions Returning an `address' +An error will be indicated by a NULL return pointer +with the reason found in the formal errno value. + +.SH FILES +.TP +.I /proc/loadavg +The raw values for load average. +.TP +.I /proc/sys/kernel/osrelease +Contains the release version of the Linux kernel or proc filesystem. +.TP +.I /proc/sys/kernel/pid_max +Contains the value at which PIDs wrap around, one greater than the maximum PID value. +.TP +.I /proc/uptime +The raw values for uptime and idle time. +.TP +.IB /proc//ns +contains the set of namespaces for a particular \fBPID\fR. + +.SH SEE ALSO +.BR procps (3), +.BR procps_pids (3), +.BR proc (5). diff --git a/man/procps_pids.3 b/man/procps_pids.3 new file mode 100644 index 0000000..9ead691 --- /dev/null +++ b/man/procps_pids.3 @@ -0,0 +1,210 @@ +.\" +.\" Copyright (c) 2020-2023 Jim Warner +.\" Copyright (c) 2020-2023 Craig Small +.\" +.\" This manual is free software; you can redistribute it and/or +.\" modify it under the terms of the GNU Lesser General Public +.\" License as published by the Free Software Foundation; either +.\" version 2.1 of the License, or (at your option) any later version. +.\" +.\" +.TH PROCPS_PIDS 3 "August 2022" "libproc2" +.\" Please adjust this date whenever revising the manpage. +.\" +.nh +.SH NAME +procps_pids \- API to access process information in the /proc filesystem + +.SH SYNOPSIS +.nf +#include + +.RI "int\fB procps_pids_new \fR (struct pids_info **" info ", enum pids_item *" items ", int " numitems ); +.RI "int\fB procps_pids_ref \fR (struct pids_info *" info ); +.RI "int\fB procps_pids_unref\fR (struct pids_info **" info ); + + +.RB "struct pids_stack *" procps_pids_get " (" +.RI " struct pids_info *" info , +.RI " enum pids_fetch_type " which ); + +.RB "struct pids_fetch *" procps_pids_reap " (" +.RI " struct pids_info *" info , +.RI " enum pids_fetch_type " which ); + +.RB "struct pids_fetch *" procps_pids_select " (" +.RI " struct pids_info *" info , +.RI " unsigned *" these , +.RI " int " numthese , +.RI " enum pids_select_type " which ); + +.RB "struct pids_stack **" procps_pids_sort " (" +.RI " struct pids_info *" info , +.RI " struct pids_stack *" stacks [], +.RI " int " numstacked , +.RI " enum pids_item " sortitem , +.RI " enum pids_sort_order " order ); + +.RB "int " procps_pids_reset " (" +.RI " struct pids_info *" info , +.RI " enum pids_item *" newitems , +.RI " int " newnumitems ); + +.RB "struct pids_stack *" fatal_proc_unmounted " (" +.RI " struct pids_info *" info , +.RI " int " return_self ); + +.fi + +Link with \fI\-lproc2\fP. + +.SH DESCRIPTION +.SS Overview +Central to this interface is a simple `result' +structure reflecting an `item' plus its value (in a union +with standard C language types as members). +All `result' structures are automatically allocated and +provided by the library. + +By specifying an array of `items', these structures can be +organized as a `stack', potentially yielding many results +with a single function call. +Thus, a `stack' can be viewed as a variable length record +whose content and order is determined solely by the user. + +As part of this interface there are two unique enumerators. +The `noop' and `extra' items exist to hold user values. +They are never set by the library, but the `extra' +result will be zeroed with each library interaction. + +The pids.h file will be an essential document during +user program development. +There you will find available items, their return type +(the `result' struct member name) and the source for such values. +Additional enumerators and structures are also documented there. + +.SS Usage +The following would be a typical sequence of calls to +this interface. + +.nf +.RB "1. " fatal_proc_unmounted() +.RB "2. " procps_pids_new() +.RB "3. " procps_pids_get() ", " procps_pids_reap() " or " procps_pids_select() +.RB "4. " procps_pids_unref() +.fi + +The \fBget\fR function is an iterator for successive PIDs/TIDs, +returning those `items' previously identified via \fBnew\fR +or \fBreset\fR. + +Two functions support unpredictable variable outcomes. +The \fBreap\fR function gathers data for all processes while +the \fBselect\fR function deals with specific PIDs or UIDs. +Both can return multiple `stacks' each containing multiple `result' +structures. +Optionally, a user may choose to \fBsort\fR such results + +To exploit any `stack', and access individual `result' structures, +a \fIrelative_enum\fR is required as shown in the \fBVAL\fR macro +defined in the header file. +Such values could be hard coded as: 0 through numitems-1. +However, this need is typically satisfied by creating your own +enumerators corresponding to the order of the `items' array. + +.SS Caveats +The API differs from others in that those items +of interest must be provided at \fBnew\fR or \fBreset\fR time, +the latter being unique to this API. +If either the \fIitems\fR or \fInumitems\fR parameter is zero at +\fBnew\fR time, then \fBreset\fR becomes mandatory before +issuing any other call. + +For the \fBnew\fR and \fBunref\fR functions, the address of an \fIinfo\fR +struct pointer must be supplied. +With \fBnew\fR it must have been initialized to NULL. +With \fBunref\fR it will be reset to NULL if the reference count reaches zero. + +The \fBget\fR and \fBreap\fR functions use the \fIwhich\fR parameter +to specify whether just tasks or both tasks and threads are to be fetched. + +The \fBselect\fR function requires an array of PIDs or UIDs as +\fIthese\fR along with \fInumthese\fR to identify which processes +are to be fetched. +This function then operates as a subset of \fBreap\fR. + +When using the \fBsort\fR function, the parameters \fIstacks\fR and +\fInumstacked\fR would normally be those returned in the `pids_fetch' +structure. + +Lastly, a \fBfatal_proc_unmounted\fR function may be called before +any other function to ensure that the /proc/ directory is mounted. +As such, the \fIinfo\fR parameter would be NULL and the +\fIreturn_self\fR parameter zero. +If, however, some items are desired for the issuing program (a +\fIreturn_self\fR other than zero) then the \fBnew\fR call must precede +it to identify the \fIitems\fR and obtain the required \fIinfo\fR pointer. + +.SH RETURN VALUE +.SS Functions Returning an `int' +An error will be indicated by a negative number that +is always the inverse of some well known errno.h value. + +Success is indicated by a zero return value. +However, the \fBref\fR and \fBunref\fR functions return +the current \fIinfo\fR structure reference count. + +.SS Functions Returning an `address' +An error will be indicated by a NULL return pointer +with the reason found in the formal errno value. + +Success is indicated by a pointer to the named structure. +However, if one survives the \fBfatal_proc_unmounted\fR call, +NULL is always returned when \fIreturn_self\fR is zero. + +.SH DEBUGGING +To aid in program development, there are two procps-ng provisions +that can be exploited. + +The first is a supplied file named `libproc.supp' which may be +useful when developing a \fImulti-threaded\fR application. +When used with the valgrind `--suppressions=' option, warnings +associated with the procps library itself are avoided. + +Such warnings arise because the library handles heap based +allocations in a thread-safe manner. +A \fIsingle-threaded\fR application will not receive those warnings. + +The second provision can help ensure `result' member references +agree with library expectations. +It assumes that a supplied macro in the header file is +used to access the `result' value. + +This feature can be activated through either of the following +methods and any discrepancies will be written to \fBstderr\fR. + +.IP 1) 3 +Add CFLAGS='-DXTRA_PROCPS_DEBUG' to any other ./configure +options your project may employ. + +.IP 2) 3 +Add #include to any program +\fIafter\fR the #include . + +.PP +This verification feature incurs substantial overhead. +Therefore, it is important that it \fInot\fR be activated +for a production/release build. + +.SH ENVIRONMENT VARIABLE(S) +The value set for the following is unimportant, just its presence. + +.IP LIBPROC_HIDE_KERNEL +This will hide kernel threads which would otherwise be returned with a +.BR procps_pids_get ", " procps_pids_select " or " procps_pids_reap +call. + +.SH SEE ALSO +.BR procps (3), +.BR procps_misc (3), +.BR proc (5). diff --git a/man/ps.1 b/man/ps.1 new file mode 100644 index 0000000..0f4d946 --- /dev/null +++ b/man/ps.1 @@ -0,0 +1,2124 @@ +.\" +.\" Copyright (c) 2004-2023 Craig Small +.\" Copyright (c) 2011-2023 Jim Warner +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 1998-2003 Albert Cahalan +.\" +.\" 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. +.\" +.\" +.TH PS "1" "2023-08-19" "procps-ng" "User Commands" +.\" +.\" Ragged-right text. +.na +.\" Disable hyphenation. +.nh +.\" +.\" ColSize is used for the format spec table. +.\" It's the left margin, minus the right, minus +.\" the space needed for the 1st two columns. +.\" Making it messy: inches, ens, points, scaled points... +.\" +.nr ColSize ((\n[.l] - \n[.i]) / 1n - 29) +.\" +.SH NAME +ps \- report a snapshot of the current processes. +.SH SYNOPSIS +\fBps\fR [\,\fIoptions\/\fR] +.SH DESCRIPTION +.B ps +displays information about a selection of the active processes. If you want +a repetitive update of the selection and the displayed information, use +.B top +instead. +.P +This version of +.B ps +accepts several kinds of options: +.IP +.PD 0 +.IP 1 4 +UNIX options, which may be grouped and must be preceded by a dash. +.IP 2 4 +BSD options, which may be grouped and must not be used with a dash. +.IP 3 4 +GNU long options, which are preceded by two dashes. +.PD +.PP +Options of different types may be freely mixed, but conflicts can appear. +There are some synonymous options, which are functionally identical, due to +the many standards and +.B ps +implementations that this +.B ps +is compatible with. +.P +By default, +.B ps +selects all processes with the same effective user ID (euid=EUID) as the +current user and associated with the same terminal as the invoker. It +displays the process ID (pid=PID), the terminal associated with the process +(tname=TTY), the cumulated CPU time in [DD\-]hh:mm:ss format (time=TIME), and +the executable name (ucmd=CMD). Output is unsorted by default. +.P +The use of BSD\-style options will add process state (stat=STAT) to the +default display and show the command args (args=COMMAND) instead of the +executable name. You can override this with the +.B PS_FORMAT +environment variable. The use of BSD\-style options will also change the +process selection to include processes on other terminals (TTYs) that are +owned by you; alternately, this may be described as setting the selection to +be the set of all processes filtered to exclude processes owned by other +users or not on a terminal. These effects are not considered when options +are described as being "identical" below, so +.B \-M +will be considered identical to \fBZ\fR and so on. +.P +Except as described below, process selection options are additive. The +default selection is discarded, and then the selected processes are added to +the set of processes to be displayed. A process will thus be shown if it +meets any of the given selection criteria. +.SH "EXAMPLES" +.TP 3 +To see every process on the system using standard syntax: +.B ps\ \-e +.br +.B ps\ \-ef +.br +.B ps\ \-eF +.br +.B ps\ \-ely +.TP +To see every process on the system using BSD syntax: +.B ps\ ax +.br +.B ps\ axu +.TP +To print a process tree: +.B ps\ \-ejH +.br +.B ps\ axjf +.TP +To get info about threads: +.B ps\ \-eLf +.br +.B ps\ axms +.TP +To get security info: +.B ps\ \-eo euser,ruser,suser,fuser,f,comm,label +.br +.B ps\ axZ +.br +.B ps\ \-eM +.TP +To see every process running as root (real\ &\ effective\ ID) in user format: +.B ps\ \-U\ root\ \-u\ root\ u +.TP +To see every process with a user\-defined format: +.B ps\ \-eo\ pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm +.br +.B ps\ axo\ stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm +.br +.B ps\ \-Ao\ pid,tt,user,fname,tmout,f,wchan +.TP +Print only the process IDs of syslogd: +.B ps\ \-C\ syslogd\ \-o\ pid= +.TP +Print only the name of PID 42: +.B ps\ \-q\ 42\ \-o\ comm= +.SH "SIMPLE PROCESS SELECTION" +.TP +.B a +Lift the BSD\-style "only yourself" restriction, which is imposed upon the +set of all processes when some BSD\-style (without "\-") options are used or +when the +.B ps +personality setting is BSD\-like. The set of processes selected in this +manner is in addition to the set of processes selected by other means. An +alternate description is that this option causes +.B ps +to list all processes with a terminal (tty), or to list all processes when +used together with the +.B x +option. +.TP +.B \-A +Select all processes. Identical to +.BR \-e . +.TP +.B \-a +Select all processes except both session leaders (see +.IR getsid (2)) +and processes not associated with a terminal. +.TP +.B \-d +Select all processes except session leaders. +.TP +.B \-\-deselect +Select all processes except those that fulfill the specified conditions +(negates the selection). Identical to +.BR \-N . +.TP +.B \-e +Select all processes. Identical to +.BR \-A . +.\" Current "g" behavior: add in the session leaders, which would +.\" be excluded in the sunos4 personality. Supposed "g" behavior: +.\" add in the group leaders -- at least according to the SunOS 4 +.\" man page on the FreeBSD site. Uh oh. I think I had tested SunOS +.\" though, so maybe the code is correct. +.TP +.B g +Really all, even session leaders. This flag is obsolete and may be +discontinued in a future release. It is normally implied by the +.B a +flag, and is only useful when operating in the sunos4 personality. +.TP +.B \-N +Select all processes except those that fulfill the specified conditions +(negates the selection). Identical to +.BR \-\-deselect . +.TP +.B T +Select all processes associated with this terminal. Identical to the +.B t +option without any argument. +.TP +.B r +Restrict the selection to only running processes. +.TP +.B x +Lift the BSD\-style "must have a tty" restriction, which is imposed upon the +set of all processes when some BSD\-style (without "\-") options are used or +when the +.B ps +personality setting is BSD\-like. The set of processes selected in this +manner is in addition to the set of processes selected by other means. An +alternate description is that this option causes +.B ps +to list all processes owned by you (same EUID as +.BR ps ), +or to list all processes when used together with the +.B a +option. +.PD +.SH "PROCESS SELECTION BY LIST" +These options accept a single argument in the form of a blank\-separated or +comma\-separated list. They can be used multiple times. For example: +.B ps\ \-p\ "1\ 2"\ \-p\ 3,4 +.TP +.I 123 +Identical to +.B \-\-pid\ \fI123\fR. +.TP +.RI \+ 123 +Identical to +.B \-\-sid\ \fI123\fR. +.TP +.RI \- 123 +Select by process group ID (PGID). +.TP +.BI \-C \ cmdlist +Select by command name. This selects the processes whose executable name is +given in +.IR cmdlist . +NOTE: The command name is not the same as the command line. Previous versions +of procps and the kernel truncated this command name to 15 characters. This +limitation is no longer present in both. If you depended on matching only +15 characters, you may no longer get a match. +.TP +.BI \-G \ grplist +Select by real group ID (RGID) or name. This selects the processes whose +real group name or ID is in the +.I grplist +list. The real group ID identifies the group of the user who created the +process, see +.IR getgid (2). +.TP +.BI \-g \ grplist +Select by session OR by effective group name. Selection by session is +specified by many standards, but selection by effective group is the logical +behavior that several other operating systems use. This +.B ps +will select by session when the list is completely numeric (as sessions +are). Group ID numbers will work only when some group names are also +specified. See the +.B \-s +and +.B \-\-group +options. +.TP +.BI \-\-Group \ grplist +Select by real group ID (RGID) or name. Identical to +.BR \-G . +.TP +.BI \-\-group \ grplist +Select by effective group ID (EGID) or name. This selects the processes +whose effective group name or ID is in +.IR grplist . +The effective group ID describes the group whose file access permissions are +used by the process (see +.IR getegid (2)). +The +.B \-g +option is often an alternative to +.BR \-\-group . +.TP +.BI p \ pidlist +Select by process ID. Identical to +.B \-p +and +.BR \-\-pid . +.TP +.BI \-p \ pidlist +Select by PID. This selects the processes whose process ID numbers appear in +.IR pidlist . +Identical to +.B p +and +.BR \-\-pid . +.TP +.BI \-\-pid \ pidlist +Select by process\ ID. Identical to +.B \-p +and +.BR p . +.TP +.BI \-\-ppid \ pidlist +Select by parent process ID. This selects the processes with a parent +process\ ID in +.IR pidlist . +That is, it selects processes that are children of those listed in +.IR pidlist . +.TP +.BI q \ pidlist +Select by process ID (quick mode). Identical to +.B \-q +and +.BR \-\-quick\-pid . +.TP +.BI \-q \ pidlist +Select by PID (quick mode). +This selects the processes whose process ID numbers appear in +.IR pidlist . +With this option \fBps\fR reads the necessary info only +for the pids listed in the \fIpidlist\fR and doesn't apply +additional filtering rules. The order of pids is unsorted +and preserved. No additional selection options, sorting +and forest type listings are allowed in this mode. +Identical to +.B q +and +.BR \-\-quick\-pid . +.TP +.BI \-\-quick\-pid \ pidlist +Select by process\ ID (quick mode). Identical to +.B \-q +and +.BR q . +.TP +.BI \-s \ sesslist +Select by session ID. This selects the processes with a session ID specified +in +.IR sesslist . +.TP +.BI \-\-sid \ sesslist +Select by session\ ID. Identical to +.BR \-s . +.TP +.BI t \ ttylist +Select by tty. Nearly identical to +.B \-t +and +.BR \-\-tty , +but can also +be used with an empty +.I ttylist +to indicate the terminal associated with +.BR ps . +Using the +.B T +option is considered cleaner than using +.B t +with an empty +.IR ttylist . +.TP +.BI \-t \ ttylist +Select by tty. This selects the processes associated with the terminals +given in +.IR ttylist . +Terminals (ttys, or screens for text output) can be specified in several +forms: /dev/ttyS1, ttyS1, S1. A plain "\-" may be used to select processes +not attached to any terminal. +.TP +.BI \-\-tty \ ttylist +Select by terminal. Identical to +.B \-t +and +.BR t . +.TP +.BI U \ userlist +Select by effective user ID (EUID) or name. This selects the processes whose +effective user name or ID is in +.IR userlist . +The effective user ID describes the user whose file access permissions are +used by the process (see +.IR geteuid (2)). +Identical to +.B \-u +and +.BR \-\-user . +.TP +.BI \-U \ userlist +Select by real user ID (RUID) or name. It selects the processes whose real +user name or ID is in the +.I userlist +list. The real user ID identifies the user who created the process, see +.IR getuid (2). +.TP +.BI \-u \ userlist +Select by effective user ID (EUID) or name. This selects the processes whose +effective user name or ID is in +.IR userlist . + +The effective user ID describes the user whose file +access permissions are used by the process (see +.IR geteuid (2)). +Identical to +.B U +and +.BR \-\-user . +.TP +.BI \-\-User \ userlist +Select by real user ID (RUID) or name. Identical to +.BR \-U . +.TP +.BI \-\-user \ userlist +Select by effective user ID (EUID) or name. Identical to +.B \-u +and +.BR U . +.PD +.SH "OUTPUT FORMAT CONTROL" +These options are used to choose the information displayed by +.BR ps . +The output may differ by personality. +.TP +.B \-c +Show different scheduler information for the +.B \-l +option. +.TP +.B \-\-context +Display security context format (for SELinux). +.TP +.B \-f +Do full\-format listing. This option can be combined with many other +UNIX\-style options to add additional columns. It also causes the command +arguments to be printed. When used with +.BR \-L , +the NLWP (number of threads) and LWP (thread ID) columns will be added. See +the +.B c +option, the format keyword +.BR args , +and the format keyword +.BR comm . +.TP +.B \-F +Extra full format. See the +.B \-f +option, which +.B \-F +implies. +.TP +.BI \-\-format \ format +user\-defined format. Identical to +.B \-o +and +.BR o . +.TP +.B j +BSD job control format. +.TP +.B \-j +Jobs format. +.TP +.B l +Display BSD long format. +.TP +.B \-l +Long format. The +.B \-y +option is often useful with this. +.TP +.B \-M +Add a column of security data. Identical to +.B Z +(for SELinux). +.TP +.BI O \ format +is preloaded +.B o +(overloaded). The BSD +.B O +option can act like +.B \-O +(user\-defined output format with some common fields predefined) or can be +used to specify sort order. Heuristics are used to determine the behavior of +this option. To ensure that the desired behavior is obtained (sorting or +formatting), specify the option in some other way (e.g. with +.B \-O +or +.BR \-\-sort ). +When used as a formatting option, it is identical to +.BR \-O , +with the BSD personality. +.TP +.BI \-O \ format +Like +.BR \-o , +but preloaded with some default columns. Identical to +.BI \-o\ pid,\: format ,\:state,\:tname,\:time,\:command +or +.BI \-o\ pid,\: format ,\:tname,\:time,\:cmd \fR, +see +.B \-o +below. +.TP +.BI o \ format +Specify user\-defined format. Identical to +.B \-o +and +.BR \-\-format . +.TP +.BI \-o \ format +User\-defined format. +.I format +is a single argument in the form of a blank\-separated or comma\-separated +list, which offers a way to specify individual output columns. The +recognized keywords are described in the +.B STANDARD FORMAT SPECIFIERS +section below. Headers may be renamed +.RB ( "ps \-o pid,\:ruser=RealUser \-o comm=Command" ) +as desired. +If all column headers are empty +.RB ( "ps \-o pid= \-o comm=" ) +then the header line will not be output. Column width will increase as +needed for wide headers; this may be used to widen up columns such as WCHAN +.RB ( "ps \-o pid,\:wchan=\:WIDE\-\:WCHAN\-\:COLUMN \-o comm" ). +Explicit width +control +.RB ( "ps opid,\:wchan:42,\:cmd" ) +is offered too. The behavior of +.B ps \-o pid=X,\:comm=Y +varies with personality; output may be one column named "X,\:comm=Y" or two +columns named "X" and "Y". Use multiple +.B \-o +options when in doubt. Use the +.B PS_FORMAT +environment variable to specify a default as desired; DefSysV and DefBSD are +macros that may be used to choose the default UNIX or BSD columns. +.TP +.B \-P +Add a column showing \fBpsr\fR. +.TP +.B s +Display signal format. +.TP +.B u +Display user\-oriented format. +.TP +.B v +Display virtual memory format. +.TP +.B X +Register format. +.TP +.B \-y +Do not show flags; show rss in place of addr. This option can only be used +with +.BR \-l . +.TP +.B Z +Add a column of security data. Identical to +.B \-M +(for SELinux). +.PD +.SH "OUTPUT MODIFIERS" +.TP +.B c +Show the true command name. This is derived from the name of the executable +file, rather than from the argv value. Command arguments and any +modifications to them are thus not shown. This option effectively turns the +.B args +format keyword into the +.B comm +format keyword; it is useful with the +.B \-f +format option and with the various BSD\-style format options, which all +normally display the command arguments. See the +.B \-f +option, the format +keyword +.BR args , +and the format keyword +.BR comm . +.TP +.BI \-\-cols \ n +Set screen width. +.TP +.BI \-\-columns \ n +Set screen width. +.TP +.B \-\-cumulative +Include some dead child process data (as a sum with the parent). +.TP +.TP +.BI \-D \ format +Set the date format of the \fBlstart\fR field to \fIformat\fR. This format is parsed +by +.BR strftime (3) +and should be a maximum of 24 characters to not mis-align columns. +.TP +.BI \-\-date-format \ format +Identical to \fB\-D\fR. +.TP +.B e +Show the environment after the command. +.TP +.B f +ASCII art process hierarchy (forest). +.TP +.B \-\-forest +ASCII art process tree. +.TP +.B h +No header. (or, one header per screen in the BSD personality). The +.B h +option is problematic. Standard BSD +.B ps +uses this option to print a header on each page of output, but older Linux +.B ps +uses this option to totally disable the header. This version of +.B ps +follows the Linux usage of not printing the header unless the BSD personality +has been selected, in which case it prints a header on each page of output. +Regardless of the current personality, you can use the long options +.B \-\-headers +and +.B \-\-no\-headers +to enable printing headers each page or disable headers entirely, +respectively. +.TP +.B \-H +Show process hierarchy (forest). +.TP +.B \-\-headers +Repeat header lines, one per page of output. +.TP +.BI k \ spec +Specify sorting order. Sorting syntax is +.RB [ + | \- ]\c +.I key\/\c +.RB [,[ + | \- ]\c +.IR key [,...]]. +Choose a multi\-letter key from the +.B STANDARD FORMAT SPECIFIERS +section. The "+" is optional since default direction is increasing +numerical or lexicographic order. Identical to +.BR \-\-sort . +.RS 8 +.IP +Examples: +.br +.B ps jaxkuid,\-ppid,+pid +.br +.B ps axk comm o comm,args +.br +.B ps kstart_time \-ef +.RE +.TP +.BI \-\-lines \ n +Set screen height. +.TP +.B n +Numeric output for WCHAN and USER (including all types of UID and GID). +.TP +.B \-\-no\-headers +Print no header line at all. +.B \-\-no\-heading +is an alias for this option. +.TP +.BI O \ order +Sorting order (overloaded). +The BSD +.B O +option can act like +.B \-O +(user\-defined output format with some common fields predefined) or can be +used to specify sort order. Heuristics are used to determine the behavior of +this option. To ensure that the desired behavior is obtained (sorting or +formatting), specify the option in some other way (e.g. with +.B \-O +or +.BR \-\-sort ). +.IP +For sorting, obsolete BSD +.B O +option syntax is +.BR O [ + | \- ]\c +.IR k1 [,[\c +.BR + | \- ]\c +.IR k2 [,...]]. +It orders the processes listing according to the multilevel sort specified by +the sequence of one\-letter short keys +.IR k1 , k2 ", ...\&" +described in the +.B OBSOLETE SORT KEYS +section below. The\ "+" is currently optional, merely re\-iterating the +default direction on a key, but may help to distinguish an +.B O +sort from an +.B O +format. The "\-" reverses direction only on the key it precedes. +.TP +.BI \-\-rows \ n +Set screen height. +.TP +.B S +Sum up some information, such as CPU usage, from dead child processes into +their parent. This is useful for examining a system where a parent process +repeatedly forks off short\-lived children to do work. +.TP +.BI \-\-sort \ spec +Specify sorting order. Sorting syntax is +.RI [ + | \- ]\c +.IR key [,[\c +.BR + | \- ]\c +.IR key [,...]]. +Choose a multi\-letter key from the +.B STANDARD FORMAT SPECIFIERS +section. The "+" is optional since default direction is increasing numerical +or lexicographic order. Identical to +.BR k . +For example: +.B ps jax \-\-sort=\:uid,\:\-ppid,\:+pid +.TP +.B \-\-signames +Show signal masks using abbreviated signal names and expands the collumn. +If the column width cannot show all signals, the column will end with a plus "\fI+\fR". +Columns with only a hyphen have no signals. +.TP +.B w +Wide output. Use this option twice for unlimited width. +.TP +.B \-w +Wide output. Use this option twice for unlimited width. +.TP +.BI \-\-width \ n +Set screen width. +.PD +.SH "THREAD DISPLAY" +.TP +.B H +Show threads as if they were processes. +.TP +.B \-L +Show threads, possibly with LWP and NLWP columns. +.TP +.B m +Show threads after processes. +.TP +.B \-m +Show threads after processes. +.TP +.B \-T +Show threads, possibly with SPID column. +.SH "OTHER INFORMATION" +.TP +.BI \-\-help \ section +Print a help message. The \fIsection\fR argument can be one of +.IR s imple, +.IR l ist, +.IR o utput, +.IR t hreads, +.IR m "isc, or" +.IR a ll. +The argument can be shortened to one of the underlined letters as in: +s\^|\^l\^|\^o\^|\^t\^|\^m\^|\^a. +.TP +.B \-\-info +Print debugging info. +.TP +.B L +List all format specifiers. +.TP +.B V +Print the procps-ng version. +.TP +.B \-V +Print the procps-ng version. +.TP +.B \-\-version +Print the procps-ng version. +.SH NOTES +This +.B ps +works by reading the virtual files in /proc. This +.B ps +does not need to be setuid kmem or have any privileges to run. Do not give +this +.B ps +any special permissions. +.PP +CPU usage is currently expressed as the percentage of time spent running +during the entire lifetime of a process. This is not ideal, and\ it does not +conform to the standards that +.B ps +otherwise conforms to. CPU usage is unlikely to add up to exactly 100%. +.PP +The SIZE and RSS fields don't count some parts of a process including the +page tables, kernel stack, struct thread_info, and struct task_struct. This +is usually at least 20\ KiB of memory that is always resident. SIZE is the +virtual size of the process (code+\:data+\:stack). +.PP +Processes marked are dead processes (so\-called "zombies") that +remain because their parent has not destroyed them properly. These processes +will be destroyed by +.IR init (8) +if the parent process exits. +.PP +If the length of the username is greater than the width of the display +column, the username will be truncated. See the \fB\-o\fR and \fB\-O\fR +formatting options to customize length. +.PP +Commands options such as +.B ps \-aux +are not recommended as it is a confusion of two different standards. +According to the POSIX and UNIX standards, the above command asks to +display all processes with a TTY (generally the commands users are +running) plus all processes owned by a user named \fIx\fR. If that user +doesn't exist, then +.B ps +will assume you really meant +.RB """" ps +.IR aux """." +.SH "PROCESS FLAGS" +The sum of these values is displayed in the "F" column, +which is provided by the +.B flags +output specifier: +.PP +.RS 8 +.PD 0 +.TP 5 +1 +forked but didn't exec +.TP +4 +used super\-user privileges +.PD +.RE +.SH "PROCESS STATE CODES" +Here are the different values that the +.BR s ", " stat " and " state +output specifiers (header "STAT" or "S") will display to describe the state +of a process: +.PP +.RS 8 +.PD 0 +.TP 5 +D +uninterruptible sleep (usually IO) +.TP +I +Idle kernel thread +.TP +R +running or runnable (on run queue) +.TP +S +interruptible sleep (waiting for an event to complete) +.TP +T +stopped by job control signal +.TP +t +stopped by debugger during the tracing +.TP +W +paging (not valid since the 2.6.xx kernel) +.TP +X +dead (should never be seen) +.TP +Z +defunct ("zombie") process, terminated but not reaped by its parent +.PD +.RE +.PP +For BSD formats and when the +.B stat +keyword is used, additional characters may be displayed: +.PP +.RS 8 +.PD 0 +.TP 5 +< +high\-priority (not nice to other users) +.TP +N +low\-priority (nice to other users) +.TP +L +has pages locked into memory (for real\-time and custom IO) +.TP +s +is a session leader +.TP +l +is multi-threaded (using CLONE_THREAD, like NPTL pthreads do) +.TP ++ +is in the foreground process group +.PD +.RE +.SH "OBSOLETE SORT KEYS" +These keys are used by the BSD +.B O +option (when it is used for sorting). The GNU +.B \-\-sort +option doesn't use these keys, but the specifiers described below in the +.B STANDARD FORMAT SPECIFIERS +section. Note that the values used in sorting are the internal values +.B ps +uses and not the "cooked" values used in some of the output format fields +(e.g. sorting on tty will sort into device number, not according to the +terminal name displayed). Pipe +.B ps +output into the +.BR sort (1) +command if you want to sort the cooked values. +.TS +l l lw(3i). +\fBKEY LONG DESCRIPTION\fR +c cmd simple name of executable +C pcpu cpu utilization +f flags flags as in long format F field +g pgrp process group ID +G tpgid controlling tty process group ID +j cutime cumulative user time +J cstime cumulative system time +k utime user time +m min_flt number of minor page faults +M maj_flt number of major page faults +n cmin_flt cumulative minor page faults +N cmaj_flt cumulative major page faults +o session session ID +p pid process ID +P ppid parent process ID +r rss resident set size +R resident resident pages +s size memory size in kilobytes +S share amount of shared pages +t tty the device number of the controlling tty +T start_time time process was started +U uid user ID number +u user user name +v vsize total VM size in KiB +y priority kernel scheduling priority +.\"K stime system time (conflict, system vs. start time) +.TE +.SH "AIX FORMAT DESCRIPTORS" +This +.B ps +supports AIX format descriptors, which work somewhat like the +formatting codes of +.IR printf (1) +and +.IR printf (3). +For example, the normal default output can be produced with this: +.B ps \-eo """%p %y %x %c""\fR." +The +.B NORMAL +codes are described in the next section. +.TS +l l l. +\fBCODE NORMAL HEADER\fR +%C pcpu %CPU +%G group GROUP +%P ppid PPID +%U user USER +%a args COMMAND +%c comm COMMAND +%g rgroup RGROUP +%n nice NI +%p pid PID +%r pgid PGID +%t etime ELAPSED +%u ruser RUSER +%x time TIME +%y tty TTY +%z vsz VSZ +.TE +.SH "STANDARD FORMAT SPECIFIERS" +Here are the different keywords that may be used to control the output +format (e.g., with option +.BR \-o ) +or to sort the selected processes with the GNU\-style +.B \-\-sort +option. +.PP +For example: +.B ps \-eo pid,\:user,\:args \-\-sort user +.PP +This version of +.B ps +tries to recognize most of the keywords used in other implementations of +.BR ps . +.PP +The following user\-defined format specifiers may contain +spaces: +.BR args ", " cmd ", " comm ", " command ", " fname ", " ucmd ", " ucomm , +.BR lstart ", " bsdstart ", " start . +.PP +Some keywords may not be available for sorting. + +.\" ####################################################################### +.\" lB1 lB1 lB1 lB1 s s s +.\" lB1 l1 l1 l1 s s s. +.\" +.\" lB1 lB1 lBw(5.5i) +.\" lB1 l1 l. +.\" +.TS +expand; +l1B l1B lBw(\n[ColSize]n) +l1B l1 l. +CODE HEADER DESCRIPTION + +%cpu %CPU T{ +cpu utilization of the process in "##.#" format. Currently, it is the CPU +time used divided by the time the process has been running (cputime/realtime +ratio), expressed as a percentage. It will not add up to 100% unless you are +lucky. (alias +.BR pcpu ). +T} + +%mem %MEM T{ +ratio of the process's resident set size to the physical memory on the +machine, expressed as a percentage. (alias +.BR pmem ). +T} + +ag_id AGID T{ +The autogroup identifier associated with a process which operates in conjunction +with the CFS scheduler to improve interactive desktop performance. +T} + +ag_nice AGNI T{ +The autogroup nice value which affects scheduling of all processes in that group. +T} + +args COMMAND T{ +command with all its arguments as a string. Modifications to the arguments +may be shown. The output in this column may contain spaces. A process +marked is partly dead, waiting to be fully destroyed by its parent. +Sometimes the process args will be unavailable; when this happens, +.B ps +will instead print the executable name in brackets. (alias +.BR cmd ", " command ). +See also the +.B comm +format keyword, the +.B \-f +option, and the +.B c +option. +.br +When specified last, this column will extend to the edge of the display. If +.B ps +can not determine display width, as when output is redirected (piped) into a +file or another command, the output width is undefined (it may be 80, +unlimited, determined by the +.B TERM +variable, and so on). The +.B COLUMNS +environment variable or +.B \-\-cols +option may be used to exactly determine the width in this case. The +.B w +or +.B \-w +option may be also be used to adjust width. +T} + +blocked BLOCKED T{ +mask of the blocked signals, see +.IR signal (7). +According to the width of the field, a 32 or 64\-bit mask in hexadecimal +format is displayed, unless the \fB\-\-signames\fR option is used. (alias +.BR sig_block ", " sigmask ). +T} + +bsdstart START T{ +time the command started. If the process was started less than 24 hours ago, +the output format is "\ HH:MM", else it is " Mmm:SS" (where Mmm is the three +letters of the month). See also +.BR lstart , \ start , \ start_time ", and" \ stime . +T} + +bsdtime TIME T{ +accumulated cpu time, user + system. The display format is usually +"MMM:SS", but can be shifted to the right if the process used more than 999 +minutes of cpu time. +T} + +c C T{ +processor utilization. Currently, this is the integer value of the percent +usage over the lifetime of the process. (see +.BR %cpu ). +T} + +caught CAUGHT T{ +mask of the caught signals, see +.IR signal (7). +According to the width of the field, a 32 or 64 bits mask in hexadecimal +format is displayed, unless the \fB\-\-signames\fR option is used. (alias +.BR sig_catch ", " sigcatch ). +T} + +cgname CGNAME T{ +display name of control groups to which the process belongs. +T} + +cgroup CGROUP T{ +display control groups to which the process belongs. +T} + +cgroupns CGROUPNS T{ +Unique inode number describing the namespace the process belongs to. +See +.IR namespaces (7). +T} + +class CLS T{ +scheduling class of the process. (alias +.BR policy ", " cls ). +Field's possible values are: +.sp 1 +.in +9n +\- not reported +.br +TS SCHED_OTHER +.br +FF SCHED_FIFO +.br +RR SCHED_RR +.br +B SCHED_BATCH +.br +ISO SCHED_ISO +.br +IDL SCHED_IDLE +.br +DLN SCHED_DEADLINE +.br +? unknown value +.in +T} + +cls CLS T{ +scheduling class of the process. (alias +.BR policy ", " cls ). +Field's possible values are: +.sp 1 +.in +9n +\- not reported +.br +TS SCHED_OTHER +.br +FF SCHED_FIFO +.br +RR SCHED_RR +.br +B SCHED_BATCH +.br +ISO SCHED_ISO +.br +IDL SCHED_IDLE +.br +DLN SCHED_DEADLINE +.br +? unknown value +.in +T} + +cmd CMD T{ +see +.BR args . +(alias +.BR args ", " command ). +T} + +comm COMMAND T{ +command name (only the executable name). The output in this column may +contain spaces. +(alias +.BR ucmd ", " ucomm ). +See also the +.B args +format keyword, the +.B \-f +option, and the +.B c +option. +.br +When specified last, this column will extend to the edge of the display. If +.B ps +can not determine display width, as when output is redirected (piped) into a +file or another command, the output width is undefined (it may be 80, +unlimited, determined by the +.B TERM +variable, and so on). The +.B COLUMNS +environment variable or +.B \-\-cols +option may be used to exactly determine the width in this case. The +.BR w \ or \ \-w +option may be also be used to adjust width. +T} + +command COMMAND T{ +See +.BR args . +(alias +.BR args ", " command ). +T} + +cp CP T{ +per\-mill (tenths of a percent) CPU usage. (see +.BR %cpu ). +T} + +cputime TIME T{ +cumulative CPU time, "[DD\-]hh:mm:ss" format. (alias +.BR time ). +T} + +cputimes TIME T{ +cumulative CPU time in seconds (alias +.BR times ). +T} + +cuc %CUC T{ +The CPU utilization of a process, including dead children, in an extended "##.###" format. +(see also +.BR %cpu , +.BR c , +.BR cp , +.BR cuu , +.BR pcpu ). +T} + +cuu %CUU T{ +The CPU utilization of a process in an extended "##.###" format. +(see also +.BR %cpu , +.BR c , +.BR cp , +.BR cuc , +.BR pcpu ). +T} + +drs DRS T{ +data resident set size, the amount of private memory \fIreserved\fR by a process. +It is also known as DATA. Such memory may not yet be mapped to +.B rss +but will always be included +included in the +.B vsz +amount. + +T} + +egid EGID T{ +effective group ID number of the process as a decimal integer. (alias +.BR gid ). +T} + +egroup EGROUP T{ +effective group ID of the process. This will be the textual group ID, if it +can be obtained and the field width permits, or a decimal representation +otherwise. (alias +.BR group ). +T} + +eip EIP T{ +instruction pointer. As of kernel 4.9.xx will be zeroed out unless task is +exiting or being core dumped. +T} + +esp ESP T{ +stack pointer. As of kernel 4.9.xx will be zeroed out unless task is +exiting or being core dumped. +T} + +etime ELAPSED T{ +elapsed time since the process was started, in the form [[DD\-]hh:]mm:ss. +T} + +etimes ELAPSED T{ +elapsed time since the process was started, in seconds. +T} + +euid EUID T{ +effective user ID (alias +.BR uid ). +T} + +euser EUSER T{ +effective user name. This will be the textual user ID, if it can be obtained +and the field width permits, or a decimal representation otherwise. The +.B n +option can be used to force the decimal representation. (alias +.BR uname ", " user ). +T} + +exe EXE T{ +path to the executable. Useful if path cannot be printed via +.BR cmd ", " comm +or +.BR args +format options. +T} + +f F T{ +flags associated with the process, see the +.B PROCESS FLAGS +section. (alias +.BR flag ", " flags ). +T} + +fgid FGID T{ +filesystem access group\ ID. (alias +.BR fsgid ). +T} + +fgroup FGROUP T{ +filesystem access group ID. This will be the textual group ID, if it can +be obtained and the field width permits, or a decimal representation +otherwise. (alias +.BR fsgroup ). +T} + +flag F T{ +see +.BR f . +(alias +.BR f ", " flags ). +T} + +flags F T{ +see +.BR f . +(alias +.BR f ", " flag ). +T} + +fname COMMAND T{ +first 8 bytes of the base name of the process's executable file. The output +in this column may contain spaces. +T} + +fuid FUID T{ +filesystem access user ID. (alias +.BR fsuid ). +T} + +fuser FUSER T{ +filesystem access user ID. This will be the textual user ID, if it can be +obtained and the field width permits, or a decimal representation otherwise. +T} + +gid GID T{ +see +.BR egid . +(alias +.BR egid ). +T} + +group GROUP T{ +see +.BR egroup . +(alias +.BR egroup ). +T} + +ignored IGNORED T{ +mask of the ignored signals, see +.IR signal (7). +According to the width of the field, a 32 or 64 bits mask in hexadecimal +format is displayed, unless the \fB\-\-signames\fR option is used. (alias +.BR sig_ignore ", " sigignore ). +T} + +ipcns IPCNS T{ +Unique inode number describing the namespace the process belongs to. +See +.IR namespaces (7). +T} + +label LABEL T{ +security label, most commonly used for SELinux context data. This is for +the +.I Mandatory Access Control +("MAC") found on high\-security systems. +T} + +lstart STARTED T{ +time the command started. This will be in the form "DDD mmm HH:MM:SS YYY" +unless changed by the \fB\-D\fR option. +T} + +lsession SESSION T{ +displays the login session identifier of a process, +if systemd support has been included. +T} + +luid LUID T{ +displays Login ID associated with a process. +T} + +lwp LWP T{ +light weight process (thread) ID of the dispatchable entity (alias +.BR spid , \ tid ). +See +.B tid +for additional information. +T} + +lxc LXC T{ +The name of the lxc container within which a task is running. +If a process is not running inside a container, a dash ('\-') will be shown. +T} + +machine MACHINE T{ +displays the machine name for processes assigned to VM or container, +if systemd support has been included. +T} + +maj_flt MAJFLT T{ +The number of major page faults that have occurred with this process. +T} + +min_flt MINFLT T{ +The number of minor page faults that have occurred with this process. +T} + +mntns MNTNS T{ +Unique inode number describing the namespace the process belongs to. +See +.IR namespaces (7). +T} + +netns NETNS T{ +Unique inode number describing the namespace the process belongs to. +See +.IR namespaces (7). +T} + +ni NI T{ +nice value. This ranges from 19 (nicest) to \-20 (not nice to others), +see +.IR nice (1). +(alias +.BR nice ). +T} + +nice NI T{ +see +.BR ni . (alias +.BR ni ). +T} + +nlwp NLWP T{ +number of lwps (threads) in the process. (alias +.BR thcount ). +T} + +numa NUMA T{ +The node associated with the most recently used processor. +A \fI\-1\fR means that NUMA information is unavailable. +T} + +nwchan WCHAN T{ +address of the kernel function where the process is sleeping (use +.B wchan +if you want the kernel function name). +T} + +oom OOM T{ +Out of Memory Score. The value, ranging from 0 to +1000, used to select +task(s) to kill when memory is exhausted. +T} + +oomadj OOMADJ T{ +Out of Memory Adjustment Factor. The value is added to the current out of +memory score which is then used to determine which task to kill when memory +is exhausted. +T} + +ouid OWNER T{ +displays the Unix user identifier of the owner of the session of a process, +if systemd support has been included. +T} + +pcpu %CPU T{ +see +.BR %cpu . +(alias +.BR %cpu ). +T} + +pending PENDING T{ +mask of the pending signals. See +.IR signal (7). +Signals pending on the process are distinct from signals pending on +individual threads. Use the +.B m +option or the +.B \-m +option to see both. According to the width of the field, a 32 or 64 bits +mask in hexadecimal +format is displayed, unless the \fB\-\-signames\fR option is used. (alias +.BR sig ). +T} + +pgid PGID T{ +process group ID or, equivalently, the process ID of the process group +leader. (alias +.BR pgrp ). +T} + +pgrp PGRP T{ +see +.BR pgid . +(alias +.BR pgid ). +T} + +pid PID T{ +a number representing the process ID (alias +.BR tgid ). +T} + +pidns PIDNS T{ +Unique inode number describing the namespace the process belongs to. +See +.IR namespaces (7). +T} + +pmem %MEM T{ +see +.BR %mem . +(alias +.BR %mem ). +T} + +policy POL T{ +scheduling class of the process. (alias +.BR class ", " cls ). +Possible values are: +.sp 1 +.in +9n +\- not reported +.br +TS SCHED_OTHER +.br +FF SCHED_FIFO +.br +RR SCHED_RR +.br +B SCHED_BATCH +.br +ISO SCHED_ISO +.br +IDL SCHED_IDLE +.br +DLN SCHED_DEADLINE +.br +? unknown value +.in +T} + +ppid PPID T{ +parent process ID. +T} + +pri PRI T{ +priority of the process. Higher number means higher priority. +T} + +psr PSR T{ +processor that process last executed on. +T} + +pss PSS T{ +Proportional share size, the non-swapped physical memory, with shared memory +proportionally accounted to all tasks mapping it. +T} + +rbytes RBYTES T{ +Number of bytes which this process really did cause to be fetched from the storage layer. +T} + +rchars RCHARS T{ +Number of bytes which this task has caused to be read from storage. +T} + +rgid RGID T{ +real group ID. +T} + +rgroup RGROUP T{ +real group name. This will be the textual group ID, if it can be obtained +and the field width permits, or a decimal representation otherwise. +T} + +rops ROPS T{ +Number of read I/O operations—that is, system calls such as +.BR read "(2) and " pread (2). +T} + +rss RSS T{ +resident set size, the non\-swapped physical memory that a task has used (in +kilobytes). (alias +.BR rssize ", " rsz ). +T} + +rssize RSS T{ +see +.BR rss . +(alias +.BR rss ", " rsz ). +T} + +rsz RSZ T{ +see +.BR rss . +(alias +.BR rss ", " rssize ). +T} + +rtprio RTPRIO T{ +realtime priority. +T} + +ruid RUID T{ +real user ID. +T} + +ruser RUSER T{ +real user ID. This will be the textual user ID, if it can be obtained and +the field width permits, or a decimal representation otherwise. +T} + +s S T{ +minimal state display (one character). See section +.B PROCESS STATE CODES +for the different values. See also +.B stat +if you want additional information displayed. (alias +.BR state ). +T} + +sched SCH T{ +scheduling policy of the process. The policies SCHED_OTHER (SCHED_NORMAL), +SCHED_FIFO, SCHED_RR, SCHED_BATCH, SCHED_ISO, SCHED_IDLE and SCHED_DEADLINE are +respectively displayed as 0, 1, 2, 3, 4, 5 and 6. +T} + +seat SEAT T{ +displays the identifier associated with all hardware devices assigned +to a specific workplace, +if systemd support has been included. +T} + +sess SESS T{ +session ID or, equivalently, the process ID of the session leader. (alias +.BR session ", " sid ). +T} + +sgi_p P T{ +processor that the process is currently executing on. Displays "*" if the +process is not currently running or runnable. +T} + +sgid SGID T{ +saved group ID. (alias +.BR svgid ). +T} + +sgroup SGROUP T{ +saved group name. This will be the textual group ID, if it can be obtained +and the field width permits, or a decimal representation otherwise. +T} + +sid SID T{ +see +.BR sess . +(alias +.BR sess ", " session ). +T} + +sig PENDING T{ +see +.BR pending . +(alias +.BR pending ", " sig_pend ). +T} + +sigcatch CAUGHT T{ +see +.BR caught . +(alias +.BR caught ", " sig_catch ). +T} + +sigignore IGNORED T{ +see +.BR ignored . +(alias +.BR ignored ", " sig_ignore ). +T} + +sigmask BLOCKED T{ +see +.BR blocked . +(alias +.BR blocked ", " sig_block ). +T} + +size SIZE T{ +approximate amount of swap space that would be required if the process were +to dirty all writable pages and then be swapped out. This number is very +rough! +T} + +slice SLICE T{ +displays the slice unit which a process belongs to, +if systemd support has been included. +T} + +spid SPID T{ +see +.BR lwp . +(alias +.BR lwp ", " tid ). +T} + +stackp STACKP T{ +address of the bottom (start) of stack for the process. +T} + +start STARTED T{ +time the command started. If the process was started less than 24 hours ago, +the output format is "HH:MM:SS", else it is "\ \ Mmm\ dd" (where Mmm is a +three\-letter month name). See also +.BR bsdstart ", " start ", " start_time ", and " stime . +T} + +start_time START T{ +starting time or date of the process. Only the year will be displayed if the +process was not started the same year +.B ps +was invoked, or "MmmDD" if it was not started the same day, or "HH:MM" +otherwise. See also +.BR bsdstart ", " start ", " lstart ", and " stime . +T} + +stat STAT T{ +multi\-character process state. See section +.B PROCESS STATE CODES +for the different values meaning. See also +.BR s \ and \ state +if you just want the first character displayed. +T} + +state S T{ +see +.BR s ".\& (alias" \ s ). +T} + +stime STIME T{ +see \fBstart_time\fR. (alias \fBstart_time\fR). +T} + +suid SUID T{ +saved user ID. (alias +.BR svuid ). +T} + +supgid SUPGID T{ +group ids of supplementary groups, if any. See +.BR getgroups (2). +T} + +supgrp SUPGRP T{ +group names of supplementary groups, if any. See +.BR getgroups (2). +T} + +suser SUSER T{ +saved user name. This will be the textual user ID, if it can be obtained and +the field width permits, or a decimal representation otherwise. (alias +.BR svuser ). +T} + +svgid SVGID T{ +see +.BR sgid . +(alias +.BR sgid ). +T} + +svuid SVUID T{ +see +.BR suid . +(alias +.BR suid ). +T} + +sz SZ T{ +size in physical pages of the core image of the process. This includes text, +data, and stack space. Device mappings are currently excluded; this is +subject to change. See +.BR vsz \ and \ rss . +T} + +tgid TGID T{ +a number representing the thread group to which a task belongs (alias +.BR pid ). +It is the process ID of the thread group leader. +T} + +thcount THCNT T{ +see +.BR nlwp . +(alias +.BR nlwp ). +number of kernel threads owned by the process. +T} + +tid TID T{ +the unique number representing a dispatchable entity (alias +.BR spid ", " tid ). +This value may also appear as: a process ID (pid); a process group ID (pgrp); +a session ID for the session leader (sid); a thread group ID for the thread +group leader (tgid); and a tty process group ID for the process group leader +(tpgid). +T} + +time TIME T{ +cumulative CPU\ time, "[DD\-]HH:MM:SS" format. (alias +.BR cputime ). +T} + +timens TIMENS T{ +Unique inode number describing the namespace the process belongs to. +See +.IR namespaces (7). +T} + +times TIME T{ +cumulative CPU\ time in seconds (alias +.BR cputimes ). +T} + +tname TTY T{ +controlling tty (terminal). (alias +.BR tt ", " tty ). +T} + +tpgid TPGID T{ +ID of the foreground process group on the tty (terminal) that the process is +connected to, or \-1 if the process is not connected to a tty. +T} + +trs TRS T{ +text resident set size, the amount of physical memory devoted to executable code. +T} + +tt TT T{ +controlling tty (terminal). (alias +.BR tname ", " tty ). +T} + +tty TT T{ +controlling tty (terminal). (alias +.BR tname ", " tt ). +T} + +ucmd CMD T{ +see +.BR comm . +(alias +.BR comm ", " ucomm ). +T} + +ucomm COMMAND T{ +see +.BR comm . +(alias +.BR comm ", " ucmd ). +T} + +uid UID T{ +see +.BR euid . +(alias +.BR euid ). +T} + +uname USER T{ +see +.BR euser . +(alias +.BR euser ", " user ). +T} + +unit UNIT T{ +displays unit which a process belongs to, +if systemd support has been included. +T} + +user USER T{ +see +.BR euser . +(alias +.BR euser ", " uname ). +T} + +userns USERNS T{ +Unique inode number describing the namespace the process belongs to. +See +.IR namespaces (7). +T} + +uss USS T{ +Unique set size, the non-swapped physical memory, which +is not shared with an another task. +T} + +utsns UTSNS T{ +Unique inode number describing the namespace the process belongs to. +See +.IR namespaces (7). +T} + +uunit UUNIT T{ +displays user unit which a process belongs to, +if systemd support has been included. +T} + +vsize VSZ T{ +see +.BR vsz . +(alias +.BR vsz ). +T} + +vsz VSZ T{ +virtual memory size of the process in KiB (1024\-byte units). Device +mappings are currently excluded; this is subject to change. (alias +.BR vsize ). +T} + +wbytes WBYTES T{ +Number of bytes which this process caused to be sent to the storage layer. +T} + +wcbytes WCBYTES T{ +Number of cancelled write bytes. +T} + +wchan WCHAN T{ +name of the kernel function in which the process is sleeping. +T} + +wchars WCHARS T{ +Number of bytes which this task has caused, or shall cause to be written to disk. +T} + +wops WOPS T{ +Number of write I/O operations—that is, system calls such as +.BR write "(2) and " pwrite (2). +T} + +.TE +.SH "ENVIRONMENT VARIABLES" +The following environment variables could affect +.BR ps : +.TP 3 +.B COLUMNS +Override default display width. +.TP +.B LINES +Override default display height. +.TP +.B PS_PERSONALITY +Set to one of posix, old, linux, bsd, sun, digital...\& (see section +.B PERSONALITY +below). +.TP +.B CMD_ENV +Set to one of posix, old, linux, bsd, sun, digital...\& (see section +.B PERSONALITY +below). +.TP +.B I_WANT_A_BROKEN_PS +Force obsolete command line interpretation. +.TP +.B LC_TIME +Date format. +.TP +.B LIBPROC_HIDE_KERNEL +Set this to any value to hide kernel threads normally displayed with the +.B -e +option. This is equivalent to selecting +.B --ppid 2 -p 2 --deselect +instead. Also works in BSD mode. +.TP +.B PS_COLORS +Not currently supported. +.TP +.B PS_FORMAT +Default output format override. You may set this to a format +string of the type used for the +.B \-o +option. +The +.B DefSysV +and +.B DefBSD +values are particularly useful. +.TP +.B POSIXLY_CORRECT +Don't find excuses to ignore bad "features". +.TP +.B POSIX2 +When set to "on", acts as +.BR POSIXLY_CORRECT . +.TP +.B UNIX95 +Don't find excuses to ignore bad "features". +.TP +.B _XPG +Cancel +.BR CMD_ENV =\c +.I irix +non\-standard behavior. +.PP +In general, it is a bad idea to set these variables. The one exception is +.B CMD_ENV +or +.BR PS_PERSONALITY , +which could be set to Linux for normal systems. Without that setting, +.B ps +follows the useless and bad parts of the Unix98 standard. +.SH "PERSONALITY" +.TS +l l. +390 like the OS/390 OpenEdition \fBps\fR +aix like AIX \fBps\fR +bsd like FreeBSD \fBps\fR (totally non\-standard) +compaq like Digital Unix \fBps\fR +debian like the old Debian \fBps\fR +digital like Tru64 (was Digital\ Unix, was OSF/1) \fBps\fR +gnu like the old Debian \fBps\fR +hp like HP\-UX \fBps\fR +hpux like HP\-UX \fBps\fR +irix like Irix \fBps\fR +linux ***** \fBrecommended\fR ***** +old like the original Linux \fBps\fR (totally non\-standard) +os390 like OS/390 Open Edition \fBps\fR +posix standard +s390 like OS/390 Open Edition \fBps\fR +sco like SCO \fBps\fR +sgi like Irix \fBps\fR +solaris2 like Solaris 2+ (SunOS 5) \fBps\fR +sunos4 like SunOS 4 (Solaris 1) \fBps\fR (totally non\-standard) +svr4 standard +sysv standard +tru64 like Tru64 (was Digital Unix, was OSF/1) \fBps\fR +unix standard +unix95 standard +unix98 standard +.TE +.SH BUGS +The fields \fBbsdstart\fR and \fBstart\fR will only show the abbreviated +month name in English. The fields \fBlstart\fR and \fBstime\fR will show +the abbreviated month name in the configured locale but may exceed the +column width due to the different lengths for abbreviated month and day +names across languages. +.PP +.SH "SEE ALSO" +.BR pgrep (1), +.BR pstree (1), +.BR top (1), +.BR strftime (3), +.BR proc (5). +.SH STANDARDS +This +.B ps +conforms to: +.PP +.PD 0 +.IP 1 4 +Version 2 of the Single Unix Specification +.IP 2 4 +The Open Group Technical Standard Base Specifications, Issue\ 6 +.IP 3 4 +IEEE Std 1003.1, 2004\ Edition +.IP 4 4 +X/Open System Interfaces Extension [UP\ XSI] +.IP 5 4 +ISO/IEC 9945:2003 +.PD +.SH AUTHOR +.B ps +was originally written by +.MT lankeste@\:fwi.\:uva.\:nl +Branko Lankester +.ME . +.MT johnsonm@\:redhat.\:com +Michael K. Johnson +.ME +re\-wrote it significantly to use the proc filesystem, changing a few things +in the process. +.MT mjshield@\:nyx.\:cs.\:du.\:edu +Michael Shields +.ME +added the pid\-list feature. +.MT cblake@\:bbn.\:com +Charles Blake +.ME +added multi\-level sorting, the dirent\-style library, the device +name\-to\-number mmaped database, the approximate binary search directly on +System.map, and many code and documentation cleanups. David Mossberger\-Tang +wrote the generic BFD support for psupdate. +.MT albert@\:users.\:sf.\:net +Albert Cahalan +.ME +rewrote ps for full Unix98 and BSD support, along with some ugly hacks for +obsolete and foreign syntax. +.PP +Please send bug reports to +.MT procps@\:freelists.\:org +.ME . +No subscription is required or suggested. diff --git a/man/pwdx.1 b/man/pwdx.1 new file mode 100644 index 0000000..98e7b6e --- /dev/null +++ b/man/pwdx.1 @@ -0,0 +1,40 @@ +.\" +.\" Copyright (c) 2020-2023 Craig Small +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 2004 Nicholas Miel. +.\" +.\" 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. +.\" +.\" +.TH PWDX "1" "2020-06-04" "procps-ng" "User Commands" +.SH NAME +pwdx \- report current working directory of a process +.SH SYNOPSIS +.B pwdx +[\fIoptions\fR] \fIpid\fR [...] +.SH OPTIONS +.TP +\fB\-V\fR, \fB\-\-version\fR +Output version information and exit. +.TP +\fB\-h\fR, \fB\-\-help\fR +Output help screen and exit. +.SH "SEE ALSO" +.BR ps (1), +.BR pgrep (1) +.SH STANDARDS +No standards apply, but +.B pwdx +looks an awful lot like a SunOS command. +.SH AUTHOR +.UR nmiell@gmail.com +Nicholas Miell +.UE +wrote pwdx in 2004. +.SH "REPORTING BUGS" +Please send bug reports to +.UR procps@freelists.org +.UE diff --git a/man/skill.1 b/man/skill.1 new file mode 100644 index 0000000..de95871 --- /dev/null +++ b/man/skill.1 @@ -0,0 +1,128 @@ +.\" +.\" Copyright (c) 2011-2023 Craig Small +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 2002-2006 Albert Cahalan +.\" +.\" 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. +.\" +.\" +.TH SKILL 1 "2023-08-19" "procps-ng" "User Commands" +.SH NAME +skill, snice \- send a signal or report process status +.SH SYNOPSIS +.B skill +.RI [ signal ] +.RI [ options ] +.I expression +.br +.B snice +.RI [ "new priority" ] +.RI [ options ] +.I expression +.SH DESCRIPTION +These tools are obsolete and unportable. The command syntax is +poorly defined. Consider using the +.BR killall , +.BR pkill , +and +.B pgrep +commands instead. +.PP +The default signal for \fBskill\fP is TERM. Use \fB\-l\fP or \fB\-L\fP to list +available signals. Particularly useful signals include HUP, INT, +KILL, STOP, CONT, and 0. Alternate signals may be specified in three +ways: \fB\-9\fP \fB\-SIGKILL\fP \fB\-KILL\fP. +.PP +The default priority for \fBsnice\fP is +4. Priority numbers range from ++20 (slowest) to \-20 (fastest). Negative priority numbers are +restricted to administrative users. +.SH OPTIONS +.TP +.BR \-f , \ \-\-fast +Fast mode. This option has not been implemented. +.TP +.BR \-i , \ \-\-interactive +Interactive use. You will be asked to approve each action. +.TP +.BR \-l , \ \-\-list +List all signal names. +.TP +.BR \-L , \ \-\-table +List all signal names in a nice table. +.TP +.BR \-n , \ \-\-no\-action +No action; perform a simulation of events that would occur but do not +actually change the system. +.TP +.BR \-v , \ \-\-verbose +Verbose; explain what is being done. +.TP +.BR \-w , \ \-\-warnings +Enable warnings. This option has not been implemented. +.TP +\fB\-h\fR, \fB\-\-help\fR +Display help text and exit. +.TP +\fB\-V\fR, \fB\-\-version\fR +Display version information. +.PD +.SH "PROCESS SELECTION OPTIONS" +Selection criteria can be: terminal, user, pid, command. The options +below may be used to ensure correct interpretation. +.TP +\fB\-t\fR, \fB\-\-tty\fR \fItty\fR +The next expression is a terminal (tty or pty). +.TP +\fB\-u\fR, \fB\-\-user\fR \fIuser\fR +The next expression is a username. +.TP +\fB\-p\fR, \fB\-\-pid\fR \fIpid\fR +The next expression is a process ID number. +.TP +\fB\-c\fR, \fB\-\-command\fR \fIcommand\fR +The next expression is a command name. +.TP +\fB\-\-ns \fIpid\fR +Match the processes that belong to the same namespace as pid. +.TP +\fB\-\-nslist \fIns\/\fR,\,\fI...\/\fR +list which namespaces will be considered for the \fB\-\-ns\fP option. +Available namespaces: ipc, mnt, net, pid, user, uts. +.PD +.SH SIGNALS +The behavior of signals is explained in +.BR signal (7) +manual page. +.SH EXAMPLES +.TP +.B snice \-c seti \-c crack +7 ++Slow down \fBseti\fP and \fBcrack\fP commands. +.TP +.B skill \-KILL \-t /dev/pts/* +Kill users on PTY devices. +.TP +.B skill \-STOP \-u viro \-u lm \-u davem +Stop three users. +.SH "SEE ALSO" +.BR kill (1), +.BR kill (2), +.BR killall (1), +.BR nice (1), +.BR pkill (1), +.BR renice (1), +.BR signal (7) +.SH STANDARDS +No standards apply. +.SH AUTHOR +.MT albert@users.sf.net +Albert Cahalan +.ME +wrote skill and snice in 1999 as a replacement for a non-free +version. +.SH "REPORTING BUGS" +Please send bug reports to +.UR procps@freelists.org +.UE diff --git a/man/slabtop.1 b/man/slabtop.1 new file mode 100644 index 0000000..0734348 --- /dev/null +++ b/man/slabtop.1 @@ -0,0 +1,123 @@ +.\" +.\" Copyright (c) 2011-2023 Craig Small +.\" Copyright (c) 2013-2023 Jim Warner +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 2004-2006 Albert Cahalan +.\" Copyright (C) 2003 Chris Rivera +.\" +.\" This program is free software; you can redistribute it and/or modify +.\" it under the terms of the GNU Lesser General Public License as +.\" published by the Free Software Foundation; either version 2.1 of the +.\" License, or (at your option) any later version. +.\" +.\" +.TH SLABTOP "1" "2021-03-11" "procps-ng" "User Commands" +.SH NAME +slabtop \- display kernel slab cache information in real time +.SH SYNOPSIS +.B slabtop +[\fIoptions\fR] +.SH DESCRIPTION +.B slabtop +displays detailed kernel slab cache information in real time. It displays a +listing of the top caches sorted by one of the listed sort criteria. It also +displays a statistics header filled with slab layer information. +.SH OPTIONS +Normal invocation of +.B slabtop +does not require any options. The behavior, however, can be fine-tuned by +specifying one or more of the following flags: +.TP +\fB\-d\fR, \fB\-\-delay\fR=\fIN\fR +Refresh the display every +.I n +in seconds. By default, +.B slabtop +refreshes the display every three seconds. To exit the program, hit +.BR q . +This cannot be combined with the \fB-o\fR option. +.TP +\fB\-s\fR, \fB\-\-sort\fR=\fIS\fR +Sort by \fIS\fR, where \fIS\fR is one of the sort criteria. +.TP +\fB\-o\fR, \fB\-\-once\fR +Display the output once and then exit. +.TP +\fB\-V\fR, \fB\-\-version\fR +Display version information and exit. +.TP +\fB\-h\fR, \fB\-\-help\fR +Display usage information and exit. +.SH SORT CRITERIA +The following are valid sort criteria used to sort the individual slab caches +and thereby determine what are the "top" slab caches to display. The default +sort criteria is to sort by the number of objects ("o"). +.PP +The sort criteria can also be changed while +.B slabtop +is running by pressing the associated character. +.TS +l l l. +\fBcharacter description header\fR +a number of active objects ACTIVE +b objects per slab OBJ/SLAB +c cache size CACHE SIZE +l number of slabs SLABS +v number of active slabs N/A +n name NAME\: +o number of objects OBJS +p pages per slab N/A +s object size OBJ SIZE +u cache utilization USE +.TE +.SH COMMANDS +.B slabtop +accepts keyboard commands from the user during use. The following are +supported. In the case of letters, both cases are accepted. +.PP +Each of the valid sort characters are also accepted, to change the sort +routine. See the section +.BR "SORT CRITERIA" . +.TP +.BR +Refresh the screen. +.TP +.BR Q +Quit the program. +.SH FILES +.TP +.I /proc/slabinfo +slab information +.SH "SEE ALSO" +.BR free (1), +.BR ps (1), +.BR top (1), +.BR vmstat (8) +.SH NOTES +Currently, +.B slabtop +requires a 2.4 or later kernel (specifically, a version 1.1 or later +.IR /proc/slabinfo ). +Kernel 2.2 should be supported in the future. +.PP +The +.B slabtop +statistic header is tracking how many bytes of slabs are being +used and is not a measure of physical memory. The 'Slab' field in the +\fI/proc/meminfo\fR file is tracking information about used slab physical memory. +.PP +The +.B CACHE SIZE +column is not accurate, it's the upper limit of memory used by specific slab. When system +using slub (most common case) is under high memory pressure, there are slab order +fallbacks, which means "pages per slab" is not constant and may decrease. +.SH AUTHORS +Written by Chris Rivera and Robert Love. +.PP +.B slabtop +was inspired by Martin Bligh's perl script, +.BR vmtop . +.SH "REPORTING BUGS" +Please send bug reports to +.UR procps@freelists.org +.UE diff --git a/man/snice.1 b/man/snice.1 new file mode 100644 index 0000000..1595a80 --- /dev/null +++ b/man/snice.1 @@ -0,0 +1 @@ +.so man1/skill.1 diff --git a/man/sysctl.8 b/man/sysctl.8 new file mode 100644 index 0000000..fe555bd --- /dev/null +++ b/man/sysctl.8 @@ -0,0 +1,196 @@ +.\" +.\" Copyright (c) 2011-2023 Craig Small +.\" Copyright (c) 2013-2023 Jim Warner +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 2004-2006 Albert Cahalan +.\" Copyright (c) 1999 George Staikos +.\" +.\" 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. +.\" +.\" +.TH SYSCTL "8" "2023-08-19" "procps-ng" "System Administration" +.SH NAME +sysctl \- configure kernel parameters at runtime +.SH SYNOPSIS +.B sysctl +[\fIoptions\fR] [\fIvariable\fR[\fB=\fIvalue\fR]] [...] +.br +.B sysctl \-p +[\fIfile\fR or \fIregexp\fR] [...] +.SH DESCRIPTION +.B sysctl +is used to modify kernel parameters at runtime. The parameters available +are those listed under \fI/proc/sys/\fR. Procfs is required for +.B sysctl +support in Linux. You can use +.B sysctl +to both read and write sysctl data. +.SH PARAMETERS +.TP +.I variable +The name of a key to read from. An example is kernel.ostype. The '/' +separator is also accepted in place of a '.'. +.TP +.IR variable = value +To set a key, use the form +.IR variable = value +where +.I variable +is the key and +.I value +is the value to set it to. If the value contains quotes or characters +which are parsed by the shell, you may need to enclose the value in double +quotes. +.TP +\fB\-n\fR, \fB\-\-values\fR +Use this option to disable printing of the key name when printing values. +.TP +\fB\-e\fR, \fB\-\-ignore\fR +Use this option to ignore errors about unknown keys. +.TP +\fB\-N\fR, \fB\-\-names\fR +Use this option to only print the names. It may be useful with shells that +have programmable completion. +.TP +\fB\-q\fR, \fB\-\-quiet\fR +Use this option to not display the values set to stdout. +.TP +\fB\-w\fR, \fB\-\-write\fR +Force all arguments to be write arguments and print an error if +they cannot be parsed this way. +.TP +\fB\-p\fR[\fIFILE\fR], \fB\-\-load\fR[=\fIFILE\fR] +Load in \fBsysctl\fR settings from the file specified or \fI/etc/sysctl.conf\fR +if none given. Specifying \- as filename means reading data from standard +input. Using this option will mean arguments to +.B sysctl +are files, which are read in the order they are specified. +The file argument may be specified as regular expression. +.TP +\fB\-a\fR, \fB\-\-all\fR +Display all values currently available. +.TP +\fB\-\-deprecated\fR +Include deprecated parameters to +.B \-\-all +values listing. +.TP +\fB\-b\fR, \fB\-\-binary\fR +Print value without new line. +.TP +\fB\-\-system\fR +Load settings from all system configuration files. See the +.B SYSTEM FILE PRECEDENCE +section below. +.TP +\fB\-r\fR, \fB\-\-pattern\fR \fIpattern\fR +Only apply settings that match +.IR pattern . +The +.I pattern +uses extended regular expression syntax. +.TP +\fB\-A\fR +Alias of \fB\-a\fR +.TP +\fB\-d\fR +Alias of \fB\-h\fR +.TP +\fB\-f\fR +Alias of \fB\-p\fR +.TP +\fB\-X\fR +Alias of \fB\-a\fR +.TP +\fB\-o\fR +Does nothing, exists for BSD compatibility. +.TP +\fB\-x\fR +Does nothing, exists for BSD compatibility. +.TP +\fB\-h\fR, \fB\-\-help\fR +Display help text and exit. +.TP +\fB\-V\fR, \fB\-\-version\fR +Display version information and exit. +.SH SYSTEM FILE PRECEDENCE +When using the \fB\-\-system\fR option, +.B sysctl +will read files from directories in the following list in given +order from top to bottom. Once a file of a given filename is loaded, any +file of the same name in subsequent directories is ignored. + +/etc/sysctl.d/*.conf +.br +/run/sysctl.d/*.conf +.br +/usr/local/lib/sysctl.d/*.conf +.br +/usr/lib/sysctl.d/*.conf +.br +/lib/sysctl.d/*.conf +.br +/etc/sysctl.conf + +All configuration files are sorted in lexicographic order, regardless of the +directory they reside in. Configuration files can either be completely +replaced (by having a new configuration file with the same name in a +directory of higher priority) or partially replaced (by having a configuration +file that is ordered later). +.SH EXAMPLES +/sbin/sysctl \-a +.br +/sbin/sysctl \-n kernel.hostname +.br +/sbin/sysctl \-w kernel.domainname="example.com" +.br +/sbin/sysctl \-p/etc/sysctl.conf +.br +/sbin/sysctl \-a \-\-pattern forward +.br +/sbin/sysctl \-a \-\-pattern forward$ +.br +/sbin/sysctl \-a \-\-pattern 'net.ipv4.conf.(eth|wlan)0.arp' +.br +/sbin/sysctl \-\-pattern '\[char94]net.ipv6' \-\-system +.SH DEPRECATED PARAMETERS +The +.B base_reachable_time +and +.B retrans_time +are deprecated. The +.B sysctl +command does not allow changing values of these +parameters. Users who insist to use deprecated kernel interfaces should push values +to \fB/proc\fR file system by other means. For example: +.PP +echo 256 > /proc/sys/net/ipv6/neigh/eth0/base_reachable_time +.SH FILES +.I /proc/sys +.br +.I /etc/sysctl.d/*.conf +.br +.I /run/sysctl.d/*.conf +.br +.I /usr/local/lib/sysctl.d/*.conf +.br +.I /usr/lib/sysctl.d/*.conf +.br +.I /lib/sysctl.d/*.conf +.br +.I /etc/sysctl.conf +.SH SEE ALSO +.BR proc (5), +.BR sysctl.conf (5), +.BR regex (7) +.SH AUTHOR +.UR staikos@0wned.org +George Staikos +.UE +.SH "REPORTING BUGS" +Please send bug reports to +.UR procps@freelists.org +.UE diff --git a/man/sysctl.conf.5 b/man/sysctl.conf.5 new file mode 100644 index 0000000..b64cb3b --- /dev/null +++ b/man/sysctl.conf.5 @@ -0,0 +1,92 @@ +.\" +.\" Copyright (c) 2016-2023 Jim Warner +.\" Copyright (c) 2019-2023 Craig Small +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 1999 George Staikos +.\" +.\" 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. +.\" +.\" +.TH SYSCTL.CONF "5" "2021-09-15" "procps-ng" "File Formats" +.SH NAME +sysctl.conf \- sysctl preload/configuration file +.SH DESCRIPTION +.B sysctl.conf +is a simple file containing sysctl values to be read in and set by +.BR sysctl . +The syntax is simply as follows: +.RS +.sp +.nf +.ne 7 +# comment +; comment + +token = value +.fi +.RE +.PP +Note that blank lines are ignored, and whitespace before and after a token or +value is ignored, although a value can contain whitespace within. Lines which +begin with a \fI#\fR or \fI;\fR are considered comments and ignored. + +If a line begins with a single \-, any attempts to set the value that fail will be +ignored. + +.SH NOTES +As the +.BR /etc/sysctl.conf +file is used to override default kernel parameter values, only a small number of parameters is predefined in the file. +Use +.IR /sbin/sysctl\ \-a +or follow +.BR sysctl (8) +to list all possible parameters. The description of individual parameters can be found in the kernel documentation. + +Maximum supported line length of the value is 4096 characters due +to a limitation of \fI/proc\fR entries in Linux kernel. +.SH EXAMPLE +.RS +.sp +.nf +.ne 7 +# sysctl.conf sample +# + kernel.domainname = example.com +; this one has a space which will be written to the sysctl! + kernel.modprobe = /sbin/mod probe +.fi +.RE +.PP +.SH FILES +.I /etc/sysctl.d/*.conf +.br +.I /run/sysctl.d/*.conf +.br +.I /usr/local/lib/sysctl.d/*.conf +.br +.I /usr/lib/sysctl.d/*.conf +.br +.I /lib/sysctl.d/*.conf +.br +.I /etc/sysctl.conf + +The paths where +.B sysctl +preload files usually exist. See also +.B sysctl +option +.IR \-\-system . +.SH SEE ALSO +.BR sysctl (8) +.SH AUTHOR +.UR staikos@0wned.org +George Staikos +.UE +.SH "REPORTING BUGS" +Please send bug reports to +.UR procps@freelists.org +.UE diff --git a/man/tload.1 b/man/tload.1 new file mode 100644 index 0000000..c2a12f5 --- /dev/null +++ b/man/tload.1 @@ -0,0 +1,69 @@ +.\" +.\" Copyright (c) 2011-2023 Craig Small +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 1993 Matt Welsh +.\" +.\" 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. +.\" +.\" +.TH TLOAD "1" "2020-06-04" "procps-ng" "User Commands" +.SH NAME +tload \- graphic representation of system load average +.SH SYNOPSIS +.B tload +[\fIoptions\fR] [\fItty\fR] +.SH DESCRIPTION +.B tload +prints a graph of the current system load average to the specified +.I tty +(or the tty of the +.B tload +process if none is specified). +.SH OPTIONS +.TP +\fB\-s\fR, \fB\-\-scale\fR \fInumber\fR +The scale option allows a vertical scale to be specified for the display (in +characters between graph ticks); thus, a smaller value represents a larger +scale, and vice versa. +.TP +\fB\-d\fR, \fB\-\-delay\fR \fIseconds\fR +The delay sets the delay between graph updates in +.IR seconds . +.TP +\fB\-h\fR, \fB\-\-help\fR +Display this help text. +.TP +\fB\-V\fR, \fB\-\-version\fR +Display version information and exit. +.PP +.SH FILES +.I /proc/loadavg +load average information +.SH "SEE ALSO" +.BR ps (1), +.BR top (1), +.BR uptime (1), +.BR w (1) +.SH BUGS +The +.BI "\-d" " delay" +option sets the time argument for an +.BR alarm (2); +if \-d 0 is specified, the alarm is set to 0, which will never send the +.B SIGALRM +and update the display. +.SH AUTHORS +Branko Lankester, +.UR david@\:ods.\:com +David Engel +.UE , and +.UR johnsonm@\:redhat.\:com +Michael K. Johnson +.UE . +.SH "REPORTING BUGS" +Please send bug reports to +.UR procps@freelists.org +.UE diff --git a/man/top.1 b/man/top.1 new file mode 100644 index 0000000..3791dfe --- /dev/null +++ b/man/top.1 @@ -0,0 +1,2810 @@ +.ig +. manual page for NEW and IMPROVED linux top +. +. Copyright (c) 2002-2023 Jim Warner force a screen \fBredraw\fR (if necessary) +.fi + +But if the display is still corrupted, there is one more step you could try. +Insert this command after \*(We has been suspended but before resuming it. +.nf + \fIkey/cmd objective \fR + reset restore your \fBterminal settings\fR +.fi + +\*(NT the width of \*(We's display will be limited to \*(WX positions. +Displaying all fields requires \*(WF characters. +Remaining screen width is usually allocated to any variable width columns +currently visible. +The variable width columns, such as COMMAND, are noted in topic +3a. DESCRIPTIONS of Fields. +Actual output width may also be influenced by the \-w switch, which is +discussed in topic 1. COMMAND\-LINE Options. + +Lastly, some of \*(We's screens or functions require the use of cursor +motion keys like the standard \*(KAs plus the Home, End, PgUp and PgDn keys. +If your terminal or emulator does not provide those keys, the following +combinations are accepted as alternatives: +.nf + \fI key equivalent-keys \fR + Left alt +\fB h \fR + Down alt +\fB j \fR + Up alt +\fB k \fR + Right alt +\fB l \fR + Home alt + ctrl +\fB h \fR + PgDn alt + ctrl +\fB j \fR + PgUp alt + ctrl +\fB k \fR + End alt + ctrl +\fB l \fR +.fi + +The \fBUp\fR and \fBDown\fR \*(KAs have special significance when prompted +for line input terminated with the key. +Those keys, or their aliases, can be used to retrieve previous input lines +which can then be edited and re-input. +And there are four additional keys available with line oriented input. +.nf + \fI key special-significance \fR + Up recall \fBolder\fR strings for re-editing + Down recall \fBnewer\fR strings or \fBerase\fR entire line + Insert toggle between \fBinsert\fR and \fBovertype\fR modes + Delete character \fBremoved\fR at cursor, moving others left + Home jump to \fBbeginning\fR of input line + End jump to \fBend\fR of input line +.fi + +.\" ...................................................................... +.SS Linux Memory Types +.\" ---------------------------------------------------------------------- +For our purposes there are three types of memory, and one is optional. +First is \*(MP, a limited resource where code and data must +reside when executed or referenced. +Next is the optional \*(MS, where modified (dirty) memory can be saved +and later retrieved if too many demands are made on \*(MP. +Lastly we have \*(MV, a nearly unlimited resource serving the +following goals: + +.nf + 1. abstraction, free from physical memory addresses/limits + 2. isolation, every process in a separate address space + 3. sharing, a single mapping can serve multiple needs + 4. flexibility, assign a virtual address to a file +.fi + +Regardless of which of these forms memory may take, all are managed as +pages (typically 4096 bytes) but expressed by default in \*(We as +KiB (kibibyte). +The memory discussed under topic `2c. MEMORY Usage' deals with \*(MP +and the \*(MS for the system as a whole. +The memory reviewed in topic `3. FIELDS / Columns Display' +embraces all three memory types, but for individual processes. + +For each such process, every memory page is restricted to a single +quadrant from the table below. +Both \*(MP and \*(MV can include any of the four, while the \*(MS only +includes #1 through #3. +The memory in quadrant #4, when modified, acts as its own dedicated \*(MS. + +.nf + \fBPrivate\fR | \fBShared\fR + \fB1\fR | \fB2\fR + \fBAnonymous\fR . stack | + . malloc() | + . brk()/sbrk() | . POSIX shm* + . mmap(PRIVATE, ANON) | . mmap(SHARED, ANON) + -----------------------+---------------------- + . mmap(PRIVATE, fd) | . mmap(SHARED, fd) + \fBFile-backed\fR . pgms/shared libs | + \fB3\fR | \fB4\fR +.fi + +The following may help in interpreting process level memory values displayed +as scalable columns and discussed under topic `3a. DESCRIPTIONS of Fields'. + +.nf + %MEM \- simply RES divided by total \*(MP + CODE \- the `pgms' portion of quadrant \fB3\fR + DATA \- the entire quadrant \fB1\fR portion of VIRT plus all + explicit mmap file-backed pages of quadrant \fB3\fR + RES \- anything occupying \*(MP which, beginning with + Linux-4.5, is the sum of the following three fields: + RSan \- quadrant \fB1\fR pages, which include any + former quadrant \fB3\fR pages if modified + RSfd \- quadrant \fB3\fR and quadrant \fB4\fR pages + RSsh \- quadrant \fB2\fR pages + RSlk \- subset of RES which cannot be swapped out (any quadrant) + SHR \- subset of RES (excludes \fB1\fR, includes all \fB2\fR & \fB4\fR, some \fB3\fR) + SWAP \- potentially any quadrant except \fB4\fR + USED \- simply the sum of RES and SWAP + VIRT \- everything in-use and/or reserved (all quadrants) +.fi + +\*(NT Even though program images and shared libraries are considered +\fIprivate\fR to a process, they will be accounted for as \fIshared\fR +(SHR) by the kernel. + +.\" ---------------------------------------------------------------------- +.SH 1. COMMAND-LINE Options +.\" ---------------------------------------------------------------------- +Mandatory\fI arguments\fR to long options are mandatory for short +options too. + +Although not required, the equals sign can be used with either option +form and whitespace before and/or after the `=' is permitted. + +.TP 3 +\-\fBb\fR, \fB\-\-batch\fR +Starts \*(We in Batch mode, which could be useful for sending output +from \*(We to other programs or to a file. +In this mode, \*(We will not accept input and runs until the iterations +limit you've set with the `\-n' \*(CO or until killed. + +.TP 3 +\-\fBc\fR, \fB\-\-cmdline\-toggle\fR +Starts \*(We with the last remembered `c' state reversed. +Thus, if \*(We was displaying command lines, now that field will show program +names, and vice versa. +\*(XC `c' \*(CI for additional information. + +.TP 3 +\-\fBd\fR, \fB\-\-delay\fR = \fISECS\fR [\fI.TENTHS\fR]\fR +Specifies the delay between screen updates, and overrides the corresponding +value in one's personal \*(CF or the startup default. +Later this can be changed with the `d' or `s' \*(CIs. + +Fractional seconds are honored, but a negative number is not allowed. +In all cases, however, such changes are prohibited if \*(We is running +in Secure mode, except for root (unless the `s' \*(CO was used). +For additional information on Secure mode \*(Xt 6d. SYSTEM Restrictions File. + +.TP 3 +\-\fBE\fR, \fB\-\-scale-summary-mem\fR = \fIk\fR | \fIm\fR | \fIg\fR | \fIt\fR | \fIp\fR | \fIe\fR +Instructs \*(We to force \*(SA memory to be scaled as: +.nf + k \- kibibytes + m \- mebibytes + g \- gibibytes + t \- tebibytes + p \- pebibytes + e \- exbibytes +.fi + +Later this can be changed with the `E' \*(CT. + +.TP 3 +\-\fBe\fR, \fB\-\-scale-task-mem\fR = \fIk\fR | \fIm\fR | \fIg\fR | \fIt\fR | \fIp\fR +Instructs \*(We to force \*(TA memory to be scaled as: +.nf + k \- kibibytes + m \- mebibytes + g \- gibibytes + t \- tebibytes + p \- pebibytes +.fi + +Later this can be changed with the `e' \*(CT. + +.TP 3 +\-\fBH\fR, \fB\-\-threads-show\fR +Instructs \*(We to display individual threads. +Without this \*(CO a summation of all threads in each process is shown. +Later this can be changed with the `H' \*(CI. + +.TP 3 +\-\fBh\fR, \fB\-\-help\fR +Display usage help text, then quit. + +.TP 3 +\-\fBi\fR, \fB\-\-idle-toggle\fR +Starts \*(We with the last remembered `i' state reversed. +When this toggle is \*F, tasks that have not used any \*(PU since the +last update will not be displayed. +For additional information regarding this toggle +\*(Xt 4c. TASK AREA Commands, SIZE. + +.TP 3 +\-\fBn\fR, \fB\-\-iterations\fR = \fINUMBER\fR +Specifies the maximum number of iterations, or frames, \*(We should +produce before ending. + +.TP 3 +\-\fBO\fR, \fB\-\-list-fields\fR +This option acts as a form of help for the \-o option shown below. +It will cause \*(We to print each of the available field names on a +separate line, then quit. +Such names are subject to NLS (National Language Support) translation. + +.TP 3 +\-\fBo\fR, \fB\-\-sort-override\fR = \fIFIELDNAME\fR +Specifies the name of the field on which tasks will be sorted, independent +of what is reflected in the configuration file. +You can prepend a `+' or `\-' to the field name to also override the sort +direction. +A leading `+' will force sorting high to low, whereas a `\-' will ensure +a low to high ordering. + +This option exists primarily to support automated/scripted batch mode +operation. + +.TP 3 +\-\fBp\fR, \fB\-\-pid\fR = \fIPIDLIST\fR \ +(as: \fI1\fR,\fI2\fR,\fI3\fR, ...\fR or \fR-p\fI1\fR -p\fI2\fR -p\fI3\fR ...) +Monitor only processes with specified process IDs. +However, when combined with Threads mode (`H'), all processes in the +thread group (\*(Xa TGID) of each monitored PID will also be shown. + +This option can be given up to 20 times, or you can provide a comma delimited +list with up to 20 pids. +Co-mingling both approaches is permitted. + +A pid value of zero will be treated as the process id of the \*(We program +itself once it is running. + +This is a \*(CO only and should you wish to return to normal operation, +it is not necessary to quit and restart \*(We \*(Em just issue any +of these \*(CIs: `=', `u' or `U'. + +The `p', `u' and `U' \*(COs are mutually exclusive. + +.TP 3 +\-\fBS\fR, \fB\-\-accum-time-toggle\fR +Starts \*(We with the last remembered `S' state reversed. +When Cumulative time mode is \*O, each process is listed with the \*(Pu +time that it and its dead children have used. +\*(XC `S' \*(CI for additional information regarding this mode. + +.TP 3 +\-\fBs\fR, \fB\-\-secure-mode\fR +Starts \*(We with secure mode forced, even for root. +This mode is far better controlled through a system \*(CF +(\*(Xt 6. FILES). + +.TP 3 +\-\fBU\fR, \fB\-\-filter-any-user\fR = \fIUSER\fR (as: \fInumber\fR or \fIname\fR) +Display only processes with a user id or user name matching that given. +This option matches on\fI any\fR user (\fIreal\fR, \fIeffective\fR, +\fIsaved\fR, or \fIfilesystem\fR). + +Prepending an exclamation point (`!') to the user id or name instructs \*(We +to display only processes with users not matching the one provided. + +The `p', `U' and `u' \*(COs are mutually exclusive. + +.TP 3 +\-\fBu\fR, \fB\-\-filter-only-euser\fR = \fIUSER\fR (as: \fInumber\fR or \fIname\fR) +Display only processes with a user id or user name matching that given. +This option matches on the\fI effective\fR user id only. + +Prepending an exclamation point (`!') to the user id or name instructs \*(We +to display only processes with users not matching the one provided. + +The `p', `U' and `u' \*(COs are mutually exclusive. + +.TP 3 +\-\fBV\fR, \fB\-\-version\fR +Display version information, then quit. + +.TP 3 +\-\fBw\fR, \fB\-\-width\fR [=\fICOLUMNS\fR] +In Batch mode, when used without an argument \*(We will format +output using the COLUMNS= and LINES= environment variables, if set. +Otherwise, width will be fixed at the maximum \*(WX columns. +With an argument, output width can be decreased or increased (up to \*(WX) +but the number of rows is considered unlimited. + +In normal display mode, when used without an argument \*(We will\fI attempt\fR +to format output using the COLUMNS= and LINES= environment variables, if set. +With an argument, output width can only be decreased, not increased. +Whether using environment variables or an argument with \-w, when\fI not\fR +in Batch mode actual terminal dimensions can never be exceeded. + +\*(NT Without the use of this \*(CO, output width is always based on the +terminal at which \*(We was invoked whether or not in Batch mode. + +.TP 3 +\-\fB1\fR, \fB\-\-single-cpu-toggle\fR +Starts \*(We with the last remembered Cpu States portion of the \*(SA reversed. +Either all \*(Pu information will be displayed in a single line or +each \*(Pu will be displayed separately, depending on the state of the NUMA Node +\*(CT (`2'). + +\*(XC `1' and `2' \*(CIs for additional information. + +.\" ---------------------------------------------------------------------- +.SH 2. SUMMARY Display +.\" ---------------------------------------------------------------------- +Each of the following three areas are individually controlled through +one or more \*(CIs. +\*(XT 4b. SUMMARY AREA Commands for additional information regarding +these provisions. + +.\" ...................................................................... +.SS 2a. UPTIME and LOAD Averages +.\" ---------------------------------------------------------------------- +This portion consists of a single line containing: +.nf + \fBprogram\fR or\fB window\fR name, depending on display mode + current time and length of time since last boot + total number of users + system load avg over the last 1, 5 and 15 minutes +.fi + +.\" ...................................................................... +.SS 2b. TASK and CPU States +.\" ---------------------------------------------------------------------- +This portion consists of a minimum of two lines. +In an SMP environment, additional lines can reflect individual \*(PU +state percentages. + +Line 1 shows total\fB tasks\fR or\fB threads\fR, depending on the state +of the Threads-mode toggle. +That total is further classified as: +.nf + running; sleeping; stopped; zombie +.fi + +Line 2 shows \*(PU state percentages based on the interval since the +last refresh. + +As a default, percentages for these individual categories are displayed. +Depending on your kernel version, the \fBst\fR field may not be shown. +.nf + \fBus\fR : time running un-niced user processes + \fBsy\fR : time running kernel processes + \fBni\fR : time running niced user processes + \fBid\fR : time spent in the kernel idle handler + \fBwa\fR : time waiting for I/O completion + \fBhi\fR : time spent servicing hardware interrupts + \fBsi\fR : time spent servicing software interrupts + \fBst\fR : time stolen from this vm by the hypervisor +.fi + +The `sy' value above also reflects the time running a virtual \*(Pu +for guest operating systems, including those that have been niced. + +Beyond the first tasks/threads line, there are alternate \*(PU display +modes available via the 4-way `t' \*(CT. +They show an abbreviated summary consisting of these elements: +.nf + \fR a \fR b \fR c \fR d + %Cpu(s): \fB75.0\fR/25.0 \fB100\fR[ ... ] + +.fi + +Where: a) is the `user' (us + ni) percentage; b) is the `system' +(sy + hi + si + guests) percentage; c) is the total percentage; +and d) is one of two visual graphs of those representations. +Such graphs also reflect separate `user' and `system' portions. + +If the `4' \*(CT is used to yield more than two cpus per line, +results will be further abridged eliminating the a) and b) elements. +However, that information is still reflected in the graph itself +assuming color is active or, if not, bars vs. blocks are being shown. + +\*(XT 4b. SUMMARY AREA Commands for additional information on the `t' +and `4' \*(CTs. + +.\" ...................................................................... +.SS 2c. MEMORY Usage +.\" ---------------------------------------------------------------------- +This portion consists of two lines which may express values in kibibytes (KiB) +through exbibytes (EiB) depending on the scaling factor enforced +with the `E' \*(CI. The /proc/meminfo source fields are shown in parenthesis. + +Line 1 reflects \*(MP, classified as: +.nf + total ( MemTotal ) + free ( MemFree ) + used ( MemTotal - MemAvailable ) + buff/cache ( Buffers + Cached + SReclaimable ) +.fi + +Line 2 reflects mostly \*(MV, classified as: +.nf + total ( SwapTotal ) + free ( SwapFree ) + used ( SwapTotal - SwapFree ) + avail ( MemAvailable, which is \*(MP ) +.fi + +The \fBavail\fR number on line 2 is an estimation of \*(MP available for +starting new applications, without swapping. +Unlike the \fBfree\fR field, it attempts to account for readily reclaimable +page cache and memory slabs. +It is available on kernels 3.14, emulated on kernels 2.6.27+, otherwise +the same as \fBfree\fR. + +In the alternate memory display modes, two abbreviated summary lines +are shown consisting of these elements: +.nf + \fR a \fR b c + GiB Mem : \fB18.7\fR/15.738 [ ... ] + GiB Swap: \fB 0.0\fR/7.999 [ ... ] +.fi + +Where: a) is the percentage used; b) is the total available; and c) is one of two +visual graphs of those representations. + +In the case of \*(MP, the percentage represents the \fBtotal\fR minus the estimated +\fBavail\fR noted above. +The `Mem' graph itself is divided between the non-cached portion of \fBused\fR and +any remaining memory not otherwise accounted for by \fBavail\fR. +\*(XT 4b. SUMMARY AREA Commands and the `m' command for additional information +on that special 4-way toggle. + +This table may help in interpreting the scaled values displayed: +.nf + KiB = kibibyte = 1024 bytes + MiB = mebibyte = 1024 KiB = 1,048,576 bytes + GiB = gibibyte = 1024 MiB = 1,073,741,824 bytes + TiB = tebibyte = 1024 GiB = 1,099,511,627,776 bytes + PiB = pebibyte = 1024 TiB = 1,125,899,906,842,624 bytes + EiB = exbibyte = 1024 PiB = 1,152,921,504,606,846,976 bytes +.fi + +.\" ---------------------------------------------------------------------- +.SH 3. FIELDS / Columns +.\" ---------------------------------------------------------------------- +.\" ...................................................................... +.SS 3a. DESCRIPTIONS of Fields +.\" ---------------------------------------------------------------------- +Listed below are \*(We's available process fields (columns). +They are shown in strict ascii alphabetical order. +You may customize their position and whether or not they are displayable +with the `f' (Fields Management) \*(CI. + +Any field is selectable as the sort field, and you control whether they +are sorted high-to-low or low-to-high. +For additional information on sort provisions +\*(Xt 4c. TASK AREA Commands, SORTING. + +The fields related to \*(MP or \*(MV reference `(KiB)' which is the +unsuffixed display mode. +Such fields may, however, be scaled from KiB through PiB. +That scaling is influenced via the `e' \*(CI or established for startup +through a build option. + +.TP 4 +\fB%CPU \*(Em \*(PU Usage \fR +The task's share of the elapsed \*(PU time since the last screen update, +expressed as a percentage of total \*(PU time. + +In a true SMP environment, if a process is multi-threaded and \*(We is +\fInot\fR operating in Threads mode, amounts greater than 100% may be +reported. +You toggle Threads mode with the `H' \*(CI. + +Also for multi-processor environments, if Irix mode is \*F, \*(We +will operate in Solaris mode where a task's \*(Pu usage will be +divided by the total number of \*(PUs. +You toggle Irix/Solaris modes with the `I' \*(CI. + +\*(NT When running in forest view mode (`V') with children +collapsed (`v'), this field will also include the \*(PU time of +those unseen children. +\*(XT 4c. TASK AREA Commands, CONTENT for more information regarding +the `V' and `v' toggles. + +.TP 4 +\fB%CUC \*(Em \*(PU Utilization \fR +This field is identical to %CUU below, except the percentage also +reflects reaped child processes. + +.TP 4 +\fB%CUU \*(Em \*(PU Utilization \fR +A task's total \*(PU usage divided by its elapsed running time, +expressed as a percentage. + +If a process currently displays high \*(PU usage, this field can help +determine if such behavior is normal. +Conversely, if a process has low \*(PU usage currently, %CUU may reflect +historically higher demands over its lifetime. + +.TP 4 +\fB%MEM \*(Em Memory Usage (RES) \fR +A task's currently resident share of available \*(MP. + +\*(XX. + +.TP 4 +\fBAGID \*(Em Autogroup Identifier \fR +The autogroup identifier associated with a process. +This feature operates in conjunction with the CFS scheduler +to improve interactive desktop performance. + +When /proc/sys/kernel/sched_autogroup_enabled is set, a new +autogroup is created with each new session (\*(Xa SID). +All subsequently forked processes in that session inherit membership in +this autogroup. +The kernel then attempts to equalize distribution of CPU cycles +across such groups. +Thus, an autogroup with many \*(PU intensive processes (e.g make -j) +will not dominate an autogroup with only one or two processes. + +When -1 is displayed it means this information is not available. + +.TP 4 +\fBAGNI \*(Em Autogroup Nice Value \fR +The autogroup nice value which affects scheduling of all processes +in that group. +A negative nice value means higher priority, whereas a positive nice +value means lower priority. + +.TP 4 +\fBCGNAME \*(Em Control Group Name \fR +The name of the control group to which a process belongs, +or `\-' if not applicable for that process. + +This will typically be the last entry in the full list of control +groups as shown under the next heading (CGROUPS). +And as is true there, this field is also variable width. + +.TP 4 +\fBCGROUPS \*(Em Control Groups \fR +The names of the control group(s) to which a process belongs, +or `\-' if not applicable for that process. + +Control Groups provide for allocating resources (cpu, memory, network +bandwidth, etc.) among installation-defined groups of processes. +They enable fine-grained control over allocating, denying, prioritizing, +managing and monitoring those resources. + +Many different hierarchies of cgroups can exist simultaneously on a system +and each hierarchy is attached to one or more subsystems. +A subsystem represents a single resource. + +\*(NT The CGROUPS field, unlike most columns, is not fixed-width. +When displayed, it plus any other variable width columns will be allocated +all remaining screen width (up to the maximum \*(WX characters). +Even so, such variable width fields could still suffer truncation. +\*(XT 5c. SCROLLING a Window for additional information on accessing +any truncated data. + +.TP 4 +\fBCODE \*(Em Code Size (KiB) \fR +The amount of \*(MP currently devoted to executable code, also known +as the Text Resident Set size or TRS. + +\*(XX. + +.TP 4 +\fBCOMMAND \*(Em Command\fB Name\fR or Command\fB Line \fR +Display the command line used to start a task or the name of the associated +program. +You toggle between command\fI line\fR and\fI name\fR with `c', which is both +a \*(CO and an \*(CI. + +When you've chosen to display command lines, processes without a command +line (like kernel threads) will be shown with only the program name in +brackets, as in this example: + \fR[kthreadd] + +This field may also be impacted by the forest view display mode. +\*(XC `V' \*(CI for additional information regarding that mode. + +\*(NT The COMMAND field, unlike most columns, is not fixed-width. +When displayed, it plus any other variable width columns will be allocated +all remaining screen width (up to the maximum \*(WX characters). +Even so, such variable width fields could still suffer truncation. +This is especially true for this field when command lines are being +displayed (the `c' \*(CI.) +\*(XT 5c. SCROLLING a Window for additional information on accessing +any truncated data. + +.TP 4 +\fBDATA \*(Em Data + Stack Size (KiB) \fR +The amount of private memory \fIreserved\fR by a process. +It is also known as the Data Resident Set or DRS. +Such memory may not yet be mapped to \*(MP (RES) but will always be +included in the \*(MV (VIRT) amount. + +\*(XX. + +.TP 4 +\fBELAPSED \*(Em Elapsed Running Time\fR +The length of time since a process was started. +Thus, the most recently started task will display the smallest time interval. + +The value will be expressed as `HH,MM' (hours,minutes) but is subject to +additional scaling if the interval becomes too great to fit column width. +At that point it will be scaled to `DD+HH' (days+hours) and possibly +beyond. + +.TP 4 +\fBENVIRON \*(Em Environment variables \fR +Display all of the environment variables, if any, as seen by the +respective processes. +These variables will be displayed in their raw native order, not the +sorted order you are accustomed to seeing with an unqualified `set'. + +\*(NT The ENVIRON field, unlike most columns, is not fixed-width. +When displayed, it plus any other variable width columns will be allocated +all remaining screen width (up to the maximum \*(WX characters). +Even so, such variable width fields could still suffer truncation. +This is especially true for this field. +\*(XT 5c. SCROLLING a Window for additional information on accessing +any truncated data. + +.TP 4 +\fBEXE \*(Em Executable Path \fR +Where available, this is the full path to the executable, +including the program name. + +\*(NT The EXE field, unlike most columns, is not fixed-width. +When displayed, it plus any other variable width columns will be allocated +all remaining screen width (up to the maximum \*(WX characters). + +.TP 4 +\fBFlags \*(Em Task Flags \fR +This column represents the task's current scheduling flags which are +expressed in hexadecimal notation and with zeros suppressed. +These flags are officially documented in . + +.TP 4 +\fBGID \*(Em Group Id \fR +The\fI effective\fR group ID. + +.TP 4 +\fBGROUP \*(Em Group Name \fR +The\fI effective\fR group name. + +.TP 4 +\fBLOGID \*(Em Login User Id \fR +The user ID used at\fI login\fR. +When -1 is displayed it means this information is not available. + +.TP 4 +\fBLXC \*(Em Lxc Container Name \fR +The name of the lxc container within which a task is running. +If a process is not running inside a container, a dash (`\-') will be shown. + +.TP 4 +\fBNI \*(Em Nice Value \fR +The nice value of the task. +A negative nice value means higher priority, whereas a positive nice value +means lower priority. +Zero in this field simply means priority will not be adjusted in determining +a task's dispatch-ability. + +\*(NT This value only affects scheduling priority relative to other processes +in the same autogroup. +\*(XC `AGID' and `AGNI' fields for additional information on autogroups. + +.TP 4 +\fBNU \*(Em Last known NUMA node \fR +A number representing the NUMA node associated with the last used processor (`P'). +When -1 is displayed it means that NUMA information is not available. + +\*(XC `2' and `3' \*(CIs for additional NUMA provisions affecting the \*(SA. + +.TP 4 +\fBOOMa \*(Em Out of Memory Adjustment Factor \fR +The value, ranging from -1000 to +1000, added to the current out of memory +score (OOMs) which is then used to determine which task to kill when memory +is exhausted. + +.TP 4 +\fBOOMs \*(Em Out of Memory Score \fR +The value, ranging from 0 to +1000, used to select task(s) to kill when memory +is exhausted. +Zero translates to `never kill' whereas 1000 means `always kill'. + +.TP 4 +\fBP \*(Em Last used \*(PU (SMP) \fR +A number representing the last used processor. +In a true SMP environment this will likely change frequently since the kernel +intentionally uses weak affinity. +Also, the very act of running \*(We may break this weak affinity and cause more +processes to change \*(PUs more often (because of the extra demand for +\*(Pu time). + +.TP 4 +\fBPGRP \*(Em Process Group Id \fR +Every process is member of a unique process group which is used for +distribution of signals and by terminals to arbitrate requests for their +input and output. +When a process is created (forked), it becomes a member of the process +group of its parent. +By convention, this value equals the process ID (\*(Xa PID) of the first +member of a process group, called the process group leader. + +.TP 4 +\fBPID \*(Em Process Id \fR +The task's unique process ID, which periodically wraps, though never +restarting at zero. +In kernel terms, it is a dispatchable entity defined by a task_struct. + +This value may also be used as: a process group ID (\*(Xa PGRP); +a session ID for the session leader (\*(Xa SID); +a thread group ID for the thread group leader (\*(Xa TGID); +and a TTY process group ID for the process group leader (\*(Xa TPGID). + +.TP 4 +\fBPPID \*(Em Parent Process Id \fR +The process ID (pid) of a task's parent. + +.TP 4 +\fBPR \*(Em Priority \fR +The scheduling priority of the task. +If you see `rt' in this field, it means the task is running +under real time scheduling priority. + +Under linux, real time priority is somewhat misleading since traditionally +the operating itself was not preemptible. +And while the 2.6 kernel can be made mostly preemptible, it is not always so. + +.TP 4 +\fBPSS \*(Em Proportional Resident Memory, smaps (KiB) \fR +The proportion of this task's share of `RSS' where each page is divided by +the number of processes sharing it. +It is also the sum of the `PSan', `PSfd' and `PSsh' fields. + +For example, if a process has 1000 resident pages alone and 1000 resident +pages shared with another process, its `PSS' would be 1500 (times page size). + +\*(ZX. + +.PP +\fBPSan \*(Em Proportional Anonymous Memory, smaps (KiB) \fR +.br +\fBPSfd \*(Em Proportional File Memory, smaps (KiB) \fR +.br +\fBPSsh \*(Em Proportional Shmem Memory, smaps (KiB) \fR +.RS 4 +As was true for `PSS' above (total proportional resident memory), +these fields represent the proportion of this task's share of each type +of memory divided by the number of processes sharing it. + +\*(ZX. +.RE + +.TP 4 +\fBRES \*(Em Resident Memory Size (KiB) \fR +A subset of the virtual address space (VIRT) representing the non-swapped +\*(MP a task is currently using. +It is also the sum of the `RSan', `RSfd' and `RSsh' fields. + +It can include private anonymous pages, private pages mapped to files +(including program images and shared libraries) plus shared anonymous pages. +All such memory is backed by the \*(MS represented separately under SWAP. + +Lastly, this field may also include shared file-backed pages which, when +modified, act as a dedicated \*(MS and thus will never impact SWAP. + +\*(XX. + +.TP 4 +\fBRSS \*(Em Resident Memory, smaps (KiB) \fR +Another, more precise view of process non-swapped \*(MP. +It is obtained from the `smaps_rollup' file and is +generally slightly larger than that shown for `RES'. + +\*(ZX. + +.TP 4 +\fBRSan \*(Em Resident Anonymous Memory Size (KiB) \fR +A subset of resident memory (RES) representing private pages not +mapped to a file. + +.TP 4 +\fBRSfd \*(Em Resident File-Backed Memory Size (KiB) \fR +A subset of resident memory (RES) representing the implicitly shared +pages supporting program images and shared libraries. +It also includes explicit file mappings, both private and shared. + +.TP 4 +\fBRSlk \*(Em Resident Locked Memory Size (KiB) \fR +A subset of resident memory (RES) which cannot be swapped out. + +.TP 4 +\fBRSsh \*(Em Resident Shared Memory Size (KiB) \fR +A subset of resident memory (RES) representing the explicitly shared +anonymous shm*/mmap pages. + +.TP 4 +\fBRUID \*(Em Real User Id \fR +The\fI real\fR user ID. + +.TP 4 +\fBRUSER \*(Em Real User Name \fR +The\fI real\fR user name. + +.TP 4 +\fBS \*(Em Process Status \fR +The status of the task which can be one of: + \fBD\fR = uninterruptible sleep + \fBI\fR = idle + \fBR\fR = running + \fBS\fR = sleeping + \fBT\fR = stopped by job control signal + \fBt\fR = stopped by debugger during trace + \fBZ\fR = zombie + +Tasks shown as running should be more properly thought of as ready to run +\*(Em their task_struct is simply represented on the Linux run-queue. +Even without a true SMP machine, you may see numerous tasks in this state +depending on \*(We's delay interval and nice value. + +.TP 4 +\fBSHR \*(Em Shared Memory Size (KiB) \fR +A subset of resident memory (RES) that may be used by other processes. +It will include shared anonymous pages and shared file-backed pages. +It also includes private pages mapped to files representing +program images and shared libraries. + +\*(XX. + +.TP 4 +\fBSID \*(Em Session Id \fR +A session is a collection of process groups (\*(Xa PGRP), +usually established by the login shell. +A newly forked process joins the session of its creator. +By convention, this value equals the process ID (\*(Xa PID) of the first +member of the session, called the session leader, which is usually the +login shell. + +.TP 4 +\fBSTARTED \*(Em Start Time Interval\fR +The length of time since system boot when a process started. +Thus, the most recently started task will display the largest time interval. + +The value will be expressed as `MM:SS' (minutes:seconds). +But if the interval is too great to fit column width it will be scaled +as `HH,MM' (hours,minutes) and possibly beyond. + +.TP 4 +\fBSUID \*(Em Saved User Id \fR +The\fI saved\fR user ID. + +.TP 4 +\fBSUPGIDS \*(Em Supplementary Group IDs \fR +The IDs of any supplementary group(s) established at login or +inherited from a task's parent. +They are displayed in a comma delimited list. + +\*(NT The SUPGIDS field, unlike most columns, is not fixed-width. +When displayed, it plus any other variable width columns will be allocated +all remaining screen width (up to the maximum \*(WX characters). + +.TP 4 +\fBSUPGRPS \*(Em Supplementary Group Names \fR +The names of any supplementary group(s) established at login or +inherited from a task's parent. +They are displayed in a comma delimited list. + +\*(NT The SUPGRPS field, unlike most columns, is not fixed-width. +When displayed, it plus any other variable width columns will be allocated +all remaining screen width (up to the maximum \*(WX characters). + +.TP 4 +\fBSUSER \*(Em Saved User Name \fR +The\fI saved\fR user name. + +.TP 4 +\fBSWAP \*(Em Swapped Size (KiB) \fR +The formerly resident portion of a task's address space written +to the \*(MS when \*(MP becomes over committed. + +\*(XX. + +.TP 4 +\fBTGID \*(Em Thread Group Id \fR +The ID of the thread group to which a task belongs. +It is the PID of the thread group leader. +In kernel terms, it represents those tasks that share an mm_struct. + +.TP 4 +\fBTIME \*(Em \*(PU Time \fR +Total \*(PU time the task has used since it started. +When Cumulative mode is \*O, each process is listed with the \*(Pu +time that it and its dead children have used. +You toggle Cumulative mode with `S', which is both a \*(CO and an \*(CI. +\*(XC `S' \*(CI for additional information regarding this mode. + +.TP 4 +\fBTIME+ \*(Em \*(PU Time, hundredths \fR +The same as TIME, but reflecting more granularity through hundredths +of a second. + +.TP 4 +\fBTPGID \*(Em Tty Process Group Id \fR +The process group ID of the foreground process for the connected tty, +or \-1 if a process is not connected to a terminal. +By convention, this value equals the process ID (\*(Xa PID) of the +process group leader (\*(Xa PGRP). + +.TP 4 +\fBTTY \*(Em Controlling Tty \fR +The name of the controlling terminal. +This is usually the device (serial port, pty, etc.) from which the +process was started, and which it uses for input or output. +However, a task need not be associated with a terminal, in which case +you'll see `?' displayed. + +.TP 4 +\fBUID \*(Em User Id \fR +The\fI effective\fR user ID of the task's owner. + +.TP 4 +\fBUSED \*(Em Memory in Use (KiB) \fR +This field represents the non-swapped \*(MP a task is using (RES) plus +the swapped out portion of its address space (SWAP). + +\*(XX. + +.TP 4 +\fBUSER \*(Em User Name \fR +The\fI effective\fR user name of the task's owner. + +.TP 4 +\fBUSS \*(Em Unique Set Size \fR +The non-swapped portion of \*(MP (`RSS') not shared with +any other process. +It is derived from the `smaps_rollup' file. + +\*(ZX. + +.TP 4 +\fBVIRT \*(Em Virtual Memory Size (KiB) \fR +The total amount of \*(MV used by the task. +It includes all code, data and shared libraries plus pages that have been +swapped out and pages that have been mapped but not used. + +\*(XX. + +.TP 4 +\fBWCHAN \*(Em Sleeping in Function \fR +This field will show the name of the kernel function in which the task +is currently sleeping. +Running tasks will display a dash (`\-') in this column. + +.TP 4 +\fBioR \*(Em I/O Bytes Read \fR +The number of bytes a process caused to be fetched from the storage layer. + +Root privileges are required to display `io' data for other users. + +.TP 4 +\fBioRop \*(Em I/O Read Operations \fR +The number of read I/O operations (syscalls) for a process. +Such calls might not result in actual physical disk I/O. + +.TP 4 +\fBioW \*(Em I/O Bytes Written \fR +The number of bytes a process caused to be sent to the storage layer. + +.TP 4 +\fBioWop \*(Em I/O Write Operations \fR +The number of write I/O operations (syscalls) for a process. +Such calls might not result in actual physical disk I/O. + +.TP 4 +\fBnDRT \*(Em Dirty Pages Count \fR +The number of pages that have been modified since they were last +written to \*(AS. +Dirty pages must be written to \*(AS before the corresponding physical +memory location can be used for some other virtual page. + +This field was deprecated with linux 2.6 and is always zero. + +.TP 4 +\fBnMaj \*(Em Major Page Fault Count \fR +The number of\fB major\fR page faults that have occurred for a task. +A page fault occurs when a process attempts to read from or write to a +virtual page that is not currently present in its address space. +A major page fault is when \*(AS access is involved in making that +page available. + +.TP 4 +\fBnMin \*(Em Minor Page Fault count \fR +The number of\fB minor\fR page faults that have occurred for a task. +A page fault occurs when a process attempts to read from or write to a +virtual page that is not currently present in its address space. +A minor page fault does not involve \*(AS access in making that +page available. + +.TP 4 +\fBnTH \*(Em Number of Threads \fR +The number of threads associated with a process. + +.TP 4 +\fBnsCGROUP \*(Em CGROUP namespace \fR +The Inode of the namespace used to hide the identity of the control group of +which process is a member. + +.TP 4 +\fBnsIPC \*(Em IPC namespace \fR +The Inode of the namespace used to isolate interprocess communication (IPC) +resources such as System V IPC objects and POSIX message queues. + +.TP 4 +\fBnsMNT \*(Em MNT namespace \fR +The Inode of the namespace used to isolate filesystem mount points thus +offering different views of the filesystem hierarchy. + +.TP 4 +\fBnsNET \*(Em NET namespace \fR +The Inode of the namespace used to isolate resources such as network devices, +IP addresses, IP routing, port numbers, etc. + +.TP 4 +\fBnsPID \*(Em PID namespace \fR +The Inode of the namespace used to isolate process ID numbers +meaning they need not remain unique. +Thus, each such namespace could have its own `init/systemd' (PID #1) to +manage various initialization tasks and reap orphaned child processes. + +.TP 4 +\fBnsTIME \*(Em TIME namespace \fR +The Inode of the namespace which allows processes to see different system +times in a way similar to the UTS namespace. + +.TP 4 +\fBnsUSER \*(Em USER namespace \fR +The Inode of the namespace used to isolate the user and group ID numbers. +Thus, a process could have a normal unprivileged user ID outside a user +namespace while having a user ID of 0, with full root privileges, inside +that namespace. + +.TP 4 +\fBnsUTS \*(Em UTS namespace \fR +The Inode of the namespace used to isolate hostname and NIS domain name. +UTS simply means "UNIX Time-sharing System". + +.TP 4 +\fBvMj \*(Em Major Page Fault Count Delta\fR +The number of\fB major\fR page faults that have occurred since the +last update (see nMaj). + +.TP 4 +\fBvMn \*(Em Minor Page Fault Count Delta\fR +The number of\fB minor\fR page faults that have occurred since the +last update (see nMin). + +.\" ...................................................................... +.SS 3b. MANAGING Fields +.\" ---------------------------------------------------------------------- +After pressing the \*(CI `f' (Fields Management) you will be presented +with a screen showing: 1) the \*(CW name; 2) the designated sort field; +3) all fields in their current order along with descriptions. +Entries marked with an asterisk are the currently displayed fields, +screen width permitting. + +.RS +4 +.IP \(bu 3 +As the on screen instructions indicate, you navigate among the fields with +the\fB Up\fR and\fB Down\fR \*(KAs. +The PgUp, PgDn, Home and End keys can also be used to quickly reach the +first or last available field. + +.IP \(bu 3 +The\fB Right\fR \*(KA selects a field for repositioning and +the\fB Left\fR \*(KA or the <\fBEnter\fR> key commits that field's +placement. + +.IP \(bu 3 +The `\fBd\fR' key or the <\fBSpace\fR> bar toggles a field's display +status, and thus the presence or absence of the asterisk. + +.IP \(bu 3 +The `\fBs\fR' key designates a field as the sort field. +\*(XT 4c. TASK AREA Commands, SORTING for additional information regarding +your selection of a sort field. + +.IP \(bu 3 +The `\fBa\fR' and `\fBw\fR' keys can be used to cycle through all available +windows and the `\fBq\fR' or <\fBEsc\fR> keys exit Fields Management. +.RS -4 + +.PP +The Fields Management screen can also be used to change the \*(CG in +either \*(FM or \*(AM. +Whatever was targeted when `q' or was pressed will be made current +as you return to the \*(We display. +\*(XT 5. ALTERNATE\-DISPLAY Provisions and the `g' \*(CI for insight +into \*(CWs and \*(FGs. + +.PP +\*(NT Any window that has been scrolled\fI horizontally\fR will be reset if any +field changes are made via the Fields Management screen. +Any\fI vertical\fR scrolled position, however, will not be affected. +\*(XT 5c. SCROLLING a Window for additional information regarding vertical +and horizontal scrolling. + +.\" ---------------------------------------------------------------------- +.SH 4. INTERACTIVE Commands +.\" ---------------------------------------------------------------------- +Listed below is a brief index of commands within categories. +Some commands appear more than once \*(Em their meaning or scope may vary +depending on the context in which they are issued. + +.nf + 4a.\fI Global-Commands \fR + ?, =, 0, + A, B, d, E, e, g, H, h, I, k, q, r, s, W, X, Y, Z, + ^G, ^K, ^N, ^P, ^U, ^L, ^R + 4b.\fI Summary-Area-Commands \fR + C, l, t, m, 1, 2, 3, 4, 5, ! + 4c.\fI Task-Area-Commands \fR + Appearance: b, J, j, x, y, z + Content: c, F, f, O, o, S, U, u, V, v, ^E + Size: #, i, n + Sorting: <, >, f, R + 4d.\fI Color-Mapping \fR + , a, B, b, H, M, q, S, T, w, z, 0 \- 7 + 5b.\fI Commands-for-Windows \fR + \-, _, =, +, A, a, G, g, w + 5c.\fI Scrolling-a-Window \fR + C, Up, Dn, Left, Right, PgUp, PgDn, Home, End + 5d.\fI Searching-in-a-Window \fR + L, & + 5e.\fI Filtering-in-a-Window + O, o, ^O, =, + +.fi + +.\" ...................................................................... +.SS 4a. GLOBAL Commands +.\" ---------------------------------------------------------------------- +The global \*(CIs are\fB always\fR available\fR in both \*(FM and \*(AM. +However, some of these \*(CIs are\fB not available\fR when running +in Secure mode. + +If you wish to know in advance whether or not your \*(We has been +secured, simply ask for help and view the system summary on the second +line. + +.TP 7 +\ \ <\fBEnter\fR> or <\fBSpace\fR>\ \ :\fIRefresh-Display \fR +These commands awaken \*(We and following receipt of any input +the entire display will be repainted. +They also force an update of any hotplugged \*(Pu or \*(MP changes. + +Use either of these keys if you have a large delay interval and wish +to see current status, + +.TP 7 +\ \ \ \fB?\fR | \fBh\fR\ \ :\fIHelp \fR +There are two help levels available. +The first will provide a reminder of all the basic \*(CIs. +If \*(We is\fI secured\fR, that screen will be abbreviated. + +Typing `h' or `?' on that help screen will take you to help for +those \*(CIs applicable to \*(AM. + +.TP 7 +\ \ \ \fB=\fR\ \ :\fIExit-Display-Limits \fR +Removes restrictions on what is shown. +This command will reverse any `i' (idle tasks), `n' (max tasks), +`v' (hide children) and `F' focus commands that might be active. +It also provides for an exit from PID monitoring, User filtering, +Other filtering, Locate processing and Combine Cpus mode. + +Additionally, if the window has been scrolled it will be reset with +this command. + +.TP 7 +\ \ \ \fB0\fR\ \ :\fIZero-Suppress\fR toggle \fR +This command determines whether zeros are shown or suppressed for many +of the fields in a \*(TW. +Fields like UID, GID, NI, PR or P are not affected by this toggle. + +.TP 7 +\ \ \ \fBA\fR\ \ :\fIAlternate-Display-Mode\fR toggle \fR +This command will switch between \*(FM and \*(AM. +\*(XT 5. ALTERNATE\-DISPLAY Provisions and the `g' \*(CI for insight +into \*(CWs and \*(FGs. + +.TP 7 +\ \ \ \fBB\fR\ \ :\fIBold-Disable/Enable\fR toggle \fR +This command will influence use of the bold terminfo capability and +alters\fB both\fR the \*(SA and \*(TA for the \*(CW. +While it is intended primarily for use with dumb terminals, it can be +applied anytime. + +\*(NT When this toggle is \*O and \*(We is operating in monochrome mode, +the\fB entire display\fR will appear as normal text. +Thus, unless the `x' and/or `y' toggles are using reverse for emphasis, +there will be no visual confirmation that they are even on. + +.TP 7 +*\ \ \fBd\fR | \fBs\fR\ \ :\fIChange-Delay-Time-interval \fR +You will be prompted to enter the delay time, in seconds, between +display updates. + +Fractional seconds are honored, but a negative number is not allowed. +Entering 0 causes (nearly) continuous updates, with an unsatisfactory +display as the system and tty driver try to keep up with \*(We's demands. +The delay value is inversely proportional to system loading, +so set it with care. + +If at any time you wish to know the current delay time, simply ask for +help and view the system summary on the second line. + +.TP 7 +\ \ \ \fBE\fR\ \ :\fIEnforce-Summary-Memory-Scale\fR in Summary Area +With this command you can cycle through the available \*(SA memory scaling +which ranges from KiB (kibibytes or 1,024 bytes) through EiB (exbibytes or +1,152,921,504,606,846,976 bytes). + +If you see a `+' between a displayed number and the following label, it +means that \*(We was forced to truncate some portion of that number. +By raising the scaling factor, such truncation can be avoided. + +.TP 7 +\ \ \ \fBe\fR\ \ :\fIEnforce-Task-Memory-Scale\fR in Task Area +With this command you can cycle through the available \*(TA memory scaling +which ranges from KiB (kibibytes or 1,024 bytes) through PiB (pebibytes or +1,125,899,906,842,624 bytes). + +While \*(We will try to honor the selected target range, additional +scaling might still be necessary in order to accommodate current values. +If you wish to see a more homogeneous result in the memory columns, +raising the scaling range will usually accomplish that goal. +Raising it too high, however, is likely to produce an all zero result +which cannot be suppressed with the `0' \*(CI. + +.TP 7 +\ \ \ \fBg\fR\ \ :\fIChoose-Another-Window/Field-Group \fR +You will be prompted to enter a number between 1 and 4 designating the +\*(FG which should be made the \*(CW. +You will soon grow comfortable with these 4 windows, especially after +experimenting with \*(AM. + +.TP 7 +\ \ \ \fBH\fR\ \ :\fIThreads-mode\fR toggle \fR +When this toggle is \*O, individual threads will be displayed for all +processes in all visible \*(TWs. +Otherwise, \*(We displays a summation of all threads in each process. + +.TP 7 +\ \ \ \fBI\fR\ \ :\fIIrix/Solaris-Mode\fR toggle \fR +When operating in Solaris mode (`I' toggled \*F), a task's \*(Pu usage +will be divided by the total number of \*(PUs. +After issuing this command, you'll be told the new state of this toggle. + +.TP 7 +*\ \ \fBk\fR\ \ :\fIKill-a-task \fR +You will be prompted for a PID and then the signal to send. + +Entering no PID or a negative number will be interpreted as +the default shown in the prompt (the first task displayed). +A PID value of zero means the \*(We program itself. + +The default signal, as reflected in the prompt, is SIGTERM. +However, you can send any signal, via number or name. + +If you wish to abort the kill process, do one of the following +depending on your progress: +.nf + 1) at the pid prompt, type an invalid number + 2) at the signal prompt, type 0 (or any invalid signal) + 3) at any prompt, type +.fi + +.TP 7 +\ \ \ \fBq\fR\ \ :\fIQuit \fR + +.TP 7 +*\ \ \fBr\fR\ \ :\fIRenice-a-Task \fR +You will be prompted for a PID and then the value to nice it to. + +Entering no PID or a negative number will be interpreted as +the default shown in the prompt (the first task displayed). +A PID value of zero means the \*(We program itself. + +A positive nice value will cause a process to lose priority. +Conversely, a negative nice value will cause a process to be viewed +more favorably by the kernel. +As a general rule, ordinary users can only increase the nice value +and are prevented from lowering it. + +If you wish to abort the renice process, do one of the following +depending on your progress: +.nf + 1) at the pid prompt, type an invalid number + 2) at the nice prompt, type with no input + 3) at any prompt, type +.fi + +.TP 7 +\ \ \ \fBW\fR\ \ :\fIWrite-the-Configuration-File \fR +This will save all of your options and toggles plus the current +display mode and delay time. +By issuing this command just before quitting \*(We, you will be able +restart later in exactly that same state. + +.TP 7 +\ \ \ \fBX\fR\ \ :\fIExtra-Fixed-Width \fR +Some fields are fixed width and not scalable. +As such, they are subject to truncation which would be indicated +by a `+' in the last position. + +This \*(CI can be used to alter the widths of the following fields: + +.nf + \fI field default field default field default \fR + GID 5 GROUP 8 WCHAN 10 + LOGID 5 LXC 8 nsCGROUP 10 + RUID 5 RUSER 8 nsIPC 10 + SUID 5 SUSER 8 nsMNT 10 + UID 5 TTY 8 nsNET 10 + USER 8 nsPID 10 + nsTIME 10 + nsUSER 10 + nsUTS 10 +.fi + +You will be prompted for the amount to be added to the default +widths shown above. +Entering zero forces a return to those defaults. + +If you enter a negative number, \*(We will automatically increase +the column size as needed until there is no more truncated data. + +\*(NT Whether explicitly or automatically increased, the widths for +these fields are never decreased by \*(We. +To narrow them you must specify a smaller number or restore the defaults. + +.TP 7 +\ \ \ \fBY\fR\ \ :\fIInspect-Other-Output \fR +After issuing the `Y' \*(CI, you will be prompted for a target PID. +Typing a value or accepting the default results in a separate screen. +That screen can be used to view a variety of files or piped command output +while the normal \*(We iterative display is paused. + +\*(NT This \*(CI is only fully realized when supporting entries have been +manually added to the end of the \*(We \*(CF. +For details on creating those entries, \*(Xt 6b. ADDING INSPECT Entries. + +Most of the keys used to navigate the Inspect feature are reflected in +its header prologue. +There are, however, additional keys available once you have selected a +particular file or command. +They are familiar to anyone who has used the pager `less' and are +summarized here for future reference. + +.nf + \fI key function \fR + = alternate status\-line, file or pipeline + / find, equivalent to `L' locate + n find next, equivalent to `&' locate next + scroll down, equivalent to + b scroll up, equivalent to + g first line, equivalent to + G last line, equivalent to +.fi + +.TP 7 +\ \ \ \fBZ\fR\ \ :\fIChange-Color-Mapping \fR +This key will take you to a separate screen where you can change the +colors for the \*(CW, or for all windows. +For details regarding this \*(CI \*(Xt 4d. COLOR Mapping. + +.P +\ \ \fB^G\fR\ \ :\fIDisplay-Control-Groups \fR (Ctrl key + `g') +.br +\ \ \fB^K\fR\ \ :\fIDisplay-Cmdline \fR (Ctrl key + `k') +.br +\ \ \fB^N\fR\ \ :\fIDisplay-Environment \fR (Ctrl key + `n') +.br +\ \ \fB^P\fR\ \ :\fIDisplay-Namesspaces \fR (Ctrl key + `p') +.br +\ \ \fB^U\fR\ \ :\fIDisplay-Supplementary-Groups \fR (Ctrl key + `u') +.br +.RS +7 +Applied to the first process displayed, these commands will show +that task's full (potentially wrapped) information. +Such data will be displayed in a separate window at the bottom of +the screen while normal \*(We monitoring continues. + +Keying the\fI same\fR `Ctrl' command a second time removes that +separate window as does the `=' command. +Keying a different `Ctrl' combination, while one is already active, +immediately transitions to the new information. + +Notable among these provisions is the Ctrl+N (environment) command. +Its output can be extensive and not easily read when line wrapped. +A more readable version can be achieved with an `Inspect' entry +in the rcfile like the following. + +.nf + pipe ^I Environment ^I cat /proc/%d/environ | tr '\\0' '\\n' +.fi + +\*(XC `Y' \*(CI above and topic 6b. ADDING INSPECT Entries for +additional information. + +As an alternative to `Inspect', and available to all of these `Ctrl' +commands, the tab key can be used to highlight individual elements +in the bottom window. +.RS -7 + +.TP 7 +\ \ \fB^L\fR\ \ :\fILogged-Messages \fR (Ctrl key + `l') +The 10 most recent messages are displayed in a separate window at +the bottom of the screen while normal \*(We monitoring continues. +Keying `^L' a second time removes that window as does the `=' command. +Use the tab key to highlight individual messages. + +.TP 7 +*\ \fB^R\fR\ \ :\fIRenice-an-Autogroup \fR (Ctrl key + `r') +You will be prompted for a PID and then the value for its +autogroup AGNI. + +Entering no PID will be interpreted as the default shown in +the prompt (the first task displayed). + +A positive AGNI value will cause processes in that autogroup +to lose priority. +Conversely, a negative value causes them to be viewed more +favorably by the kernel. +Ordinary users are not allowed to set negative AGNI values. + +If you wish to abort the renice process type . + +.IP "*" 3 +The commands shown with an \*(AK are not available in Secure mode, +nor will they be shown on the level-1 help screen. + +.\" ...................................................................... +.SS 4b. SUMMARY AREA Commands +.\" ---------------------------------------------------------------------- +The \*(SA \*(CIs are\fB always available\fR in both \*(FM and \*(AM. +They affect the beginning lines of your display and will determine the +position of messages and prompts. + +These commands always impact just the \*(CG. +\*(XT 5. ALTERNATE\-DISPLAY Provisions and the `g' \*(CI for insight into +\*(CWs and \*(FGs. + +.TP 7 +\ \ \ \fBC\fR\ \ :\fIShow-scroll-coordinates\fR toggle \fR +Toggle an informational message which is displayed whenever the message +line is not otherwise being used. +For additional information \*(Xt 5c. SCROLLING a Window. + +.TP 7 +\ \ \ \fBl\fR\ \ :\fILoad-Average/Uptime\fR toggle \fR +This is also the line containing the program name (possibly an alias) +when operating in \*(FM or the \*(CW name when operating in \*(AM. + +.TP 7 +\ \ \ \fBt\fR\ \ :\fITask/Cpu-States\fR toggle \fR +This command affects from 2 to many \*(SA lines, depending on the state +of the `1', `2' or `3' \*(CTs and whether or not \*(We is running under +true SMP. + +This portion of the \*(SA is also influenced by the `H' \*(CI toggle, +as reflected in the total label which shows either Tasks or Threads. + +This command serves as a 4-way toggle, cycling through these modes: +.nf + 1. detailed percentages by category + 2. abbreviated user/system and total % + bar graph + 3. abbreviated user/system and total % + block graph + 4. turn off task and cpu states display +.fi + +When operating in either of the graphic modes, the display becomes much +more meaningful when individual CPUs or NUMA nodes are also displayed. +\*(XC the `1', `2' and `3' commands below for additional information. + +.TP 7 +\ \ \ \fBm\fR\ \ :\fIMemory/Swap-Usage\fR toggle \fR +This command affects the two \*(SA lines dealing with physical +and virtual memory. + +This command serves as a 4-way toggle, cycling through these modes: +.nf + 1. detailed percentages by memory type + 2. abbreviated % used/total available + bar graph + 3. abbreviated % used/total available + block graph + 4. turn off memory display +.fi + +.TP 7 +\ \ \ \fB1\fR\ \ :\fISingle/Separate-Cpu-States\fR toggle \fR +This command affects how the `t' command's Cpu States portion is shown. +Although this toggle exists primarily to serve massively-parallel SMP +machines, it is not restricted to solely SMP environments. + +When you see `%Cpu(s):' in the \*(SA, the `1' toggle is \*O and all +\*(Pu information is gathered in a single line. +Otherwise, each \*(Pu is displayed separately as: `%Cpu0, %Cpu1, ...' +up to available screen height. + +.TP 7 +\ \ \ \fB2\fR\ \ :\fINUMA-Nodes/Cpu-Summary\fR toggle \fR +This command toggles between the `1' command cpu summary display (only) +or a summary display plus the cpu usage statistics for each NUMA Node. +It is only available if a system has the requisite NUMA support. + +.TP 7 +\ \ \ \fB3\fR\ \ :\fIExpand-NUMA-Node \fR +You will be invited to enter a number representing a NUMA Node. +Thereafter, a node summary plus the statistics for each cpu in that +node will be shown until the `1', `2' or `4' \*(CT is pressed. +This \*(CI is only available if a system has the requisite NUMA support. + +.TP 7 +\ \ \ \fB4\fR\ \ :\fIDisplay-Multiple-Elements-Adjacent\fR toggle \fR +This \*(CT turns the `1' toggle \*F and shows multiple \*(PU and +Memory results on each line. +Each successive `4' key adds another \*(PU until again reverting +to separate lines for \*(PU and Memory results. + +A maximum of 8 \*(PUs per line can be displayed in this manner. +However, data truncation may occur before reaching the maximum. +That is definitely true when displaying detailed statistics via +the `t' \*(CT since such data cannot be scaled like the graphic +representations. + +If one wished to quickly exit adjacent mode without cycling all the +way to 8, simply use the `1' \*(CT. + +.TP 7 +\ \ \ \fB5\fR\ \ :\fIDisplay-P-Cores-and-E-Cores\fR toggle \fR +This \*(CT is only active when the `t' toggle is \*O and the `1', `2', +`3' and `!' toggles are \*F, thus showing individual \*(PU results. +It assumes a platform has multiple cores of two distinct types, +either multi-threaded (P-Core) or single-threaded (E-Core). + +While normally each \*(Pu is displayed as `%Cpu0, %Cpu1, ...', this +toggle can be used to identify and/or filter those \*(Pus by their +core type, either P-Core (performance) or E-Core (efficient). + +The 1st time `5' is struck, each \*(PU is displayed as `%Cp\fBP\fR' +or `%Cp\fBE\fR' representing the two core types. +The 2nd time, only P-Cores (%Cp\fBP\fR) will be shown. +The 3rd time, only E-Cores (%Cp\fBE\fR) are displayed. +When this \*(CT is struck for the 4th time, the \*(PU display +returns to the normal `%Cpu' convention. + +If separate\fI performance\fR and\fI efficient\fR categories are +not present, this \*(CT will have no effect. + +.TP 7 +\ \ \ \fB!\fR\ \ :\fICombine-Cpus-Mode\fR toggle \fR +This \*(CT is intended for massively parallel SMP environments where, +even with the `4' \*(CT, not all processors can be displayed. +With each press of `!' the number of \*(Pus combined is doubled thus +reducing the total number of \*(Pu lines displayed. + +For example, with the first press of `!' two \*(Pus will be combined and +displayed as `0-1, 2-3, ...' instead of the normal `%Cpu0, %Cpu1, %Cpu2, +%Cpu3, ...'. With a second `!' \*(CT four \*(Pus are combined and shown +as `0-3, 4-7, ...'. +Then the third `!' press, combining eight \*(Pus, shows as `0-7, 8-15, ...', +etc. + +Such progression continues until individual \*(Pus are again displayed +and impacts both the `1' and `4' toggles (one or multiple columns). +Use the `=' command to exit \fBCombine Cpus\fR mode. + +.PP +\*(NT If the entire \*(SA has been toggled \*F for any window, you would +be left with just the\fB message line\fR. +In that way, you will have maximized available task rows but (temporarily) +sacrificed the program name in \*(FM or the \*(CW name when in \*(AM. + +.\" ...................................................................... +.SS 4c. TASK AREA Commands +.\" ---------------------------------------------------------------------- +The \*(TA \*(CIs are\fB always\fR available in \*(FM. + +The \*(TA \*(CIs are\fB never available\fR in \*(AM\fI if\fR the \*(CW's +\*(TD has been toggled \*F (\*(Xt 5. ALTERNATE\-DISPLAY Provisions). + +.\" .................................................. +.PP +.B APPEARANCE\fR of \*(TW + +.TP 7 +\ \ \ \fBJ\fR\ \ :\fIJustify-Numeric-Columns\fR toggle \fR +Alternates between right-justified (the default) and +left-justified numeric data. +If the numeric data completely fills the available column, this +\*(CT may impact the column header only. + +.TP 7 +\ \ \ \fBj\fR\ \ :\fIJustify-Character-Columns\fR toggle \fR +Alternates between left-justified (the default) and +right-justified character data. +If the character data completely fills the available column, this +\*(CT may impact the column header only. + +.PP +.RS +2 +The following commands will also be influenced by the state of the +global `B' (bold enable) toggle. +.RS -2 + +.TP 7 +\ \ \ \fBb\fR\ \ :\fIBold/Reverse\fR toggle \fR +This command will impact how the `x' and `y' toggles are displayed. +It may also impact the \*(SA when a bar graph has been selected for \*(Pu +states or memory usage via the `t' or `m' toggles. + +.TP 7 +\ \ \ \fBx\fR\ \ :\fIColumn-Highlight\fR toggle \fR +Changes highlighting for the current sort field. +If you forget which field is being sorted this command can serve as a quick +visual reminder, providing the sort field is being displayed. +The sort field might\fI not\fR be visible because: + 1) there is insufficient\fI Screen Width \fR + 2) the `f' \*(CI turned it \*F + +.TP 7 +\ \ \ \fBy\fR\ \ :\fIRow-Highlight\fR toggle \fR +Changes highlighting for "running" tasks. +For additional insight into this task state, +\*(Xt 3a. DESCRIPTIONS of Fields, the `S' field (Process Status). + +Use of this provision provides important insight into your system's health. +The only costs will be a few additional tty escape sequences. + +.TP 7 +\ \ \ \fBz\fR\ \ :\fIColor/Monochrome\fR toggle \fR +Switches the \*(CW between your last used color scheme and the older form +of black-on-white or white-on-black. +This command will alter\fB both\fR the \*(SA and \*(TA but does not affect +the state of the `x', `y' or `b' toggles. + +.\" .................................................. +.PP +.B CONTENT\fR of \*(TW + +.TP 7 +\ \ \ \fBc\fR\ \ :\fICommand-Line/Program-Name\fR toggle \fR +This command will be honored whether or not the COMMAND column +is currently visible. +Later, should that field come into view, the change you applied will be seen. + +.TP 7 +\ \ \ \fBF\fR\ \ :\fIMaintain-Parent-Focus\fR toggle \fR +When in forest view mode, this key serves as a toggle to retain focus +on a target task, presumably one with forked children. +If forest view mode is \*F this key has no effect. + +The toggle is applied to the first (topmost) process in the \*(CW. +Once established, that task is always displayed as the first (topmost) +process along with its forked children. +All other processes will be suppressed. + +\*(NT keys like `i' (idle tasks), `n' (max tasks), `v' (hide children) +and User/Other filtering remain accessible and can impact what is displayed. + +.TP 7 +\ \ \ \fBf\fR\ \ :\fIFields-Management \fR +This key displays a separate screen where you can change which fields are +displayed, their order and also designate the sort field. +For additional information on this \*(CI +\*(Xt 3b. MANAGING Fields. + +.TP 7 +\ \ \ \fBO\fR | \fBo\fR\ \ :\fIOther-Filtering \fR +You will be prompted for the selection criteria which then determines +which tasks will be shown in the \*(CW. +Your criteria can be made case sensitive or case can be ignored. +And you determine if \*(We should include or exclude matching tasks. + +\*(XT 5e. FILTERING in a window for details on these and additional +related \*(CIs. + +.TP 7 +\ \ \ \fBS\fR\ \ :\fICumulative-Time-Mode\fR toggle \fR +When Cumulative mode is \*O, each process is listed with the \*(Pu +time that it and its dead children have used. + +When \*F, programs that fork into many separate tasks will appear +less demanding. +For programs like `init' or a shell this is appropriate but for others, +like compilers, perhaps not. +Experiment with two \*(TWs sharing the same sort field but with different `S' +states and see which representation you prefer. + +After issuing this command, you'll be informed of the new state of this toggle. +If you wish to know in advance whether or not Cumulative mode is in +effect, simply ask for help and view the window summary on the second line. + +.TP 7 +\ \ \ \fBU\fR | \fBu\fR\ \ :\fIShow-Specific-User-Only \fR +You will be prompted for the\fB uid\fR or\fB name\fR of the user to display. +The \-u option matches on \fB effective\fR user whereas the \-U option +matches on\fB any\fR user (real, effective, saved, or filesystem). + +Thereafter, in that \*(TW only matching users will be shown, or possibly +no processes will be shown. +Prepending an exclamation point (`!') to the user id or name instructs \*(We +to display only processes with users not matching the one provided. + +Different \*(TWs can be used to filter different users. +Later, if you wish to monitor all users again in the \*(CW, re-issue this +command but just press at the prompt. + +.TP 7 +\ \ \ \fBV\fR\ \ :\fIForest-View-Mode\fR toggle \fR +In this mode, processes are reordered according to their parents and +the layout of the COMMAND column resembles that of a tree. +In forest view mode it is still possible to toggle between program +name and command line (\*(Xc `c' \*(CI) or between processes and +threads (\*(Xc `H' \*(CI). + +\*(NT Typing any key affecting the sort order will exit forest view +mode in the \*(CW. +\*(XT 4c. TASK AREA Commands, SORTING for information on those keys. + +.TP 7 +\ \ \ \fBv\fR\ \ :\fIHide/Show-Children\fR toggle \fR +When in forest view mode, this key serves as a toggle to collapse or +expand the children of a parent. + +The toggle is applied against the first (topmost) process in the \*(CW. +\*(XT 5c. SCROLLING a Window for additional information regarding +vertical scrolling. + +If the target process has not forked any children, this key has no effect. +It also has no effect when not in forest view mode. + +.TP 7 +\ \ \fB^E\fR\ \ :\fIScale-CPU-Time-fields\fR (Ctrl key + `e') +The `time' fields are normally displayed with the greatest +precision their widths permit. +This toggle reduces that precision until it wraps. +It also illustrates the scaling those fields \fImight\fR experience +automatically, which usually depends on how long the system runs. + +For example, if `MMM:SS.hh' is shown, each ^E keystroke would change +it to: `MM:SS', `Hours,MM', `Days+Hours' and finally `Weeks+Days'. + +Not all time fields are subject to the full range of such scaling. + +.\" .................................................. +.PP +.B SIZE\fR of \*(TW + +.TP 7 +\ \ \ \fBi\fR\ \ :\fIIdle-Process\fR toggle \fR +Displays all tasks or just active tasks. +When this toggle is \*F, tasks that have not used any \*(PU since the +last update will not be displayed. +However, due to the granularity of the %CPU and TIME+ fields, +some processes may still be displayed that\fI appear\fR to have +used\fI no\fR \*(PU. + +If this command is applied to the last \*(TD when in \*(AM, then it will not +affect the window's size, as all prior \*(TDs will have already been painted. + +.TP 7 +\ \ \ \fBn\fR | \fB#\fR\ \ :\fISet-Maximum-Tasks \fR +You will be prompted to enter the number of tasks to display. +The lessor of your number and available screen rows will be used. + +When used in \*(AM, this is the command that gives you precise control over +the size of each currently visible \*(TD, except for the very last. +It will not affect the last window's size, as all prior \*(TDs will have +already been painted. + +\*(NT If you wish to increase the size of the last visible \*(TD when in \*(AM, +simply decrease the size of the \*(TD(s) above it. + +.\" .................................................. +.PP +.B SORTING\fR of \*(TW +.PP +.RS +3 +For compatibility, this \*(We supports most of the former \*(We sort keys. +Since this is primarily a service to former \*(We users, these commands do +not appear on any help screen. +.nf + \fI command sorted-field supported \fR + A start time (non-display) \fB No \fR + M %MEM Yes + N PID Yes + P %CPU Yes + T TIME+ Yes +.fi + +Before using any of the following sort provisions, \*(We suggests that you +temporarily turn on column highlighting using the `x' \*(CI. +That will help ensure that the actual sort environment matches your intent. + +The following \*(CIs will\fB only\fR be honored when the current sort field +is\fB visible\fR. +The sort field might\fI not\fR be visible because: + 1) there is insufficient\fI Screen Width \fR + 2) the `f' \*(CI turned it \*F + +.TP 7 +\ \ \ \fB<\fR\ \ :\fIMove-Sort-Field-Left \fR +Moves the sort column to the left unless the current sort field is +the first field being displayed. + +.TP 7 +\ \ \ \fB>\fR\ \ :\fIMove-Sort-Field-Right \fR +Moves the sort column to the right unless the current sort field is +the last field being displayed. + +.PP +The following \*(CIs will\fB always\fR be honored whether or not +the current sort field is visible. + +.TP 7 +\ \ \ \fBf\fR\ \ :\fIFields-Management \fR +This key displays a separate screen where you can change which field +is used as the sort column, among other functions. +This can be a convenient way to simply verify the current sort field, +when running \*(We with column highlighting turned \*F. + +.TP 7 +\ \ \ \fBR\fR\ \ :\fIReverse/Normal-Sort-Field\fR toggle \fR +Using this \*(CI you can alternate between high-to-low and low-to-high sorts. + +.\" ...................................................................... +.SS 4d. COLOR Mapping +.\" ---------------------------------------------------------------------- +When you issue the `Z' \*(CI, you will be presented with a separate screen. +That screen can be used to change the colors in just the \*(CW or +in all four windows before returning to the \*(We display. + +.P +The following \*(CIs are available. +.nf + \fB4\fR upper case letters to select a\fB target \fR + \fB8\fR numbers to select a\fB color \fR + normal toggles available \fR + B :bold disable/enable + b :running tasks "bold"/reverse + z :color/mono + other commands available \fR + a/w :apply, then go to next/prior + :apply and exit + q :abandon current changes and exit +.fi + +If you use `a' or `w' to cycle the targeted window, you will +have applied the color scheme that was displayed when you left that window. +You can, of course, easily return to any window and reapply different +colors or turn colors \*F completely with the `z' toggle. + +The Color Mapping screen can also be used to change the \*(CG in +either \*(FM or \*(AM. +Whatever was targeted when `q' or was pressed will be made current +as you return to the \*(We display. + +.\" ---------------------------------------------------------------------- +.SH 5. ALTERNATE\-DISPLAY Provisions +.\" ---------------------------------------------------------------------- +.\" ...................................................................... +.SS 5a. WINDOWS Overview +.\" ---------------------------------------------------------------------- +.TP 3 +.B Field Groups/Windows\fR: +In \*(FM there is a single window represented by the entire screen. +That single window can still be changed to display 1 of 4 different\fB field +groups\fR (\*(Xc `g' \*(CI, repeated below). +Each of the 4 \*(FGs has a unique separately configurable\fB \*(SA \fR +and its own configurable\fB \*(TA\fR. + +In \*(AM, those 4 underlying \*(FGs can now be made visible +simultaneously, or can be turned \*F individually at your command. + +The \*(SA will always exist, even if it's only the message line. +At any given time only\fI one\fR \*(SA can be displayed. +However, depending on your commands, there could be from\fI zero \fR +to\fI four\fR separate \*(TDs currently showing on the screen. + +.TP 3 +.B Current Window\fR: +The \*(CW is the window associated with the \*(SA and the window to which +task related commands are always directed. +Since in \*(AM you can toggle the \*(TD \*F, some commands might be +restricted for the \*(CW. + +A further complication arises when you have toggled the first \*(SA +line \*F. +With the loss of the window name (the `l' toggled line), you'll not easily +know what window is the \*(CW. + +.\" ...................................................................... +.SS 5b. COMMANDS for Windows +.\" ---------------------------------------------------------------------- +.TP 7 +\ \ \ \fB-\fR | \fB_\fR\ \ :\fIShow/Hide-Window(s)\fR toggles \fR +The `\-' key turns the \*(CW's \*(TD \*O and \*F. +When \*O, that \*(TA will show a minimum of the columns header you've +established with the `f' \*(CI. +It will also reflect any other \*(TA options/toggles you've applied +yielding zero or more tasks. + +The `_' key does the same for all \*(TDs. +In other words, it switches between the currently visible \*(TD(s) and any +\*(TD(s) you had toggled \*F. +If all 4 \*(TDs are currently visible, this \*(CI will leave the \*(SA +as the only display element. + +.TP 7 +*\ \ \fB=\fR | \fB+\fR\ \ :\fIEqualize/Reset-Window(s) \fR +The `=' key forces the \*(CW's \*(TD to be visible. +It also reverses any active `i' (idle tasks), `n' (max tasks), `u/U' +(user filter), `o/O' (other filter), `v' (hide children), `F' focused, +`L' (locate) and `!' (combine cpus) commands. +Also, if the window had been scrolled, it will be reset with this command. +\*(XT 5c. SCROLLING a Window for additional information regarding vertical +and horizontal scrolling. + +The `+' key does the same for all windows. +The four \*(TDs will reappear, evenly balanced, while retaining +any customizations previously applied beyond those noted +for the `=' \*(CT. + +.TP 7 +*\ \ \fBA\fR\ \ :\fIAlternate-Display-Mode\fR toggle \fR +This command will switch between \*(FM and \*(AM. + +The first time you issue this command, all four \*(TDs will be shown. +Thereafter when you switch modes, you will see only the \*(TD(s) you've +chosen to make visible. + +.TP 7 +*\ \ \fBa\fR | \fBw\fR\ \ :\fINext-Window-Forward/Backward \fR +This will change the \*(CW, which in turn changes the window to which +commands are directed. +These keys act in a circular fashion so you can reach any desired window +using either key. + +Assuming the window name is visible (you have not toggled `l' \*F), +whenever the \*(CW name loses its emphasis/color, that's a reminder +the \*(TD is \*F and many commands will be restricted. + +.TP 7 +\ \ \ \fBG\fR\ \ :\fIChange-Window/Field-Group-Name \fR +You will be prompted for a new name to be applied to the \*(CW. +It does not require that the window name be visible +(the `l' toggle to be \*O). + +.IP "*" 3 +The \*(CIs shown with an \*(AK have use beyond \*(AM. +.nf + =, A, g are always available + a, w act the same with color mapping + and fields management +.fi + +.TP 7 +*\ \ \fBg\fR\ \ :\fIChoose-Another-Window/Field-Group \fR +You will be prompted to enter a number between 1 and 4 designating the +\*(FG which should be made the \*(CW. + +In \*(FM, this command is necessary to alter the \*(CW. +In \*(AM, it is simply a less convenient alternative to the `a' and `w' +commands. + +.\" ...................................................................... +.SS 5c. SCROLLING a Window +.\" ---------------------------------------------------------------------- +Typically a \*(TW is a partial view into a system's total tasks/threads +which shows only some of the available fields/columns. +With these \*(KSs, you can move that view vertically or horizontally to +reveal any desired task or column. + +.TP 4 +\fBUp\fR,\fBPgUp\fR\ \ :\fIScroll-Tasks \fR +Move the view up toward the first task row, until the first task is +displayed at the top of the \*(CW. +The \fIUp\fR \*(KA moves a single line while \fIPgUp\fR scrolls the +entire window. + +.TP 4 +\fBDown\fR,\fBPgDn\fR\ \ :\fIScroll-Tasks \fR +Move the view down toward the last task row, until the last task is +the only task displayed at the top of the \*(CW. +The \fIDown\fR \*(KA moves a single line while \fIPgDn\fR scrolls the +entire window. + +.TP 4 +\fBLeft\fR,\fBRight\fR\ \ :\fIScroll-Columns \fR +Move the view of displayable fields horizontally one column at a time. + +\*(NT As a reminder, some fields/columns are not fixed-width but +allocated all remaining screen width when visible. +When scrolling right or left, that feature may produce some +unexpected results initially. + +Additionally, there are special provisions for any variable width field +when positioned as the last displayed field. +Once that field is reached via the right arrow key, and is thus the only +column shown, you can continue scrolling horizontally within such a field. +\*(XC `C' \*(CI below for additional information. + +.TP 4 +\fBHome\fR\ \ :\fIJump-to-Home-Position \fR +Reposition the display to the un-scrolled coordinates. + +.TP 4 +\fBEnd\fR\ \ :\fIJump-to-End-Position \fR +Reposition the display so that the rightmost column reflects the last +displayable field and the bottom task row represents the last task. + +\*(NT From this position it is still possible to scroll\fI down\fR +and\fI right\fR using the \*(KAs. +This is true until a single column and a single task is left as the only +display element. + +.TP 4 +\fBC\fR\ \ :\fIShow-scroll-coordinates\fR toggle \fR +Toggle an informational message which is displayed whenever the message +line is not otherwise being used. +That message will take one of two forms depending on whether or not a +variable width column has also been scrolled. + +.nf + \fBscroll coordinates: y = n/n (tasks), x = n/n (fields)\fR + \fRscroll coordinates: y = n/n (tasks), x = n/n (fields)\fB + nn\fR +.fi + +The coordinates shown as \fBn\fR/\fBn\fR are relative to the upper left +corner of the \*(CW. +The additional `\fB+\ nn\fR' represents the displacement into a variable +width column when it has been scrolled horizontally. +Such displacement occurs in normal 8 character tab stop amounts via +the right and left arrow keys. + +.RS +4 +.TP 4 +\fBy = n/n (tasks) \fR +The first \fBn\fR represents the topmost visible task and is controlled +by \*(KSs. +The second \fBn\fR is updated automatically to reflect total tasks. + +.TP 4 +\fBx = n/n (fields) \fR +The first \fBn\fR represents the leftmost displayed column and is +controlled by \*(KSs. +The second \fBn\fR is the total number of displayable fields and is +established with the `\fBf\fR' \*(CI. +.RS -4 + +.PP +The above \*(CIs are\fB always\fR available in \*(FM but\fB never\fR +available in \*(AM if the \*(CW's \*(TD has been toggled \*F. + +\*(NT When any form of filtering is active, you can expect some slight +aberrations when scrolling since not all tasks will be visible. +This is particularly apparent when using the Up/Down \*(KAs. + +.\" ...................................................................... +.SS 5d. SEARCHING in a Window +.\" ---------------------------------------------------------------------- +You can use these \*(CIs to locate a task row containing a particular value. + +.TP 4 +\fBL\fR\ \ :\fILocate-a-string\fR +You will be prompted for the case-sensitive string to locate starting from +the current window coordinates. +There are no restrictions on search string content. + +Searches are not limited to values from a single field or column. +All of the values displayed in a task row are allowed in a search string. +You may include spaces, numbers, symbols and even forest view artwork. + +Keying with no input will effectively disable the `&' key until +a new search string is entered. + +.TP 4 +\fB&\fR\ \ :\fILocate-next\fR +Assuming a search string has been established, \*(We will attempt to locate +the next occurrence. + +.PP +When a match is found, the current window is repositioned vertically so the +task row containing that string is first. +The scroll coordinates message can provide confirmation of such vertical +repositioning (\*(Xc `C' \*(CI). +Horizontal scrolling, however, is never altered via searching. + +The availability of a matching string will be influenced by the following +factors. +.RS +3 +.TP 3 +a. Which fields are displayable from the total available, +\*(Xt 3b. MANAGING Fields. +.TP 3 +b. Scrolling a window vertically and/or horizontally, +\*(Xt 5c. SCROLLING a Window. +.TP 3 +c. The state of the command/command-line toggle, +\*(Xc `c' \*(CI. +.TP 3 +d. The stability of the chosen sort column, +for example PID is good but %CPU bad. +.RS -3 + +.PP +If a search fails, restoring the \*(CW home (unscrolled) position, scrolling +horizontally, displaying command-lines or choosing a more stable sort field +could yet produce a successful `&' search. + +The above \*(CIs are\fB always\fR available in \*(FM but\fB never\fR +available in \*(AM if the \*(CW's \*(TD has been toggled \*F. + +.\" ...................................................................... +.SS 5e. FILTERING in a Window +.\" ---------------------------------------------------------------------- +You can use this `Other Filter' feature to establish selection criteria which +will then determine which tasks are shown in the \*(CW. +Such filters can be made persistent if preserved in the rcfile via +the `W' \*(CI. + +Establishing a filter requires: 1) a field name; 2) an operator; and +3) a selection value, as a minimum. +This is the most complex of \*(We's user input requirements so, when you make +a mistake, command recall will be your friend. +Remember the Up/Down \*(KAs or their aliases when prompted for input. + +.B Filter Basics +.RS +3 +.TP 3 +1. field names are case sensitive and spelled as in the header +.TP 3 +2. selection values need not comprise the full displayed field +.TP 3 +3. a selection is either case insensitive or sensitive to case +.TP 3 +4. the default is inclusion, prepending `!' denotes exclusions +.TP 3 +5. multiple selection criteria can be applied to a \*(TW +.TP 3 +6. inclusion and exclusion criteria can be used simultaneously +.TP 3 +7. the 1 equality and 2 relational filters can be freely mixed +.TP 3 +8. separate unique filters are maintained for each \*(TW + +.PP +If a field is not turned on or is not currently in view, then your selection +criteria will not affect the display. +Later, should a filtered field become visible, the selection criteria will +then be applied. +.RE + +.B Keyboard Summary +.TP 6 +\ \ \fBO\fR\ \ :\fIOther-Filter\fR (upper case) +You will be prompted to establish a \fBcase sensitive\fR filter. + +.TP 6 +\ \ \fBo\fR\ \ :\fIOther-Filter\fR (lower case) +You will be prompted to establish a filter that \fBignores case\fR when +matching. + +.TP 6 +\ \fB^O\fR\ \ :\fIShow-Active-Filters\fR (Ctrl key + `o') +This can serve as a reminder of which filters are active in the \*(CW. +A summary will be shown on the message line until you press the key. + +.TP 6 +\ \ \fB=\fR\ \ :\fIReset-Filtering\fR in current window +This clears all of your selection criteria in the \*(CW. +It also has additional impact so please \*(Xt 4a. GLOBAL Commands. + +.TP 6 +\ \ \fB+\fR\ \ :\fIReset-Filtering\fR in all windows +This clears the selection criteria in all windows, assuming you are in \*(AM. +As with the `=' \*(CI, it too has additional consequences so you might wish to +\*(Xt 5b. COMMANDS for Windows. + +.PP +.B Input Requirements +.RS +3 +.P +When prompted for selection criteria, the data you provide must take one +of two forms. +There are 3 required pieces of information, with a 4th as optional. +These examples use spaces for clarity but your input generally would not. +.nf + #1 \fB#2\fR #3 ( required ) + Field\-Name ? include\-if\-value + \fB!\fR Field\-Name ? \fBexclude\fR\-if\-value + #4 ( optional ) +.fi + +Items #1, #3 and #4 should be self\-explanatory. +Item \fB#2\fR represents both a required \fIdelimiter\fR and the \fIoperator\fR +which must be one of either equality (`=') or relation (`<' or `>'). + +The `=' equality operator requires only a partial match and that +can reduce your `if\-value' input requirements. +The `>' or `<' relational operators always employ string comparisons, +even with numeric fields. +They are designed to work with a field's default \fIjustification\fR and +with homogeneous data. +When some field's numeric amounts have been subjected to \fIscaling\fR +while others have not, that data is no longer homogeneous. + +If you establish a relational filter and you \fBhave\fR changed the +default Numeric or Character \fIjustification\fR, that filter is likely to fail. +When a relational filter is applied to a memory field and you \fBhave not\fR +changed the \fIscaling\fR, it may produce misleading results. +This happens, for example, because `100.0m' (MiB) would appear greater +than `1.000g' (GiB) when compared as strings. + +If your filtered results appear suspect, simply altering justification or +scaling may yet achieve the desired objective. +See the `j', `J' and `e' \*(CIs for additional information. +.RE + +.B Potential Problems +.RS +3 +.P +These \fBGROUP\fR filters could produce the exact same results or the +second one might not display anything at all, just a blank \*(TW. +.nf + GROUP=root ( only the same results when ) + GROUP=ROOT ( invoked via lower case `o' ) +.fi + +Either of these \fBRES\fR filters might yield inconsistent and/or +misleading results, depending on the current memory scaling factor. +Or both filters could produce the exact same results. +.nf + RES>9999 ( only the same results when ) + !RES<10000 ( memory scaling is at `KiB' ) +.fi + +This \fBnMin\fR filter illustrates a problem unique to scalable fields. +This particular field can display a maximum of 4 digits, beyond which values +are automatically scaled to KiB or above. +So while amounts greater than 9999 exist, they will appear as 2.6m, 197k, etc. +.nf + nMin>9999 ( always a blank \*(TW ) +.fi +.RE + +.B Potential Solutions +.RS +3 +.P +These examples illustrate how Other Filtering can be creatively +applied to achieve almost any desired result. +Single quotes are sometimes shown to delimit the spaces which are part of +a filter or to represent a request for status (^O) accurately. +But if you used them with if-values in real life, no matches would be found. + +Assuming field \fBnTH\fR is displayed, the first filter will result in +only multi-threaded processes being shown. +It also reminds us that a trailing space is part of every displayed field. +The second filter achieves the exact same results with less typing. +.nf + !nTH=` 1 ' ( ` for clarity only ) + nTH>1 ( same with less i/p ) +.fi + +With Forest View mode active and the \fBCOMMAND\fR column in view, this +filter effectively collapses child processes so that just 3 levels are shown. +.nf + !COMMAND=` `- ' ( ` for clarity only ) +.fi + +The final two filters appear as in response to the status request key (^O). +In reality, each filter would have required separate input. +The \fBPR\fR example shows the two concurrent filters necessary to display +tasks with priorities of 20 or more, since some might be negative. +Then by exploiting trailing spaces, the \fBnMin\fR series of filters could +achieve the failed `9999' objective discussed above. +.nf + `PR>20' + `!PR=-' ( 2 for right result ) + `!nMin=0 ' + `!nMin=1 ' + `!nMin=2 ' + `!nMin=3 ' ... +.fi +.RS -3 + +.\" ---------------------------------------------------------------------- +.SH 6. FILES +.\" ---------------------------------------------------------------------- +.SS 6a. PERSONAL Configuration File +.\" ---------------------------------------------------------------------- +This file is created or updated via the `W' \*(CI. + +The legacy version is written as `$HOME/.your\-name\-4\-\*(We' + `rc' +with a leading period. + +A newly created \*(CF is written as procps/your\-name\-4\-\*(We' + `rc' +without a leading period. +The procps directory will be subordinate to either $XDG_CONFIG_HOME when +set as an absolute path or the $HOME/.config directory. + +While not intended to be edited manually, here is the general layout: +.nf + global # line 1: the program name/alias notation + " # line 2: id,altscr,irixps,delay,curwin + per ea # line a: winname,fieldscur + window # line b: winflags,sortindx,maxtasks,etc + " # line c: summclr,msgsclr,headclr,taskclr + global # line 15: additional miscellaneous settings + " # any remaining lines are devoted to optional + " # active `other filters' discussed in section 5e above + " # plus `inspect' entries discussed in section 6b below +.fi + +If a valid absolute path to the rcfile cannot be established, customizations +made to a running \*(We will be impossible to preserve. + +.\" ...................................................................... +.SS 6b. ADDING INSPECT Entries +.\" ---------------------------------------------------------------------- +To exploit the `Y' \*(CI, you must add entries at the\fB end\fR of the +\*(We personal \*(CF. +Such entries simply reflect a file to be read or command/pipeline to be +executed whose results will then be displayed in a separate scrollable, +searchable window. + +If you don't know the location or name of your \*(We rcfile, use the `W' +\*(CI to rewrite it and note those details. + +Inspect entries can be added with a redirected echo or by editing the \*(CF. +Redirecting an echo risks overwriting the rcfile should it replace (>) +rather than append (>>) to that file. +Conversely, when using an editor care must be taken not to corrupt existing +lines, some of which could contain unprintable data or unusual characters +depending on the \*(We version under which that \*(CF was saved. + +Those Inspect entries beginning with a `#' character are ignored, regardless +of content. +Otherwise they consist of the following 3 elements, each of which\fI must\fR +be separated by a tab character (thus 2 `\\t' total): + +.nf + .type: literal `file' or `pipe' + .name: selection shown on the Inspect screen + .fmts: string representing a path or command +.fi + +The two types of Inspect entries are\fI not\fR interchangeable. +Those designated `\fBfile\fR' will be accessed using fopen and +must reference a single file in the `.fmts' element. +Entries specifying `\fBpipe\fR' will employ popen, their `.fmts' element +could contain many pipelined commands and, none can be interactive. + +If the file or pipeline represented in your `.fmts' deals with the specific PID +input or accepted when prompted, then the format string must also contain +the `\fB%d\fR' specifier, as these examples illustrate. + +.nf + .fmts= /proc/\fI%d\fR/numa_maps + .fmts= lsof -P -p\fI %d\fR +.fi + +For `\fBpipe\fR' type entries only, you may also wish to redirect stderr to +stdout for a more comprehensive result. +Thus the format string becomes: + +.nf + .fmts= pmap -x %d\fI 2>&1\fR +.fi + +Here are examples of both types of Inspect entries as they might appear +in the rcfile. +The first entry will be ignored due to the initial `#' character. +For clarity, the pseudo tab depictions (^I) are surrounded by an +extra space but the actual tabs would not be. +.nf + + # pipe ^I Sockets ^I lsof -n -P -i 2>&1 + pipe ^I Open Files ^I lsof -P -p %d 2>&1 + file ^I NUMA Info ^I /proc/%d/numa_maps + pipe ^I Log ^I tail -n100 /var/log/syslog | sort -Mr +.fi + +Except for the commented entry above, these next examples show what could +be echoed to achieve similar results, assuming the rcfile name was `.toprc'. +However, due to the embedded tab characters, each of these lines should be +preceded by `\fB/bin/echo \-e\fR', not just a simple an `echo', to +enable backslash interpretation regardless of which shell you use. + +.nf + "pipe\\tOpen Files\\tlsof -P -p %d 2>&1" >> ~/.toprc + "file\\tNUMA Info\\t/proc/%d/numa_maps" >> ~/.toprc + "pipe\\tLog\\ttail -n200 /var/log/syslog | sort -Mr" >> ~/.toprc +.fi + +If any inspect entry you create produces output with unprintable characters +they will be displayed in either the ^C notation or hexadecimal form, +depending on their value. +This applies to tab characters as well, which will show as `^I'. +If you want a truer representation, any embedded tabs should be expanded. +The following example takes what could have been a `file' entry but employs +a `pipe' instead so as to expand the embedded tabs. + +.nf + # next would have contained `\\t' ... + # file ^I ^I /proc/%d/status + # but this will eliminate embedded `\\t' ... + pipe ^I ^I cat /proc/%d/status | expand \- +.fi + +\*(NT Some programs might rely on \fISIGINT\fR to end. +Therefore, if a `\fBpipe\fR' such as the following is established, one must +use Ctrl-C to terminate it in order to review the results. +This is the single occasion where a `^C' will not also terminate \*(We. + +.nf + pipe ^I Trace ^I /usr/bin/strace -p %d 2>&1 +.fi + +Lastly, while `\fBpipe\fR' type entries have been discussed in terms of pipelines +and commands, there is nothing to prevent you from including \fI shell scripts\fR +as well. +Perhaps even newly created scripts designed specifically for the `Y' \*(CI. + +For example, as the number of your Inspect entries grows over time, the `Options:' +row will be truncated when screen width is exceeded. +That does not affect operation other than to make some selections invisible. +However, if some choices are lost to truncation but you want to see more options, +there is an easy solution hinted at below. + +.nf + Inspection Pause at pid ... + Use: left/right then ... + Options: help 1 2 3 4 5 6 7 8 9 10 11 ... +.fi + +The entries in the \*(We rcfile would have a number for the `.name' element and +the `help' entry would identify a shell script you've written explaining what +those numbered selections actually mean. +In that way, many more choices can be made visible. + +.\" ...................................................................... +.SS 6c. SYSTEM Configuration File +.\" ---------------------------------------------------------------------- +This \*(CF represents defaults for users who have not saved their own \*(CF. +The format mirrors exactly the personal \*(CF and can also include `inspect' +entries as explained above. + +Creating it is a simple process. + +1. Configure \*(We appropriately for your installation and preserve that +configuration with the `W' \*(CI. + +2. Add and test any desired `inspect' entries. + +3. Copy that \*(CF to the \fI/etc/\fR directory as `\fBtopdefaultrc\fR'. + +.\" ...................................................................... +.SS 6d. SYSTEM Restrictions File +.\" ---------------------------------------------------------------------- +The presence of this file will influence which version of the help screen +is shown to an ordinary user. + +More importantly, it will limit what ordinary users are allowed +to do when \*(We is running. +They will not be able to issue the following commands. +.nf + k Kill a task + r Renice a task + d or s Change delay/sleep interval +.fi + +This \*(CF is not created by \*(We. +Rather, it is created manually and placed it in the \fI/etc/\fR +directory as `\fBtoprc\fR'. + +It should have exactly two lines, as shown in this example: +.nf + s # line 1: secure mode switch + 5.0 # line 2: delay interval in seconds +.fi + +.\" ---------------------------------------------------------------------- +.SH 7. ENVIRONMENT VARIABLE(S) +.\" ---------------------------------------------------------------------- +The value set for the following is unimportant, just its presence. + +.IP LIBPROC_HIDE_KERNEL +This will prevent display of any kernel threads and exclude such processes +from the \*(SA Tasks/Threads counts. + +.\" ---------------------------------------------------------------------- +.SH 8. STUPID TRICKS Sampler +.\" ---------------------------------------------------------------------- +Many of these tricks work best when you give \*(We a scheduling boost. +So plan on starting him with a nice value of \-10, assuming you've got +the authority. + +.\" ...................................................................... +.SS 7a. Kernel Magic +.\" ---------------------------------------------------------------------- +.\" sorry, just can't help it -- don't ya love the sound of this? +For these stupid tricks, \*(We needs \*(FM. +.\" ( apparently AM static was a potential concern ) + +.IP \(bu 3 +The user interface, through prompts and help, intentionally implies +that the delay interval is limited to tenths of a second. +However, you're free to set any desired delay. +If you want to see Linux at his scheduling best, try a delay of .09 +seconds or less. + +For this experiment, under x-windows open an xterm and maximize it. +Then do the following: +.nf + . provide a scheduling boost and tiny delay via: + nice -n -10 \*(We -d.09 + . keep sorted column highlighting \*F so as to + minimize path length + . turn \*O reverse row highlighting for emphasis + . try various sort columns (TIME/MEM work well), + and normal or reverse sorts to bring the most + active processes into view +.fi + +What you'll see is a very busy Linux doing what he's always done for you, +but there was no program available to illustrate this. + +.IP \(bu 3 +Under an xterm using `white-on-black' colors, on \*(We's Color Mapping screen +set the task color to black and be sure that task highlighting is set to bold, +not reverse. +Then set the delay interval to around .3 seconds. + +After bringing the most active processes into view, what you'll see are +the ghostly images of just the currently running tasks. + +.IP \(bu 3 +Delete the existing rcfile, or create a new symlink. +Start this new version then type `T' (a secret key, +\*(Xt 4c. Task Area Commands, SORTING) followed by `W' and `q'. +Finally, restart the program with \-d0 (zero delay). + +Your display will be refreshed at three times the rate of the former \*(We, +a 300% speed advantage. +As \*(We climbs the TIME ladder, be as patient as you can while speculating +on whether or not \*(We will ever reach the \*(We. + +.\" ...................................................................... +.SS 7b. Bouncing Windows +.\" ---------------------------------------------------------------------- +For these stupid tricks, \*(We needs \*(AM. + +.IP \(bu 3 +With 3 or 4 \*(TDs visible, pick any window other than the last +and turn idle processes \*F using the `i' \*(CT. +Depending on where you applied `i', sometimes several \*(TDs are bouncing and +sometimes it's like an accordion, as \*(We tries his best to allocate space. + +.IP \(bu 3 +Set each window's summary lines differently: one with no memory (`m'); another +with no states (`t'); maybe one with nothing at all, just the message line. +Then hold down `a' or `w' and watch a variation on bouncing windows \*(Em +hopping windows. + +.IP \(bu 3 +Display all 4 windows and for each, in turn, set idle processes to \*F using +the `i' \*(CT. +You've just entered the "extreme bounce" zone. + +.\" ...................................................................... +.SS 7c. The Big Bird Window +.\" ---------------------------------------------------------------------- +This stupid trick also requires \*(AM. + +.IP \(bu 3 +Display all 4 windows and make sure that 1:Def is the \*(CW. +Then, keep increasing window size with the `n' \*(CI until all the other +\*(TDs are "pushed out of the nest". + +When they've all been displaced, toggle between all visible/invisible windows +using the `_' \*(CT. +Then ponder this: +.br + is \*(We fibbing or telling honestly your imposed truth? + +.\" ...................................................................... +.SS 7d. The Ol' Switcheroo +.\" ---------------------------------------------------------------------- +This stupid trick works best without \*(AM, since justification is active +on a per window basis. + +.IP \(bu 3 +Start \*(We and make COMMAND the last (rightmost) column displayed. +If necessary, use the `c' \*(CT to display command lines and ensure +that forest view mode is active with the `V' \*(CT. + +Then use the up/down arrow keys to position the display so that some +truncated command lines are shown (`+' in last position). +You may have to resize your xterm to produce truncation. + +Lastly, use the `j' \*(CT to make the COMMAND column right justified. + +Now use the right arrow key to reach the COMMAND column. +Continuing with the right arrow key, watch closely the direction +of travel for the command lines being shown. + +.br + some lines travel left, while others travel right + + eventually all lines will Switcheroo, and move right + +.\" ---------------------------------------------------------------------- +.SH 9. BUGS +.\" ---------------------------------------------------------------------- +Please send bug reports to +.UR procps@freelists.org +.UE . + + \" ---------------------------------------------------------------------- +.SH 10. SEE Also +.\" ---------------------------------------------------------------------- +.BR free (1), +.BR ps (1), +.BR uptime (1), +.BR atop (1), +.BR slabtop (1), +.BR vmstat (8), +.BR w (1) diff --git a/man/uptime.1 b/man/uptime.1 new file mode 100644 index 0000000..eb8cc9f --- /dev/null +++ b/man/uptime.1 @@ -0,0 +1,74 @@ +.\" +.\" Copyright (c) 2011-2023 Craig Small +.\" Copyright (c) 2011-2023 Jim Warner +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 2002 Albert Cahalan +.\" +.\" 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. +.\" +.\" +.TH UPTIME "1" "December 2012" "procps-ng" "User Commands" +.SH NAME +uptime \- Tell how long the system has been running. +.SH SYNOPSIS +.B uptime +[\fIoptions\fR] +.SH DESCRIPTION +.B uptime +gives a one line display of the following information. The current time, how +long the system has been running, how many users are currently logged on, and +the system load averages for the past 1, 5, and 15 minutes. +.PP +This is the same information contained in the header line displayed by +.BR w (1). +.PP +System load averages is the average number of processes that are either in a +runnable or uninterruptable state. A process in a runnable state is either +using the CPU or waiting to use the CPU. A process in uninterruptable state +is waiting for some I/O access, eg waiting for disk. The averages are taken +over the three time intervals. Load averages are not normalized for the +number of CPUs in a system, so a load average of 1 means a single CPU system +is loaded all the time while on a 4 CPU system it means it was idle 75% of +the time. +.SH OPTIONS +.TP +\fB\-p\fR, \fB\-\-pretty\fR +show uptime in pretty format +.TP +\fB\-h\fR, \fB\-\-help\fR +display this help text +.TP +\fB\-s\fR, \fB\-\-since\fR +system up since, in yyyy-mm-dd HH:MM:SS format +.TP +\fB\-V\fR, \fB\-\-version\fR +display version information and exit +.SH FILES +.TP +.I /var/run/utmp +information about who is currently logged on +.TP +.I /proc +process information +.SH AUTHORS +.B uptime +was written by +.UR greenfie@gauss.\:rutgers.\:edu +Larry Greenfield +.UE +and +.UR johnsonm@sunsite.\:unc.\:edu +Michael K. Johnson +.UE +.SH "SEE ALSO" +.BR ps (1), +.BR top (1), +.BR utmp (5), +.BR w (1) +.SH "REPORTING BUGS" +Please send bug reports to +.UR procps@freelists.org +.UE diff --git a/man/vmstat.8 b/man/vmstat.8 new file mode 100644 index 0000000..bfaba27 --- /dev/null +++ b/man/vmstat.8 @@ -0,0 +1,202 @@ +.\" +.\" Copyright (c) 2002-2023 Craig Small +.\" Copyright (c) 2012-2023 Jim Warner +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 1994 Henry Ware +.\" +.\" 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. +.\" +.\" +.TH VMSTAT 8 "2023-01-18" "procps-ng" "System Administration" +.SH NAME +vmstat \- Report virtual memory statistics +.SH SYNOPSIS +.B vmstat +[options] +.RI [ delay " [" count ]] +.SH DESCRIPTION +.B vmstat +reports information about processes, memory, paging, block IO, traps, disks +and cpu activity. +.PP +The first report produced gives averages since the last reboot. Additional +reports give information on a sampling period of length +.IR delay . +The process and memory reports are instantaneous in either case. +.SH OPTIONS +.TP +.I delay +The +.I delay +between updates in seconds. If no +.I delay +is specified, only one report is printed with the average values since boot. +.TP +.I count +Number of updates. In absence of +.IR count , +when +.I delay +is defined, default is infinite. +.TP +\fB\-a\fR, \fB\-\-active\fR +Display active and inactive memory, given a 2.5.41 kernel or better. +.TP +\fB\-f\fR, \fB\-\-forks\fR +The +.B \-f +switch displays the number of forks since boot. This includes the fork, +vfork, and clone system calls, and is equivalent to the total number of tasks +created. Each process is represented by one or more tasks, depending on +thread usage. This display does not repeat. +.TP +\fB\-m\fR, \fB\-\-slabs\fR +Displays slabinfo. +.TP +\fB\-n\fR, \fB\-\-one-header\fR +Display the header only once rather than periodically. +.TP +\fB\-s\fR, \fB\-\-stats\fR +Displays a table of various event counters and memory statistics. This +display does not repeat. +.TP +\fB\-d\fR, \fB\-\-disk\fR +Report disk statistics (2.5.70 or above required). +.TP +\fB\-D\fR, \fB\-\-disk-sum\fR +Report some summary statistics about disk activity. +.TP +\fB\-p\fR, \fB\-\-partition\fR \fIdevice\fR +Detailed statistics about partition (2.5.70 or above required). +.TP +\fB\-S\fR, \fB\-\-unit\fR \fIcharacter\fR +Switches outputs between 1000 +.RI ( k ), +1024 +.RI ( K ), +1000000 +.RI ( m ), +or 1048576 +.RI ( M ) +bytes. Note this does not change the swap (si/so) or block (bi/bo) +fields. +.TP +\fB\-t\fR, \fB\-\-timestamp\fR +Append timestamp to each line +.TP +\fB\-w\fR, \fB\-\-wide\fR +Wide output mode (useful for systems with higher amount of memory, +where the default output mode suffers from unwanted column breakage). +The output is wider than 80 characters per line. +.TP +\fB\-y\fR, \fB\-\-no-first\fR +Omits first report with statistics since system boot. +.TP +\fB\-V\fR, \fB\-\-version\fR +Display version information and exit. +.TP +\fB\-h\fR, \fB\-\-help\fR +Display help and exit. +.PD +.SH FIELD DESCRIPTION FOR VM MODE +.SS Procs +.nf +r: The number of runnable processes (running or waiting for run time). +b: The number of processes blocked waiting for I/O to complete. +.fi +.SS Memory +These are affected by the \fB\-\-unit\fR option. +.nf +swpd: the amount of swap memory used. +free: the amount of idle memory. +buff: the amount of memory used as buffers. +cache: the amount of memory used as cache. +inact: the amount of inactive memory. (\fB\-a\fR option) +active: the amount of active memory. (\fB\-a\fR option) +.fi +.SS Swap +These are affected by the \fB\-\-unit\fR option. +.nf +si: Amount of memory swapped in from disk (/s). +so: Amount of memory swapped to disk (/s). +.fi +.SS IO +.nf +bi: Kibibyte received from a block device (KiB/s). +bo: Kibibyte sent to a block device (KiB/s). +.fi +.SS System +.nf +in: The number of interrupts per second, including the clock. +cs: The number of context switches per second. +.fi +.SS CPU +These are percentages of total CPU time. +.nf +us: Time spent running non\-kernel code. (user time, including nice time) +sy: Time spent running kernel code. (system time) +id: Time spent idle. Prior to Linux 2.5.41, this includes IO\-wait time. +wa: Time spent waiting for IO. Prior to Linux 2.5.41, included in idle. +st: Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown. +gu: Time spent running KVM guest code (guest time, including guest nice). +.fi +.SH FIELD DESCRIPTION FOR DISK MODE +.SS Reads +.nf +total: Total reads completed successfully +merged: grouped reads (resulting in one I/O) +sectors: Sectors read successfully +ms: milliseconds spent reading +.fi +.SS Writes +.nf +total: Total writes completed successfully +merged: grouped writes (resulting in one I/O) +sectors: Sectors written successfully +ms: milliseconds spent writing +.fi +.SS IO +.nf +cur: I/O in progress +s: seconds spent for I/O +.fi +.SH FIELD DESCRIPTION FOR DISK PARTITION MODE +.nf +reads: Total number of reads issued to this partition +read sectors: Total read sectors for partition +writes : Total number of writes issued to this partition +requested writes: Total number of write requests made for partition +.fi +.SH FIELD DESCRIPTION FOR SLAB MODE +Slab mode shows statistics per slab, for more information +about this information see +.BR slabinfo (5) +.PP +.nf +cache: Cache name +num: Number of currently active objects +total: Total number of available objects +size: Size of each object +pages: Number of pages with at least one active object +.fi +.SH NOTES +.B vmstat +requires read access to files under \fI/proc\fR. The \fB\-m\fR requires read +access to \fI/proc/slabinfo\fR which may not be available to standard users. +Mount options for \fI/proc\fR such as \fIsubset=pid\fR may also impact what +is visible. +.SH "SEE ALSO" +.BR free (1), +.BR iostat (1), +.BR mpstat (1), +.BR ps (1), +.BR sar (1), +.BR top (1), +.BR slabinfo (5) +.SH "REPORTING BUGS" +Please send bug reports to +.UR procps@freelists.org +.UE diff --git a/man/w.1 b/man/w.1 new file mode 100644 index 0000000..dd10e9c --- /dev/null +++ b/man/w.1 @@ -0,0 +1,115 @@ +.\" +.\" Copyright (c) 2009-2023 Craig Small +.\" Copyright (c) 2015-2023 Jim Warner +.\" Copyright (c) 2012-2013 Jaromir Capik +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 2002-2004 Albert Cahalan +.\" +.\" 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. +.\" +.\" +.TH W "1" "2023-01-15" "procps-ng" "User Commands" +.SH NAME +w \- Show who is logged on and what they are doing. +.SH SYNOPSIS +.B w +[\fIoptions\fR] [\fIuser\fR] +.SH DESCRIPTION +.B w +displays information about the users currently on the machine, and their +processes. The header shows, in this order, the current time, how long the +system has been running, how many users are currently logged on, and the +system load averages for the past 1, 5, and 15 minutes. +.PP +The following entries are displayed for each user: login name, the tty name, +the remote host, login time, idle time, JCPU, PCPU, and the command line of +their current process. +.PP +The JCPU time is the time used by all processes attached to the tty. It does +not include past background jobs, but does include currently running +background jobs. +.PP +The PCPU time is the time used by the current process, named in the "what" +field. +.SH "COMMAND\-LINE OPTIONS" +.TP +\fB\-h\fR, \fB\-\-no\-header\fR +Don't print the header. +.TP +\fB\-u\fR, \fB\-\-no\-current\fR +Ignores the username while figuring out the +current process and cpu times. To demonstrate this, do a +.B su +and do a +.B w +and a +.BR "w \-u". +.TP +\fB\-s\fR, \fB\-\-short\fR +Use the short format. Don't print the login time, JCPU or PCPU times. +.TP +\fB\-f\fR, \fB\-\-from\fR +Toggle printing the +.B from +(remote hostname) field. The default as released is for the +.B from +field to not be printed, although your system administrator or distribution +maintainer may have compiled a version in which the +.B from +field is shown by default. +.TP +\fB\-\-help\fR +Display help text and exit. +.TP +\fB\-i\fR, \fB\-\-ip\-addr\fR +Display IP address instead of hostname for \fBfrom\fR field. +.TP +\fB\-p\fR, \fB\-\-pids\fR +Display pid of the login process/the "what" process in the "what" field. +.TP +\fB\-V\fR, \fB\-\-version\fR +Display version information. +.TP +\fB\-o\fR, \fB\-\-old\-style\fR +Old style output. Prints blank space for idle times less than one minute. +.TP +.B "user " +Show information about the specified user only. +.SH ENVIRONMENT +.TP +PROCPS_USERLEN +Override the default width of the username column. Defaults to 8. +.TP +PROCPS_FROMLEN +Override the default width of the from column. Defaults to 16. +.SH FILES +.TP +.I /var/run/utmp +information about who is currently logged on +.TP +.I /proc +process information +.SH "SEE ALSO" +.BR free (1), +.BR ps (1), +.BR top (1), +.BR uptime (1), +.BR utmp (5), +.BR who (1) +.SH AUTHORS +.B w +was re-written almost entirely by Charles Blake, based on the version by +.UR greenfie@\:gauss.\:rutgers.\:edu +Larry Greenfield +.UE +and +.UR johnsonm@\:redhat.\:com +Michael K. Johnson +.UE +.SH "REPORTING BUGS" +Please send bug reports to +.UR procps@freelists.org +.UE diff --git a/man/watch.1 b/man/watch.1 new file mode 100644 index 0000000..01685e6 --- /dev/null +++ b/man/watch.1 @@ -0,0 +1,232 @@ +.\" +.\" Copyright (c) 2009-2023 Craig Small +.\" Copyright (c) 2018-2023 Jim Warner +.\" Copyright (c) 2011-2012 Sami Kerola +.\" Copyright (c) 2003 Albert Cahalan +.\" +.\" 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. +.\" +.\" +.TH WATCH 1 "2023-01-17" "procps-ng" "User Commands" +.SH NAME +watch \- execute a program periodically, showing output fullscreen +.SH SYNOPSIS +.B watch +[\fIoptions\fR] \fIcommand\fR +.SH DESCRIPTION +.B watch +runs +.I command +repeatedly, displaying its output and errors (the first screenfull). This +allows you to watch the program output change over time. By default, +\fIcommand\fR is run every 2 seconds and \fBwatch\fR will run until interrupted. +.SH OPTIONS +.TP +\fB\-b\fR, \fB\-\-beep\fR +Beep if command has a non-zero exit. +.TP +\fB\-c\fR, \fB\-\-color\fR +Interpret ANSI color and style sequences. +.TP +\fB\-C\fR, \fB\-\-no-color\fR +Do not interpret ANSI color and style sequences. +.TP +\fB\-d\fR, \fB\-\-differences\fR[=\fIpermanent\fR] +Highlight the differences between successive updates. If the optional +\fIpermanent\fR argument is specified then +.B watch +will show all changes since the first iteration. +.TP +\fB\-e\fR, \fB\-\-errexit\fR +Freeze updates on command error, and exit after a key press. +.TP +\fB\-g\fR, \fB\-\-chgexit\fR +Exit when the output of +.I command +changes. +.TP +\fB\-n\fR, \fB\-\-interval\fR \fIseconds\fR +Specify update interval. The command will not allow quicker than 0.1 second +interval, in which the smaller values are converted. Both '.' and ',' work +for any locales. The \fBWATCH_INTERVAL\fR environment can be used to persistently +set a non-default interval (following the same rules and formatting). +.TP +\fB\-p\fR, \fB\-\-precise\fR +Make +.BR watch +attempt to run +.I command +every +.B \-\-interval +.IR seconds . +Try it with +.B ntptime +(if present) and notice how the fractional seconds stays (nearly) the same, as opposed to +normal mode where they continuously increase. +.TP +\fB\-q\fR, \fB\-\-equexit\fR +Exit when output of +.I command +does not change for the given number of cycles. +.TP +\fB\-r\fR, \fB\-\-no-rerun\fR +Do not run the program on terminal resize, the output of the program will re-appear at the next +regular run time. +.TP +\fB\-t\fR, \fB\-\-no\-title\fR +Turn off the header showing the interval, command, and current time at the +top of the display, as well as the following blank line. +.TP +\fB\-w\fR, \fB\-\-no\-wrap\fR +Turn off line wrapping. Long lines will be truncated instead of wrapped to the next line. +.TP +\fB\-x\fR, \fB\-\-exec\fR +Pass +.I command +to +.BR exec (2) +instead of +.B sh \-c +which reduces the need to use extra quoting to get the desired effect. +.TP +\fB\-h\fR, \fB\-\-help\fR +Display help text and exit. +.TP +\fB\-v\fR, \fB\-\-version\fR +Display version information and exit. +.SH "EXIT STATUS" +.PP +.RS +.PD 0 +.TP +.B 0 +Success. +.TP +.B 1 +Various failures. +.TP +.B 2 +Forking the process to watch failed. +.TP +.B 3 +Replacing child process stdout with write side pipe failed. +.TP +.B 4 +Command execution failed. +.TP +.B 5 +Closing child process write pipe failed. +.TP +.B 7 +IPC pipe creation failed. +.TP +.B 8 +Getting child process return value with +.BR waitpid (2) +failed, or command exited up on error. +.TP +.B other +The watch will propagate command exit status as child exit status. +.SH ENVIRONMENT +The behavior of +.B watch +is affected by the following environment variables. + +.TP +.B WATCH_INTERVAL +Update interval, follows the same rules as the +.B \-\-interval +command line option. +.sp +.SH NOTES +POSIX option processing is used (i.e., option processing stops at +the first non\-option argument). This means that flags after +.I command +don't get interpreted by +.BR watch +itself. +.sp +.SH BUGS +Upon terminal resize, the screen will not be correctly repainted until the +next scheduled update. All +.B \-\-differences +highlighting is lost on that update as well. When using the +.B \-\-no\-rerun +option, no output of will be visible. + +Non-printing characters are stripped from program output. Use \fBcat -v\fR as +part of the command pipeline if you want to see them. + +Combining Characters that are supposed to display on the character at the +last column on the screen may display one column early, or they may not +display at all. + +Combining Characters never count as different in +.B \-\-differences +mode. Only the base character counts. + +Blank lines directly after a line which ends in the last column do not +display. + +.B \-\-precise +mode doesn't yet have advanced temporal distortion technology to compensate +for a +.I command +that takes more than +.B \-\-interval +.I seconds +to execute. +.B watch +also can get into a state where it rapid-fires as many executions of +.I command +as it can to catch up from a previous executions running longer than +.B \-\-interval +(for example, +.BR netstat (8) +taking ages on a DNS lookup). +.sp +.SH EXAMPLES +.PP +To watch for mail, you might do +.IP +watch \-n 60 from +.PP +To watch the contents of a directory change, you could use +.IP +watch \-d ls \-l +.PP +If you're only interested in files owned by user joe, you might use +.IP +watch \-d 'ls \-l | fgrep joe' +.PP +To see the effects of quoting, try these out +.IP +watch echo $$ +.br +watch echo '$$' +.br +watch echo "'"'$$'"'" +.PP +To see the effect of precision time keeping, try adding +.B \-p +to +.IP +watch \-n 10 sleep 1 +.PP +You can watch for your administrator to install the latest kernel with +.IP +watch uname \-r +.PP +(Note that +.B \-p +isn't guaranteed to work across reboots, especially in the face of +.B ntpdate +(if present) or other bootup time-changing mechanisms) +.sp +.SH "REPORTING BUGS" +Please send bug reports to +.UR procps@freelists.org +.UE diff --git a/missing b/missing new file mode 100755 index 0000000..1fe1611 --- /dev/null +++ b/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1996-2021 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=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://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 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..d2d5f21 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,111 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +errstatus=0 +dirmode="" + +usage="\ +Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" 1>&2 + exit 0 + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +case $dirmode in + '') + if mkdir -p -- . 2>/dev/null; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + fi + ;; + *) + if mkdir -m "$dirmode" -p -- . 2>/dev/null; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + fi + ;; +esac + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# End: +# mkinstalldirs ends here diff --git a/po-man/Makefile.am b/po-man/Makefile.am new file mode 100644 index 0000000..cb531af --- /dev/null +++ b/po-man/Makefile.am @@ -0,0 +1,101 @@ + +# *.po and *.pot are kept in VCS and generated by po4a-dist command +# translated/* are put in distribution but not found in VCS +# +# run: +# rm po-man/man.stamp +# make -C po-man man.stamp +# To update man page translations + +src_MANS = $(wildcard $(top_srcdir)/man/*.[1-9]) + +translated_MANS = $(wildcard translated/*/*.[1-9]) +translated_MAN_sections=$(subst .,,$(sort $(suffix $(translated_MANS)))) + +translated_langs = $(notdir $(wildcard translated/*)) + + +EXTRA_DIST = po4a.cfg \ + procps-man.pot \ + $(translated_MANS) + +# Extract the list of languages from the po4a config file. +LINGUAS_DIST = $(shell sed -ne 's/^.*\[po4a_langs\] \(.*\)$$/\1/p' $(srcdir)/po4a.cfg) + +# If the user has not defined it let's use the default. +LINGUAS ?= $(LINGUAS_DIST) + +PO4A_V = $(PO4A_V_@AM_V@) +PO4A_V_ = $(PO4A_V_@AM_DEFAULT_V@) +PO4A_V_0 = @echo " PO4A $@"; + +PO4A_OPTS = --srcdir $(srcdir) --destdir $(CURDIR) \ + --package-name $(PACKAGE) --package-version $(VERSION) \ + --msgid-bugs-address "Procps list " + +all-local: all-local-@USE_PO4A@ + +all-local-no: +all-local-yes: man.stamp + +# FIXME: Use a stamp file until po4a supports them internally. +man.stamp: + $(PO4A_V) $(PO4A) $(PO4A_OPTS) $(srcdir)/po4a.cfg + $(AM_V_at) touch $@ + +clean-local: clean-local-@USE_PO4A@ + +clean-local-no: +clean-local-yes: + rm -rf $(LINGUAS_DIST) + $(AM_V_at) rm -f man.stamp + +.PHONY: update-po + +procps-man.pot: $(src_MANS) +# parafiles = $(patsubst %,-m%,$(subst :, ,$(src_MANS))) +# parafiles = $(src_MANS:doc=Ente) + po4a-gettextize -M utf8 --option groff_code=verbatim --option generated --option untranslated="a.RE,\|" --option unknown_macros=untranslated -f man $(patsubst %,-m%,$(subst :, ,$(src_MANS))) -p $@ + +update-po: + $(PO4A_V) $(PO4A) $(PO4A_OPTS) --force $(srcdir)/po4a.cfg + + +install-data-local: + for lang in $(LINGUAS) ; do \ + files=""; \ + for trans in $(notdir $(src_MANS)); do \ + if [ -f $(CURDIR)/$$lang/$$trans ]; then \ + files="$$files $(CURDIR)/$$lang/$$trans"; \ + elif [ -f $(srcdir)/$$lang/$$trans ]; then \ + files="$$files $(srcdir)/$$lang/$$trans"; \ + fi; \ + done; \ + $(MAKE) -C .. install-man \ + mandir="$(mandir)/$$lang" \ + dist_man_MANS="$$files"; \ + done + +uninstall-local: + for lang in $(LINGUAS); do \ + files=""; \ + for trans in $(notdir $(src_MANS)); do \ + if [ -f $(CURDIR)/$$lang/$$trans ]; then \ + files="$$files $(CURDIR)/$$lang/$$trans"; \ + elif [ -f $(srcdir)/$$lang/$$trans ]; then \ + files="$$files $(srcdir)/$$lang/$$trans"; \ + fi; \ + done; \ + $(MAKE) -C .. uninstall-man \ + mandir="$(mandir)/$$lang" \ + dist_man_MANS="$$files"; \ + done + +dist-hook: man.stamp + cp $(srcdir)/man.stamp $(distdir)/ + for lang in $(LINGUAS_DIST); do \ + cp $(srcdir)/$$lang.po $(distdir); \ + cp $(srcdir)/$$lang.add $(distdir); \ + $(MKDIR_P) $(distdir)/$$lang; \ + cp -r $(srcdir)/$$lang $(distdir)/; \ + done diff --git a/po-man/Makefile.in b/po-man/Makefile.in new file mode 100644 index 0000000..6c7e67c --- /dev/null +++ b/po-man/Makefile.in @@ -0,0 +1,575 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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@ + +# *.po and *.pot are kept in VCS and generated by po4a-dist command +# translated/* are put in distribution but not found in VCS +# +# run: +# rm po-man/man.stamp +# make -C po-man man.stamp +# To update man page translations +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 = po-man +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +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 $(top_srcdir)/mkinstalldirs +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEJAGNU = @DEJAGNU@ +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@ +ELOGIND_CFLAGS = @ELOGIND_CFLAGS@ +ELOGIND_LIBS = @ELOGIND_LIBS@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +HARDEN_CFLAGS = @HARDEN_CFLAGS@ +HARDEN_LDFLAGS = @HARDEN_LDFLAGS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +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@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NCURSES_CFLAGS = @NCURSES_CFLAGS@ +NCURSES_LIBS = @NCURSES_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PO4A = @PO4A@ +POSUB = @POSUB@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@ +SYSTEMD_LIBS = @SYSTEMD_LIBS@ +USE_NLS = @USE_NLS@ +USE_PO4A = @USE_PO4A@ +VERSION = @VERSION@ +WITH_COLORWATCH = @WITH_COLORWATCH@ +WITH_WATCH8BIT = @WITH_WATCH8BIT@ +XGETTEXT = @XGETTEXT@ +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@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrbin_execdir = @usrbin_execdir@ +src_MANS = $(wildcard $(top_srcdir)/man/*.[1-9]) +translated_MANS = $(wildcard translated/*/*.[1-9]) +translated_MAN_sections = $(subst .,,$(sort $(suffix $(translated_MANS)))) +translated_langs = $(notdir $(wildcard translated/*)) +EXTRA_DIST = po4a.cfg \ + procps-man.pot \ + $(translated_MANS) + + +# Extract the list of languages from the po4a config file. +LINGUAS_DIST = $(shell sed -ne 's/^.*\[po4a_langs\] \(.*\)$$/\1/p' $(srcdir)/po4a.cfg) +PO4A_V = $(PO4A_V_@AM_V@) +PO4A_V_ = $(PO4A_V_@AM_DEFAULT_V@) +PO4A_V_0 = @echo " PO4A $@"; +PO4A_OPTS = --srcdir $(srcdir) --destdir $(CURDIR) \ + --package-name $(PACKAGE) --package-version $(VERSION) \ + --msgid-bugs-address "Procps list " + +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) --foreign po-man/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign po-man/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__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + 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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(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 +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: + +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 + +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 + +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 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 mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am uninstall-local + +.PRECIOUS: Makefile + + +# If the user has not defined it let's use the default. +LINGUAS ?= $(LINGUAS_DIST) + +all-local: all-local-@USE_PO4A@ + +all-local-no: +all-local-yes: man.stamp + +# FIXME: Use a stamp file until po4a supports them internally. +man.stamp: + $(PO4A_V) $(PO4A) $(PO4A_OPTS) $(srcdir)/po4a.cfg + $(AM_V_at) touch $@ + +clean-local: clean-local-@USE_PO4A@ + +clean-local-no: +clean-local-yes: + rm -rf $(LINGUAS_DIST) + $(AM_V_at) rm -f man.stamp + +.PHONY: update-po + +procps-man.pot: $(src_MANS) +# parafiles = $(patsubst %,-m%,$(subst :, ,$(src_MANS))) +# parafiles = $(src_MANS:doc=Ente) + po4a-gettextize -M utf8 --option groff_code=verbatim --option generated --option untranslated="a.RE,\|" --option unknown_macros=untranslated -f man $(patsubst %,-m%,$(subst :, ,$(src_MANS))) -p $@ + +update-po: + $(PO4A_V) $(PO4A) $(PO4A_OPTS) --force $(srcdir)/po4a.cfg + +install-data-local: + for lang in $(LINGUAS) ; do \ + files=""; \ + for trans in $(notdir $(src_MANS)); do \ + if [ -f $(CURDIR)/$$lang/$$trans ]; then \ + files="$$files $(CURDIR)/$$lang/$$trans"; \ + elif [ -f $(srcdir)/$$lang/$$trans ]; then \ + files="$$files $(srcdir)/$$lang/$$trans"; \ + fi; \ + done; \ + $(MAKE) -C .. install-man \ + mandir="$(mandir)/$$lang" \ + dist_man_MANS="$$files"; \ + done + +uninstall-local: + for lang in $(LINGUAS); do \ + files=""; \ + for trans in $(notdir $(src_MANS)); do \ + if [ -f $(CURDIR)/$$lang/$$trans ]; then \ + files="$$files $(CURDIR)/$$lang/$$trans"; \ + elif [ -f $(srcdir)/$$lang/$$trans ]; then \ + files="$$files $(srcdir)/$$lang/$$trans"; \ + fi; \ + done; \ + $(MAKE) -C .. uninstall-man \ + mandir="$(mandir)/$$lang" \ + dist_man_MANS="$$files"; \ + done + +dist-hook: man.stamp + cp $(srcdir)/man.stamp $(distdir)/ + for lang in $(LINGUAS_DIST); do \ + cp $(srcdir)/$$lang.po $(distdir); \ + cp $(srcdir)/$$lang.add $(distdir); \ + $(MKDIR_P) $(distdir)/$$lang; \ + cp -r $(srcdir)/$$lang $(distdir)/; \ + done + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/po-man/de.po b/po-man/de.po new file mode 100644 index 0000000..70992b7 --- /dev/null +++ b/po-man/de.po @@ -0,0 +1,16179 @@ +# German translation of the procps man pages. +# Copyright (C) 2014 Free Software Foundation, Inc. +# This file is distributed under the same license as the procps-ng package. +# +# Martin Eberhard Schauer , 2010. +# Tobias Quathamer , 2011, 2012, 2014. +# Mario Blättermann , 2014, 2019, 2021-2023. +msgid "" +msgstr "" +"Project-Id-Version: procps-ng-man-4.0.4-rc1\n" +"Report-Msgid-Bugs-To: Procps list \n" +"POT-Creation-Date: 2023-08-19 17:38+1000\n" +"PO-Revision-Date: 2023-08-20 17:36+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" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Lokalize 23.04.3\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. type: TH +#: ../man/free.1:14 +#, no-wrap +msgid "FREE" +msgstr "FREE" + +#. type: TH +#: ../man/free.1:14 +#, no-wrap +msgid "2023-05-02" +msgstr "2. Mai 2023" + +#. type: TH +#: ../man/free.1:14 ../man/kill.1:12 ../man/pgrep.1:13 ../man/pmap.1:19 +#: ../man/pwdx.1:12 ../man/skill.1:12 ../man/slabtop.1:14 ../man/sysctl.8:14 +#: ../man/sysctl.conf.5:13 ../man/tload.1:12 ../man/uptime.1:13 +#: ../man/vmstat.8:13 ../man/w.1:14 ../man/watch.1:13 ../man/ps.1:13 +#: ../man/top.1:62 +#, no-wrap +msgid "procps-ng" +msgstr "procps-ng" + +#. type: TH +#: ../man/free.1:14 ../man/kill.1:12 ../man/pgrep.1:13 ../man/pidof.1:13 +#: ../man/pmap.1:19 ../man/pwdx.1:12 ../man/skill.1:12 ../man/slabtop.1:14 +#: ../man/tload.1:12 ../man/uptime.1:13 ../man/w.1:14 ../man/watch.1:13 +#: ../man/ps.1:13 ../man/top.1:62 +#, no-wrap +msgid "User Commands" +msgstr "Dienstprogramme für Benutzer" + +#. type: SH +#: ../man/free.1:15 ../man/kill.1:13 ../man/pgrep.1:14 ../man/pidof.1:14 +#: ../man/pmap.1:20 ../man/pwdx.1:13 ../man/skill.1:13 ../man/slabtop.1:15 +#: ../man/sysctl.8:15 ../man/sysctl.conf.5:14 ../man/tload.1:13 +#: ../man/uptime.1:14 ../man/vmstat.8:14 ../man/w.1:15 ../man/watch.1:14 +#: ../man/ps.1:27 ../man/top.1:67 ../man/procps.3:15 ../man/procps_misc.3:15 +#: ../man/procps_pids.3:15 +#, no-wrap +msgid "NAME" +msgstr "BEZEICHNUNG" + +#. type: Plain text +#: ../man/free.1:17 +msgid "free - Display amount of free and used memory in the system" +msgstr "free - Anzeige des freien und belegten Speichers" + +#. type: SH +#: ../man/free.1:17 ../man/kill.1:15 ../man/pgrep.1:16 ../man/pidof.1:16 +#: ../man/pmap.1:22 ../man/pwdx.1:15 ../man/skill.1:15 ../man/slabtop.1:17 +#: ../man/sysctl.8:17 ../man/tload.1:15 ../man/uptime.1:16 ../man/vmstat.8:16 +#: ../man/w.1:17 ../man/watch.1:16 ../man/ps.1:29 ../man/top.1:72 +#: ../man/procps.3:18 ../man/procps_misc.3:17 ../man/procps_pids.3:18 +#, no-wrap +msgid "SYNOPSIS" +msgstr "ÜBERSICHT" + +#. type: Plain text +#: ../man/free.1:20 +msgid "B [I]" +msgstr "B [I]" + +#. type: SH +#: ../man/free.1:20 ../man/kill.1:18 ../man/pgrep.1:25 ../man/pidof.1:30 +#: ../man/pmap.1:25 ../man/skill.1:25 ../man/slabtop.1:20 ../man/sysctl.8:23 +#: ../man/sysctl.conf.5:16 ../man/tload.1:18 ../man/uptime.1:19 +#: ../man/vmstat.8:20 ../man/w.1:20 ../man/watch.1:19 ../man/ps.1:31 +#: ../man/ps.1:1002 ../man/top.1:77 ../man/procps.3:67 ../man/procps_misc.3:49 +#: ../man/procps_pids.3:61 +#, no-wrap +msgid "DESCRIPTION" +msgstr "BESCHREIBUNG" + +#. type: Plain text +#: ../man/free.1:26 +msgid "B displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches used by the kernel. The information is gathered by parsing /proc/meminfo. The displayed columns are:" +msgstr "B zeigt den gesamten freien und genutzten physischen Speicher und Auslagerungsspeicher im System sowie die vom Kernel verwendeten Puffer und Zwischenspeicher an. Die Informationen werden durch Auslesen von /proc/meminfo ermittelt. Folgende Spalten werden angezeigt:" + +#. type: TP +#: ../man/free.1:26 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/free.1:30 +msgid "Total usable memory (MemTotal and SwapTotal in /proc/meminfo). This includes the physical and swap memory minus a few reserved bits and kernel binary code." +msgstr "Gesamter nutzbarer Speicher (MemTotal und SwapTotal in /proc/meminfo). Dies umfasst den physischen und den Auslagerungsspeicher, abzüglich reservierter Bits und Kernel-Binärcode." + +#. type: TP +#: ../man/free.1:30 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/free.1:33 +msgid "Used or unavailable memory (calculated as B - B)" +msgstr "Benutzter oder nicht verfügbarer Speicher (errechnet durch B minus B)" + +#. type: TP +#: ../man/free.1:33 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/free.1:36 +msgid "Unused memory (MemFree and SwapFree in /proc/meminfo)" +msgstr "Ungenutzter Speicher (MemFree und SwapFree in /proc/meminfo)" + +#. type: TP +#: ../man/free.1:36 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/free.1:39 +msgid "Memory used (mostly) by tmpfs (Shmem in /proc/meminfo)" +msgstr "(Meist) von Tmpfs genutzter Speicher (Shmem in /proc/meminfo)" + +#. type: TP +#: ../man/free.1:39 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/free.1:42 +msgid "Memory used by kernel buffers (Buffers in /proc/meminfo)" +msgstr "Von den Kernel-Puffern genutzter Speicher (Buffers in /proc/meminfo)" + +#. type: TP +#: ../man/free.1:42 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/free.1:45 +msgid "Memory used by the page cache and slabs (Cached and SReclaimable in /proc/meminfo)" +msgstr "Vom Page-Cache und Slabs genutzter Speicher (Cached und SReclaimable in /proc/meminfo)" + +#. type: TP +#: ../man/free.1:45 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/free.1:48 +msgid "Sum of B and B" +msgstr "Summe von B und B" + +#. type: TP +#: ../man/free.1:48 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/free.1:57 +msgid "Estimation of how much memory is available for starting new applications, without swapping. Unlike the data provided by the B or B fields, this field takes into account page cache and also that not all reclaimable memory slabs will be reclaimed due to items being in use (MemAvailable in /proc/meminfo, available on kernels 3.14, emulated on kernels 2.6.27+, otherwise the same as B)" +msgstr "Schätzung des zum Starten neuer Anwendungen verfügbaren Speichers, ohne den Auslagerungsspeicher zu nutzen. Im Gegensatz zu den in den Feldern B oder B angezeigten Daten bezieht dieses Feld den Page-Cache mit ein, und beachtet außerdem, dass nicht alle beanspruchbaren Speicher-Slabs durch in Verwendung befindliche Objekte auch wirklich beansprucht werden. (MemAvailable in /proc/meminfo, verfügbar ab Kernel 3.14, emuliert in Kernel 2.6.27 und neuer, anderenfalls gleichbedeutend mit B)" + +#. type: SH +#: ../man/free.1:57 ../man/kill.1:34 ../man/pgrep.1:53 ../man/pidof.1:34 +#: ../man/pmap.1:29 ../man/pwdx.1:18 ../man/skill.1:42 ../man/slabtop.1:25 +#: ../man/tload.1:25 ../man/uptime.1:36 ../man/vmstat.8:29 ../man/watch.1:26 +#, no-wrap +msgid "OPTIONS" +msgstr "OPTIONEN" + +#. type: TP +#: ../man/free.1:58 +#, no-wrap +msgid "B<-b>, B<--bytes>" +msgstr "B<-b>, B<--bytes>" + +#. type: Plain text +#: ../man/free.1:61 +msgid "Display the amount of memory in bytes." +msgstr "zeigt die Speichergröße in Byte an." + +#. type: TP +#: ../man/free.1:61 +#, no-wrap +msgid "B<-k>, B<--kibi>" +msgstr "B<-k>, B<--kibi>" + +#. type: Plain text +#: ../man/free.1:64 +msgid "Display the amount of memory in kibibytes. This is the default." +msgstr "zeigt die Speichergröße in Kibibyte an. Das ist die Voreinstellung." + +#. type: TP +#: ../man/free.1:64 +#, no-wrap +msgid "B<-m>, B<--mebi>" +msgstr "B<-m>, B<--mebi>" + +#. type: Plain text +#: ../man/free.1:67 +msgid "Display the amount of memory in mebibytes." +msgstr "zeigt die Speichergröße in Mebibyte an." + +#. type: TP +#: ../man/free.1:67 +#, no-wrap +msgid "B<-g>, B<--gibi>" +msgstr "B<-g>, B<--gibi>" + +#. type: Plain text +#: ../man/free.1:70 +msgid "Display the amount of memory in gibibytes." +msgstr "zeigt die Speichergröße in Gibibyte an." + +#. type: TP +#: ../man/free.1:70 +#, no-wrap +msgid "B<--tebi>" +msgstr "B<--tebi>" + +#. type: Plain text +#: ../man/free.1:73 +msgid "Display the amount of memory in tebibytes." +msgstr "zeigt die Speichergröße in Tebibyte an." + +#. type: TP +#: ../man/free.1:73 +#, no-wrap +msgid "B<--pebi>" +msgstr "B<--pebi>" + +#. type: Plain text +#: ../man/free.1:76 +msgid "Display the amount of memory in pebibytes." +msgstr "Zeigt die Speichergröße in Pebibyte an." + +#. type: TP +#: ../man/free.1:76 +#, no-wrap +msgid "B<--kilo>" +msgstr "B<--kilo>" + +#. type: Plain text +#: ../man/free.1:79 +msgid "Display the amount of memory in kilobytes. Implies --si." +msgstr "zeigt die Speichergröße in Kilobyte an. Impliziert --si." + +#. type: TP +#: ../man/free.1:79 +#, no-wrap +msgid "B<--mega>" +msgstr "B<--mega>" + +#. type: Plain text +#: ../man/free.1:82 +msgid "Display the amount of memory in megabytes. Implies --si." +msgstr "zeigt die Speichergröße in Megabyte an. Impliziert --si." + +#. type: TP +#: ../man/free.1:82 +#, no-wrap +msgid "B<--giga>" +msgstr "B<--giga>" + +#. type: Plain text +#: ../man/free.1:85 +msgid "Display the amount of memory in gigabytes. Implies --si." +msgstr "zeigt die Speichergröße in Gigabyte an. Impliziert --si." + +#. type: TP +#: ../man/free.1:85 +#, no-wrap +msgid "B<--tera>" +msgstr "B<--tera>" + +#. type: Plain text +#: ../man/free.1:88 +msgid "Display the amount of memory in terabytes. Implies --si." +msgstr "zeigt die Speichergröße in Terabyte an. Impliziert --si." + +#. type: TP +#: ../man/free.1:88 +#, no-wrap +msgid "B<--peta>" +msgstr "B<--peta>" + +#. type: Plain text +#: ../man/free.1:91 +msgid "Display the amount of memory in petabytes. Implies --si." +msgstr "zeigt die Speichergröße in Petabyte an. Impliziert --si." + +#. type: TP +#: ../man/free.1:91 +#, no-wrap +msgid "B<-h>, B<--human>" +msgstr "B<-h>, B<--human>" + +#. type: Plain text +#: ../man/free.1:95 +msgid "Show all output fields automatically scaled to shortest three digit unit and display the units of print out. Following units are used." +msgstr "Alle angezeigten Felder werden automatisch auf die kleinste Einheit mit drei Ziffern skaliert. Die Einheiten werden in der Ausgabe angezeigt. Es werden die folgenden Einheiten verwendet." + +#. type: Plain text +#: ../man/free.1:103 +#, no-wrap +msgid "" +" B = bytes\n" +" Ki = kibibyte\n" +" Mi = mebibyte\n" +" Gi = gibibyte\n" +" Ti = tebibyte\n" +" Pi = pebibyte\n" +msgstr "" +" B = Byte\n" +" Ki = Kibibyte\n" +" Mi = Mebibyte\n" +" Gi = Gibibyte\n" +" Ti = Tebibyte\n" +" Pi = Pebibyte\n" + +#. type: Plain text +#: ../man/free.1:107 +msgid "If unit is missing, and you have exbibyte of RAM or swap, the number is in tebibytes and columns might not be aligned with header." +msgstr "Falls die Einheit fehlt und Sie Exbibyte an RAM oder Auslagerungsspeicher haben, wird die Zahl in Tebibyte angezeigt und die Spalten sind möglicherweise nicht an den Kopfzeilen ausgerichtet." + +#. type: TP +#: ../man/free.1:107 ../man/vmstat.8:89 +#, no-wrap +msgid "B<-w>, B<--wide>" +msgstr "B<-w>, B<--wide>" + +#. type: Plain text +#: ../man/free.1:112 +msgid "Switch to the wide mode. The wide mode produces lines longer than 80 characters. In this mode B and B are reported in two separate columns." +msgstr "wechselt in den breiten Modus. In diesem Modus können Zeilen dargestellt werden, die länger als 80 Zeichen sind. B und B werden dann in zwei separaten Spalten dargestellt." + +#. type: TP +#: ../man/free.1:112 +#, no-wrap +msgid "B<-c>, B<--count> I" +msgstr "B<-c>, B<--count> I" + +#. type: Plain text +#: ../man/free.1:119 +msgid "Display the result I times. Requires the B<-s> option." +msgstr "zeigt das Ergebnis I mal an. Erfordert die Option B<-s>." + +#. type: TP +#: ../man/free.1:119 +#, no-wrap +msgid "B<-l>, B<--lohi>" +msgstr "B<-l>, B<--lohi>" + +#. type: Plain text +#: ../man/free.1:122 +msgid "Show detailed low and high memory statistics." +msgstr "zeigt detailliert die Belegung von »low memory« und »high memory« an." + +#. type: TP +#: ../man/free.1:122 +#, no-wrap +msgid "B<-L>, B<--line>" +msgstr "B<-L>, B<--line>" + +#. type: Plain text +#: ../man/free.1:127 +msgid "Show output on a single line, often used with the B<-s> option to show memory statistics repeatedly." +msgstr "zeigt die Ausgabe in einer einzelnen Zeile an; wird oft mit der Option B<-s> verwendet, um Speicherstatistiken wiederholt anzuzeigen." + +#. type: TP +#: ../man/free.1:127 +#, no-wrap +msgid "B<-s>, B<--seconds> I" +msgstr "B<-s>, B<--seconds> I" + +#. type: Plain text +#: ../man/free.1:134 +msgid "Continuously display the result I seconds apart. You may actually specify any floating point number for I using either . or , for decimal point. B(3) is used for microsecond resolution delay times." +msgstr "Fortlaufende Aktualisierung der Anzeige nach I Sekunden. Sie können für I eine beliebige Gleitkommazahl angeben mit einem Punkt oder Komma als Dezimaltrenner angeben. Durch die Nutzung von B(3) können die Intervalle bis auf die Mikrosekunde genau festgelegt werden." + +#. type: TP +#: ../man/free.1:134 +#, no-wrap +msgid "B<--si>" +msgstr "B<--si>" + +#. type: Plain text +#: ../man/free.1:138 +msgid "Use kilo, mega, giga etc (power of 1000) instead of kibi, mebi, gibi (power of 1024)." +msgstr "verwendet Kilo, Mega, Giga usw. (Vielfache von 1000) anstelle von Kibi, Mebi, Gibi (Vielfache von 1024)." + +#. type: TP +#: ../man/free.1:138 +#, no-wrap +msgid "B<-t>, B<--total>" +msgstr "B<-t>, B<--total>" + +#. type: Plain text +#: ../man/free.1:141 +msgid "Display a line showing the column totals." +msgstr "zeigt eine Zeile mit den Spaltensummen an." + +#. type: TP +#: ../man/free.1:141 +#, no-wrap +msgid "B<-v>, B<--committed>" +msgstr "B<-v>, B<--committed>" + +#. type: Plain text +#: ../man/free.1:146 +msgid "Display a line showing the memory commit limit and amount of committed/uncommitted memory. The B column on this line will display the memory commit limit. This line is relevant if memory overcommit is disabled." +msgstr "" + +#. type: TP +#: ../man/free.1:146 ../man/w.1:63 +#, no-wrap +msgid "B<--help>" +msgstr "B<--help>" + +#. type: Plain text +#: ../man/free.1:149 +msgid "Print help." +msgstr "Hilfe ausgeben." + +#. type: TP +#: ../man/free.1:149 ../man/pgrep.1:228 ../man/pmap.1:72 ../man/pwdx.1:19 +#: ../man/skill.1:68 ../man/slabtop.1:45 ../man/sysctl.8:116 ../man/tload.1:38 +#: ../man/uptime.1:46 ../man/vmstat.8:97 ../man/w.1:72 +#, no-wrap +msgid "B<-V>, B<--version>" +msgstr "B<-V>, B<--version>" + +#. type: Plain text +#: ../man/free.1:152 ../man/skill.1:71 ../man/w.1:75 +msgid "Display version information." +msgstr "Versionsinformationen anzeigen." + +#. type: SH +#: ../man/free.1:153 ../man/slabtop.1:87 ../man/sysctl.8:171 +#: ../man/sysctl.conf.5:64 ../man/tload.1:42 ../man/uptime.1:49 ../man/w.1:88 +#: ../man/procps_misc.3:136 +#, no-wrap +msgid "FILES" +msgstr "DATEIEN" + +#. type: TP +#: ../man/free.1:154 +#, no-wrap +msgid "/proc/meminfo" +msgstr "/proc/meminfo" + +#. type: Plain text +#: ../man/free.1:157 +msgid "memory information" +msgstr "Speicherinformationen" + +#. type: SH +#: ../man/free.1:158 ../man/pgrep.1:301 ../man/pidof.1:69 ../man/tload.1:50 +#: ../man/watch.1:152 ../man/ps.1:2063 +#, no-wrap +msgid "BUGS" +msgstr "FEHLER" + +#. type: Plain text +#: ../man/free.1:161 +msgid "The value for the B column is not available from kernels before 2.6.32 and is displayed as zero." +msgstr "Der Wert der Spalte B ist für Kernel vor 2.6.32 nicht verfügbar und wird als Null angezeigt." + +#. type: TP +#: ../man/free.1:161 +#, no-wrap +msgid "Please send bug reports to" +msgstr "Bitte senden Sie Fehlermeldungen (auf Englisch) an" + +#. type: Plain text +#: ../man/free.1:165 +msgid "E<.UR procps@freelists.org> E<.UE>" +msgstr "E<.UR procps@freelists.org> E<.UE>" + +#. type: SH +#: ../man/free.1:165 ../man/kill.1:88 ../man/pgrep.1:317 ../man/pidof.1:76 +#: ../man/pmap.1:90 ../man/pwdx.1:25 ../man/skill.1:109 ../man/slabtop.1:91 +#: ../man/sysctl.8:185 ../man/sysctl.conf.5:83 ../man/tload.1:45 +#: ../man/uptime.1:66 ../man/vmstat.8:191 ../man/w.1:95 ../man/ps.1:2070 +#: ../man/procps.3:182 ../man/procps_misc.3:153 ../man/procps_pids.3:207 +#, no-wrap +msgid "SEE ALSO" +msgstr "SIEHE AUCH" + +#. type: Plain text +#: ../man/free.1:169 +msgid "B(1), B(1), B(1), B(8)." +msgstr "B(1), B(1), B(1), B(8)." + +#. type: TH +#: ../man/kill.1:12 +#, no-wrap +msgid "KILL" +msgstr "KILL" + +#. type: TH +#: ../man/kill.1:12 ../man/pgrep.1:13 ../man/pidof.1:13 +#, no-wrap +msgid "2023-01-16" +msgstr "16. Januar 2023" + +#. type: Plain text +#: ../man/kill.1:15 +msgid "kill - send a signal to a process" +msgstr "kill - ein Signal an einen Prozess senden" + +#. type: Plain text +#: ../man/kill.1:18 +msgid "B [options] EpidE [...]" +msgstr "B [Optionen] EProzesskennungE […]" + +#. type: Plain text +#: ../man/kill.1:34 +msgid "The default signal for kill is TERM. Use B<-l> or B<-L> to list available signals. Particularly useful signals include HUP, INT, KILL, STOP, CONT, and 0. Alternate signals may be specified in three ways: B<-9>, B<-SIGKILL> or B<-KILL>. Negative PID values may be used to choose whole process groups; see the PGID column in ps command output. A PID of B<-1> is special; it indicates all processes except the kill process itself and init." +msgstr "Das Standardsignal für B ist TERM. Mit B<-l> oder B<-L> können Sie die verfügbaren Signale auflisten. Im einzelnen sind HUP, INT, KILL, STOP, CONT und 0 nützliche Signale. Alternative Signale können auf drei Arten angegeben werden: B<-9>, B<-SIGKILL> oder B<-KILL>. Negative Werte für die Prozesskennung können verwendet werden, um ganze Prozessgruppen auszuwählen; siehe die Spalte PGID der Ausgabe des Befehls B. Eine Prozesskennung von B<-1> ist besonders. Sie bezeichnet alle Prozesse außer B und den B-Prozess selbst." + +#. type: TP +#: ../man/kill.1:35 +#, no-wrap +msgid "BpidE [...]>" +msgstr "BProzesskennungE […]>" + +#. type: Plain text +#: ../man/kill.1:38 +msgid "Send signal to every EpidE listed." +msgstr "sendet das Signal an alle aufgelisteten EProzesskennungenE." + +#. type: TP +#: ../man/kill.1:38 +#, no-wrap +msgid "B<-EsignalE>" +msgstr "B<-ESignalE>" + +#. type: TQ +#: ../man/kill.1:40 +#, no-wrap +msgid "B<-s EsignalE>" +msgstr "B<-s ESignalE>" + +#. type: TQ +#: ../man/kill.1:42 +#, no-wrap +msgid "B<--signal EsignalE>" +msgstr "B<--signal ESignalE>" + +#. type: Plain text +#: ../man/kill.1:50 +msgid "Specify the B to be sent. The signal can be specified by using name or number. The behavior of signals is explained in B(7) manual page." +msgstr "gibt das zu sendende B an. Es kann als Name oder Nummer angegeben werden. Das Verhalten der Signale ist in der Handbuchseite zu B(7) beschrieben." + +#. type: TP +#: ../man/kill.1:50 ../man/pgrep.1:216 +#, no-wrap +msgid "B<-q>, B<--queue >I" +msgstr "B<-q>, B<--queue >I" + +# FIXME Formatting +#. type: Plain text +#: ../man/kill.1:62 ../man/pgrep.1:228 +msgid "Use B(3) rather than B(2) and the value argument is used to specify an integer to be sent with the signal. If the receiving process has installed a handler for this signal using the SA_SIGINFO flag to B(2), then it can obtain this data via the si_value field of the siginfo_t structure." +msgstr "verwendet B(3) anstatt B(2) und das I-Argument wird zur Angabe einer Ganzzahl verwendet, die mit dem Signal gesendet wird. Falls der empfangende Prozess mit dem SA_SIGINFO-Flag für B(2) einen Handler für dieses Signal installiert hat, dann kann er diese Daten über das I-Feld der Struktur I beziehen." + +#. type: TP +#: ../man/kill.1:62 +#, no-wrap +msgid "B<-l>, B<--list> [I]" +msgstr "B<-l>, B<--list> [I]" + +#. type: Plain text +#: ../man/kill.1:66 +msgid "List signal names. This option has optional argument, which will convert signal number to signal name, or other way round." +msgstr "listet Signalnamen auf. Diese Option kann ein Argument haben, welches die Signalnummer in einen Signalnamen umwandelt oder umgekehrt." + +#. type: TP +#: ../man/kill.1:66 ../man/skill.1:52 +#, no-wrap +msgid "B<-L>,B<\\ --table>" +msgstr "B<-L>,B<\\ --table>" + +#. type: Plain text +#: ../man/kill.1:69 +msgid "List signal names in a nice table." +msgstr "listet Signalnamen in einer übersichtlichen Tabelle auf." + +#. type: SH +#: ../man/kill.1:71 ../man/pgrep.1:284 ../man/slabtop.1:96 +#: ../man/sysctl.conf.5:39 ../man/vmstat.8:185 ../man/watch.1:144 +#: ../man/ps.1:768 +#, no-wrap +msgid "NOTES" +msgstr "ANMERKUNGEN" + +#. type: Plain text +#: ../man/kill.1:75 +msgid "Your shell (command line interpreter) may have a built-in kill command. You may need to run the command described here as /bin/kill to solve the conflict." +msgstr "In Ihrer Shell (dem Befehlszeileninterpreter) könnte bereits ein Kill-Befehl eingebaut sein. In diesem Fall müssen Sie den hier beschriebenen Befehl als /bin/kill aufrufen, um den Konflikt zu umgehen." + +#. type: SH +#: ../man/kill.1:75 ../man/pgrep.1:240 ../man/skill.1:99 ../man/sysctl.8:143 +#: ../man/watch.1:191 ../man/ps.1:84 +#, no-wrap +msgid "EXAMPLES" +msgstr "BEISPIELE" + +#. type: TP +#: ../man/kill.1:76 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/kill.1:79 +msgid "Kill all processes you can kill." +msgstr "killt alle Prozesse, die gekillt werden können." + +#. type: TP +#: ../man/kill.1:79 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/kill.1:82 +msgid "Translate number 11 into a signal name." +msgstr "übersetzt die Zahl 11 in einen Signalnamen." + +#. type: TP +#: ../man/kill.1:82 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/kill.1:85 +msgid "List the available signal choices in a nice table." +msgstr "listet die Auswahl der verfügbaren Signale in einer übersichtlichen Tabelle auf." + +#. type: TP +#: ../man/kill.1:85 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/kill.1:88 +msgid "Send the default signal, SIGTERM, to all those processes." +msgstr "Sendet das Standardsignal SIGTERM an alle diese Prozesse." + +#. type: Plain text +#: ../man/kill.1:97 +msgid "B(2), B(1), B(1), B(1), B(1), B(7), B(3), B(1)" +msgstr "B(2), B(1), B(1), B(1), B(1), B(7), B(3), B(1)" + +#. type: SH +#: ../man/kill.1:97 ../man/pmap.1:93 ../man/pwdx.1:28 ../man/skill.1:117 +#: ../man/ps.1:2076 +#, no-wrap +msgid "STANDARDS" +msgstr "STANDARDS" + +#. type: Plain text +#: ../man/kill.1:101 +msgid "This command meets appropriate standards. The B<-L> flag is Linux-specific." +msgstr "Dieser Befehl erfüllt die entsprechenden Standards. Der Schalter B<-L> ist Linux-spezifisch." + +#. type: SH +#: ../man/kill.1:101 ../man/pgrep.1:327 ../man/pidof.1:79 ../man/pwdx.1:32 +#: ../man/skill.1:119 ../man/sysctl.8:189 ../man/sysctl.conf.5:85 +#: ../man/ps.1:2093 +#, no-wrap +msgid "AUTHOR" +msgstr "AUTOR" + +#. type: Plain text +#: ../man/kill.1:107 +msgid "E<.UR albert@users.sf.net> Albert Cahalan E<.UE> wrote kill in 1999 to replace a bsdutils one that was not standards compliant. The util-linux one might also work correctly." +msgstr "E<.MT albert@users.sf.net> Albert Cahalan E<.ME> schrieb B im Jahre 1999, um die Version aus den Bsdutils zu ersetzen, die nicht standardkonform war. Die Version aus Util-linux sollte ebenfalls korrekt funktionieren." + +#. type: SH +#: ../man/kill.1:107 ../man/pgrep.1:331 ../man/pmap.1:97 ../man/pwdx.1:37 +#: ../man/skill.1:125 ../man/slabtop.1:120 ../man/sysctl.8:193 +#: ../man/sysctl.conf.5:89 ../man/tload.1:66 ../man/uptime.1:71 +#: ../man/vmstat.8:199 ../man/w.1:112 ../man/watch.1:229 +#, no-wrap +msgid "REPORTING BUGS" +msgstr "FEHLER MELDEN" + +#. type: Plain text +#: ../man/kill.1:110 ../man/pgrep.1:334 ../man/pmap.1:100 ../man/pwdx.1:40 +#: ../man/skill.1:128 ../man/slabtop.1:123 ../man/sysctl.8:196 +#: ../man/sysctl.conf.5:92 ../man/tload.1:69 ../man/uptime.1:74 +#: ../man/vmstat.8:202 ../man/w.1:115 ../man/watch.1:232 +msgid "Please send bug reports to E<.UR procps@freelists.org> E<.UE>" +msgstr "Bitte schicken Sie Fehlermeldungen (auf Englisch) an E<.MT procps@freelists.org> E<.ME>" + +#. type: TH +#: ../man/pgrep.1:13 +#, no-wrap +msgid "PGREP" +msgstr "PGREP" + +#. type: Plain text +#: ../man/pgrep.1:16 +msgid "pgrep, pkill, pidwait - look up, signal, or wait for processes based on name and other attributes" +msgstr "pgrep, pkill, pidwait - Prozesse finden oder ein Signal auf Basis des Namens oder anderer Attribute senden oder auf Prozesse warten" + +#. type: Plain text +#: ../man/pgrep.1:19 +msgid "B [options] pattern" +msgstr "B [Optionen] Muster" + +#. type: Plain text +#: ../man/pgrep.1:22 +msgid "B [options] pattern" +msgstr "B [Optionen] Muster" + +#. type: Plain text +#: ../man/pgrep.1:25 +msgid "B [options] pattern" +msgstr "B [Optionen] Muster" + +#. type: Plain text +#: ../man/pgrep.1:30 +msgid "B looks through the currently running processes and lists the process IDs which match the selection criteria to stdout. All the criteria have to match. For example," +msgstr "B durchsucht die gegenwärtig laufenden Prozesse und listet die Prozesskennungen (IDs), welche den Auswahlkriterien entsprechen, in der Standardausgabe auf. Übereinstimmungen sind für alle Auswahlkriterien erforderlich. Beispielsweise listet" + +#. type: Plain text +#: ../man/pgrep.1:32 +msgid "$ pgrep -u root sshd" +msgstr "$ pgrep -u root sshd" + +#. type: Plain text +#: ../man/pgrep.1:38 +msgid "will only list the processes called B AND owned by B. On the other hand," +msgstr "nur die Prozesse auf, deren Name B lautet UND B gehören. Andererseits listet" + +#. type: Plain text +#: ../man/pgrep.1:40 +msgid "$ pgrep -u root,daemon" +msgstr "$ pgrep -u root,daemon" + +#. type: Plain text +#: ../man/pgrep.1:45 +msgid "will list the processes owned by B OR B." +msgstr "jene Prozesse auf, die entweder B ODER B gehören." + +#. type: Plain text +#: ../man/pgrep.1:50 +msgid "B will send the specified signal (by default B) to each process instead of listing them on stdout." +msgstr "B sendet das angegebene Signal (per Vorgabe B) an jeden Prozess, anstatt diese in der Standardausgabe aufzulisten." + +#. type: Plain text +#: ../man/pgrep.1:53 +msgid "B will wait for each process instead of listing them on stdout." +msgstr "B wartet auf jeden Prozess, anstatt diesen in der Standardausgabe aufzulisten." + +#. type: TP +#: ../man/pgrep.1:54 +#, no-wrap +msgid "B<->I" +msgstr "B<->I" + +#. type: TQ +#: ../man/pgrep.1:56 +#, no-wrap +msgid "B<--signal> I" +msgstr "B<--signal> I" + +#. type: Plain text +#: ../man/pgrep.1:66 +msgid "Defines the signal to send to each matched process. Either the numeric or the symbolic signal name can be used. In B or B mode only the long option can be used and has no effect unless used in conjunction with B<--require-handler> to filter to processes with a userspace signal handler present for a particular signal." +msgstr "definiert das Signal, das an jeden der passenden Prozesse gesendet werden soll. Dafür kann entweder der numerische oder ein symbolischer Signalname verwendet werden. Nur im B- oder B-Modus kann die lange Option verwendet werden. Sie ist allerdings dann wirkungslos, wenn sie nicht zusammen mit B<--require-handler> verwendet wird, um nur Prozesse anzuzeigen, für die bei einem bestimmten Signal ein Userspace-Signalhandler vorhanden ist." + +#. type: TP +#: ../man/pgrep.1:67 +#, no-wrap +msgid "B<-c>, B<--count>" +msgstr "B<-c>, B<--count>" + +#. type: Plain text +#: ../man/pgrep.1:74 +msgid "Suppress normal output; instead print a count of matching processes. When count does not match anything, e.g. returns zero, the command will return non-zero value. Note that for pkill and pidwait, the count is the number of matching processes, not the processes that were successfully signaled or waited for." +msgstr "unterdrückt normale Ausgaben und gibt stattdessen die Anzahl der passenden Prozesse aus. Wenn keine Übereinstimmungen gefunden werden, liefert der Befehl einen von 0 verschiedenen Rückgabewert. Beachten Sie, dass für B und B die Anzahl der Anzahl der passenden Prozesse entspricht und nicht der Anzahl der Prozesse, an die erfolgreich ein Signal gesendet oder auf die gewartet wurde." + +#. type: TP +#: ../man/pgrep.1:74 +#, no-wrap +msgid "B<-d>, B<--delimiter> I" +msgstr "B<-d>, B<--delimiter> I" + +#. type: Plain text +#: ../man/pgrep.1:80 +msgid "Sets the string used to delimit each process ID in the output (by default a newline). (B only.)" +msgstr "legt die in der Ausgabe als Trenner für die Prozesskennungen zu verwendende Zeichenkette fest. Vorgabe ist ein Zeilenumbruch (gilt nur für B)." + +#. type: TP +#: ../man/pgrep.1:80 +#, no-wrap +msgid "B<-e>, B<--echo>" +msgstr "B<-e>, B<--echo>" + +#. type: Plain text +#: ../man/pgrep.1:85 +msgid "Display name and PID of the process being killed. (B only.)" +msgstr "zeigt Name und Prozesskennung des zu killenden Prozesses an (nur für B)." + +#. type: TP +#: ../man/pgrep.1:85 +#, no-wrap +msgid "B<-f>, B<--full>" +msgstr "B<-f>, B<--full>" + +#. type: Plain text +#: ../man/pgrep.1:92 +msgid "The I is normally only matched against the process name. When B<-f> is set, the full command line is used." +msgstr "Das I wird normalerweise nur auf den Prozessnamen angewendet. Wenn B<-f> gesetzt ist, wird die vollständige Befehlszeile verwendet." + +#. type: TP +#: ../man/pgrep.1:92 +#, no-wrap +msgid "B<-g>, B<--pgroup> I,..." +msgstr "B<-g>, B<--pgroup> I, …" + +#. type: Plain text +#: ../man/pgrep.1:101 +msgid "Only match processes in the process group IDs listed. Process group 0 is translated into B's, B's, or B's own process group." +msgstr "sucht nur nach passenden Prozessen, die in den Prozessgruppenkennungen aufgelistet sind. Die Prozessgruppe 0 wird in die eigene Prozessgruppe von B, B oder B übersetzt." + +#. type: TP +#: ../man/pgrep.1:101 +#, no-wrap +msgid "B<-G>, B<--group> I,..." +msgstr "B<-G>, B<--group> I, …" + +#. type: Plain text +#: ../man/pgrep.1:105 +msgid "Only match processes whose real group ID is listed. Either the numerical or symbolical value may be used." +msgstr "berücksichtigt nur Prozesse, deren reale Gruppenkennung aufgelistet ist. Hier kann entweder der numerische oder der symbolische Wert verwendet werden." + +#. type: TP +#: ../man/pgrep.1:105 +#, no-wrap +msgid "B<-i>, B<--ignore-case>" +msgstr "B<-i>, B<--ignore-case>" + +#. type: Plain text +#: ../man/pgrep.1:108 +msgid "Match processes case-insensitively." +msgstr "ignoriert Groß-/Kleinschreibung bei der Suche. " + +#. type: TP +#: ../man/pgrep.1:108 +#, no-wrap +msgid "B<-l>, B<--list-name>" +msgstr "B<-l>, B<--list-name>" + +#. type: Plain text +#: ../man/pgrep.1:113 +msgid "List the process name as well as the process ID. (B only.)" +msgstr "listet sowohl den Prozessnamen als auch die Prozesskennung auf (nur für B)." + +#. type: TP +#: ../man/pgrep.1:113 +#, no-wrap +msgid "B<-a>, B<--list-full>" +msgstr "B<-a>, B<--list-full>" + +#. type: Plain text +#: ../man/pgrep.1:118 +msgid "List the full command line as well as the process ID. (B only.)" +msgstr "listet sowohl die vollständige Befehlszeile als auch die Prozesskennung auf (nur für B)." + +#. type: TP +#: ../man/pgrep.1:118 +#, no-wrap +msgid "B<-n>, B<--newest>" +msgstr "B<-n>, B<--newest>" + +#. type: Plain text +#: ../man/pgrep.1:121 +msgid "Select only the newest (most recently started) of the matching processes." +msgstr "wählt nur den neuesten (zuletzt gestarteten) aus den passenden Prozessen aus." + +#. type: TP +#: ../man/pgrep.1:121 +#, no-wrap +msgid "B<-o>, B<--oldest>" +msgstr "B<-o>, B<--oldest>" + +#. type: Plain text +#: ../man/pgrep.1:124 +msgid "Select only the oldest (least recently started) of the matching processes." +msgstr "wählt nur den ältesten (zuerst gestarteten) aus den passenden Prozessen aus." + +#. type: TP +#: ../man/pgrep.1:124 +#, no-wrap +msgid "B<-O>, B<--older> I" +msgstr "B<-O>, B<--older> I" + +#. type: Plain text +#: ../man/pgrep.1:127 +msgid "Select processes older than secs." +msgstr "wählt Prozesse aus, die älter als die angegebene Anzahl Sekunden sind." + +#. type: TP +#: ../man/pgrep.1:127 +#, no-wrap +msgid "B<-P>, B<--parent> I,..." +msgstr "B<-P>, B<--parent> I, …" + +#. type: Plain text +#: ../man/pgrep.1:130 +msgid "Only match processes whose parent process ID is listed." +msgstr "sucht nur nach Prozessen, von denen die Kennung des übergeordneten Prozesses aufgelistet ist." + +#. type: TP +#: ../man/pgrep.1:130 +#, no-wrap +msgid "B<-s>, B<--session> I,..." +msgstr "B<-s>, B<--session> I, …" + +#. type: Plain text +#: ../man/pgrep.1:139 +msgid "Only match processes whose process session ID is listed. Session ID 0 is translated into B's, B's, or B's own session ID." +msgstr "sucht nur nach passenden Prozessen, die in den Prozess-Sitzungskennungen aufgelistet ist. Die Sitzungskennung 0 wird in die eigene Prozessgruppe von B, B oder B übersetzt." + +#. type: TP +#: ../man/pgrep.1:139 +#, no-wrap +msgid "B<-t>, B<--terminal> I,..." +msgstr "B<-t>, B<--terminal> I, …" + +#. type: Plain text +#: ../man/pgrep.1:143 +msgid "Only match processes whose controlling terminal is listed. The terminal name should be specified without the \"/dev/\" prefix." +msgstr "sucht nur nach passenden Prozessen, deren steuerndes Terminal aufgelistet ist. Der Terminalname sollte ohne das Präfix »dev« angegeben werden." + +#. type: TP +#: ../man/pgrep.1:143 +#, no-wrap +msgid "B<-u>, B<--euid> I,..." +msgstr "B<-u>, B<--euid> I, …" + +#. type: Plain text +#: ../man/pgrep.1:147 +msgid "Only match processes whose effective user ID is listed. Either the numerical or symbolical value may be used." +msgstr "sucht nur nach passenden Prozessen, deren effektive Benutzerkennung aufgelistet ist. Sie können entweder numerische oder symbolische Werte verwenden." + +#. type: TP +#: ../man/pgrep.1:147 +#, no-wrap +msgid "B<-U>, B<--uid> I,..." +msgstr "B<-U>, B<--uid> I, …" + +#. type: Plain text +#: ../man/pgrep.1:151 +msgid "Only match processes whose real user ID is listed. Either the numerical or symbolical value may be used." +msgstr "sucht nur nach passenden Prozessen, deren reale Benutzerkennung aufgelistet ist. Sie können entweder numerische oder symbolische Werte verwenden." + +#. type: TP +#: ../man/pgrep.1:151 +#, no-wrap +msgid "B<-v>, B<--inverse>" +msgstr "B<-v>, B<--inverse>" + +#. type: Plain text +#: ../man/pgrep.1:160 +msgid "Negates the matching. This option is usually used in B's or B's context. In B's context the short option is disabled to avoid accidental usage of the option." +msgstr "negiert die Anwendung der Suchkriterien. Diese Option wird üblicherweise mit B oder B verwendet. In B ist die Kurzoption deaktiviert, um die zufällige Anwendung dieser Option zu vermeiden." + +#. type: TP +#: ../man/pgrep.1:160 +#, no-wrap +msgid "B<-w>, B<--lightweight>" +msgstr "B<-w>, B<--lightweight>" + +#. type: Plain text +#: ../man/pgrep.1:169 +msgid "Shows all thread ids instead of pids in B's or B's context. In B's context this option is disabled." +msgstr "zeigt bei B oder B alle Thread-Kennungen anstelle der Prozess-Kennungen an. In B ist diese Option deaktiviert." + +#. type: TP +#: ../man/pgrep.1:169 +#, no-wrap +msgid "B<-x>, B<--exact>" +msgstr "B<-x>, B<--exact>" + +# FIXME argument formatting +# FIXME line → lines +#. type: Plain text +#: ../man/pgrep.1:175 +msgid "Only match processes whose names (or command lines if B<-f> is specified) B match the I." +msgstr "sucht nur nach passenden Prozessen, deren Namen (oder Befehlszeilen, falls B<-f> angegeben ist) B dem I entsprechen." + +#. type: TP +#: ../man/pgrep.1:175 +#, no-wrap +msgid "B<-F>, B<--pidfile> I" +msgstr "B<-F>, B<--pidfile> I" + +# FIXME I's → Is +#. type: Plain text +#: ../man/pgrep.1:183 +msgid "Read Is from I. This option is more useful for B or B than B." +msgstr "liest die I aus einer I. Diese Option ist eher für B oder B als für B sinnvoll." + +#. type: TP +#: ../man/pgrep.1:183 +#, no-wrap +msgid "B<-L>, B<--logpidfile>" +msgstr "B<-L>, B<--logpidfile>" + +# FIXME argument formatting +#. type: Plain text +#: ../man/pgrep.1:186 +msgid "Fail if pidfile (see B<-F>) not locked." +msgstr "schlägt fehl, wenn die PID-Datei (siehe B<-F>) nicht gesperrt ist." + +#. type: TP +#: ../man/pgrep.1:186 +#, no-wrap +msgid "B<-r>, B<--runstates> I..." +msgstr "B<-r>, B<--runstates> I …" + +#. type: Plain text +#: ../man/pgrep.1:189 +msgid "Match only processes which match the process state." +msgstr "sucht nur nach Prozessen, die diesem Prozessstatus entsprechen." + +#. type: TP +#: ../man/pgrep.1:189 +#, no-wrap +msgid "B<-A>, B<--ignore-ancestors>" +msgstr "B<-A>, B<--ignore-ancestors>" + +#. type: Plain text +#: ../man/pgrep.1:199 +msgid "Ignore all ancestors of B, B, or B. For example, this can be useful when elevating with B or similar tools." +msgstr "ignoriert alle Vorgänger von B, B oder B. Dies kann beispielsweise in Verbindung mit B oder ähnlichen Werkzeugen nützlich sein." + +#. type: TP +#: ../man/pgrep.1:199 +#, no-wrap +msgid "B<-H>, B<--require-handler>" +msgstr "B<-H>, B<--require-handler>" + +#. type: Plain text +#: ../man/pgrep.1:203 +msgid "Only match processes with a userspace signal handler present for the signal to be sent." +msgstr "sucht nur nach Prozessen, für die für das zu sendende Signal ein Userspace-Signalhandler vorhanden ist." + +#. type: TP +#: ../man/pgrep.1:203 +#, no-wrap +msgid "B<--cgroup >IB<,...>" +msgstr "B<--cgroup >IB<,…>" + +#. type: Plain text +#: ../man/pgrep.1:207 +msgid "Match on provided control group (cgroup) v2 name. See B(8)" +msgstr "" + +#. type: TP +#: ../man/pgrep.1:207 ../man/skill.1:87 +#, no-wrap +msgid "B<--ns >I" +msgstr "B<--ns >I" + +# FIXME argument formatting +#. type: Plain text +#: ../man/pgrep.1:212 +msgid "Match processes that belong to the same namespaces. Required to run as root to match processes from other users. See B<--nslist> for how to limit which namespaces to match." +msgstr "sucht nach passenden Prozessen, die zu den gleichen Namensräumen gehören. Um Prozesse anderer Benutzer zu finden, sind Root-Rechte erforderlich. In B<--nslist> finden Sie Informationen, wie Sie die Übereinstimmungen im Zusammenhang mit Namensräumen begrenzen können." + +#. type: TP +#: ../man/pgrep.1:212 +#, no-wrap +msgid "B<--nslist >IB<,...>" +msgstr "B<--nslist >IB<, …>" + +#. type: Plain text +#: ../man/pgrep.1:216 +msgid "Match only the provided namespaces. Available namespaces: ipc, mnt, net, pid, user, uts." +msgstr "sucht nur in den angegebenen Namensräumen nach Übereinstimmungen. Verfügbare Namensräume: ipc, mnt, net, pid, user, uts." + +#. type: Plain text +#: ../man/pgrep.1:231 ../man/pmap.1:75 ../man/slabtop.1:48 ../man/sysctl.8:119 +#: ../man/tload.1:41 ../man/vmstat.8:100 ../man/watch.1:100 +msgid "Display version information and exit." +msgstr "zeigt Versionsinformationen an und beendet das Programm." + +#. type: TP +#: ../man/pgrep.1:231 ../man/pmap.1:69 ../man/pwdx.1:22 ../man/skill.1:65 +#: ../man/slabtop.1:48 ../man/sysctl.8:113 ../man/tload.1:35 +#: ../man/uptime.1:40 ../man/vmstat.8:100 ../man/watch.1:94 +#, no-wrap +msgid "B<-h>, B<--help>" +msgstr "B<-h>, B<--help>" + +#. type: Plain text +#: ../man/pgrep.1:234 ../man/vmstat.8:103 +msgid "Display help and exit." +msgstr "zeigt eine Hilfe an und beendet das Programm." + +#. type: SH +#: ../man/pgrep.1:235 +#, no-wrap +msgid "OPERANDS" +msgstr "OPERANDEN" + +#. type: TP +#: ../man/pgrep.1:236 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/pgrep.1:240 +msgid "Specifies an Extended Regular Expression for matching against the process names or command lines." +msgstr "gibt einen erweiterten regulären Ausdruck für die Übereinstimmungen von Prozessnamen oder Befehlszeilen an." + +#. type: Plain text +#: ../man/pgrep.1:244 +msgid "Example 1: Find the process ID of the B daemon:" +msgstr "Beispiel 1: Prozesskennung des B-Daemons suchen:" + +#. type: Plain text +#: ../man/pgrep.1:246 +msgid "$ pgrep -u root named" +msgstr "$ pgrep -u root named" + +#. type: Plain text +#: ../man/pgrep.1:250 +msgid "Example 2: Make B reread its configuration file:" +msgstr "Beispiel 2: B veranlassen, seine Konfigurationsdatei neu einzulesen:" + +#. type: Plain text +#: ../man/pgrep.1:252 +msgid "$ pkill -HUP syslogd" +msgstr "$ pkill -HUP syslogd" + +#. type: Plain text +#: ../man/pgrep.1:256 +msgid "Example 3: Give detailed information on all B processes:" +msgstr "Beispiel 3: Detaillierte Informationen zu allen B-Prozessen ausgeben:" + +#. type: Plain text +#: ../man/pgrep.1:258 +msgid "$ ps -fp $(pgrep -d, -x xterm)" +msgstr "$ ps -fp $(pgrep -d, -x xterm)" + +#. type: Plain text +#: ../man/pgrep.1:262 +msgid "Example 4: Make all B processes run nicer:" +msgstr "Beispiel 4: Den Nice-Wert für alle B-Prozesse erhöhen:" + +#. type: Plain text +#: ../man/pgrep.1:264 +msgid "$ renice +4 $(pgrep chrome)" +msgstr "$ renice +4 $(pgrep chrome)" + +#. type: SH +#: ../man/pgrep.1:264 ../man/pidof.1:61 ../man/pmap.1:75 ../man/watch.1:100 +#, no-wrap +msgid "EXIT STATUS" +msgstr "EXIT-STATUS" + +#. type: TP +#: ../man/pgrep.1:266 +#, no-wrap +msgid "0" +msgstr "0" + +#. type: Plain text +#: ../man/pgrep.1:274 +msgid "One or more processes matched the criteria. For B and B, one or more processes must also have been successfully signalled or waited for." +msgstr "Einer oder mehrere Prozesse entsprechen dem Kriterium. Für B und B muss auch ein Signal erfolgreich an einen oder mehrere Prozesse gesendet oder auf sie gewartet worden sein." + +#. type: IP +#: ../man/pgrep.1:274 ../man/ps.1:43 ../man/ps.1:818 ../man/ps.1:2082 +#, no-wrap +msgid "1" +msgstr "1" + +#. type: Plain text +#: ../man/pgrep.1:277 +msgid "No processes matched or none of them could be signalled." +msgstr "Es wurden keine passenden Prozesse gefunden oder an keine von ihnen konnte ein Signal gesendet werden." + +#. type: IP +#: ../man/pgrep.1:277 ../man/ps.1:45 ../man/ps.1:2084 +#, no-wrap +msgid "2" +msgstr "2" + +#. type: Plain text +#: ../man/pgrep.1:280 +msgid "Syntax error in the command line." +msgstr "Syntaxfehler in der Befehlszeile." + +#. type: IP +#: ../man/pgrep.1:280 ../man/ps.1:47 ../man/ps.1:2086 +#, no-wrap +msgid "3" +msgstr "3" + +#. type: Plain text +#: ../man/pgrep.1:283 +msgid "Fatal error: out of memory etc." +msgstr "Schwerwiegender Fehler: Speicher ausgeschöpft usw." + +# FIXME argument formatting +#. type: Plain text +#: ../man/pgrep.1:289 +msgid "The process name used for matching is limited to the 15 characters present in the output of /proc/I/stat. Use the B<-f> option to match against the complete command line, /proc/I/cmdline. Threads may not have the same process name as the parent process but will have the same command line." +msgstr "Der für die Suche verwendete Prozessname ist auf die 15 Zeichen in der Ausgabe von /proc/I/stat beschränkt. Verwenden Sie die Option B<-f>, um stattdessen Übereinstimmungen in der gesamten Befehlszeile (/proc/I/cmdline) zu suchen. Threads könnten nicht den gleichen Prozessnamen wie der Elternprozess haben, wohl aber die gleiche Befehlszeile." + +#. type: Plain text +#: ../man/pgrep.1:297 +msgid "The running B, B, or B process will never report itself as a match." +msgstr "Die laufenden B-, B- oder B-Prozesse werden niemals selbst als Treffer gemeldet." + +#. type: Plain text +#: ../man/pgrep.1:301 +msgid "The B<-O --older> option will silently fail if I is mounted with the I option." +msgstr "Die Option B<-O --older> wird stillschweigend fehlschlagen, falls I mit der Option I eingehängt ist." + +#. type: Plain text +#: ../man/pgrep.1:310 +msgid "The options B<-n> and B<-o> and B<-v> can not be combined. Let me know if you need to do this." +msgstr "Die Optionen B<-n>, B<-o> und B<-v> können nicht kombiniert werden. Bitte informieren Sie die Entwickler, falls das für Ihre Zwecke nötig sein sollte." + +#. type: Plain text +#: ../man/pgrep.1:312 +msgid "Defunct processes are reported." +msgstr "Bereits beendete Prozesse werden gemeldet." + +#. type: Plain text +#: ../man/pgrep.1:317 +msgid "B requires the B(2) system call which first appeared in Linux 5.3." +msgstr "B erfordert den Systemaufruf B(2), der zuerst in Linux 5.3 erschien." + +#. type: Plain text +#: ../man/pgrep.1:327 +msgid "B(1), B(7), B(7), B(3), B(1), B(1), B(1), B(2), B(8)." +msgstr "B(1), B(7), B(7), B(3), B(1), B(1), B(1), B(2), B(8)" + +#. type: Plain text +#: ../man/pgrep.1:331 +msgid "E<.UR kjetilho@ifi.uio.no> Kjetil Torgrim Homme E<.UE>" +msgstr "E<.UR kjetilho@ifi.uio.no> Kjetil Torgrim Homme E<.UE>" + +#. type: TH +#: ../man/pidof.1:13 +#, no-wrap +msgid "PIDOF" +msgstr "PIDOF" + +# FIXME Satzpunkt +#. type: Plain text +#: ../man/pidof.1:16 +msgid "pidof - find the process ID of a running program" +msgstr "pidof - die Prozesskennung eines laufenden Programms ermitteln" + +# FIXME .. → … +#. type: Plain text +#: ../man/pidof.1:30 +msgid "B [B<-s>] [B<-c>] [B<-q>] [B<-w>] [B<-x>] [B<-o> I] [B<-t>] [B<-S> I] I I<[>BI<]>" +msgstr "B [B<-s>] [B<-c>] [B<-q>] [B<-w>] [B<-x>] [B<-o> I<überspringen[,überspringen …] …>] [B<-t>] [B<-S> I] I I<[>BI<]>" + +#. type: Plain text +#: ../man/pidof.1:34 +msgid "B finds the process id's (pids) of the named programs. It prints those id's on the standard output." +msgstr "B findet die Prozesskennungen (PIDs) der benannten Programme. Es schreibt diese Kennungen in die Standardausgabe." + +#. type: IP +#: ../man/pidof.1:35 +#, no-wrap +msgid "B<-s>" +msgstr "B<-s>" + +#. type: Plain text +#: ../man/pidof.1:37 +msgid "Single shot - this instructs the program to only return one I." +msgstr "weist das Programm an, nur eine I auszugeben." + +#. type: TP +#: ../man/pidof.1:37 ../man/ps.1:409 +#, no-wrap +msgid "B<-c>" +msgstr "B<-c>" + +#. type: Plain text +#: ../man/pidof.1:41 +msgid "Only return process ids that are running with the same root directory. This option is ignored for non-root users, as they will be unable to check the current root directory of processes they do not own." +msgstr "gibt nur Kennungen von Prozessen zurück, die im gleichen Wurzelverzeichnis laufen. Diese Option wird für gewöhnliche Benutzer (ohne Administratorrechte) ignoriert, da diese das aktuelle Wurzelverzeichnis nicht nach Prozessen durchsuchen können, deren Eigentümer sie nicht sind." + +#. type: IP +#: ../man/pidof.1:41 +#, no-wrap +msgid "B<-q>" +msgstr "B<-q>" + +#. type: Plain text +#: ../man/pidof.1:43 +msgid "Quiet mode, suppress any output and only sets the exit status accordingly." +msgstr "aktiviert den stillen Modus, unterdrückt sämtliche Ausgaben und setzt den Exit-Status entsprechend." + +#. type: TP +#: ../man/pidof.1:43 ../man/ps.1:718 +#, no-wrap +msgid "B<-w>" +msgstr "B<-w>" + +#. type: Plain text +#: ../man/pidof.1:46 +msgid "Show also processes that do not have visible command line (e.g. kernel worker threads)." +msgstr "zeigt auch Prozesse an, die keine sichtbare Befehlszeile haben (zum Beispiel Kernel-Arbeits-Threads)." + +#. type: TP +#: ../man/pidof.1:46 ../man/sysctl.8:110 +#, no-wrap +msgid "B<-x>" +msgstr "B<-x>" + +#. type: Plain text +#: ../man/pidof.1:49 +msgid "Scripts too - this causes the program to also return process id's of shells running the named scripts." +msgstr "berücksichtigt auch Skripte. Das Programm gibt auch Prozesskennungen der Shells zurück, die die benannten Skripte ausführen." + +#. type: IP +#: ../man/pidof.1:49 +#, no-wrap +msgid "B<-o> I" +msgstr "B<-o> I<überspringen>" + +#. type: Plain text +#: ../man/pidof.1:53 +msgid "Tells B to omit processes with that process id. The special pid B<%PPID> can be used to name the parent process of the B program, in other words the calling shell or shell script." +msgstr "weist B an, Prozesse mit der angegebenen PID zu überspringen. Die spezielle PID B<%PPID> kann verwendet werden, um den Elternprozess des B-Programms zu bezeichnen, also die aufrufende Shell oder das Shell-Skript." + +#. type: IP +#: ../man/pidof.1:53 +#, no-wrap +msgid "B<-t>" +msgstr "B<-t>" + +#. type: Plain text +#: ../man/pidof.1:55 +msgid "Shows all thread ids instead of pids." +msgstr "zeigt alle Thread-IDs anstelle von PIDs an." + +#. type: IP +#: ../man/pidof.1:55 +#, no-wrap +msgid "B<-S> I" +msgstr "B<-S> I" + +#. type: Plain text +#: ../man/pidof.1:61 +msgid "Use I as a separator put between pids. Used only when more than one pids are printed for the program. The B<-d> option is an alias for this option for sysvinit B compatibility." +msgstr "verwendet den angegebenen I zwischen PIDs. Dieser wird nur verwendet, wenn für das Programm mehrere PIDs ausgegeben werden. Die Option I<-d> ist ein Alias für diese Option, der aus Gründen der Kompatibilität zu B aus Sysvinit zur Verfügung steht." + +#. type: TP +#: ../man/pidof.1:62 ../man/pmap.1:79 ../man/watch.1:104 +#, no-wrap +msgid "B<0>" +msgstr "B<0>" + +#. type: Plain text +#: ../man/pidof.1:65 +msgid "At least one program was found with the requested name." +msgstr "Es wurde mindestens ein Programm mit dem angegebenen Namen gefunden." + +#. type: TP +#: ../man/pidof.1:65 ../man/pmap.1:82 ../man/watch.1:107 +#, no-wrap +msgid "B<1>" +msgstr "B<1>" + +#. type: Plain text +#: ../man/pidof.1:68 +msgid "No program was found with the requested name." +msgstr "Es wurde kein Programm mit dem angegebenen Namen gefunden." + +#. type: Plain text +#: ../man/pidof.1:75 +msgid "When using the B<-x> option, B only has a simple method for detecting scripts and will miss scripts that, for example, use env. This limitation is due to how the scripts look in the proc filesystem." +msgstr "Wenn Sie die Option B<-x> verwenden, verfügt B nur eine einfache Methode zum Erkennen von Skripten und wird beispielsweise Skripte nicht erkennen, die B verwenden. Diese Einschränkung ist darauf zurückzuführen, wie die Skripte im proc-Dateisystem aussehen." + +#. type: Plain text +#: ../man/pidof.1:79 +msgid "B(1), B(1)" +msgstr "B(1), B(1)" + +#. type: Plain text +#: ../man/pidof.1:82 +msgid "E<.UR jcapik@redhat.com> Jaromir Capik E<.UE>" +msgstr "E<.UR jcapik@redhat.com> Jaromir Capik E<.UE>" + +#. type: TH +#: ../man/pmap.1:19 +#, no-wrap +msgid "PMAP" +msgstr "PMAP" + +#. type: TH +#: ../man/pmap.1:19 ../man/pwdx.1:12 ../man/tload.1:12 +#, no-wrap +msgid "2020-06-04" +msgstr "4. April 2020" + +#. type: Plain text +#: ../man/pmap.1:22 +msgid "pmap - report memory map of a process" +msgstr "pmap - die Speicherzuordnung eines Prozesses melden" + +#. type: Plain text +#: ../man/pmap.1:25 +msgid "B [I] I [...]" +msgstr "B [I] I […]" + +# FIXME command name formatting +#. type: Plain text +#: ../man/pmap.1:29 +msgid "The B command reports the memory map of a process or processes." +msgstr "Der Befehl B meldet die Speicherzuordnung eines oder mehrerer Prozesse." + +#. type: TP +#: ../man/pmap.1:30 +#, no-wrap +msgid "B<-x>, B<--extended>" +msgstr "B<-x>, B<--extended>" + +#. type: Plain text +#: ../man/pmap.1:33 +msgid "Show the extended format." +msgstr "zeigt im erweiterten Format an." + +#. type: TP +#: ../man/pmap.1:33 +#, no-wrap +msgid "B<-d>, B<--device>" +msgstr "B<-d>, B<--device>" + +#. type: Plain text +#: ../man/pmap.1:36 +msgid "Show the device format." +msgstr "zeigt im Geräteformat an." + +#. type: TP +#: ../man/pmap.1:36 ../man/sysctl.8:57 +#, no-wrap +msgid "B<-q>, B<--quiet>" +msgstr "B<-q>, B<--quiet>" + +#. type: Plain text +#: ../man/pmap.1:39 +msgid "Do not display some header or footer lines." +msgstr "zeigt nicht alle Kopf- oder Fußzeilen an." + +#. type: TP +#: ../man/pmap.1:39 +#, no-wrap +msgid "B<-A>, B<--range> I,I" +msgstr "B<-A>, B<--range> I,I" + +#. type: Plain text +#: ../man/pmap.1:47 +msgid "Limit results to the given range to I and I address range. Notice that the low and high arguments are single string separated with comma." +msgstr "begrenzt die Ergebnisse auf den angegebenen Adressbereich zwischen I und I. Beachten Sie, dass die Argumente für Unter- und Obergrenze eine einzige, durch ein Komma getrennte Zeichenkette sind." + +#. type: TP +#: ../man/pmap.1:47 ../man/sysctl.8:104 +#, no-wrap +msgid "B<-X>" +msgstr "B<-X>" + +#. type: Plain text +#: ../man/pmap.1:51 +msgid "Show even more details than the B<-x> option. WARNING: format changes according to I" +msgstr "zeigt noch mehr Details als die Option B<-x> an. WARNUNG: Das Format ändert sich entsprechend I." + +#. type: TP +#: ../man/pmap.1:51 +#, no-wrap +msgid "B<-XX>" +msgstr "B<-XX>" + +#. type: Plain text +#: ../man/pmap.1:54 +msgid "Show everything the kernel provides" +msgstr "zeigt alles, was der Kernel bereitstellt." + +#. type: TP +#: ../man/pmap.1:54 +#, no-wrap +msgid "B<-p>, B<--show-path>" +msgstr "B<-p>, B<--show-path>" + +#. type: Plain text +#: ../man/pmap.1:57 +msgid "Show full path to files in the mapping column" +msgstr "zeigt den vollständigen Pfad zu den Dateien in der Zuordnungs-Spalte an." + +#. type: TP +#: ../man/pmap.1:57 +#, no-wrap +msgid "B<-c>, B<--read-rc>" +msgstr "B<-c>, B<--read-rc>" + +#. type: Plain text +#: ../man/pmap.1:60 +msgid "Read the default configuration" +msgstr "liest die Standard-Konfigurationsdatei ein." + +#. type: TP +#: ../man/pmap.1:60 +#, no-wrap +msgid "B<-C>, B<--read-rc-from> I" +msgstr "B<-C>, B<--read-rc-from> I" + +#. type: Plain text +#: ../man/pmap.1:63 +msgid "Read the configuration from I" +msgstr "liest die Konfiguration aus der angegebenen I." + +#. type: TP +#: ../man/pmap.1:63 +#, no-wrap +msgid "B<-n>, B<--create-rc>" +msgstr "B<-n>, B<--create-rc>" + +#. type: Plain text +#: ../man/pmap.1:66 +msgid "Create new default configuration" +msgstr "erstellt eine neue Standardkonfiguration." + +#. type: TP +#: ../man/pmap.1:66 +#, no-wrap +msgid "B<-N>, B<--create-rc-to> I" +msgstr "B<-N>, B<--create-rc-to> I" + +#. type: Plain text +#: ../man/pmap.1:69 +msgid "Create new configuration to I" +msgstr "legt eine neue Konfiguration in der angegebenen I an." + +#. type: Plain text +#: ../man/pmap.1:72 ../man/skill.1:68 ../man/sysctl.8:116 ../man/w.1:66 +#: ../man/watch.1:97 +msgid "Display help text and exit." +msgstr "zeigt einen Hilfetext an und beendet das Programm." + +#. type: Plain text +#: ../man/pmap.1:82 ../man/watch.1:107 +msgid "Success." +msgstr "Erfolg." + +#. type: Plain text +#: ../man/pmap.1:85 +msgid "Failure." +msgstr "Fehlschlag." + +#. type: TP +#: ../man/pmap.1:85 +#, no-wrap +msgid "B<42>" +msgstr "B<42>" + +#. type: Plain text +#: ../man/pmap.1:88 +msgid "Did not find all processes asked for." +msgstr "Nicht alle Prozesse, nach denen gefragt wurde, konnten gefunden werden." + +#. type: Plain text +#: ../man/pmap.1:93 ../man/pwdx.1:28 +msgid "B(1), B(1)" +msgstr "B(1), B(1)" + +# FIXME command name formatting +#. type: Plain text +#: ../man/pmap.1:97 +msgid "No standards apply, but B looks an awful lot like a SunOS command." +msgstr "Es sind keine Standards anwendbar, aber B ähnelt stark einem SunOS-Befehl." + +#. type: TH +#: ../man/pwdx.1:12 +#, no-wrap +msgid "PWDX" +msgstr "PWDX" + +#. type: Plain text +#: ../man/pwdx.1:15 +msgid "pwdx - report current working directory of a process" +msgstr "pwdx - aktuelles Arbeitsverzeichnis eines Prozesses anzeigen" + +#. type: Plain text +#: ../man/pwdx.1:18 +msgid "B [I] I [...]" +msgstr "B [I] I […]" + +#. type: Plain text +#: ../man/pwdx.1:22 +msgid "Output version information and exit." +msgstr "zeigt Versionsinformation an und beendet das Programm." + +#. type: Plain text +#: ../man/pwdx.1:25 +msgid "Output help screen and exit." +msgstr "zeigt eine Hilfe an und beendet das Programm." + +# FIXME command name formatting +#. type: Plain text +#: ../man/pwdx.1:32 +msgid "No standards apply, but B looks an awful lot like a SunOS command." +msgstr "Es sind keine Standards anwendbar, aber B ähnelt stark einem SunOS-Befehl." + +#. type: Plain text +#: ../man/pwdx.1:37 +msgid "E<.UR nmiell@gmail.com> Nicholas Miell E<.UE> wrote pwdx in 2004." +msgstr "E<.UR nmiell@gmail.com> Nicholas Miell E<.UE> schrieb Pwdx im Jahre 2004." + +#. type: TH +#: ../man/skill.1:12 +#, no-wrap +msgid "SKILL" +msgstr "SKILL" + +#. type: TH +#: ../man/skill.1:12 ../man/sysctl.8:14 ../man/ps.1:13 +#, no-wrap +msgid "2023-08-19" +msgstr "19. August 2023" + +#. type: Plain text +#: ../man/skill.1:15 +msgid "skill, snice - send a signal or report process status" +msgstr "skill, snice - ein Signal senden oder den Prozessstatus ermitteln" + +#. type: Plain text +#: ../man/skill.1:20 +msgid "B [I] [I] I" +msgstr "B [I] [I] I" + +#. type: Plain text +#: ../man/skill.1:25 +msgid "B [I] [I] I" +msgstr "B [I] [I] I" + +#. type: Plain text +#: ../man/skill.1:33 +msgid "These tools are obsolete and unportable. The command syntax is poorly defined. Consider using the B, B, and B commands instead." +msgstr "Diese Dienstprogramme sind veraltet und nicht portabel. Die Befehlssyntax ist unzureichend dokumentiert. Bitte verwenden Sie stattdessen die Befehle B(1), B(1) und B(1)." + +# FIXME command name formatting +#. type: Plain text +#: ../man/skill.1:38 +msgid "The default signal for B is TERM. Use B<-l> or B<-L> to list available signals. Particularly useful signals include HUP, INT, KILL, STOP, CONT, and 0. Alternate signals may be specified in three ways: B<-9> B<-SIGKILL> B<-KILL>." +msgstr "Das Standardsignal für B ist TERM. Verwenden Sie B<-l> oder B<-L>, um verfügbare Signale aufzulisten. Im Einzelnen sind diese Signale HUP, INT, KILL, STOP, CONT und 0. Andere Signale können auf drei verschiedene Arten angegeben werden: B<-9>, B<-SIGKILL> oder B<-KILL>." + +# FIXME command name formatting +#. type: Plain text +#: ../man/skill.1:42 +msgid "The default priority for B is +4. Priority numbers range from +20 (slowest) to -20 (fastest). Negative priority numbers are restricted to administrative users." +msgstr "Die Vorgabepriorität für B ist +4. Prioritätskennziffern liegen im Bereich von +20 (am langsamsten) und -20 (am schnellsten). Negative Prioritätskennziffern sind Benutzern mit Administratorrechten vorbehalten." + +#. type: TP +#: ../man/skill.1:43 +#, no-wrap +msgid "B<-f>,B<\\ --fast>" +msgstr "B<-f>,B<\\ --fast>" + +#. type: Plain text +#: ../man/skill.1:46 +msgid "Fast mode. This option has not been implemented." +msgstr "Schneller Modus. Diese Option wurde nicht implementiert." + +#. type: TP +#: ../man/skill.1:46 +#, no-wrap +msgid "B<-i>,B<\\ --interactive>" +msgstr "B<-i>,B<\\ --interactive>" + +#. type: Plain text +#: ../man/skill.1:49 +msgid "Interactive use. You will be asked to approve each action." +msgstr "Interaktiver Modus. Sie werden vor der Ausführung einer Aktion stets um Bestätigung gebeten." + +#. type: TP +#: ../man/skill.1:49 +#, no-wrap +msgid "B<-l>,B<\\ --list>" +msgstr "B<-l>,B<\\ --list>" + +#. type: Plain text +#: ../man/skill.1:52 +msgid "List all signal names." +msgstr "listet alle Signalnamen auf." + +#. type: Plain text +#: ../man/skill.1:55 +msgid "List all signal names in a nice table." +msgstr "listet alle Signalnamen in einer Tabelle auf." + +#. type: TP +#: ../man/skill.1:55 +#, no-wrap +msgid "B<-n>,B<\\ --no-action>" +msgstr "B<-n>,B<\\ --no-action>" + +#. type: Plain text +#: ../man/skill.1:59 +msgid "No action; perform a simulation of events that would occur but do not actually change the system." +msgstr "führt keine Aktion aus. Es wird eine Simulation ausgeführt, aber keine Änderung am System vorgenommen." + +#. type: TP +#: ../man/skill.1:59 +#, no-wrap +msgid "B<-v>,B<\\ --verbose>" +msgstr "B<-v>,B<\\ --verbose>" + +#. type: Plain text +#: ../man/skill.1:62 +msgid "Verbose; explain what is being done." +msgstr "Ausführlicher Modus, es wird erklärt, was geschieht." + +#. type: TP +#: ../man/skill.1:62 +#, no-wrap +msgid "B<-w>,B<\\ --warnings>" +msgstr "B<-w>,B<\\ --warnings>" + +#. type: Plain text +#: ../man/skill.1:65 +msgid "Enable warnings. This option has not been implemented." +msgstr "aktiviert Warnungen. Diese Option wurde nicht implementiert." + +#. type: SH +#: ../man/skill.1:72 +#, no-wrap +msgid "PROCESS SELECTION OPTIONS" +msgstr "OPTIONEN ZUR PROZESSAUSWAHL" + +#. type: Plain text +#: ../man/skill.1:75 +msgid "Selection criteria can be: terminal, user, pid, command. The options below may be used to ensure correct interpretation." +msgstr "Auswahlkriterien können sein: terminal, user, pid, command. Die nachfolgenden Optionen können verwendet werden, um eine korrekte Interpretation zu gewährleisten." + +#. type: TP +#: ../man/skill.1:75 +#, no-wrap +msgid "B<-t>, B<--tty> I" +msgstr "B<-t>, B<--tty> I" + +#. type: Plain text +#: ../man/skill.1:78 +msgid "The next expression is a terminal (tty or pty)." +msgstr "Der nächste Ausdruck ist ein Terminal (tty oder pty)." + +#. type: TP +#: ../man/skill.1:78 +#, no-wrap +msgid "B<-u>, B<--user> I" +msgstr "B<-u>, B<--user> I" + +#. type: Plain text +#: ../man/skill.1:81 +msgid "The next expression is a username." +msgstr "Der nächste Ausdruck ist ein Benutzername." + +#. type: TP +#: ../man/skill.1:81 +#, no-wrap +msgid "B<-p>, B<--pid> I" +msgstr "B<-p>, B<--pid> I" + +#. type: Plain text +#: ../man/skill.1:84 +msgid "The next expression is a process ID number." +msgstr "Der nächste Ausdruck ist eine Prozesskennung (ID)." + +#. type: TP +#: ../man/skill.1:84 +#, no-wrap +msgid "B<-c>, B<--command> I" +msgstr "B<-c>, B<--command> I" + +#. type: Plain text +#: ../man/skill.1:87 +msgid "The next expression is a command name." +msgstr "Der nächste Ausdruck ist ein Befehlsname." + +#. type: Plain text +#: ../man/skill.1:90 +msgid "Match the processes that belong to the same namespace as pid." +msgstr "sucht nach Prozessen, die zum gleichen Namensraum wie I gehören." + +#. type: TP +#: ../man/skill.1:90 +#, no-wrap +msgid "B<--nslist >I,\\,I<...\\/>" +msgstr "B<--nslist >I,\\,I<…\\/>" + +#. type: Plain text +#: ../man/skill.1:94 +msgid "list which namespaces will be considered for the B<--ns> option. Available namespaces: ipc, mnt, net, pid, user, uts." +msgstr "listet die Namensräume auf, die in der Option B<--ns> berücksichtigt werden. Verfügbare Namensräume: ipc, mnt, net, pid, user, uts." + +#. type: SH +#: ../man/skill.1:95 +#, no-wrap +msgid "SIGNALS" +msgstr "SIGNALE" + +#. type: Plain text +#: ../man/skill.1:99 +msgid "The behavior of signals is explained in B(7) manual page." +msgstr "Das Verhalten der Signale ist in der Handbuchseite zu B(7) beschrieben." + +#. type: TP +#: ../man/skill.1:100 +#, no-wrap +msgid "B" +msgstr "B" + +# FIXME command name formatting +#. type: Plain text +#: ../man/skill.1:103 +msgid "+Slow down B and B commands." +msgstr "verlangsamt die Ausführung der B- und B-Befehle." + +#. type: TP +#: ../man/skill.1:103 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/skill.1:106 +msgid "Kill users on PTY devices." +msgstr "killt Benutzer auf PTY-Geräten." + +#. type: TP +#: ../man/skill.1:106 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/skill.1:109 +msgid "Stop three users." +msgstr "stoppt drei Benutzer." + +#. type: Plain text +#: ../man/skill.1:117 +msgid "B(1), B(2), B(1), B(1), B(1), B(1), B(7)" +msgstr "B(1), B(2), B(1), B(1), B(1), B(1), B(7)" + +#. type: Plain text +#: ../man/skill.1:119 +msgid "No standards apply." +msgstr "Es sind keine Standards anwendbar." + +#. type: Plain text +#: ../man/skill.1:125 +msgid "E<.MT albert@users.sf.net> Albert Cahalan E<.ME> wrote skill and snice in 1999 as a replacement for a non-free version." +msgstr "E<.MT albert@users.sf.net> Albert Cahalan E<.ME> schrieb B und B im Jahre 1999 als Ersatz für eine unfreie Version." + +#. type: TH +#: ../man/slabtop.1:14 +#, no-wrap +msgid "SLABTOP" +msgstr "SLABTOP" + +#. type: TH +#: ../man/slabtop.1:14 +#, no-wrap +msgid "2021-03-11" +msgstr "11. März 2021" + +#. type: Plain text +#: ../man/slabtop.1:17 +msgid "slabtop - display kernel slab cache information in real time" +msgstr "slabtop - zeigt Informationen zum Slab-Zwischenspeicher des Kernels in Echtzeit an" + +#. type: Plain text +#: ../man/slabtop.1:20 +msgid "B [I]" +msgstr "B [I]" + +#. type: Plain text +#: ../man/slabtop.1:25 +msgid "B displays detailed kernel slab cache information in real time. It displays a listing of the top caches sorted by one of the listed sort criteria. It also displays a statistics header filled with slab layer information." +msgstr "B zeigt detaillierte Informationen zum Slab-Zwischenspeicher des Kernels in Echtzeit an. Es zeigt eine Liste der Top-Zwischenspeicher, nach einem der aufgeführten Kriterien sortiert. Außerdem werden Statistik-Kopfzeilen mit Slab-Ebenen-Informationen angezeigt." + +#. type: Plain text +#: ../man/slabtop.1:30 +msgid "Normal invocation of B does not require any options. The behavior, however, can be fine-tuned by specifying one or more of the following flags:" +msgstr "Der normale Aufruf von B erfordert keine Optionen. Sie können das Verhalten beeinflussen, indem Sie einen oder mehrere der folgenden Schalter angeben:" + +#. type: TP +#: ../man/slabtop.1:30 +#, no-wrap +msgid "B<-d>, B<--delay>=I" +msgstr "B<-d>, B<--delay>=I" + +#. type: Plain text +#: ../man/slabtop.1:39 +msgid "Refresh the display every I in seconds. By default, B refreshes the display every three seconds. To exit the program, hit B. This cannot be combined with the B<-o> option." +msgstr "aktualisiert die Anzeige alle I Sekunden. Per Vorgabe aktualisiert B die Anzeige alle drei Sekunden. Um das Programm zu beenden, drücken Sie B. Dies kann nicht mit der Option B<-o> kombiniert werden." + +#. type: TP +#: ../man/slabtop.1:39 +#, no-wrap +msgid "B<-s>, B<--sort>=I" +msgstr "B<-s>, B<--sort>=I" + +#. type: Plain text +#: ../man/slabtop.1:42 +msgid "Sort by I, where I is one of the sort criteria." +msgstr "sortiert nach I, wobei I eines der Suchkritieren ist." + +#. type: TP +#: ../man/slabtop.1:42 +#, no-wrap +msgid "B<-o>, B<--once>" +msgstr "B<-o>, B<--once>" + +#. type: Plain text +#: ../man/slabtop.1:45 +msgid "Display the output once and then exit." +msgstr "zeigt die Ausgabe einmal an und beendet das Programm." + +#. type: Plain text +#: ../man/slabtop.1:51 +msgid "Display usage information and exit." +msgstr "zeigt Informationen zur Benutzung an und beendet das Programm." + +#. type: SH +#: ../man/slabtop.1:51 +#, no-wrap +msgid "SORT CRITERIA" +msgstr "SORTIERKRITERIEN" + +#. type: Plain text +#: ../man/slabtop.1:55 +msgid "The following are valid sort criteria used to sort the individual slab caches and thereby determine what are the \"top\" slab caches to display. The default sort criteria is to sort by the number of objects (\"o\")." +msgstr "Folgende Kriterien sind für die Sortierung der einzelnen Slab-Zwischenspeicher zulässig und bestimmen, welche die obersten Zwischenspeicher für die Anzeige sind. Die Voreinstellung ist die Sortierung nach der Anzahl der Objekte (»o«)." + +# FIXME command name formatting +#. type: Plain text +#: ../man/slabtop.1:59 +msgid "The sort criteria can also be changed while B is running by pressing the associated character." +msgstr "Die Sortierkriterien können auch angepasst werden, während B läuft, indem Sie die Taste mit dem entsprechenden Zeichen drücken." + +#. type: tbl table +#: ../man/slabtop.1:61 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: tbl table +#: ../man/slabtop.1:61 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: tbl table +#: ../man/slabtop.1:61 +#, no-wrap +msgid "B
" +msgstr "B
" + +#. type: tbl table +#: ../man/slabtop.1:62 +#, no-wrap +msgid "a" +msgstr "a" + +#. type: tbl table +#: ../man/slabtop.1:62 +#, no-wrap +msgid "number of active objects" +msgstr "Anzahl der aktiven Objekte" + +#. type: tbl table +#: ../man/slabtop.1:62 +#, no-wrap +msgid "ACTIVE" +msgstr "ACTIVE" + +#. type: tbl table +#: ../man/slabtop.1:63 +#, no-wrap +msgid "b" +msgstr "b" + +#. type: tbl table +#: ../man/slabtop.1:63 +#, no-wrap +msgid "objects per slab" +msgstr "Objekte pro Slab" + +#. type: tbl table +#: ../man/slabtop.1:63 +#, no-wrap +msgid "OBJ/SLAB" +msgstr "OBJ/SLAB" + +# #-#-#-#-# de.po (procps-ng-man-3.3.16-pre2) #-#-#-#-# +# FIXME formatting +#. type: tbl table +#: ../man/slabtop.1:64 ../man/ps.1:909 ../man/ps.1:1081 +#, no-wrap +msgid "c" +msgstr "c" + +#. type: tbl table +#: ../man/slabtop.1:64 +#, no-wrap +msgid "cache size" +msgstr "Cache-Größe" + +#. type: tbl table +#: ../man/slabtop.1:64 +#, no-wrap +msgid "CACHE SIZE" +msgstr "CACHE SIZE" + +#. type: TP +#: ../man/slabtop.1:65 ../man/ps.1:882 +#, no-wrap +msgid "l" +msgstr "l" + +#. type: tbl table +#: ../man/slabtop.1:65 +#, no-wrap +msgid "number of slabs" +msgstr "Anzahl der Slabs" + +#. type: tbl table +#: ../man/slabtop.1:65 +#, no-wrap +msgid "SLABS" +msgstr "SLABS" + +#. type: tbl table +#: ../man/slabtop.1:66 ../man/ps.1:932 +#, no-wrap +msgid "v" +msgstr "v" + +#. type: tbl table +#: ../man/slabtop.1:66 +#, no-wrap +msgid "number of active slabs" +msgstr "Anzahl der aktiven Slabs" + +#. type: tbl table +#: ../man/slabtop.1:66 ../man/slabtop.1:69 +#, no-wrap +msgid "N/A" +msgstr "n.v." + +#. type: tbl table +#: ../man/slabtop.1:67 ../man/ps.1:919 +#, no-wrap +msgid "n" +msgstr "n" + +#. type: tbl table +#: ../man/slabtop.1:67 +#, no-wrap +msgid "name" +msgstr "Name" + +#. type: tbl table +#: ../man/slabtop.1:67 +#, no-wrap +msgid "NAME\\:" +msgstr "NAME\\:" + +#. type: tbl table +#: ../man/slabtop.1:68 ../man/ps.1:921 +#, no-wrap +msgid "o" +msgstr "o" + +#. type: tbl table +#: ../man/slabtop.1:68 +#, no-wrap +msgid "number of objects" +msgstr "Anzahl der Objekte" + +#. type: tbl table +#: ../man/slabtop.1:68 +#, no-wrap +msgid "OBJS" +msgstr "OBJS" + +#. type: tbl table +#: ../man/slabtop.1:69 ../man/ps.1:922 +#, no-wrap +msgid "p" +msgstr "p" + +#. type: tbl table +#: ../man/slabtop.1:69 +#, no-wrap +msgid "pages per slab" +msgstr "Seiten pro Slab" + +# #-#-#-#-# de.po (procps-ng-man-3.3.16-pre2) #-#-#-#-# +# FIXME formatting +#. type: tbl table +#: ../man/slabtop.1:70 ../man/ps.1:879 ../man/ps.1:926 ../man/ps.1:1631 +#, no-wrap +msgid "s" +msgstr "s" + +#. type: tbl table +#: ../man/slabtop.1:70 +#, no-wrap +msgid "object size" +msgstr "Objektgröße" + +#. type: tbl table +#: ../man/slabtop.1:70 +#, no-wrap +msgid "OBJ SIZE" +msgstr "OBJ SIZE" + +#. type: tbl table +#: ../man/slabtop.1:71 ../man/ps.1:931 +#, no-wrap +msgid "u" +msgstr "u" + +#. type: tbl table +#: ../man/slabtop.1:71 +#, no-wrap +msgid "cache utilization" +msgstr "Zwischenspeichernutzung" + +#. type: tbl table +#: ../man/slabtop.1:71 +#, no-wrap +msgid "USE" +msgstr "USE" + +#. type: SH +#: ../man/slabtop.1:73 +#, no-wrap +msgid "COMMANDS" +msgstr "BEFEHLE" + +#. type: Plain text +#: ../man/slabtop.1:77 +msgid "B accepts keyboard commands from the user during use. The following are supported. In the case of letters, both cases are accepted." +msgstr "B akzeptiert Tastaturbefehle des Benutzers, während das Programm läuft. Die folgenden Befehle werden unterstützt, wobei für Buchstaben die Groß- oder Kleinschreibung nicht berücksichtigt wird." + +#. type: Plain text +#: ../man/slabtop.1:81 +msgid "Each of the valid sort characters are also accepted, to change the sort routine. See the section B." +msgstr "Jedes der zulässigen Sortierzeichen wird zum Anpassen der Sortierroutine ebenfalls unterstützt. Siehe Abschnitt B." + +#. type: TP +#: ../man/slabtop.1:81 +#, no-wrap +msgid "BSPACEBARE>" +msgstr "BLEERTASTEE>" + +#. type: Plain text +#: ../man/slabtop.1:84 +msgid "Refresh the screen." +msgstr "aktualisiert den Bildschirm." + +#. type: TP +#: ../man/slabtop.1:84 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/slabtop.1:87 +msgid "Quit the program." +msgstr "beendet das Programm." + +#. type: TP +#: ../man/slabtop.1:88 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/slabtop.1:91 +msgid "slab information" +msgstr "Slab-Information" + +#. type: Plain text +#: ../man/slabtop.1:96 +msgid "B(1), B(1), B(1), B(8)" +msgstr "B(1), B(1), B(1), B(8)" + +#. type: Plain text +#: ../man/slabtop.1:102 +msgid "Currently, B requires a 2.4 or later kernel (specifically, a version 1.1 or later I). Kernel 2.2 should be supported in the future." +msgstr "Gegenwärtig benötigt B einen Kernel der Version 2.4 oder neuer (speziell I in Version 1.1 oder neuer). Der Kernel 2.2 wird wahrscheinlich in zukünftigen Versionen unterstützt." + +#. type: Plain text +#: ../man/slabtop.1:108 +msgid "The B statistic header is tracking how many bytes of slabs are being used and is not a measure of physical memory. The 'Slab' field in the I file is tracking information about used slab physical memory." +msgstr "Die Statistik-Kopfzeile von B verfolgt die Byte-Anzahl der genutzten Slabs, bezieht sich aber nicht auf den tatsächlichen physischen Speicher. Das »Slab«-Feld in der Datei I enthält Informationen über den physischen Slab-Speicher." + +#. type: Plain text +#: ../man/slabtop.1:114 +msgid "The B column is not accurate, it's the upper limit of memory used by specific slab. When system using slub (most common case) is under high memory pressure, there are slab order fallbacks, which means \"pages per slab\" is not constant and may decrease." +msgstr "" + +#. type: SH +#: ../man/slabtop.1:114 ../man/tload.1:58 ../man/uptime.1:56 ../man/w.1:102 +#, no-wrap +msgid "AUTHORS" +msgstr "AUTOREN" + +#. type: Plain text +#: ../man/slabtop.1:116 +msgid "Written by Chris Rivera and Robert Love." +msgstr "Geschrieben von Chris Rivera und Robert Love." + +#. type: Plain text +#: ../man/slabtop.1:120 +msgid "B was inspired by Martin Bligh's perl script, B." +msgstr "B wurde vom Perl-Skript B von Martin Bligh inspiriert." + +#. type: TH +#: ../man/sysctl.8:14 +#, no-wrap +msgid "SYSCTL" +msgstr "SYSCTL" + +#. type: TH +#: ../man/sysctl.8:14 ../man/vmstat.8:13 +#, no-wrap +msgid "System Administration" +msgstr "System-Administration" + +#. type: Plain text +#: ../man/sysctl.8:17 +msgid "sysctl - configure kernel parameters at runtime" +msgstr "sysctl - Kernelparameter zur Laufzeit konfigurieren" + +#. type: Plain text +#: ../man/sysctl.8:20 +msgid "B [I] [I[B<=>I]] [...]" +msgstr "B [I] [I[B<=>I]] […]" + +#. type: Plain text +#: ../man/sysctl.8:23 +msgid "B [I or I] [...]" +msgstr "B [I oder I] […]" + +#. type: Plain text +#: ../man/sysctl.8:31 +msgid "B is used to modify kernel parameters at runtime. The parameters available are those listed under I. Procfs is required for B support in Linux. You can use B to both read and write sysctl data." +msgstr "B wird dazu verwendet, Kernelparameter zur Laufzeit zu ändern. Die verfügbaren Parameter sind unter I aufgelistet. Für die B-Unterstützung in Linux ist Procfs notwendig. Sie können B sowohl zum Lesen als auch zum Schreiben von Sysctl-Daten verwenden." + +#. type: SH +#: ../man/sysctl.8:31 +#, no-wrap +msgid "PARAMETERS" +msgstr "PARAMETER" + +#. type: TP +#: ../man/sysctl.8:32 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/sysctl.8:36 +msgid "The name of a key to read from. An example is kernel.ostype. The '/' separator is also accepted in place of a '.'." +msgstr "bezeichnet den Namen des Schlüssels, aus dem gelesen werden soll. Ein Beispiel ist kernel.ostype. Anstelle von ».« wird auch »/« als Trenner akzeptiert." + +#. type: TP +#: ../man/sysctl.8:36 +#, no-wrap +msgid "I=I" +msgstr "I=I" + +#. type: Plain text +#: ../man/sysctl.8:47 +msgid "To set a key, use the form I=I where I is the key and I is the value to set it to. If the value contains quotes or characters which are parsed by the shell, you may need to enclose the value in double quotes." +msgstr "Um einen Schlüssel zu setzen, verwenden Sie die Form I=I, wobei die I der Schlüssel ist und I der Wert, auf den er gesetzt werden soll. Wenn der Wert Anführungszeichen oder Zeichen enthält, die von der Shell ausgewertet werden, müssen Sie den Wert in doppelte Anführungszeichen (\") einschließen." + +#. type: TP +#: ../man/sysctl.8:47 +#, no-wrap +msgid "B<-n>, B<--values>" +msgstr "B<-n>, B<--values>" + +#. type: Plain text +#: ../man/sysctl.8:50 +msgid "Use this option to disable printing of the key name when printing values." +msgstr "deaktiviert die Ausgabe des Schlüsselnamens, wenn Werte ausgegeben werden." + +#. type: TP +#: ../man/sysctl.8:50 +#, no-wrap +msgid "B<-e>, B<--ignore>" +msgstr "B<-e>, B<--ignore>" + +#. type: Plain text +#: ../man/sysctl.8:53 +msgid "Use this option to ignore errors about unknown keys." +msgstr "ignoriert Fehlermeldungen über unbekannte Schlüssel." + +#. type: TP +#: ../man/sysctl.8:53 +#, no-wrap +msgid "B<-N>, B<--names>" +msgstr "B<-N>, B<--names>" + +#. type: Plain text +#: ../man/sysctl.8:57 +msgid "Use this option to only print the names. It may be useful with shells that have programmable completion." +msgstr "gibt nur die Namen aus. Dies könnte mit Shells nützlich sein, die über eine programmierbare Vervollständigung verfügen." + +#. type: Plain text +#: ../man/sysctl.8:60 +msgid "Use this option to not display the values set to stdout." +msgstr "bewirkt, dass die gesetzten Werte nicht in die Standardausgabe geschrieben werden." + +#. type: TP +#: ../man/sysctl.8:60 +#, no-wrap +msgid "B<-w>, B<--write>" +msgstr "B<-w>, B<--write>" + +#. type: Plain text +#: ../man/sysctl.8:64 +msgid "Force all arguments to be write arguments and print an error if they cannot be parsed this way." +msgstr "erzwingt, dass alle Argumente Schreibargumente sind und gibt einen Fehler aus, wenn die Argumente nicht nach dieser Vorgabe ausgewertet werden können." + +#. type: TP +#: ../man/sysctl.8:64 +#, no-wrap +msgid "B<-p>[I], B<--load>[=I]" +msgstr "B<-p>[I], B<--load>[=I]" + +# FIXME Formatierung des Minuszeichens +#. type: Plain text +#: ../man/sysctl.8:72 +msgid "Load in B settings from the file specified or I if none given. Specifying - as filename means reading data from standard input. Using this option will mean arguments to B are files, which are read in the order they are specified. The file argument may be specified as regular expression." +msgstr "lädt B-Einstellungen aus der angegebenen Datei oder aus I, falls keine Datei angegeben ist. Die Angabe von B<-> als Dateiname bewirkt, dass die Daten aus der Standardeingabe gelesen werden. Mit dieser Option sieht B Argumente als Dateien an, die in der Reihenfolge gelesen werden, in der sie angegeben sind. Das Datei-Argument kann als regulärer Ausdruck angegeben werden." + +#. type: TP +#: ../man/sysctl.8:72 +#, no-wrap +msgid "B<-a>, B<--all>" +msgstr "B<-a>, B<--all>" + +#. type: Plain text +#: ../man/sysctl.8:75 +msgid "Display all values currently available." +msgstr "zeigt alle aktuell verfügbaren Werte an." + +#. type: TP +#: ../man/sysctl.8:75 +#, no-wrap +msgid "B<--deprecated>" +msgstr "B<--deprecated>" + +#. type: Plain text +#: ../man/sysctl.8:80 +msgid "Include deprecated parameters to B<--all> values listing." +msgstr "schließt veraltete Parameter in die Auflistung der Werte mit B<--all> ein." + +#. type: TP +#: ../man/sysctl.8:80 +#, no-wrap +msgid "B<-b>, B<--binary>" +msgstr "B<-b>, B<--binary>" + +#. type: Plain text +#: ../man/sysctl.8:83 +msgid "Print value without new line." +msgstr "gibt Werte ohne Zeilenumbrüche aus." + +#. type: TP +#: ../man/sysctl.8:83 +#, no-wrap +msgid "B<--system>" +msgstr "B<--system>" + +#. type: Plain text +#: ../man/sysctl.8:88 +msgid "Load settings from all system configuration files. See the B section below." +msgstr "lädt Einstellungen aus allen Systemkonfigurationsdateien. Siehe B unten." + +#. type: TP +#: ../man/sysctl.8:88 +#, no-wrap +msgid "B<-r>, B<--pattern> I" +msgstr "B<-r>, B<--pattern> I" + +#. type: Plain text +#: ../man/sysctl.8:95 +msgid "Only apply settings that match I. The I uses extended regular expression syntax." +msgstr "wendet nur Einstellungen an, die dem angegebenen I entsprechen. Das I kann ein erweiterter regulärer Ausdruck sein." + +#. type: TP +#: ../man/sysctl.8:95 ../man/ps.1:147 +#, no-wrap +msgid "B<-A>" +msgstr "B<-A>" + +#. type: Plain text +#: ../man/sysctl.8:98 ../man/sysctl.8:107 +msgid "Alias of B<-a>" +msgstr "Alias für B<-a>" + +#. type: TP +#: ../man/sysctl.8:98 ../man/ps.1:156 +#, no-wrap +msgid "B<-d>" +msgstr "B<-d>" + +#. type: Plain text +#: ../man/sysctl.8:101 +msgid "Alias of B<-h>" +msgstr "Alias für B<-h>" + +#. type: TP +#: ../man/sysctl.8:101 ../man/ps.1:417 +#, no-wrap +msgid "B<-f>" +msgstr "B<-f>" + +#. type: Plain text +#: ../man/sysctl.8:104 +msgid "Alias of B<-p>" +msgstr "Alias für B<-p>" + +#. type: TP +#: ../man/sysctl.8:107 +#, no-wrap +msgid "B<-o>" +msgstr "B<-o>" + +#. type: Plain text +#: ../man/sysctl.8:110 ../man/sysctl.8:113 +msgid "Does nothing, exists for BSD compatibility." +msgstr "bewirkt nichts; ist nur zwecks BSD-Kompatibilität vorhanden." + +#. type: SH +#: ../man/sysctl.8:119 +#, no-wrap +msgid "SYSTEM FILE PRECEDENCE" +msgstr "RANGFOLGE DER SYSTEMDATEIEN" + +#. type: Plain text +#: ../man/sysctl.8:125 +msgid "When using the B<--system> option, B will read files from directories in the following list in given order from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored." +msgstr "Wenn Sie die Option B<--system> verwenden, liest B Dateien aus den Verzeichnissen in der folgenden Liste in der angegebenen Reihenfolge von oben nach unten. Sobald eine Datei eines angegebenen Namens geladen ist, werden jegliche Dateien gleichen Namens in darauf folgenden Verzeichnissen ignoriert." + +#. type: Plain text +#: ../man/sysctl.8:127 +msgid "/etc/sysctl.d/*.conf" +msgstr "/etc/sysctl.d/*.conf" + +#. type: Plain text +#: ../man/sysctl.8:129 +msgid "/run/sysctl.d/*.conf" +msgstr "/run/sysctl.d/*.conf" + +#. type: Plain text +#: ../man/sysctl.8:131 +msgid "/usr/local/lib/sysctl.d/*.conf" +msgstr "/usr/local/lib/sysctl.d/*.conf" + +#. type: Plain text +#: ../man/sysctl.8:133 +msgid "/usr/lib/sysctl.d/*.conf" +msgstr "/usr/lib/sysctl.d/*.conf" + +#. type: Plain text +#: ../man/sysctl.8:135 +msgid "/lib/sysctl.d/*.conf" +msgstr "/lib/sysctl.d/*.conf" + +#. type: Plain text +#: ../man/sysctl.8:137 +msgid "/etc/sysctl.conf" +msgstr "/etc/sysctl.conf" + +#. type: Plain text +#: ../man/sysctl.8:143 +#, fuzzy +msgid "All configuration files are sorted in lexicographic order, regardless of the directory they reside in. Configuration files can either be completely replaced (by having a new configuration file with the same name in a directory of higher priority) or partially replaced (by having a configuration file that is ordered later)." +msgstr "Alle Konfigurationsdateien werden lexikografisch aufgelistet, unabhängig davon, in welchem Ordner sie enthalten sind." + +#. type: Plain text +#: ../man/sysctl.8:145 +msgid "/sbin/sysctl -a" +msgstr "/sbin/sysctl -a" + +#. type: Plain text +#: ../man/sysctl.8:147 +msgid "/sbin/sysctl -n kernel.hostname" +msgstr "/sbin/sysctl -n kernel.hostname" + +#. type: Plain text +#: ../man/sysctl.8:149 +msgid "/sbin/sysctl -w kernel.domainname=\"example.com\"" +msgstr "/sbin/sysctl -w kernel.domainname=\"example.com\"" + +#. type: Plain text +#: ../man/sysctl.8:151 +msgid "/sbin/sysctl -p/etc/sysctl.conf" +msgstr "/sbin/sysctl -p/etc/sysctl.conf" + +#. type: Plain text +#: ../man/sysctl.8:153 +msgid "/sbin/sysctl -a --pattern forward" +msgstr "/sbin/sysctl -a --pattern forward" + +#. type: Plain text +#: ../man/sysctl.8:155 +msgid "/sbin/sysctl -a --pattern forward$" +msgstr "/sbin/sysctl -a --pattern forward$" + +#. type: Plain text +#: ../man/sysctl.8:157 +msgid "/sbin/sysctl -a --pattern 'net.ipv4.conf.(eth|wlan)0.arp'" +msgstr "/sbin/sysctl -a --pattern 'net.ipv4.conf.(eth|wlan)0.arp'" + +#. type: Plain text +#: ../man/sysctl.8:159 +msgid "/sbin/sysctl --pattern '\\[char94]net.ipv6' --system" +msgstr "/sbin/sysctl --pattern '\\[char94]net.ipv6' --system" + +#. type: SH +#: ../man/sysctl.8:159 +#, no-wrap +msgid "DEPRECATED PARAMETERS" +msgstr "VERALTETE PARAMETER" + +# FIXME command name formatting +#. type: Plain text +#: ../man/sysctl.8:169 +msgid "The B and B are deprecated. The B command does not allow changing values of these parameters. Users who insist to use deprecated kernel interfaces should push values to B file system by other means. For example:" +msgstr "Die Parameter B und B sind veraltet. Der Befehl B erlaubt keine Änderungen der Werte dieser Parameter. Benutzer, die nach wie vor veraltete Kernel-Schnittstellen verwenden, sollten die Werte auf anderen Wegen in das /I-Dateisystem befördern. Zum Beispiel:" + +#. type: Plain text +#: ../man/sysctl.8:171 +msgid "echo 256 E /proc/sys/net/ipv6/neigh/eth0/base_reachable_time" +msgstr "echo 256 E /proc/sys/net/ipv6/neigh/eth0/base_reachable_time" + +#. type: Plain text +#: ../man/sysctl.8:173 +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/sysctl.8:175 ../man/sysctl.conf.5:66 +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/sysctl.8:177 ../man/sysctl.conf.5:68 +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/sysctl.8:179 ../man/sysctl.conf.5:70 +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/sysctl.8:181 ../man/sysctl.conf.5:72 +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/sysctl.8:183 ../man/sysctl.conf.5:74 +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/sysctl.8:185 ../man/sysctl.conf.5:76 +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/sysctl.8:189 +msgid "B(5), B(5), B(7)" +msgstr "B(5), B(5), B(7)" + +#. type: Plain text +#: ../man/sysctl.8:193 ../man/sysctl.conf.5:89 +msgid "E<.UR staikos@0wned.org> George Staikos E<.UE>" +msgstr "E<.UR staikos@0wned.org> George Staikos E<.UE>" + +#. type: TH +#: ../man/sysctl.conf.5:13 +#, no-wrap +msgid "SYSCTL.CONF" +msgstr "SYSCTL.CONF" + +#. type: TH +#: ../man/sysctl.conf.5:13 +#, no-wrap +msgid "2021-09-15" +msgstr "15. September 2021" + +#. type: TH +#: ../man/sysctl.conf.5:13 +#, no-wrap +msgid "File Formats" +msgstr "Dateiformate" + +#. type: Plain text +#: ../man/sysctl.conf.5:16 +msgid "sysctl.conf - sysctl preload/configuration file" +msgstr "sysctl.conf - Vorlade-/Konfigurationsdatei für Sysctl" + +#. type: Plain text +#: ../man/sysctl.conf.5:21 +msgid "B is a simple file containing sysctl values to be read in and set by B. The syntax is simply as follows:" +msgstr "B ist eine einfache Datei, welche Sysctl-Werte enthält, die in B gelesen und gesetzt werden. Die Syntax ist einfach, wie folgt:" + +#. type: Plain text +#: ../man/sysctl.conf.5:27 +#, no-wrap +msgid "" +"# comment\n" +"; comment\n" +msgstr "" +"# Kommentar\n" +"; Kommentar\n" + +#. type: Plain text +#: ../man/sysctl.conf.5:29 +#, no-wrap +msgid "token = value\n" +msgstr "Token = Wert\n" + +# FIXME formatting +#. type: Plain text +#: ../man/sysctl.conf.5:35 +msgid "Note that blank lines are ignored, and whitespace before and after a token or value is ignored, although a value can contain whitespace within. Lines which begin with a I<#> or I<;> are considered comments and ignored." +msgstr "Beachten Sie, dass leere Zeilen sowie Leerräume vor und nach einem Token oder einem Wert ignoriert werden, obwohl ein Token auch Leerraum enthalten kann. Zeilen, die mit einem I<#> oder I<;> beginnen, werden als Kommentarzeilen angesehen und ignoriert." + +#. type: Plain text +#: ../man/sysctl.conf.5:38 +msgid "If a line begins with a single -, any attempts to set the value that fail will be ignored." +msgstr "Falls eine Zeile mit einem einzelnen B<-> beginnt, werden alle fehlschlagenden Versuche, den Wert zu setzen, ignoriert." + +#. type: Plain text +#: ../man/sysctl.conf.5:48 +msgid "As the B file is used to override default kernel parameter values, only a small number of parameters is predefined in the file. Use I or follow B(8) to list all possible parameters. The description of individual parameters can be found in the kernel documentation." +msgstr "Da die Datei B zur Außerkraftsetzung standardmäßiger Werte der Kernelparameter verwendet wird, ist in der Datei nur eine kleine Anzahl Parameter vordefiniert. Verwenden Sie I oder folgen Sie B(8), um alle möglichen Parameter aufzulisten. Die Beschreibungen der einzelnen Parameter finden Sie in der Kerneldokumentation." + +#. type: Plain text +#: ../man/sysctl.conf.5:51 +msgid "Maximum supported line length of the value is 4096 characters due to a limitation of I entries in Linux kernel." +msgstr "Aufgrund einer Beschränkung der I-Einträge im Linux-Kernel ist die maximal mögliche Zeilenlänge auf 4096 Zeichen begrenzt." + +#. type: SH +#: ../man/sysctl.conf.5:51 +#, no-wrap +msgid "EXAMPLE" +msgstr "BEISPIEL" + +#. type: Plain text +#: ../man/sysctl.conf.5:61 +#, no-wrap +msgid "" +"# sysctl.conf sample\n" +"#\n" +" kernel.domainname = example.com\n" +"; this one has a space which will be written to the sysctl!\n" +" kernel.modprobe = /sbin/mod probe\n" +msgstr "" +"# sysctl.conf sample\n" +"#\n" +" kernel.domainname = example.com\n" +"; this one has a space which will be written to the sysctl!\n" +" kernel.modprobe = /sbin/mod probe\n" + +# FIXME comand formatting +#. type: Plain text +#: ../man/sysctl.conf.5:83 +msgid "The paths where B preload files usually exist. See also B option I<--system>." +msgstr "Die Pfade, aus denen B Dateien vorlädt, existieren üblicherweise. Siehe auch die Option B<--system> zu B." + +#. type: Plain text +#: ../man/sysctl.conf.5:85 +msgid "B(8)" +msgstr "B(8)" + +#. type: TH +#: ../man/tload.1:12 +#, no-wrap +msgid "TLOAD" +msgstr "TLOAD" + +#. type: Plain text +#: ../man/tload.1:15 +msgid "tload - graphic representation of system load average" +msgstr "tload - grafische Darstellung der durchschnittlichen Systemlast" + +#. type: Plain text +#: ../man/tload.1:18 +msgid "B [I] [I]" +msgstr "B [I] [I]" + +# FIXME process name formatting +#. type: Plain text +#: ../man/tload.1:25 +msgid "B prints a graph of the current system load average to the specified I (or the tty of the B process if none is specified)." +msgstr "B gibt eine Grafik der aktuellen durchschnittlichen Systemlast an das angegebene I aus (oder an das Terminal des B-Prozesses, falls keines angegeben wurde)." + +#. type: TP +#: ../man/tload.1:26 +#, no-wrap +msgid "B<-s>, B<--scale> I" +msgstr "B<-s>, B<--scale> I" + +#. type: Plain text +#: ../man/tload.1:31 +msgid "The scale option allows a vertical scale to be specified for the display (in characters between graph ticks); thus, a smaller value represents a larger scale, and vice versa." +msgstr "ermöglicht die Angabe eines vertikalen Maßstabes für die Anzeige (in Zeichen zwischen den Diagrammeinheiten). Ein kleinerer Wert bezeichnet daher einen größeren Maßstab und umgekehrt." + +#. type: TP +#: ../man/tload.1:31 +#, no-wrap +msgid "B<-d>, B<--delay> I" +msgstr "B<-d>, B<--delay> I" + +#. type: Plain text +#: ../man/tload.1:35 +msgid "The delay sets the delay between graph updates in I." +msgstr "legt die Zeitspanne in I zwischen den Aktualisierungen des Graphen fest." + +#. type: Plain text +#: ../man/tload.1:38 +msgid "Display this help text." +msgstr "zeigt einen Hilfetext an." + +#. type: Plain text +#: ../man/tload.1:45 +msgid "I load average information" +msgstr "I enthält Informationen zur Durchschnittslast" + +#. type: Plain text +#: ../man/tload.1:50 +msgid "B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1)" + +#. type: Plain text +#: ../man/tload.1:58 +msgid "The B<-d>I< delay> option sets the time argument for an B(2); if -d 0 is specified, the alarm is set to 0, which will never send the B and update the display." +msgstr "Die Option B<-d>I< Verzögerung> setzt das Zeitargument für B(2). Falls -d 0 angegeben ist, wird der Alarm auf 0 gesetzt, wodurch niemals das Signal B gesendet und die Anzeige aktualisiert wird." + +#. type: Plain text +#: ../man/tload.1:66 +msgid "Branko Lankester, E<.UR david@\\:ods.\\:com> David Engel E<.UE , and> E<.UR johnsonm@\\:redhat.\\:com> Michael K. Johnson E<.UE .>" +msgstr "Branko Lankester, E<.UR david@\\:ods.\\:com> David Engel E<.UE und> E<.UR johnsonm@\\:redhat.\\:com> Michael K. Johnson E<.UE .>" + +#. type: TH +#: ../man/uptime.1:13 +#, no-wrap +msgid "UPTIME" +msgstr "UPTIME" + +#. type: TH +#: ../man/uptime.1:13 +#, no-wrap +msgid "December 2012" +msgstr "Dezember 2012" + +#. type: Plain text +#: ../man/uptime.1:16 +msgid "uptime - Tell how long the system has been running." +msgstr "uptime - feststellen, wie lange das System schon läuft" + +#. type: Plain text +#: ../man/uptime.1:19 +msgid "B [I]" +msgstr "B [I]" + +#. type: Plain text +#: ../man/uptime.1:24 +msgid "B gives a one line display of the following information. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes." +msgstr "B zeigt in einer Zeile die folgenden Informationen an: die aktuelle Zeit, wie lange das System bereits läuft, die Anzahl der aktuell angemeldeten Benutzer und die durchschnittliche Auslastung des Systems in den letzten 1, 5 und 15 Minuten." + +#. type: Plain text +#: ../man/uptime.1:27 +msgid "This is the same information contained in the header line displayed by B(1)." +msgstr "Dies sind dieselben Informationen, die auch in der Kopfzeile des Befehls B(1) angezeigt werden." + +#. type: Plain text +#: ../man/uptime.1:36 +msgid "System load averages is the average number of processes that are either in a runnable or uninterruptable state. A process in a runnable state is either using the CPU or waiting to use the CPU. A process in uninterruptable state is waiting for some I/O access, eg waiting for disk. The averages are taken over the three time intervals. Load averages are not normalized for the number of CPUs in a system, so a load average of 1 means a single CPU system is loaded all the time while on a 4 CPU system it means it was idle 75% of the time." +msgstr "Die durchschnittliche Auslastung des Systems ist die durchschnittliche Anzahl der Prozesse, die entweder in einem lauffähigen oder nicht unterbrechbaren Zustand sind. Lauffähiger Zustand bedeutet, dass ein Prozess entweder gerade die CPU benutzt oder darauf wartet, sie benutzen zu können. Der nicht unterbrechbare Zustand bedeutet, dass ein Prozess auf einen E/A-Zugriff wartet, beispielsweise auf die Festplatte. Die Durchschnitte werden über drei Zeitintervalle gebildet. Die durchschnittliche Auslastung wird nicht auf die Anzahl der CPUs in einem System normalisiert, so dass eine Auslastung von 1 bei einem System mit einer CPU bedeutet, dass das System zu jeder Zeit voll ausgelastet ist. Auf einem System mit vier CPUs bedeutet dieselbe Auslastung, dass der Rechner während 75% der Zeit im Leerlauf war." + +#. type: TP +#: ../man/uptime.1:37 +#, no-wrap +msgid "B<-p>, B<--pretty>" +msgstr "B<-p>, B<--pretty>" + +#. type: Plain text +#: ../man/uptime.1:40 +msgid "show uptime in pretty format" +msgstr "Uptime im schönen Format anzeigen" + +#. type: Plain text +#: ../man/uptime.1:43 +msgid "display this help text" +msgstr "Diesen Hilfetext anzeigen" + +#. type: TP +#: ../man/uptime.1:43 +#, no-wrap +msgid "B<-s>, B<--since>" +msgstr "B<-s>, B<--since>" + +#. type: Plain text +#: ../man/uptime.1:46 +msgid "system up since, in yyyy-mm-dd HH:MM:SS format" +msgstr "System ist hochgefahren seit, im Format »yyyy-mm-dd HH:MM:SS«" + +#. type: Plain text +#: ../man/uptime.1:49 +msgid "display version information and exit" +msgstr "Versionsinformationen anzeigen und das Programm beenden." + +#. type: TP +#: ../man/uptime.1:50 ../man/w.1:89 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/uptime.1:53 ../man/w.1:92 +msgid "information about who is currently logged on" +msgstr "Informationen darüber, wer aktuell angemeldet ist" + +#. type: TP +#: ../man/uptime.1:53 ../man/w.1:92 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/uptime.1:56 ../man/w.1:95 +msgid "process information" +msgstr "Prozessinformation" + +#. type: Plain text +#: ../man/uptime.1:66 +msgid "B was written by E<.UR greenfie@gauss.\\:rutgers.\\:edu> Larry Greenfield E<.UE> and E<.UR johnsonm@sunsite.\\:unc.\\:edu> Michael K. Johnson E<.UE>" +msgstr "B wurde von E<.UR greenfie@gauss.\\:rutgers.\\:edu> Larry Greenfield E<.UE> und E<.UR johnsonm@sunsite.\\:unc.\\:edu> Michael K. Johnson E<.UE> geschrieben." + +#. type: Plain text +#: ../man/uptime.1:71 +msgid "B(1), B(1), B(5), B(1)" +msgstr "B(1), B(1), B(5), B(1)" + +#. type: TH +#: ../man/vmstat.8:13 +#, no-wrap +msgid "VMSTAT" +msgstr "VMSTAT" + +#. type: TH +#: ../man/vmstat.8:13 +#, no-wrap +msgid "2023-01-18" +msgstr "18. Januar 2023" + +#. type: Plain text +#: ../man/vmstat.8:16 +msgid "vmstat - Report virtual memory statistics" +msgstr "vmstat - Statistiken zum virtuellen Speicher anzeigen" + +#. type: Plain text +#: ../man/vmstat.8:20 +msgid "B [options] [I [I]]" +msgstr "B [Optionen] [I [I]]" + +#. type: Plain text +#: ../man/vmstat.8:24 +msgid "B reports information about processes, memory, paging, block IO, traps, disks and cpu activity." +msgstr "B zeigt Informationen zu Prozessen, Speicher, Paging, Block-E/A, Traps, Laufwerken und CPU-Aktivität an." + +#. type: Plain text +#: ../man/vmstat.8:29 +msgid "The first report produced gives averages since the last reboot. Additional reports give information on a sampling period of length I. The process and memory reports are instantaneous in either case." +msgstr "Der erste erzeugte Bericht zeigt Durchschnittswerte seit dem letzten Neustart des Systems an. Weitere erzeugte Berichte beziehen diese Informationen auf ein Zeitintervall, das in I definiert ist. Die Berichte zu Prozessen und Speicher werden unverzüglich ausgegeben." + +#. type: TP +#: ../man/vmstat.8:30 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/vmstat.8:37 +msgid "The I between updates in seconds. If no I is specified, only one report is printed with the average values since boot." +msgstr "gibt die I zwischen Aktualisierungen in Sekunden an. Falls keine I angegeben ist, wird nur ein Bericht ausgegeben, der die Durchschnittswerte seit dem Systemstart enthält." + +#. type: TP +#: ../man/vmstat.8:37 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/vmstat.8:44 +msgid "Number of updates. In absence of I, when I is defined, default is infinite." +msgstr "gibt die Anzahl der Aktualisierungen an. Wenn die I nicht angegeben, aber eine I definiert ist, dann ist die Anzahl der Aktualisierungen unendlich." + +#. type: TP +#: ../man/vmstat.8:44 +#, no-wrap +msgid "B<-a>, B<--active>" +msgstr "B<-a>, B<--active>" + +#. type: Plain text +#: ../man/vmstat.8:47 +msgid "Display active and inactive memory, given a 2.5.41 kernel or better." +msgstr "zeigt aktiven und inaktiven Speicher an. Dafür ist ein Kernel 2.5.41 oder neuer erforderlich." + +#. type: TP +#: ../man/vmstat.8:47 +#, no-wrap +msgid "B<-f>, B<--forks>" +msgstr "B<-f>, B<--forks>" + +#. type: Plain text +#: ../man/vmstat.8:55 +msgid "The B<-f> switch displays the number of forks since boot. This includes the fork, vfork, and clone system calls, and is equivalent to the total number of tasks created. Each process is represented by one or more tasks, depending on thread usage. This display does not repeat." +msgstr "Der Schalter B<-f> zeigt die Anzahl der Forks seit dem Systemstart an. Dies bezieht die Systemaufrufe »fork«, »vfork« und »clone« ein und entspricht der Gesamtzahl der erzeugten Tasks. Jeder Prozess wird durch ein oder mehrere Tasks repräsentiert, abhängig von der Thread-Nutzung. Diese Anzeige wird nicht wiederholt." + +#. type: TP +#: ../man/vmstat.8:55 +#, no-wrap +msgid "B<-m>, B<--slabs>" +msgstr "B<-m>, B<--slabs>" + +#. type: Plain text +#: ../man/vmstat.8:58 +msgid "Displays slabinfo." +msgstr "zeigt Slabinfo an." + +#. type: TP +#: ../man/vmstat.8:58 +#, no-wrap +msgid "B<-n>, B<--one-header>" +msgstr "B<-n>, B<--one-header>" + +#. type: Plain text +#: ../man/vmstat.8:61 +msgid "Display the header only once rather than periodically." +msgstr "zeigt den Header nur einmalig anstatt periodisch an." + +#. type: TP +#: ../man/vmstat.8:61 +#, no-wrap +msgid "B<-s>, B<--stats>" +msgstr "B<-s>, B<--stats>" + +#. type: Plain text +#: ../man/vmstat.8:65 +msgid "Displays a table of various event counters and memory statistics. This display does not repeat." +msgstr "zeigt eine Tabelle verschiedener Ereigniszähler und Speicherstatistiken an. Diese Anzeige wird nicht wiederholt." + +#. type: TP +#: ../man/vmstat.8:65 +#, no-wrap +msgid "B<-d>, B<--disk>" +msgstr "B<-d>, B<--disk>" + +#. type: Plain text +#: ../man/vmstat.8:68 +msgid "Report disk statistics (2.5.70 or above required)." +msgstr "zeigt Plattenstatistiken an (Kernel 2.5.70 oder neuer erforderlich)." + +#. type: TP +#: ../man/vmstat.8:68 +#, no-wrap +msgid "B<-D>, B<--disk-sum>" +msgstr "B<-D>, B<--disk-sum>" + +#. type: Plain text +#: ../man/vmstat.8:71 +msgid "Report some summary statistics about disk activity." +msgstr "zeigt eine statistische Zusammenfassung der Plattenaktivitäten an." + +#. type: TP +#: ../man/vmstat.8:71 +#, no-wrap +msgid "B<-p>, B<--partition> I" +msgstr "B<-p>, B<--partition> I" + +#. type: Plain text +#: ../man/vmstat.8:74 +msgid "Detailed statistics about partition (2.5.70 or above required)." +msgstr "zeigt detaillierte Statistiken zu Partitionen an (Kernel 2.5.70 oder neuer erforderlich)." + +#. type: TP +#: ../man/vmstat.8:74 +#, no-wrap +msgid "B<-S>, B<--unit> I" +msgstr "B<-S>, B<--unit> I" + +#. type: Plain text +#: ../man/vmstat.8:86 +msgid "Switches outputs between 1000 (I), 1024 (I), 1000000 (I), or 1048576 (I) bytes. Note this does not change the swap (si/so) or block (bi/bo) fields." +msgstr "wechselt die Einheit der Ausgabe zwischen 1000 (I), 1024 (I), 1000000 (I) oder 1048576 (I) Byte. Beachten Sie, dass diese Änderung die Swap- (si/so) oder Block-Felder (bi/bo) nicht beeinflusst, die stets in Blöcken gemessen werden." + +#. type: TP +#: ../man/vmstat.8:86 +#, no-wrap +msgid "B<-t>, B<--timestamp>" +msgstr "B<-t>, B<--timestamp>" + +#. type: Plain text +#: ../man/vmstat.8:89 +msgid "Append timestamp to each line" +msgstr "hängt an jede Zeile einen Zeitstempel an." + +#. type: Plain text +#: ../man/vmstat.8:94 +msgid "Wide output mode (useful for systems with higher amount of memory, where the default output mode suffers from unwanted column breakage). The output is wider than 80 characters per line." +msgstr "Breiter Ausgabemodus. Dieser ist sinnvoll, wenn der vorgegebene Ausgabemodus unerwünschte Umbrüche in den Spalten enthält, was für Systeme mit einer größeren Menge an Speicher vorkommt. Die Ausgabe ist breiter als 80 Zeichen pro Zeile." + +#. type: TP +#: ../man/vmstat.8:94 +#, no-wrap +msgid "B<-y>, B<--no-first>" +msgstr "B<-y>, B<--no-first>" + +#. type: Plain text +#: ../man/vmstat.8:97 +msgid "Omits first report with statistics since system boot." +msgstr "überspringt den ersten Bericht mit Statistiken seit dem Systemstart." + +#. type: SH +#: ../man/vmstat.8:104 +#, no-wrap +msgid "FIELD DESCRIPTION FOR VM MODE" +msgstr "FELDBESCHREIBUNG FÜR VM-MODUS" + +#. type: SS +#: ../man/vmstat.8:105 +#, no-wrap +msgid "Procs" +msgstr "Prozesse" + +#. type: Plain text +#: ../man/vmstat.8:109 +#, no-wrap +msgid "" +"r: The number of runnable processes (running or waiting for run time).\n" +"b: The number of processes blocked waiting for I/O to complete.\n" +msgstr "" +"r: die Anzahl der ausführbaren Prozesse (laufend oder auf Ausführungszeit wartend).\n" +"b: die Anzahl der blockierten Prozesse, auf Ein-/Ausgaben zum Abschluss wartend.\n" + +#. type: SS +#: ../man/vmstat.8:110 +#, no-wrap +msgid "Memory" +msgstr "Speicher" + +#. type: Plain text +#: ../man/vmstat.8:112 ../man/vmstat.8:122 +msgid "These are affected by the B<--unit> option." +msgstr "Diese werden von der Option B<--unit> beeinflusst." + +# FIXME formatting +#. type: Plain text +#: ../man/vmstat.8:119 +#, no-wrap +msgid "" +"swpd: the amount of swap memory used.\n" +"free: the amount of idle memory.\n" +"buff: the amount of memory used as buffers.\n" +"cache: the amount of memory used as cache.\n" +"inact: the amount of inactive memory. (B<-a> option)\n" +"active: the amount of active memory. (B<-a> option)\n" +msgstr "" +"swpd: die Menge des verwendeten Auslagerungsspeichers.\n" +"free: die Menge des untätigen Speichers.\n" +"buff: die Menge des als Puffer verwendeten Speichers.\n" +"cache: die Menge des als Zwischenspeicher verwendeten Speichers.\n" +"inact: die Menge des inaktiven Speichers (Option B<-a>)\n" +"active: die Menge des aktiven Speichers (Option B<-a>)\n" + +#. type: SS +#: ../man/vmstat.8:120 +#, no-wrap +msgid "Swap" +msgstr "Swap" + +#. type: Plain text +#: ../man/vmstat.8:125 +#, no-wrap +msgid "" +"si: Amount of memory swapped in from disk (/s).\n" +"so: Amount of memory swapped to disk (/s).\n" +msgstr "" +"si: Speichermenge aus dem Auslagerungsspeicher geholt (/s).\n" +"so: Speichermenge in den Auslagerungsspeicher geschrieben (/s).\n" + +#. type: SS +#: ../man/vmstat.8:126 ../man/vmstat.8:161 +#, no-wrap +msgid "IO" +msgstr "E/A" + +#. type: Plain text +#: ../man/vmstat.8:130 +#, no-wrap +msgid "" +"bi: Kibibyte received from a block device (KiB/s).\n" +"bo: Kibibyte sent to a block device (KiB/s).\n" +msgstr "" +"bi: von einem Blockgerät empfangene Kibibyte (KiB/s).\n" +"bo: an ein Blockgerät gesendete Kibibyte (KiB/s).\n" + +#. type: SS +#: ../man/vmstat.8:131 +#, no-wrap +msgid "System" +msgstr "System" + +#. type: Plain text +#: ../man/vmstat.8:135 +#, no-wrap +msgid "" +"in: The number of interrupts per second, including the clock.\n" +"cs: The number of context switches per second.\n" +msgstr "" +"in: Anzahl der Interrupts pro Sekunde, einschließlich der Uhr.\n" +"cs: Anzahl der Kontext-Switches pro Sekunde.\n" + +#. type: ds PU +#: ../man/vmstat.8:136 ../man/top.1:37 +#, no-wrap +msgid "CPU" +msgstr "CPU" + +#. type: Plain text +#: ../man/vmstat.8:138 +msgid "These are percentages of total CPU time." +msgstr "Dies sind Prozentsätze der gesamten CPU-Zeit." + +#. type: Plain text +#: ../man/vmstat.8:145 +#, no-wrap +msgid "" +"us: Time spent running non-kernel code. (user time, including nice time)\n" +"sy: Time spent running kernel code. (system time)\n" +"id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.\n" +"wa: Time spent waiting for IO. Prior to Linux 2.5.41, included in idle.\n" +"st: Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown.\n" +"gu: Time spent running KVM guest code (guest time, including guest nice).\n" +msgstr "" +"us: Verbrauchte Zeit für Nicht-Kernel-Code (Benutzerzeit, einschließlich Nice-Zeit)\n" +"sy: Verbrauchte Zeit für Kernel-Code (Systemzeit)\n" +"id: Verbrauchte Zeit für Leerlauf. Vor Linux 2.5.41 bezieht dies die E/A-Wartezeit ein.\n" +"wa: Verbrauchte Zeit für Warten auf E/A. Vor Linux 2.5.41 bezieht dies die Leerlaufzeit ein.\n" +"st: Von einer virtuellen Maschine abgezweigte Zeit. Vor Linux 2.6.11 ist diese unbekannt.\n" +"gu: Verbrauchte Zeit für KVM-Gastcode (Gastzeit, einschließlich Gast-Nice).\n" + +#. type: SH +#: ../man/vmstat.8:146 +#, no-wrap +msgid "FIELD DESCRIPTION FOR DISK MODE" +msgstr "FELDBESCHREIBUNG FÜR PlattenMODUS" + +#. type: SS +#: ../man/vmstat.8:147 +#, no-wrap +msgid "Reads" +msgstr "Lesevorgänge" + +#. type: Plain text +#: ../man/vmstat.8:153 +#, no-wrap +msgid "" +"total: Total reads completed successfully\n" +"merged: grouped reads (resulting in one I/O)\n" +"sectors: Sectors read successfully\n" +"ms: milliseconds spent reading\n" +msgstr "" +"total: Gesamtzahl erfolgreich abgeschlossener Lesevorgänge\n" +"merged: Gruppierte Lesevorgänge (resultierend in einem E/A-Vorgang)\n" +"sectors: Erfolgreich gelesene Sektoren\n" +"ms: Zeit für Lesevorgänge in Millisekunden\n" + +#. type: SS +#: ../man/vmstat.8:154 +#, no-wrap +msgid "Writes" +msgstr "Schreibvorgänge" + +#. type: Plain text +#: ../man/vmstat.8:160 +#, no-wrap +msgid "" +"total: Total writes completed successfully\n" +"merged: grouped writes (resulting in one I/O)\n" +"sectors: Sectors written successfully\n" +"ms: milliseconds spent writing\n" +msgstr "" +"total: Gesamtzahl erfolgreich abgeschlossener Schreibvorgänge\n" +"merged: Gruppierte Schreibvorgänge (resultierend in einem E/A-Vorgang)\n" +"sectors: Erfolgreich geschriebene Sektoren\n" +"ms: Zeit für Schreibvorgänge in Millisekunden\n" + +#. type: Plain text +#: ../man/vmstat.8:165 +#, no-wrap +msgid "" +"cur: I/O in progress\n" +"s: seconds spent for I/O\n" +msgstr "" +"cur: E/A in Verarbeitung\n" +"s: für E/A verbrauchte Sekunden\n" + +#. type: SH +#: ../man/vmstat.8:166 +#, no-wrap +msgid "FIELD DESCRIPTION FOR DISK PARTITION MODE" +msgstr "FELDBESCHREIBUNG FÜR PLATTENPARTITIONSMODUS" + +#. type: Plain text +#: ../man/vmstat.8:172 +#, no-wrap +msgid "" +"reads: Total number of reads issued to this partition\n" +"read sectors: Total read sectors for partition\n" +"writes : Total number of writes issued to this partition\n" +"requested writes: Total number of write requests made for partition\n" +msgstr "" +"reads: Gesamtzahl der Lesevorgänge auf dieser Partition\n" +"read sectors: Insgesamt gelesene Sektoren auf dieser Partition\n" +"writes : Gesamtzahl der Schreibvorgänge auf dieser Partition\n" +"requested writes: Gesamtzahl der für diese Partition\n" +" angeforderten Schreibvorgänge\n" + +#. type: SH +#: ../man/vmstat.8:173 +#, no-wrap +msgid "FIELD DESCRIPTION FOR SLAB MODE" +msgstr "FELDBESCHREIBUNG FÜR SLAB-MODUS" + +#. type: Plain text +#: ../man/vmstat.8:177 +msgid "Slab mode shows statistics per slab, for more information about this information see B(5)" +msgstr "Der Slab-Modus zeigt Statistiken pro Slab an; weitere Informationen hierzu finden Sie in B(5)." + +#. type: Plain text +#: ../man/vmstat.8:184 +#, no-wrap +msgid "" +"cache: Cache name\n" +"num: Number of currently active objects\n" +"total: Total number of available objects\n" +"size: Size of each object\n" +"pages: Number of pages with at least one active object\n" +msgstr "" +"cache: Zwischenspeichername\n" +"num: Anzahl der gegenwärtig aktiven Objekte\n" +"total: Gesamtzahl der verfügbaren Objekte\n" +"size: Größe jedes Objekts\n" +"pages: Anzahl der Seiten mit mindestens einem aktiven Objekt\n" + +#. type: Plain text +#: ../man/vmstat.8:191 +msgid "B requires read access to files under I. The B<-m> requires read access to I which may not be available to standard users. Mount options for I such as I may also impact what is visible." +msgstr "B benötigt Lesezugriff auf Dateien unterhalb von I. Die Option B<-m> erfordert Lesezugriff auf I, was bei Standardbenutzern unter Umständen nicht der Fall ist. Auch die Einhängeoptionen für I, wie beispielsweise I, könnten sich darauf auswirken, was tatsächlich angezeigt wird." + +#. type: Plain text +#: ../man/vmstat.8:199 +msgid "B(1), B(1), B(1), B(1), B(1), B(1), B(5)" +msgstr "B(1), B(1), B(1), B(1), B(1), B(1), B(5)" + +#. type: TP +#: ../man/w.1:14 ../man/ps.1:852 +#, no-wrap +msgid "W" +msgstr "W" + +#. type: TH +#: ../man/w.1:14 +#, no-wrap +msgid "2023-01-15" +msgstr "15. Januar 2023" + +#. type: Plain text +#: ../man/w.1:17 +msgid "w - Show who is logged on and what they are doing." +msgstr "w - anzeigen, welche Benutzer angemeldet sind und was sie machen." + +#. type: Plain text +#: ../man/w.1:20 +msgid "B [I] [I]" +msgstr "B [I] [I]" + +#. type: Plain text +#: ../man/w.1:26 +msgid "B displays information about the users currently on the machine, and their processes. The header shows, in this order, the current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes." +msgstr "B zeigt Informationen über die gerade angemeldeten Benutzer und ihre Prozesse an. Die Kopfzeile enthält in dieser Reihenfolge die aktuelle Zeit, die Laufzeit des Systems, wie viele Benutzer gerade angemeldet sind und die durchschnittliche Systemlast der letzten 1, 5 und 15 Minuten." + +#. type: Plain text +#: ../man/w.1:30 +msgid "The following entries are displayed for each user: login name, the tty name, the remote host, login time, idle time, JCPU, PCPU, and the command line of their current process." +msgstr "Die folgenden Daten werden für jeden Benutzer angezeigt: Der Anmeldename, der TTY-Name, der ferne Rechner, die Anmeldezeit, die Leerlaufzeit, JCPU, PCPU und die Befehlszeile des laufenden Prozesses." + +#. type: Plain text +#: ../man/w.1:34 +msgid "The JCPU time is the time used by all processes attached to the tty. It does not include past background jobs, but does include currently running background jobs." +msgstr "Die JCPU-Zeit ist die Zeit, die von allen Prozessen genutzt wurde, die zu dem jeweiligen Terminal gehören. Sie enthält keine abgeschlossenen Hintergrund-Aufträge, jedoch die derzeit laufenden Hintergrund-Aufträge." + +#. type: Plain text +#: ../man/w.1:37 +msgid "The PCPU time is the time used by the current process, named in the \"what\" field." +msgstr "Die PCPU-Zeit ist die Zeit, die vom derzeit laufenden Prozess bisher genutzt wurde und im Feld »what« benannt ist." + +#. type: SH +#: ../man/w.1:37 +#, no-wrap +msgid "COMMAND-LINE OPTIONS" +msgstr "BEFEHLSZEILENOPTIONEN" + +#. type: TP +#: ../man/w.1:38 +#, no-wrap +msgid "B<-h>, B<--no-header>" +msgstr "B<-h>, B<--no-header>" + +#. type: Plain text +#: ../man/w.1:41 +msgid "Don't print the header." +msgstr "gibt keine Kopfzeile aus." + +#. type: TP +#: ../man/w.1:41 +#, no-wrap +msgid "B<-u>, B<--no-current>" +msgstr "B<-u>, B<--no-current>" + +# FIXME command formatting +#. type: Plain text +#: ../man/w.1:50 +msgid "Ignores the username while figuring out the current process and cpu times. To demonstrate this, do a B and do a B and a B." +msgstr "ignoriert den Benutzernamen, während der aktuelle Prozess und die CPU-Zeiten ermittelt werden. Probieren Sie die Option aus, indem Sie zunächst B, danach B und B eingeben." + +#. type: TP +#: ../man/w.1:50 +#, no-wrap +msgid "B<-s>, B<--short>" +msgstr "B<-s>, B<--short>" + +#. type: Plain text +#: ../man/w.1:53 +msgid "Use the short format. Don't print the login time, JCPU or PCPU times." +msgstr "verwendet das Kurzformat. Die Anmeldezeit, die JCPU- und die PCPU-Zeit werden nicht ausgegeben." + +#. type: TP +#: ../man/w.1:53 +#, no-wrap +msgid "B<-f>, B<--from>" +msgstr "B<-f>, B<--from>" + +#. type: Plain text +#: ../man/w.1:63 +msgid "Toggle printing the B (remote hostname) field. The default as released is for the B field to not be printed, although your system administrator or distribution maintainer may have compiled a version in which the B field is shown by default." +msgstr "schaltet die Anzeige des B-Feldes (ferner Rechnername) ein oder aus. Standardmäßig wird das B-Feld nicht angezeigt. Allerdings könnte Ihr Systemadministrator oder Ihr Distributor eine Version kompiliert haben, in der das B-Feld standardmäßig angezeigt wird." + +#. type: TP +#: ../man/w.1:66 +#, no-wrap +msgid "B<-i>, B<--ip-addr>" +msgstr "B<-i>, B<--ip-addr>" + +#. type: Plain text +#: ../man/w.1:69 +msgid "Display IP address instead of hostname for B field." +msgstr "zeigt die IP-Adresse anstelle des Rechnernamens im Feld B an." + +#. type: TP +#: ../man/w.1:69 +#, no-wrap +msgid "B<-p>, B<--pids>" +msgstr "B<-p>, B<--pids>" + +#. type: Plain text +#: ../man/w.1:72 +msgid "Display pid of the login process/the \"what\" process in the \"what\" field." +msgstr "" + +#. type: TP +#: ../man/w.1:75 +#, no-wrap +msgid "B<-o>, B<--old-style>" +msgstr "B<-o>, B<--old-style>" + +#. type: Plain text +#: ../man/w.1:78 +msgid "Old style output. Prints blank space for idle times less than one minute." +msgstr "aktiviert die Ausgabe im alten Stil. Für Leerlaufzeiten unter einer Minute werden Leerräume ausgegeben." + +#. type: TP +#: ../man/w.1:78 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/w.1:81 +msgid "Show information about the specified user only." +msgstr "zeigt Informationen nur für den angegebenen Benutzer an." + +#. type: SH +#: ../man/w.1:81 ../man/watch.1:133 +#, no-wrap +msgid "ENVIRONMENT" +msgstr "UMGEBUNGSVARIABLEN" + +#. type: TP +#: ../man/w.1:82 +#, no-wrap +msgid "PROCPS_USERLEN" +msgstr "PROCPS_USERLEN" + +#. type: Plain text +#: ../man/w.1:85 +msgid "Override the default width of the username column. Defaults to 8." +msgstr "setzt die vorgegebene Breite der USER-Spalte außer Kraft. Standardmäßig 8." + +#. type: TP +#: ../man/w.1:85 +#, no-wrap +msgid "PROCPS_FROMLEN" +msgstr "PROCPS_FROMLEN" + +#. type: Plain text +#: ../man/w.1:88 +msgid "Override the default width of the from column. Defaults to 16." +msgstr "setzt die vorgegebene Breite der From-Spalte außer Kraft. Standardmäßig 16." + +#. type: Plain text +#: ../man/w.1:102 +msgid "B(1), B(1), B(1), B(1), B(5), B(1)" +msgstr "B(1), B(1), B(1), B(1), B(5), B(1)" + +#. type: Plain text +#: ../man/w.1:112 +msgid "B was re-written almost entirely by Charles Blake, based on the version by E<.UR greenfie@\\:gauss.\\:rutgers.\\:edu> Larry Greenfield E<.UE> and E<.UR johnsonm@\\:redhat.\\:com> Michael K. Johnson E<.UE>" +msgstr "B wurde von Charles Blake fast vollständig neu geschrieben, basierend auf der Version von E<.UR greenfie@\\:gauss.\\:rutgers.\\:edu> Larry Greenfield E<.UE> und E<.UR johnsonm@\\:redhat.\\:com> Michael K. Johnson E<.UE>" + +#. type: TH +#: ../man/watch.1:13 +#, no-wrap +msgid "WATCH" +msgstr "WATCH" + +#. type: TH +#: ../man/watch.1:13 +#, no-wrap +msgid "2023-01-17" +msgstr "17. Januar 2023" + +#. type: Plain text +#: ../man/watch.1:16 +msgid "watch - execute a program periodically, showing output fullscreen" +msgstr "watch - ein Programm periodisch ausführen, die Ausgabe im Vollbildmodus anzeigen" + +#. type: Plain text +#: ../man/watch.1:19 +msgid "B [I] I" +msgstr "B [I] I" + +#. type: Plain text +#: ../man/watch.1:26 +msgid "B runs I repeatedly, displaying its output and errors (the first screenfull). This allows you to watch the program output change over time. By default, I is run every 2 seconds and B will run until interrupted." +msgstr "B führt den I wiederholt aus, wobei dessen Ausgabe und Fehler angezeigt werden (der erste Bildschirminhalt). Dies ermöglicht Ihnen die Überwachung der Änderungen der Programmausgaben über längere Zeit. Standardmäßig wird der I alle zwei Sekunden ausgeführt und B läuft, bis es unterbrochen wird." + +#. type: TP +#: ../man/watch.1:27 +#, no-wrap +msgid "B<-b>, B<--beep>" +msgstr "B<-b>, B<--beep>" + +#. type: Plain text +#: ../man/watch.1:30 +msgid "Beep if command has a non-zero exit." +msgstr "lässt die Systemglocke ertönen, falls ein Befehl sich mit einem von Null verschiedenen Rückgabewert beendet." + +#. type: TP +#: ../man/watch.1:30 +#, no-wrap +msgid "B<-c>, B<--color>" +msgstr "B<-c>, B<--color>" + +#. type: Plain text +#: ../man/watch.1:33 +msgid "Interpret ANSI color and style sequences." +msgstr "interpretiert ANSI-Farb- und -Stilsequenzen." + +#. type: TP +#: ../man/watch.1:33 +#, no-wrap +msgid "B<-C>, B<--no-color>" +msgstr "B<-C>, B<--no-color>" + +#. type: Plain text +#: ../man/watch.1:36 +msgid "Do not interpret ANSI color and style sequences." +msgstr "interpretiert keine ANSI-Farb- und -Stilsequenzen." + +#. type: TP +#: ../man/watch.1:36 +#, no-wrap +msgid "B<-d>, B<--differences>[=I]" +msgstr "B<-d>, B<--differences>[=I]" + +# FIXME Formulierung des zweiten Satzes +#. type: Plain text +#: ../man/watch.1:42 +msgid "Highlight the differences between successive updates. If the optional I argument is specified then B will show all changes since the first iteration." +msgstr "hebt die Unterschiede zwischen aufeinander folgenden Aktualisierungen hervor. Falls das optionale Argument I angegeben ist, dann zeigt B alles, was sich seit dem ersten Durchlauf mindestens einmal geändert hat." + +#. type: TP +#: ../man/watch.1:42 +#, no-wrap +msgid "B<-e>, B<--errexit>" +msgstr "B<-e>, B<--errexit>" + +#. type: Plain text +#: ../man/watch.1:45 +msgid "Freeze updates on command error, and exit after a key press." +msgstr "friert die Aktualisierungen bei Fehlern in der Befehlsausführung ein und bricht nach einem Tastendruck ab." + +#. type: TP +#: ../man/watch.1:45 +#, no-wrap +msgid "B<-g>, B<--chgexit>" +msgstr "B<-g>, B<--chgexit>" + +#. type: Plain text +#: ../man/watch.1:50 +msgid "Exit when the output of I changes." +msgstr "beendet, wenn sich die Ausgabe des I ändert." + +#. type: TP +#: ../man/watch.1:50 +#, no-wrap +msgid "B<-n>, B<--interval> I" +msgstr "B<-n>, B<--interval> I" + +# FIXME formatting +#. type: Plain text +#: ../man/watch.1:56 +msgid "Specify update interval. The command will not allow quicker than 0.1 second interval, in which the smaller values are converted. Both '.' and ',' work for any locales. The B environment can be used to persistently set a non-default interval (following the same rules and formatting)." +msgstr "gibt das Aktualisierungsintervall an. Der Befehl erlaubt kein Intervall kleiner als 0,1 Sekunden; kleinere Werte werden auf diesen Wert geändert. In einigen Locales funktionieren sowohl »,« als auch ».«. Mit der Umgebungsvariable B können Sie ein Nicht-Standard-Intervall dauerhaft setzen (den gleichen Regeln und der gleichen Formatierung folgend)." + +#. type: TP +#: ../man/watch.1:56 +#, no-wrap +msgid "B<-p>, B<--precise>" +msgstr "B<-p>, B<--precise>" + +#. type: Plain text +#: ../man/watch.1:69 +msgid "Make B attempt to run I every B<--interval> I. Try it with B (if present) and notice how the fractional seconds stays (nearly) the same, as opposed to normal mode where they continuously increase." +msgstr "lässt B versuchen, diesen I im angegebenen B<--interval> in I auszuführen. Versuchen Sie es mit B (falls verfügbar) und beachten Sie, wie die Sekundenbruchteile (nahezu) gleich bleiben, während sie im normalen Modus fortwährend größer werden." + +#. type: TP +#: ../man/watch.1:69 +#, no-wrap +msgid "B<-q>, B<--equexit> EcyclesE" +msgstr "B<-q>, B<--equexit> EDurchläufeE" + +#. type: Plain text +#: ../man/watch.1:74 +msgid "Exit when output of I does not change for the given number of cycles." +msgstr "beendet, wenn sich die Ausgabe des I über die angegebene Anzahl durchläufe nicht ändert." + +#. type: TP +#: ../man/watch.1:74 +#, no-wrap +msgid "B<-r>, B<--no-rerun>" +msgstr "B<-r>, B<--no-rerun>" + +#. type: Plain text +#: ../man/watch.1:78 +msgid "Do not run the program on terminal resize, the output of the program will re-appear at the next regular run time." +msgstr "führt das Programm bei Änderungen der Terminalgröße nicht erneut aus; die Ausgabe des Programms erscheint wieder zum nächsten regulären Ausführungszeitpunkt." + +#. type: TP +#: ../man/watch.1:78 +#, no-wrap +msgid "B<-t>, B<--no-title>" +msgstr "B<-t>, B<--no-title>" + +#. type: Plain text +#: ../man/watch.1:82 +msgid "Turn off the header showing the interval, command, and current time at the top of the display, as well as the following blank line." +msgstr "deaktiviert die Anzeige der Kopfzeile, in der Intervall, Befehl und die aktuelle Zeit oben in der Anzeige sowie eine nachfolgende Leerzeile dargestellt werden." + +#. type: TP +#: ../man/watch.1:82 +#, no-wrap +msgid "B<-w>, B<--no-wrap>" +msgstr "B<-w>, B<--no-wrap>" + +#. type: Plain text +#: ../man/watch.1:85 +msgid "Turn off line wrapping. Long lines will be truncated instead of wrapped to the next line." +msgstr "deaktiviert den Zeilenumbruch. Lange Zeilen werden gekürzt, anstatt sie in die nächste Zeile umzubrechen." + +#. type: TP +#: ../man/watch.1:85 +#, no-wrap +msgid "B<-x>, B<--exec>" +msgstr "B<-x>, B<--exec>" + +#. type: Plain text +#: ../man/watch.1:94 +msgid "Pass I to B(2) instead of B which reduces the need to use extra quoting to get the desired effect." +msgstr "übergibt den I an B(2) anstelle von B, was das Setzen von Anführungszeichen unnötig macht, um den gewünschten Effekt zu erzielen." + +#. type: TP +#: ../man/watch.1:97 +#, no-wrap +msgid "B<-v>, B<--version>" +msgstr "B<-v>, B<--version>" + +#. type: Plain text +#: ../man/watch.1:110 +msgid "Various failures." +msgstr "Verschiedene Fehlschläge." + +#. type: TP +#: ../man/watch.1:110 +#, no-wrap +msgid "B<2>" +msgstr "B<2>" + +#. type: Plain text +#: ../man/watch.1:113 +msgid "Forking the process to watch failed." +msgstr "Forken des zu überwachenden Prozesses ist fehlgeschlagen." + +#. type: TP +#: ../man/watch.1:113 +#, no-wrap +msgid "B<3>" +msgstr "B<3>" + +#. type: Plain text +#: ../man/watch.1:116 +msgid "Replacing child process stdout with write side pipe failed." +msgstr "Ersetzen der Standardausgabe des Kindprozesses von der Schreibseite der Pipe aus ist fehlgeschlagen." + +#. type: TP +#: ../man/watch.1:116 +#, no-wrap +msgid "B<4>" +msgstr "B<4>" + +#. type: Plain text +#: ../man/watch.1:119 +msgid "Command execution failed." +msgstr "Befehlsausführung ist fehlgeschlagen." + +#. type: TP +#: ../man/watch.1:119 +#, no-wrap +msgid "B<5>" +msgstr "B<5>" + +#. type: Plain text +#: ../man/watch.1:122 +msgid "Closing child process write pipe failed." +msgstr "Schließen der Schreib-Pipe des Kindprozesses ist fehlgeschlagen." + +#. type: TP +#: ../man/watch.1:122 +#, no-wrap +msgid "B<7>" +msgstr "B<7>" + +#. type: Plain text +#: ../man/watch.1:125 +msgid "IPC pipe creation failed." +msgstr "Erzeugung der IPC-Pipe ist fehlgeschlagen." + +#. type: TP +#: ../man/watch.1:125 +#, no-wrap +msgid "B<8>" +msgstr "B<8>" + +#. type: Plain text +#: ../man/watch.1:130 +msgid "Getting child process return value with B(2) failed, or command exited up on error." +msgstr "Das Ermitteln des Rückgabewertes des Kindprozesses mit B(2) ist fehlgeschlagen oder der Befehl brach aufgrund eines Fehlers ab." + +#. type: TP +#: ../man/watch.1:130 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/watch.1:133 +msgid "The watch will propagate command exit status as child exit status." +msgstr "Die Überwachung gibt den Exit-Status des Befehls als Exit-Status des Kindprozesses weiter." + +#. type: Plain text +#: ../man/watch.1:137 +msgid "The behavior of B is affected by the following environment variables." +msgstr "Das Verhalten von B wird durch die folgenden Umgebungsvariablen beeinflusst." + +#. type: TP +#: ../man/watch.1:138 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/watch.1:143 +msgid "Update interval, follows the same rules as the B<--interval> command line option." +msgstr "Aktualisierungsintervall, welches den gleichen Regeln wie die Befehlszeilenoption B<--interval> folgt." + +#. type: Plain text +#: ../man/watch.1:151 +msgid "POSIX option processing is used (i.e., option processing stops at the first non-option argument). This means that flags after I don't get interpreted by B itself." +msgstr "Die Optionen werden gemäß POSIX verarbeitet (das heißt, die Optionsverarbeitung stoppt nach dem ersten Argument, das keine Option ist). Das bedeutet, dass Schalter nach dem I nicht von B selbst interpretiert werden." + +#. type: Plain text +#: ../man/watch.1:159 +msgid "Upon terminal resize, the screen will not be correctly repainted until the next scheduled update. All B<--differences> highlighting is lost on that update as well. When using the B<--no-rerun> option, no output of will be visible." +msgstr "Bei Größenänderungen des Terminals wird der Bildschirm nicht korrekt neu gezeichnet, bis die nächste geplante Aktualisierung erfolgt. Jegliche Hervorhebungen durch B<--differences> gehen durch diese Aktualisierung ebenfalls verloren. Wenn Sie die Option B<--no-rerun> verwenden, erfolgt keine Ausgabe." + +# FIXME command formatting +#. type: Plain text +#: ../man/watch.1:162 +msgid "Non-printing characters are stripped from program output. Use B as part of the command pipeline if you want to see them." +msgstr "Nicht darstellbare Zeichen werden aus der Programmausgabe entfernt. Verwenden Sie B als Teil der Befehls-Pipeline, wenn Sie diese sehen wollen." + +#. type: Plain text +#: ../man/watch.1:166 +msgid "Combining Characters that are supposed to display on the character at the last column on the screen may display one column early, or they may not display at all." +msgstr "Kombinierende Zeichen, die mit einem Zeichen in der letzten Spalte des Bildschirms angezeigt werden sollen, könnten eine Spalte vorher erscheinen oder überhaupt nicht dargestellt werden." + +#. type: Plain text +#: ../man/watch.1:170 +msgid "Combining Characters never count as different in B<--differences> mode. Only the base character counts." +msgstr "Kombinierende Zeichen werden im Modus B<--differences> nie als Unterschiede gewertet. Es wird nur das Basiszeichen ausgewertet." + +#. type: Plain text +#: ../man/watch.1:173 +msgid "Blank lines directly after a line which ends in the last column do not display." +msgstr "Leere Zeilen direkt nach einer Zeile, die in der letzten Spalte endet, werden nicht angezeigt." + +#. type: Plain text +#: ../man/watch.1:190 +msgid "B<--precise> mode doesn't yet have advanced temporal distortion technology to compensate for a I that takes more than B<--interval> I to execute. B also can get into a state where it rapid-fires as many executions of I as it can to catch up from a previous executions running longer than B<--interval> (for example, B(8) taking ages on a DNS lookup)." +msgstr "Der Modus B<--precise> verfügt noch nicht über eine fortgeschrittene Technologie zur zeitlichen Verzerrungskompensierung eines Befehls, dessen Ausführung mehr als die als B<--interval> angegebenen I benötigt. B kann auch in einen Zustand gelangen, wo es so viele Befehlsausführungen auslöst, wie es kann, um frühere Ausführungen aufzuholen, die länger als das B<--interval> benötigen (zum Beispiel wenn B(8) eine unglaublich lange Zeit bei einem DNS-Suchvorgang braucht)." + +#. type: Plain text +#: ../man/watch.1:194 +msgid "To watch for mail, you might do" +msgstr "Nach neuen Mails schauen:" + +#. type: Plain text +#: ../man/watch.1:196 +msgid "watch -n 60 from" +msgstr "watch -n 60 from" + +#. type: Plain text +#: ../man/watch.1:198 +msgid "To watch the contents of a directory change, you could use" +msgstr "Den Inhalt eines Verzeichnisses auf Änderungen überwachen:" + +#. type: Plain text +#: ../man/watch.1:200 +msgid "watch -d ls -l" +msgstr "watch -d ls -l" + +#. type: Plain text +#: ../man/watch.1:202 +msgid "If you're only interested in files owned by user joe, you might use" +msgstr "Nur nach den Dateien des Benutzers »joe« schauen:" + +#. type: Plain text +#: ../man/watch.1:204 +msgid "watch -d 'ls -l | fgrep joe'" +msgstr "watch -d 'ls -l | fgrep joe'" + +#. type: Plain text +#: ../man/watch.1:206 +msgid "To see the effects of quoting, try these out" +msgstr "Die Effekte von Anführungszeichen sehen:" + +#. type: Plain text +#: ../man/watch.1:208 +msgid "watch echo $$" +msgstr "watch echo $$" + +#. type: Plain text +#: ../man/watch.1:210 +msgid "watch echo '$$'" +msgstr "watch echo '$$'" + +#. type: Plain text +#: ../man/watch.1:212 +msgid "watch echo \"'\"'$$'\"'\"" +msgstr "watch echo \"'\"'$$'\"'\"" + +#. type: Plain text +#: ../man/watch.1:216 +msgid "To see the effect of precision time keeping, try adding B<-p> to" +msgstr "Um den Effekt der genauen Zeithaltung zu beobachten, versuchen Sie, I<-p> zu Folgendem hinzuzufügen:" + +#. type: Plain text +#: ../man/watch.1:218 +msgid "watch -n 10 sleep 1" +msgstr "watch -n 10 sleep 1" + +#. type: Plain text +#: ../man/watch.1:220 +msgid "You can watch for your administrator to install the latest kernel with" +msgstr "Beobachten, wenn Ihr Administrator den neuesten Kernel installiert:" + +#. type: Plain text +#: ../man/watch.1:222 +msgid "watch uname -r" +msgstr "watch uname -r" + +#. type: Plain text +#: ../man/watch.1:228 +msgid "(Note that B<-p> isn't guaranteed to work across reboots, especially in the face of B (if present) or other bootup time-changing mechanisms)" +msgstr "(Beachten Sie, dass nicht garantiert werden kann, dass B<-p> nach einem Neustart noch funktioniert, insbesondere im Hinblick auf B (falls verfügbar) oder andere die Zeit beeinflussende Startmechanismen)" + +#. type: TH +#: ../man/ps.1:13 +#, no-wrap +msgid "PS" +msgstr "PS" + +#. type: Plain text +#: ../man/ps.1:29 +msgid "ps - report a snapshot of the current processes." +msgstr "ps - einen Schnappschuss der aktuellen Prozesse darstellen." + +#. type: Plain text +#: ../man/ps.1:31 +msgid "B [\\,I]" +msgstr "B [\\,I]" + +#. type: Plain text +#: ../man/ps.1:37 +msgid "B displays information about a selection of the active processes. If you want a repetitive update of the selection and the displayed information, use B instead." +msgstr "B zeigt Informationen zu einer Auswahl aktiver Prozesse an. Falls Sie eine wiederholte Aktualisierung der Auswahl und der angezeigten Informationen benötigen, verwenden Sie stattdessen B." + +#. type: Plain text +#: ../man/ps.1:41 +msgid "This version of B accepts several kinds of options:" +msgstr "Diese Version von B akzeptiert verschiedene Arten von Optionen:" + +#. type: Plain text +#: ../man/ps.1:45 +msgid "UNIX options, which may be grouped and must be preceded by a dash." +msgstr "UNIX-Optionen, die gruppiert sein können und denen ein Bindestrich vorangestellt werden darf." + +#. type: Plain text +#: ../man/ps.1:47 +msgid "BSD options, which may be grouped and must not be used with a dash." +msgstr "BSD-Optionen, die gruppiert sein können und denen kein Bindestrich vorangestellt werden muss." + +#. type: Plain text +#: ../man/ps.1:49 +msgid "GNU long options, which are preceded by two dashes." +msgstr "Lange GNU-Optionen, denen zwei Bindestriche vorangestellt werden müssen." + +#. type: Plain text +#: ../man/ps.1:58 +msgid "Options of different types may be freely mixed, but conflicts can appear. There are some synonymous options, which are functionally identical, due to the many standards and B implementations that this B is compatible with." +msgstr "Optionen verschiedener Typen können beliebig gemischt werden, was aber auch Konflikte hervorrufen kann. Es gibt einige gleichbedeutende Optionen, die funktionell identisch sind. Das beruht auf den zahlreichen Standards und Implementationen von B, zu denen das vorliegende B kompatibel ist." + +#. type: Plain text +#: ../man/ps.1:66 +msgid "By default, B selects all processes with the same effective user ID (euid=EUID) as the current user and associated with the same terminal as the invoker. It displays the process ID (pid=PID), the terminal associated with the process (tname=TTY), the cumulated CPU time in [DD-]hh:mm:ss format (time=TIME), and the executable name (ucmd=CMD). Output is unsorted by default." +msgstr "Standardmäßig wählt B alle Prozesse mit der effektiven Benutzerkennung (euid=EUID) des aktuellen Benutzers aus, die dem gleichen Terminal wie der Aufrufende zugeordnet sind. Es zeigt die Prozesskennung (pid=PID), das dem Prozess zugeordnete Terminal (tname=TTY), die kumulierte CPU-Zeit (time=TIME) im Format [TT-]hh:mm:ss sowie den Namen des ausführbaren Programms an. Die Ausgabe wird standardmäßig nicht sortiert." + +#. type: Plain text +#: ../man/ps.1:79 +msgid "The use of BSD-style options will add process state (stat=STAT) to the default display and show the command args (args=COMMAND) instead of the executable name. You can override this with the B environment variable. The use of BSD-style options will also change the process selection to include processes on other terminals (TTYs) that are owned by you; alternately, this may be described as setting the selection to be the set of all processes filtered to exclude processes owned by other users or not on a terminal. These effects are not considered when options are described as being \"identical\" below, so B<-M> will be considered identical to B and so on." +msgstr "Durch die Verwendung von Optionen im BSD-Stil wird der Prozessstatus (stat=STATUS) zur standardmäßigen Anzeige hinzugefügt und die Befehlsargumente (args=BEFEHL) anstelle des Namens der ausführbaren Datei angezeigt. Sie können dies in der Umgebungsvariable B außer Kraft setzen. Durch die Verwendung von Optionen im BSD-Stil zeigt die Prozessauswahl außerdem Prozesse auf anderen Terminals (TTYs) an, deren Besitzer Sie selbst sind; alternativ könnte dies als Setzen der Auswahl auf alle Prozesse beschrieben werden, aus denen aber Prozesse herausgefiltert werden, die anderen Benutzern gehören oder nicht auf einem Terminal laufen. Diese Effekte werden nicht berücksichtigt, wenn Optionen nachfolgend als »gleichbedeutend« beschrieben werden, so wird B<-M> als gleichbedeutend mit B usw. aufgefasst." + +#. type: Plain text +#: ../man/ps.1:84 +msgid "Except as described below, process selection options are additive. The default selection is discarded, and then the selected processes are added to the set of processes to be displayed. A process will thus be shown if it meets any of the given selection criteria." +msgstr "Außer in den nachfolgend beschriebenen Ausnahmen sind Optionen zur Prozessauswahl additiv. Die standardmäßige Auswahl wird verworfen und dann werden die ausgewählten Prozesse zur Gruppe der anzuzeigenden Prozesse hinzugefügt. Ein Prozess wird also dann angezeigt, wenn er irgendeinem der angegebenen Auswahlkriterien entspricht." + +#. type: TP +#: ../man/ps.1:85 +#, no-wrap +msgid "To see every process on the system using standard syntax:" +msgstr "Alle Prozesse im System in der Standard-Syntax anzeigen:" + +#. type: Plain text +#: ../man/ps.1:88 +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:90 +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:92 +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:94 +msgid "B" +msgstr "B" + +#. type: TP +#: ../man/ps.1:94 +#, no-wrap +msgid "To see every process on the system using BSD syntax:" +msgstr "Alle Prozess im System in der BSD-Syntax anzeigen:" + +#. type: Plain text +#: ../man/ps.1:97 +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:99 +msgid "B" +msgstr "B" + +#. type: TP +#: ../man/ps.1:99 +#, no-wrap +msgid "To print a process tree:" +msgstr "Einen Prozessbaum ausgeben:" + +#. type: Plain text +#: ../man/ps.1:102 +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:104 +msgid "B" +msgstr "B" + +#. type: TP +#: ../man/ps.1:104 +#, no-wrap +msgid "To get info about threads:" +msgstr "Informationen zu Threads erhalten:" + +#. type: Plain text +#: ../man/ps.1:107 +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:109 +msgid "B" +msgstr "B" + +#. type: TP +#: ../man/ps.1:109 +#, no-wrap +msgid "To get security info:" +msgstr "Sicherheitsinformationen erhalten:" + +#. type: Plain text +#: ../man/ps.1:112 +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:114 +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:116 +msgid "B" +msgstr "B" + +#. type: TP +#: ../man/ps.1:116 +#, no-wrap +msgid "To see every process running as root (real\\ &\\ effective\\ ID) in user format:" +msgstr "Alle Prozesse im System, die mit Root-Rechten laufen (reale\\ &\\ effektive\\ Kennung), in einem benutzerdefinierten Format anzeigen:" + +#. type: Plain text +#: ../man/ps.1:119 +msgid "B" +msgstr "B" + +#. type: TP +#: ../man/ps.1:119 +#, no-wrap +msgid "To see every process with a user-defined format:" +msgstr "Alle Prozesse in einem benutzerdefinierten Format anzeigen:" + +#. type: Plain text +#: ../man/ps.1:122 +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:124 +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:126 +msgid "B" +msgstr "B" + +#. type: TP +#: ../man/ps.1:126 +#, no-wrap +msgid "Print only the process IDs of syslogd:" +msgstr "Nur die Prozesskennungen (PIDs) von B ausgeben:" + +#. type: Plain text +#: ../man/ps.1:129 +msgid "B" +msgstr "B" + +#. type: TP +#: ../man/ps.1:129 +#, no-wrap +msgid "Print only the name of PID 42:" +msgstr "Nur den Namen des Prozesses mit der Kennung 42 ausgeben:" + +#. type: Plain text +#: ../man/ps.1:132 +msgid "B" +msgstr "B" + +#. type: SH +#: ../man/ps.1:132 +#, no-wrap +msgid "SIMPLE PROCESS SELECTION" +msgstr "EINFACHE PROZESSAUSWAHL" + +#. type: TP +#: ../man/ps.1:133 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:147 +msgid "Lift the BSD-style \"only yourself\" restriction, which is imposed upon the set of all processes when some BSD-style (without \"-\") options are used or when the B personality setting is BSD-like. The set of processes selected in this manner is in addition to the set of processes selected by other means. An alternate description is that this option causes B to list all processes with a terminal (tty), or to list all processes when used together with the B option." +msgstr "hebt die Einschränkung »nur Sie selbst« des BSD-Stils auf, die für die Gruppe aller Prozesse gilt, wenn einige BSD-artige Optionen (ohne »-«) verwendet werden oder wenn die Einstellung der Prozessausführungsumgebung von B BSD-ähnlich ist. Die auf diese Weise ausgewählte Prozessgruppe wird zusätzlich zu den bereits auf andere Weise ausgewählten Prozessen ausgewählt. Alternativ könnte dies so beschrieben werden, dass diese Option B veranlasst, alle Prozesse mit einem Terminal (TTY) aufzulisten, oder alle Prozesse aufzulisten, wenn dies zusammen mit der Option B verwendet wird." + +#. type: Plain text +#: ../man/ps.1:151 +msgid "Select all processes. Identical to B<-e>." +msgstr "wählt alle Prozesse aus. Gleichbedeutend mit B<-e>." + +#. type: TP +#: ../man/ps.1:151 +#, no-wrap +msgid "B<-a>" +msgstr "B<-a>" + +#. type: Plain text +#: ../man/ps.1:156 +msgid "Select all processes except both session leaders (see I(2)) and processes not associated with a terminal." +msgstr "wählt alle Prozesse aus, außer sowohl Sitzungsleiter (siehe I(2)) als auch Prozesse, die keinem Terminal zugeordnet sind." + +#. type: Plain text +#: ../man/ps.1:159 +msgid "Select all processes except session leaders." +msgstr "wählt alle Prozesse außer Sitzungsleiter aus." + +#. type: TP +#: ../man/ps.1:159 +#, no-wrap +msgid "B<--deselect>" +msgstr "B<--deselect>" + +#. type: Plain text +#: ../man/ps.1:164 +msgid "Select all processes except those that fulfill the specified conditions (negates the selection). Identical to B<-N>." +msgstr "wählt alle Prozesse aus, außer jene, welche die angegebenen Bedingungen erfüllen (negiert die Auswahl). Gleichbedeutend mit B<-N>." + +#. type: TP +#: ../man/ps.1:164 +#, no-wrap +msgid "B<-e>" +msgstr "B<-e>" + +#. Current "g" behavior: add in the session leaders, which would +#. be excluded in the sunos4 personality. Supposed "g" behavior: +#. add in the group leaders -- at least according to the SunOS 4 +#. man page on the FreeBSD site. Uh oh. I think I had tested SunOS +#. though, so maybe the code is correct. +#. type: Plain text +#: ../man/ps.1:173 +msgid "Select all processes. Identical to B<-A>." +msgstr "wählt alle Prozesse aus. Gleichbedeutend mit B<-A>." + +#. type: TP +#: ../man/ps.1:173 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:179 +msgid "Really all, even session leaders. This flag is obsolete and may be discontinued in a future release. It is normally implied by the B flag, and is only useful when operating in the sunos4 personality." +msgstr "wählt wirklich alle, selbst die Sitzungsleiter. Dieser Schalter ist veraltet und könnte in zukünftigen Veröffentlichungen nicht mehr zur Verfügung stehen. Es wird normalerweise vom Schalter B impliziert und ist nur nützlich, wenn es in einer SunOs-Prozessausführungsumgebung ausgeführt wird." + +#. type: TP +#: ../man/ps.1:179 +#, no-wrap +msgid "B<-N>" +msgstr "B<-N>" + +#. type: Plain text +#: ../man/ps.1:184 +msgid "Select all processes except those that fulfill the specified conditions (negates the selection). Identical to B<--deselect>." +msgstr "wählt alle Prozesse aus, außer jene, welche die angegebenen Bedingungen erfüllen (negiert die Auswahl). Gleichbedeutend mit B<--deselect>." + +#. type: TP +#: ../man/ps.1:184 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:189 +msgid "Select all processes associated with this terminal. Identical to the B option without any argument." +msgstr "wählt alle Prozesse aus, welche diesem Terminal zugeordnet sind. Gleichbedeutend mit der Option B ohne Argumente." + +#. type: TP +#: ../man/ps.1:189 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:192 +msgid "Restrict the selection to only running processes." +msgstr "schränkt die Auswahl nur auf laufende Prozesse ein." + +#. type: TP +#: ../man/ps.1:192 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:207 +msgid "Lift the BSD-style \"must have a tty\" restriction, which is imposed upon the set of all processes when some BSD-style (without \"-\") options are used or when the B personality setting is BSD-like. The set of processes selected in this manner is in addition to the set of processes selected by other means. An alternate description is that this option causes B to list all processes owned by you (same EUID as B), or to list all processes when used together with the B option." +msgstr "hebt die Einschränkung »muss ein TTY haben« des BSD-Stils auf, die für die Gruppe aller Prozesse gilt, wenn einige BSD-artige Optionen (ohne »-«) verwendet werden oder wenn die Einstellung der Prozessausführungsumgebung von B BSD-ähnlich ist. Die auf diese Weise ausgewählte Prozessgruppe wird zusätzlich zu den bereits auf andere Weise ausgewählten Prozessen ausgewählt. Alternativ könnte dies so beschrieben werden, dass diese Option B veranlasst, alle Prozesse aufzulisten, deren Besitzer Sie selbst sind (gleiche EUID wie B), oder alle Prozesse aufzulisten, wenn dies zusammen mit der Option B verwendet wird." + +#. type: SH +#: ../man/ps.1:208 +#, no-wrap +msgid "PROCESS SELECTION BY LIST" +msgstr "PROZESSAUSWAHL NACH LISTE" + +#. type: Plain text +#: ../man/ps.1:212 +msgid "These options accept a single argument in the form of a blank-separated or comma-separated list. They can be used multiple times. For example: B" +msgstr "Diese Optionen akzeptieren ein einzelnes Argument in der Form einer durch Leerräume oder Kommata getrennten Liste. Dies kann mehrmals angegeben werden. Beispiel: B" + +#. type: TP +#: ../man/ps.1:212 +#, no-wrap +msgid "I<123>" +msgstr "I<123>" + +#. type: Plain text +#: ../man/ps.1:216 +msgid "Identical to B<--pid\\ >I<123>." +msgstr "ist gleichbedeutend mit B<--pid\\ >I<123>." + +#. type: TP +#: ../man/ps.1:216 +#, no-wrap +msgid "\\+I<123>" +msgstr "\\+I<123>" + +#. type: Plain text +#: ../man/ps.1:220 +msgid "Identical to B<--sid\\ >I<123>." +msgstr "ist gleichbedeutend mit B<--sid\\ >I<123>." + +#. type: TP +#: ../man/ps.1:220 +#, no-wrap +msgid "-I<123>" +msgstr "-I<123>" + +#. type: Plain text +#: ../man/ps.1:223 +#, fuzzy +#| msgid "process group ID" +msgid "Select by process group ID (PGID)." +msgstr "Prozessgruppenkennung" + +#. type: TP +#: ../man/ps.1:223 +#, no-wrap +msgid "B<-C>I<\\ cmdlist>" +msgstr "B<-C>I<\\ Befehlsliste>" + +#. type: Plain text +#: ../man/ps.1:232 +msgid "Select by command name. This selects the processes whose executable name is given in I. NOTE: The command name is not the same as the command line. Previous versions of procps and the kernel truncated this command name to 15 characters. This limitation is no longer present in both. If you depended on matching only 15 characters, you may no longer get a match." +msgstr "wählt nach Befehlsnamen aus. Dadurch werden die Prozesse ausgewählt, deren Namen der ausführbaren Dateien in der I aufgeführt sind. Achtung: Der Befehlsname entspricht nicht der Befehlszeile. Frühere Versionen von B und der Kernel kürzten diesen Befehlsnamen auf 15 Zeichen. Diese Einschränkung gibt es in beiden nicht mehr. Falls Sie sich nur auf 15 Zeichen beziehen, erhalten Sie keinen Treffer mehr." + +#. type: TP +#: ../man/ps.1:232 +#, no-wrap +msgid "B<-G>I<\\ grplist>" +msgstr "B<-G>I<\\ Gruppenliste>" + +#. type: Plain text +#: ../man/ps.1:240 +msgid "Select by real group ID (RGID) or name. This selects the processes whose real group name or ID is in the I list. The real group ID identifies the group of the user who created the process, see I(2)." +msgstr "wählt nach realer Gruppenkennung (RGID) oder nach Namen aus. Dadurch werden die Prozesse ausgewählt, deren realer Gruppenname oder -kennung in der I aufgeführt ist. Die reale Gruppenkennung identifiziert die Gruppe des Benutzers, der den Prozess erstellt hat, siehe I(2)." + +#. type: TP +#: ../man/ps.1:240 +#, no-wrap +msgid "B<-g>I<\\ grplist>" +msgstr "B<-g>I<\\ Gruppenliste>" + +#. type: Plain text +#: ../man/ps.1:253 +msgid "Select by session OR by effective group name. Selection by session is specified by many standards, but selection by effective group is the logical behavior that several other operating systems use. This B will select by session when the list is completely numeric (as sessions are). Group ID numbers will work only when some group names are also specified. See the B<-s> and B<--group> options." +msgstr "wählt nach Sitzung ODER effektivem Gruppennamen aus. Die Auswahl nach Sitzung wird durch zahlreiche Standards angegeben, aber die Auswahl nach effektiver Gruppe ist das logische Verhalten, das verschiedene andere Betriebssysteme verwenden. Diese Version von B wählt nach Sitzung aus, wenn die Liste vollständig numerisch ist (wie es bei Sitzungen der Fall ist). Mit Gruppenkennungen (ID-Nummern) funktioniert es nur dann, wenn auch einige Gruppennamen angegeben werden. Siehe die Optionen B<-s> und B<--group>." + +#. type: TP +#: ../man/ps.1:253 +#, no-wrap +msgid "B<--Group>I<\\ grplist>" +msgstr "B<--Group>I<\\ Gruppenliste>" + +#. type: Plain text +#: ../man/ps.1:257 +msgid "Select by real group ID (RGID) or name. Identical to B<-G>." +msgstr "wählt nach realer Gruppenkennung (RGID) oder Name aus. Gleichbedeutend mit B<-G>." + +#. type: TP +#: ../man/ps.1:257 +#, no-wrap +msgid "B<--group>I<\\ grplist>" +msgstr "B<--group>I<\\ Gruppenliste>" + +#. type: Plain text +#: ../man/ps.1:269 +msgid "Select by effective group ID (EGID) or name. This selects the processes whose effective group name or ID is in I. The effective group ID describes the group whose file access permissions are used by the process (see I(2)). The B<-g> option is often an alternative to B<--group>." +msgstr "wählt nach effektiver Gruppenkennung (EGID) oder Name aus. Dadurch werden die Prozesse ausgewählt, deren effektiver Gruppenname oder -kennung in der I aufgeführt ist. Die effektive Gruppenkennung bezieht sich auf die Gruppe, deren Dateizugriffsrechte vom Prozess genutzt werden (siehe I(2)). Die Option B<-g> ist häufig eine Alternative zu B<--group>." + +#. type: TP +#: ../man/ps.1:269 +#, no-wrap +msgid "B

I<\\ pidlist>" +msgstr "B

I<\\ PID-Liste>" + +#. type: Plain text +#: ../man/ps.1:275 +msgid "Select by process ID. Identical to B<-p> and B<--pid>." +msgstr "wählt nach Prozesskennung (PID) aus. Gleichbedeutend mit B<-p> und B<--pid>." + +#. type: TP +#: ../man/ps.1:275 +#, no-wrap +msgid "B<-p>I<\\ pidlist>" +msgstr "B<-p>I<\\ PID-Liste>" + +#. type: Plain text +#: ../man/ps.1:283 +msgid "Select by PID. This selects the processes whose process ID numbers appear in I. Identical to B

and B<--pid>." +msgstr "wählt nach Prozesskennung (PID) aus. Dadurch werden die Prozesse ausgewählt, deren Prozesskennungen (ID-Nummern) in der I aufgeführt sind. Gleichbedeutend mit B

und B<--pid>." + +#. type: TP +#: ../man/ps.1:283 +#, no-wrap +msgid "B<--pid>I<\\ pidlist>" +msgstr "B<--pid>I<\\ PID-Liste>" + +#. type: Plain text +#: ../man/ps.1:289 +msgid "Select by process\\ ID. Identical to B<-p> and B

." +msgstr "wählt nach Prozesskennung (PID) )aus. Gleichbedeutend mit B<-p> und B

." + +#. type: TP +#: ../man/ps.1:289 +#, no-wrap +msgid "B<--ppid>I<\\ pidlist>" +msgstr "B<--ppid>I<\\ PID-Liste>" + +#. type: Plain text +#: ../man/ps.1:296 +msgid "Select by parent process ID. This selects the processes with a parent process\\ ID in I. That is, it selects processes that are children of those listed in I." +msgstr "wählt nach Kennung des Elternprozesses aus. Dadurch werden die Prozesse ausgewählt, für die die Kennung eines Elternprozesses in der I aufgeführt ist. Das bedeutet, dass Prozesse ausgewählt werden, die Kindprozesse der Prozesse in der I sind." + +#. type: TP +#: ../man/ps.1:296 +#, no-wrap +msgid "BI<\\ pidlist>" +msgstr "BI<\\ PID-Liste>" + +#. type: Plain text +#: ../man/ps.1:302 +msgid "Select by process ID (quick mode). Identical to B<-q> and B<--quick-pid>." +msgstr "wählt nach Prozesskennung (PID) aus (schneller Modus). Gleichbedeutend mit B<-q> und B<--quick-pid>." + +#. type: TP +#: ../man/ps.1:302 +#, no-wrap +msgid "B<-q>I<\\ pidlist>" +msgstr "B<-q>I<\\ PID-Liste>" + +#. type: Plain text +#: ../man/ps.1:316 +msgid "Select by PID (quick mode). This selects the processes whose process ID numbers appear in I. With this option B reads the necessary info only for the pids listed in the I and doesn't apply additional filtering rules. The order of pids is unsorted and preserved. No additional selection options, sorting and forest type listings are allowed in this mode. Identical to B and B<--quick-pid>." +msgstr "wählt nach Prozesskennung (PID) aus (schneller Modus). Dadurch werden die Prozesse ausgewählt, deren Prozesskennungen (ID-Nummern) in der I aufgeführt sind. Mit dieser Option liest B die notwendigen Informationen nur für die in der I aufgeführten Prozesskennungen und wendet keine zusätzlichen Filterregeln an. Die Reihenfolge der Prozesskennungen ist unsortiert und wird beibehalten. In diesem Modus sind keine weiteren Auswahloptionen, Sortierungen und Waldtyp-Auflistungen erlaubt. Gleichbedeutend mit B und B<--quick-pid>." + +#. type: TP +#: ../man/ps.1:316 +#, no-wrap +msgid "B<--quick-pid>I<\\ pidlist>" +msgstr "B<--quick-pid>I<\\ PID-Liste>" + +#. type: Plain text +#: ../man/ps.1:322 +msgid "Select by process\\ ID (quick mode). Identical to B<-q> and B." +msgstr "wählt nach Prozesskennung (PID) aus (schneller Modus). Gleichbedeutend mit B<-q> und B." + +#. type: TP +#: ../man/ps.1:322 +#, no-wrap +msgid "B<-s>I<\\ sesslist>" +msgstr "B<-s>I<\\ Sitzungsliste>" + +#. type: Plain text +#: ../man/ps.1:327 +msgid "Select by session ID. This selects the processes with a session ID specified in I." +msgstr "wählt nach Sitzungskennung aus. Dies wählt alle Prozesse aus, deren Sitzungskennung in der I enthalten ist." + +#. type: TP +#: ../man/ps.1:327 +#, no-wrap +msgid "B<--sid>I<\\ sesslist>" +msgstr "B<--sid>I<\\ Sitzungsliste>" + +#. type: Plain text +#: ../man/ps.1:331 +msgid "Select by session\\ ID. Identical to B<-s>." +msgstr "wählt nach Sitzungskennung aus. Gleichbedeutend mit B<-s>." + +#. type: TP +#: ../man/ps.1:331 +#, no-wrap +msgid "BI<\\ ttylist>" +msgstr "BI<\\ TTY-Liste>" + +#. type: Plain text +#: ../man/ps.1:348 +msgid "Select by tty. Nearly identical to B<-t> and B<--tty>, but can also be used with an empty I to indicate the terminal associated with B. Using the B option is considered cleaner than using B with an empty I." +msgstr "wählt nach TTY aus. Dies ist fast gleichbedeutend mit B<-t> und B<--tty>, kann aber auch mit einer leeren I verwendet werden, um das B zugeordnete Terminal zu bezeichnen. Die Verwendung der Option B wird als sauberer als die Option B mit einer leeren I betrachtet." + +#. type: TP +#: ../man/ps.1:348 +#, no-wrap +msgid "B<-t>I<\\ ttylist>" +msgstr "B<-t>I<\\ TTY-Liste>" + +#. type: Plain text +#: ../man/ps.1:356 +msgid "Select by tty. This selects the processes associated with the terminals given in I. Terminals (ttys, or screens for text output) can be specified in several forms: /dev/ttyS1, ttyS1, S1. A plain \"-\" may be used to select processes not attached to any terminal." +msgstr "wählt nach TTY aus. Dadurch werden die Prozesse ausgewählt, die den in der B angegebenen Terminals zugeordnet sind. Terminals (TTYs oder Bildschirme für Textausgabe) können in verschiedenen Formen angegeben werden: /dev/ttyS1, ttyS1, S1. Ein einfaches »-« kann verwendet werden, um Prozesse auszuwählen, die keinem Terminal zugeordnet sind." + +#. type: TP +#: ../man/ps.1:356 +#, no-wrap +msgid "B<--tty>I<\\ ttylist>" +msgstr "B<--tty>I<\\ TTY-Liste>" + +#. type: Plain text +#: ../man/ps.1:362 +msgid "Select by terminal. Identical to B<-t> and B." +msgstr "wählt nach Terminal aus. Gleichbedeutend mit B<-t> und B." + +#. type: TP +#: ../man/ps.1:362 +#, no-wrap +msgid "BI<\\ userlist>" +msgstr "BI<\\ Benutzerliste>" + +#. type: Plain text +#: ../man/ps.1:374 +msgid "Select by effective user ID (EUID) or name. This selects the processes whose effective user name or ID is in I. The effective user ID describes the user whose file access permissions are used by the process (see I(2)). Identical to B<-u> and B<--user>." +msgstr "wählt nach effektiver Benutzerkennung (EUID) oder Name aus. Dadurch werden die Prozesse ausgewählt, deren effektiver Benutzername oder -kennung in der I aufgeführt ist. Die effektive Benutzerkennung bezieht sich auf den Benutzer, dessen Dateizugriffsrechte vom Prozess genutzt werden (siehe I(2)). Gleichbedeutend mit B<-u> und B<--user>." + +#. type: TP +#: ../man/ps.1:374 +#, no-wrap +msgid "B<-U>I<\\ userlist>" +msgstr "B<-U>I<\\ Benutzerliste>" + +#. type: Plain text +#: ../man/ps.1:381 +msgid "Select by real user ID (RUID) or name. It selects the processes whose real user name or ID is in the I list. The real user ID identifies the user who created the process, see I(2)." +msgstr "wählt nach realer Benutzerkennung (RUID) oder nach Namen aus. Dadurch werden die Prozesse ausgewählt, deren realer Benutzername oder -kennung in der I aufgeführt ist. Die reale Benutzerkennung identifiziert den Benutzer, der den Prozess erstellt hat, siehe I(2)." + +#. type: TP +#: ../man/ps.1:381 +#, no-wrap +msgid "B<-u>I<\\ userlist>" +msgstr "B<-u>I<\\ Benutzerliste>" + +#. type: Plain text +#: ../man/ps.1:386 +msgid "Select by effective user ID (EUID) or name. This selects the processes whose effective user name or ID is in I." +msgstr "wählt nach effektiver Benutzerkennung (EUID) oder Name aus. Dadurch werden die Prozesse ausgewählt, deren effektiver Benutzername oder -kennung in der I aufgeführt ist." + +#. type: Plain text +#: ../man/ps.1:394 +msgid "The effective user ID describes the user whose file access permissions are used by the process (see I(2)). Identical to B and B<--user>." +msgstr "Die effektiver Benutzerkennung beschreibt den Benutzer, dessen Dateizugriffsrechte vom Prozess genutzt werden (siehe I(2)). Gleichbedeutend mit B und B<--user>." + +#. type: TP +#: ../man/ps.1:394 +#, no-wrap +msgid "B<--User>I<\\ userlist>" +msgstr "B<--User>I<\\ Benutzerliste>" + +#. type: Plain text +#: ../man/ps.1:398 +msgid "Select by real user ID (RUID) or name. Identical to B<-U>." +msgstr "wählt nach realer Benutzerkennung (RUID) oder Name aus. Gleichbedeutend mit B<-U>." + +#. type: TP +#: ../man/ps.1:398 +#, no-wrap +msgid "B<--user>I<\\ userlist>" +msgstr "B<--user>I<\\ Benutzerliste>" + +#. type: Plain text +#: ../man/ps.1:404 +msgid "Select by effective user ID (EUID) or name. Identical to B<-u> and B." +msgstr "wählt nach effektiver Benutzerkennung (EUID) oder Name aus. Gleichbedeutend mit B<-u> und B." + +#. type: SH +#: ../man/ps.1:405 +#, no-wrap +msgid "OUTPUT FORMAT CONTROL" +msgstr "STEUERUNG DES AUSGABEFORMATS" + +#. type: Plain text +#: ../man/ps.1:409 +msgid "These options are used to choose the information displayed by B. The output may differ by personality." +msgstr "Diese Optionen werden dazu verwendet, die von B angezeigten Informationen auszuwählen. Die Ausgabe kann je nach Prozessausführungsumgebung variieren." + +#. type: Plain text +#: ../man/ps.1:414 +msgid "Show different scheduler information for the B<-l> option." +msgstr "zeigt verschiedene Scheduler-Informationen für die Option B<-l> an." + +#. type: TP +#: ../man/ps.1:414 +#, no-wrap +msgid "B<--context>" +msgstr "B<--context>" + +#. type: Plain text +#: ../man/ps.1:417 +msgid "Display security context format (for SELinux)." +msgstr "zeigt das Format des Sicherheitskontexts an (für SELinux)." + +#. type: Plain text +#: ../man/ps.1:430 +msgid "Do full-format listing. This option can be combined with many other UNIX-style options to add additional columns. It also causes the command arguments to be printed. When used with B<-L>, the NLWP (number of threads) and LWP (thread ID) columns will be added. See the B option, the format keyword B, and the format keyword B." +msgstr "zeigt eine Auflistung im Vollformat an. Diese Option kann mit vielen anderen Optionen im UNIX-Stil kombiniert werden, um zusätzliche Spalten hinzuzufügen. Außerdem bewirkt die Option, dass die Befehlsargumente ausgegeben werden. Wenn Sie die Option zusammen mit B<-L> verwenden, werden die Spalten NLWP (Anzahl der Threads) und LWP (Threadkennung) hinzugefügt. Siehe die Option B sowie die Formatschlüsselwörter B und B." + +#. type: TP +#: ../man/ps.1:430 +#, no-wrap +msgid "B<-F>" +msgstr "B<-F>" + +#. type: Plain text +#: ../man/ps.1:437 +msgid "Extra full format. See the B<-f> option, which B<-F> implies." +msgstr "zeigt eine Auflistung im erweiterten Vollformat an. Siehe die Option B<-f>, welche B<-F> impliziert." + +#. type: TP +#: ../man/ps.1:437 +#, no-wrap +msgid "B<--format>I<\\ format>" +msgstr "B<--format>I<\\ Format>" + +#. type: Plain text +#: ../man/ps.1:443 +msgid "user-defined format. Identical to B<-o> and B." +msgstr "zeigt im benutzerdefinierten Format an. Gleichbedeutend mit B<-o> und B." + +#. type: TP +#: ../man/ps.1:443 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:446 +msgid "BSD job control format." +msgstr "BSD-Jobsteuerung-Format." + +#. type: TP +#: ../man/ps.1:446 +#, no-wrap +msgid "B<-j>" +msgstr "B<-j>" + +#. type: Plain text +#: ../man/ps.1:449 +msgid "Jobs format." +msgstr "Job-Format." + +#. type: TP +#: ../man/ps.1:449 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:452 +msgid "Display BSD long format." +msgstr "zeigt das lange BSD-Format an." + +#. type: TP +#: ../man/ps.1:452 +#, no-wrap +msgid "B<-l>" +msgstr "B<-l>" + +#. type: Plain text +#: ../man/ps.1:457 +msgid "Long format. The B<-y> option is often useful with this." +msgstr "Langes Format. Die Option B<-y> ist oft dafür nützlich." + +#. type: TP +#: ../man/ps.1:457 +#, no-wrap +msgid "B<-M>" +msgstr "B<-M>" + +#. type: Plain text +#: ../man/ps.1:462 +msgid "Add a column of security data. Identical to B (for SELinux)." +msgstr "fügt eine Spalte mit sicherheitsrelevanten Daten hinzu. Gleichbedeutend mit B (für SELinux)." + +#. type: TP +#: ../man/ps.1:462 +#, no-wrap +msgid "BI<\\ format>" +msgstr "BI<\\ Format>" + +#. type: Plain text +#: ../man/ps.1:480 +msgid "is preloaded B (overloaded). The BSD B option can act like B<-O> (user-defined output format with some common fields predefined) or can be used to specify sort order. Heuristics are used to determine the behavior of this option. To ensure that the desired behavior is obtained (sorting or formatting), specify the option in some other way (e.g. with B<-O> or B<--sort>). When used as a formatting option, it is identical to B<-O>, with the BSD personality." +msgstr "ist ein vorgeladenes B (überladen). Die BSD-Option B kann wie B<-O> agieren (benutzerdefiniertes Ausgabeformat mit einigen vordefinierten häufig genutzten Feldern) oder dazu verwendet werden, die Sortierreihenfolge anzugeben. Das Verhalten dieser Option wird heuristisch bestimmt. Um das gewünschte Verhalten sicherzustellen (Sortierung oder Formatierung), geben Sie die Option auf eine andere Weise an (zum Beispiel mit B<-O> oder B<--sort>). Wenn Sie sie als Formatierungsoption verwenden, ist sie in der BSD-Prozessausführungsumgebung gleichbedeutend mit B<-O>." + +#. type: TP +#: ../man/ps.1:480 +#, no-wrap +msgid "B<-O>I<\\ format>" +msgstr "B<-O>I<\\ Format>" + +#. type: Plain text +#: ../man/ps.1:491 +msgid "Like B<-o>, but preloaded with some default columns. Identical to B<-o\\ pid,\\:>IB<,\\:state,\\:tname,\\:time,\\:command> or B<-o\\ pid,\\:>IB<,\\:tname,\\:time,\\:cmd>, see B<-o> below." +msgstr "ist ähnlich zu B<-o>, aber mit einigen Standardspalten vorgeladen. Gleichbedeutend mit B<-o\\ PID,\\:>IB<,\\:Status,\\:tName,\\:Zeit,\\:Befehl> oder B<-o\\ PID,\\:>IB<,\\:tName,\\:Zeit,\\:Befehl>, siehe B<-o> nachfolgend." + +#. type: TP +#: ../man/ps.1:491 +#, no-wrap +msgid "BI<\\ format>" +msgstr "BI<\\ Format>" + +#. type: Plain text +#: ../man/ps.1:497 +msgid "Specify user-defined format. Identical to B<-o> and B<--format>." +msgstr "legt das benutzerdefinierte Format fest. Gleichbedeutend mit B<-o> und B<--format>." + +#. type: TP +#: ../man/ps.1:497 +#, no-wrap +msgid "B<-o>I<\\ format>" +msgstr "B<-o>I<\\ Format>" + +#. type: Plain text +#: ../man/ps.1:525 +msgid "User-defined format. I is a single argument in the form of a blank-separated or comma-separated list, which offers a way to specify individual output columns. The recognized keywords are described in the B section below. Headers may be renamed (B) as desired. If all column headers are empty (B) then the header line will not be output. Column width will increase as needed for wide headers; this may be used to widen up columns such as WCHAN (B). Explicit width control (B) is offered too. The behavior of B varies with personality; output may be one column named \"X,\\:comm=Y\" or two columns named \"X\" and \"Y\". Use multiple B<-o> options when in doubt. Use the B environment variable to specify a default as desired; DefSysV and DefBSD are macros that may be used to choose the default UNIX or BSD columns." +msgstr "legt das benutzerdefinierte Format fest. Das I ist ein einzelnes Argument in der From einer durch Leerräume oder Kommata getrennten Liste, die eine Möglichkeit bietet, individuelle Ausgabespalten anzugeben. Die erkannten Schlüsselwörter sind im nachfolgenden Abschnitt B beschrieben. Kopfzeilen dürfen nach Wunsch umbenannt werden (B). Falls alle Spaltenüberschriften leer sind (B), wird keine Kopfzeile ausgegeben. Die Spaltenbreite wird bei breiteren Überschriften angepasst; das kann zur Verbreiterung von Spalten wie WCHAN (B) angewendet werden. Eine explizite Steuerung der Breite ist ebenfalls möglich (B). Das Verhalten von B variiert je nach Prozessausführungsumgebung; die Ausgabe kann in einer Spalte namens »X,\\:comm=Y« oder in zwei Spalten namens »X« und »Y« erfolgen. Im Zweifel sollten Sie die Option B<-o> mehrmals verwenden. Mit der Umgebungsvariable B können Sie eine Vorgabe nach Ihrem Wunsch festlegen; DefSysV und DefBSD sind Makros, die Sie zur Wahl der standardmäßigen UNIX- oder BSD-Spalten verwenden können." + +#. type: TP +#: ../man/ps.1:525 +#, no-wrap +msgid "B<-P>" +msgstr "B<-P>" + +#. type: Plain text +#: ../man/ps.1:528 +msgid "Add a column showing B." +msgstr "" + +#. type: TP +#: ../man/ps.1:528 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:531 +msgid "Display signal format." +msgstr "zeigt im Signalformat an." + +#. type: TP +#: ../man/ps.1:531 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:534 +msgid "Display user-oriented format." +msgstr "zeigt im benutzerorientierten Format an." + +#. type: TP +#: ../man/ps.1:534 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:537 +msgid "Display virtual memory format." +msgstr "zeigt im virtuellen Speicherformat an." + +#. type: TP +#: ../man/ps.1:537 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:540 +msgid "Register format." +msgstr "zeigt im Registerformat an." + +#. type: TP +#: ../man/ps.1:540 +#, no-wrap +msgid "B<-y>" +msgstr "B<-y>" + +#. type: Plain text +#: ../man/ps.1:545 +msgid "Do not show flags; show rss in place of addr. This option can only be used with B<-l>." +msgstr "zeigt keine Schalter an; statt B wird B angezeigt. Diese Option kann nur zusammen mit B<-l> verwendet werden." + +#. type: TP +#: ../man/ps.1:545 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:550 +msgid "Add a column of security data. Identical to B<-M> (for SELinux)." +msgstr "fügt eine Spalte mit sicherheitsrelevanten Daten hinzu. Gleichbedeutend mit B<-M> (für SELinux)." + +#. type: SH +#: ../man/ps.1:551 +#, no-wrap +msgid "OUTPUT MODIFIERS" +msgstr "AUSGABE-MODIFIKATOREN" + +#. type: TP +#: ../man/ps.1:552 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:570 +msgid "Show the true command name. This is derived from the name of the executable file, rather than from the argv value. Command arguments and any modifications to them are thus not shown. This option effectively turns the B format keyword into the B format keyword; it is useful with the B<-f> format option and with the various BSD-style format options, which all normally display the command arguments. See the B<-f> option, the format keyword B, and the format keyword B." +msgstr "zeigt den echten Befehlsnamen an. Dieser wird aus dem Namen der ausführbaren Datei statt aus dem Wert von argv abgeleitet. Befehlsargumente und deren eventuelle Änderungen werden daher nicht angezeigt. Diese Option verwandelt das Formatschlüsselwort B effektiv in das Formatschlüsselwort B; sie ist mit der Formatoption B<-f> und den verschiedenen Formatoptionen im BSD-Stil nützlich, welche alle normalerweise die Befehlsargumente anzeigen. Siehe die Option B<-f> sowie die Formatschlüsselwörter B und B." + +#. type: TP +#: ../man/ps.1:570 +#, no-wrap +msgid "B<--cols>I<\\ n>" +msgstr "B<--cols>I<\\ n>" + +#. type: Plain text +#: ../man/ps.1:573 ../man/ps.1:576 ../man/ps.1:724 +msgid "Set screen width." +msgstr "legt die Bildschirmbreite fest." + +#. type: TP +#: ../man/ps.1:573 +#, no-wrap +msgid "B<--columns>I<\\ n>" +msgstr "B<--columns>I<\\ n>" + +#. type: TP +#: ../man/ps.1:576 +#, no-wrap +msgid "B<--cumulative>" +msgstr "B<--cumulative>" + +#. type: Plain text +#: ../man/ps.1:579 +msgid "Include some dead child process data (as a sum with the parent)." +msgstr "fügt einige Daten toter Kindprozesse hinzu (als Summe mit den Elternprozessen)." + +#. type: TP +#: ../man/ps.1:580 +#, no-wrap +msgid "B<-D>I<\\ format>" +msgstr "B<-D>I<\\ Format>" + +#. type: Plain text +#: ../man/ps.1:586 +msgid "Set the date format of the B field to I. This format is parsed by B(3) and should be a maximum of 24 characters to not mis-align columns." +msgstr "" + +#. type: TP +#: ../man/ps.1:586 +#, no-wrap +msgid "B<--date-format>I<\\ format>" +msgstr "B<--date-format>I<\\ Format>" + +#. type: Plain text +#: ../man/ps.1:589 +msgid "Identical to B<-D>." +msgstr "ist gleichbedeutend mit B<-D>." + +#. type: TP +#: ../man/ps.1:589 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:592 +msgid "Show the environment after the command." +msgstr "zeigt die Umgebung nach dem Befehl an." + +#. type: TP +#: ../man/ps.1:592 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:595 +msgid "ASCII art process hierarchy (forest)." +msgstr "zeigt die Prozesshierarchie in ASCII-Art an (Wald)." + +#. type: TP +#: ../man/ps.1:595 +#, no-wrap +msgid "B<--forest>" +msgstr "B<--forest>" + +#. type: Plain text +#: ../man/ps.1:598 +msgid "ASCII art process tree." +msgstr "zeigt einen Prozessbaum in ASCII-Art an." + +#. type: TP +#: ../man/ps.1:598 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:616 +msgid "No header. (or, one header per screen in the BSD personality). The B option is problematic. Standard BSD B uses this option to print a header on each page of output, but older Linux B uses this option to totally disable the header. This version of B follows the Linux usage of not printing the header unless the BSD personality has been selected, in which case it prints a header on each page of output. Regardless of the current personality, you can use the long options B<--headers> and B<--no-headers> to enable printing headers each page or disable headers entirely, respectively." +msgstr "zeigt keine Kopfzeilen an (oder eine Kopfzeile pro Bildschirm in der BSD-Prozessausführungsumgebung). Die Option B ist problematisch. Das standardmäßige B in BSD verwendet diese Option, um eine Kopfzeile auf jeder Seite der Ausgabe anzuzeigen, ältere Linux-Versionen von B hingegen unterdrücken damit die Anzeige der Kopfzeile komplett. Diese Version von B gibt keine Kopfzeilen aus und folgt damit dem Linux-Verhalten. Nur wenn die BSD-Prozessausführungsumgebung ausgewählt ist, wird eine Kopfzeile auf jeder Seite der Ausgabe angezeigt. Unabhängig von der aktuellen Prozessausführungsumgebung können Sie die Langoptionen B<--headers> bzw. B<--no-headers> dazu verwenden, um die Anzeige der Kopfzeilen auf jeder Seite zu aktivieren oder vollständig zu deaktivieren." + +#. type: TP +#: ../man/ps.1:616 +#, no-wrap +msgid "B<-H>" +msgstr "B<-H>" + +#. type: Plain text +#: ../man/ps.1:619 +msgid "Show process hierarchy (forest)." +msgstr "zeigt die Prozesshierarchie an (Waldansicht)." + +#. type: TP +#: ../man/ps.1:619 +#, no-wrap +msgid "B<--headers>" +msgstr "B<--headers>" + +#. type: Plain text +#: ../man/ps.1:622 +msgid "Repeat header lines, one per page of output." +msgstr "wiederholt die Kopfzeilen jeweils einmal pro ausgegebener Seite." + +#. type: TP +#: ../man/ps.1:622 +#, no-wrap +msgid "BI<\\ spec>" +msgstr "BI<\\ Spez>" + +# FIXME artifacts from Groff code, bug in po4a? +#. type: Plain text +#: ../man/ps.1:634 +msgid "Specify sorting order. Sorting syntax is [B<+>|B<->]I Choose a multi-letter key from the B section. The \"+\" is optional since default direction is increasing numerical or lexicographic order. Identical to B<--sort>." +msgstr "legt die Sortierreihenfolge fest. Die Sortierungssyntax ist [B<+>|B<->]I[,[B<+>|B<->]I[, …]]. Wählen Sie einen aus mehreren Buchstaben bestehenden Schlüssel aus dem Abschnitt B. Das »+« ist optional, da die Standardsortierung nach der ansteigenden numerischen oder lexikographischen Reihenfolge vorgenommen wird. Gleichbedeutend mit B<--sort>." + +#. type: Plain text +#: ../man/ps.1:637 +msgid "Examples:" +msgstr "Beispiele:" + +#. type: Plain text +#: ../man/ps.1:639 +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:641 +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:643 +msgid "B" +msgstr "B" + +#. type: TP +#: ../man/ps.1:644 +#, no-wrap +msgid "B<--lines>I<\\ n>" +msgstr "B<--lines>I<\\ n>" + +#. type: Plain text +#: ../man/ps.1:647 ../man/ps.1:691 +msgid "Set screen height." +msgstr "legt die Bildschirmhöhe fest." + +#. type: TP +#: ../man/ps.1:647 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:650 +msgid "Numeric output for WCHAN and USER (including all types of UID and GID)." +msgstr "aktiviert die numerische Ausgabe für WCHAN und USER (einschließlich aller UID- und GID-Typen)." + +#. type: TP +#: ../man/ps.1:650 +#, no-wrap +msgid "B<--no-headers>" +msgstr "B<--no-headers>" + +#. type: Plain text +#: ../man/ps.1:655 +msgid "Print no header line at all. B<--no-heading> is an alias for this option." +msgstr "unterdrückt die Ausgabe jeglicher Kopfzeilen. B<--no-heading> ist ein Alias für diese Option." + +#. type: TP +#: ../man/ps.1:655 +#, no-wrap +msgid "BI<\\ order>" +msgstr "BI<\\ Reihenfolge>" + +#. type: Plain text +#: ../man/ps.1:669 +msgid "Sorting order (overloaded). The BSD B option can act like B<-O> (user-defined output format with some common fields predefined) or can be used to specify sort order. Heuristics are used to determine the behavior of this option. To ensure that the desired behavior is obtained (sorting or formatting), specify the option in some other way (e.g. with B<-O> or B<--sort>)." +msgstr "legt die Sortierreihenfolge fest (überladen). Die BSD-Option B kann wie B<-O> agieren (benutzerdefiniertes Ausgabeformat mit einigen vordefinierten häufig genutzten Feldern) oder dazu verwendet werden, die Sortierreihenfolge anzugeben. Das Verhalten dieser Option wird heuristisch bestimmt. Um das gewünschte Verhalten sicherzustellen (Sortierung oder Formatierung), geben Sie die Option auf eine andere Weise an (zum Beispiel mit B<-O> oder B<--sort>)." + +#. type: Plain text +#: ../man/ps.1:688 +msgid "For sorting, obsolete BSD B option syntax is B[B<+>|B<->]I[,[B<+>|B<->]I[,...]]. It orders the processes listing according to the multilevel sort specified by the sequence of one-letter short keys I,I, ...\" described in the B section below. The\\ \"+\" is currently optional, merely re-iterating the default direction on a key, but may help to distinguish an B sort from an B format. The \"-\" reverses direction only on the key it precedes." +msgstr "Für die Sortierung ist B[B<+>|B<->]I[,[B<+>|B<->]I[, …]] die Syntax der veralteten BSD-Option B. Es ordnet die Prozessliste anhand der mehrstufigen Sortierung gemäß der einbuchstabigen Kurzschlüssel I, I, … , die nachfolgend im Abschnitt B beschrieben sind. Das »+« ist derzeit optional, es wiederholt nur die Standardrichtung eines Schlüssels, aber kann dabei helfen, Sortierungen nach B von einem Format B zu unterscheiden. Das »-« kehrt die Richtung nur für den Schlüssel um, dem es vorangestellt ist." + +#. type: TP +#: ../man/ps.1:688 +#, no-wrap +msgid "B<--rows>I<\\ n>" +msgstr "B<--rows>I<\\ n>" + +#. type: TP +#: ../man/ps.1:691 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:696 +msgid "Sum up some information, such as CPU usage, from dead child processes into their parent. This is useful for examining a system where a parent process repeatedly forks off short-lived children to do work." +msgstr "addiert Informationen, wie die CPU-Nutzung, aus den Informationen toter Kindprozesse und denen ihrer Elternprozesse. Dies ist nützlich, wenn Sie ein System untersuchen wollen, in dem ein Elternprozess fortwährend kurzlebige Kindprozesse mit fork() erstellt, um arbeiten zu können." + +#. type: TP +#: ../man/ps.1:696 +#, no-wrap +msgid "B<--sort>I<\\ spec>" +msgstr "B<--sort>I<\\ Spez>" + +#. type: Plain text +#: ../man/ps.1:710 +msgid "Specify sorting order. Sorting syntax is [I<+>|I<->]I[,[B<+>|B<->]I[,...]]. Choose a multi-letter key from the B section. The \"+\" is optional since default direction is increasing numerical or lexicographic order. Identical to B. For example: B" +msgstr "legt die Sortierreihenfolge fest. Die Sortierungssyntax ist [I<+>|I<->]I[,[B<+>|B<->]I[, …]]. Wählen Sie einen aus mehreren Buchstaben bestehenden Schlüssel aus dem Abschnitt B. Das »+« ist optional, da die Standardsortierung nach der aufsteigenden numerischen oder lexikographischen Reihenfolge vorgenommen wird. Gleichbedeutend mit B. Beispiel: B" + +#. type: TP +#: ../man/ps.1:710 +#, no-wrap +msgid "B<--signames>" +msgstr "B<--signames>" + +# FIXMe collumn → column +#. type: Plain text +#: ../man/ps.1:715 +msgid "Show signal masks using abbreviated signal names and expands the collumn. If the column width cannot show all signals, the column will end with a plus \"I<+>\". Columns with only a hyphen have no signals." +msgstr "zeigt Signalmasken mittels abgekürzter Signalnamen an und passt die Spalte an. Falls die Spaltenbreite nicht alle Signale anzeigen kann, endet die Spalte mit einem Plus-Zeichen (»+«). Spalten, die nur einen Bindestrich enthalten, haben keine Signale." + +#. type: TP +#: ../man/ps.1:715 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:718 ../man/ps.1:721 +msgid "Wide output. Use this option twice for unlimited width." +msgstr "aktiviert die breite Ausgabe. Verwenden Sie diese Option zweimal, um die Breite auf unbegrenzt zu setzen." + +#. type: TP +#: ../man/ps.1:721 +#, no-wrap +msgid "B<--width>I<\\ n>" +msgstr "B<--width>I<\\ n>" + +#. type: SH +#: ../man/ps.1:725 +#, no-wrap +msgid "THREAD DISPLAY" +msgstr "THREAD-ANZEIGE" + +#. type: TP +#: ../man/ps.1:726 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:729 +msgid "Show threads as if they were processes." +msgstr "zeigt Threads so an, als wären sie Prozesse." + +#. type: TP +#: ../man/ps.1:729 +#, no-wrap +msgid "B<-L>" +msgstr "B<-L>" + +#. type: Plain text +#: ../man/ps.1:732 +msgid "Show threads, possibly with LWP and NLWP columns." +msgstr "zeigt Threads an, eventuell mit den Spalten LWP und NLWP." + +#. type: TP +#: ../man/ps.1:732 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:735 ../man/ps.1:738 +msgid "Show threads after processes." +msgstr "zeigt Threads nach Prozessen an." + +#. type: TP +#: ../man/ps.1:735 +#, no-wrap +msgid "B<-m>" +msgstr "B<-m>" + +#. type: TP +#: ../man/ps.1:738 +#, no-wrap +msgid "B<-T>" +msgstr "B<-T>" + +#. type: Plain text +#: ../man/ps.1:741 +msgid "Show threads, possibly with SPID column." +msgstr "zeigt Threads an, möglicherweise mit einer SPID-Spalte." + +#. type: SH +#: ../man/ps.1:741 +#, no-wrap +msgid "OTHER INFORMATION" +msgstr "WEITERE INFORMATIONEN" + +# Sieht merkwürdig aus, funktioniert aber tatsächlich so. +#. type: TP +#: ../man/ps.1:742 +#, no-wrap +msgid "B<--help>I<\\ section>" +msgstr "B<--Hilfe>I<\\ Abschnitt>" + +#. type: Plain text +#: ../man/ps.1:753 +msgid "Print a help message. The I

argument can be one of Iimple, Iist, Iutput, Ihreads, Iisc, or Ill. The argument can be shortened to one of the underlined letters as in: s\\^|\\^l\\^|\\^o\\^|\\^t\\^|\\^m\\^|\\^a." +msgstr "gibt eine Hilfemeldung aus. Das Argument I kann eines aus Iimple, Iist, Iutput, Ihreads, Iisc oder Ill sein. Das Argument kann wie folgt auf einen der unterstrichenen Buchstaben gekürzt werden: s\\^|\\^l\\^|\\^o\\^|\\^t\\^|\\^m\\^|\\^a." + +#. type: TP +#: ../man/ps.1:753 +#, no-wrap +msgid "B<--info>" +msgstr "B<--info>" + +#. type: Plain text +#: ../man/ps.1:756 +msgid "Print debugging info." +msgstr "gibt Informationen zur Fehlerdiagnose aus." + +#. type: TP +#: ../man/ps.1:756 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:759 +msgid "List all format specifiers." +msgstr "listet alle Formatbezeichner auf." + +#. type: TP +#: ../man/ps.1:759 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../man/ps.1:762 ../man/ps.1:765 ../man/ps.1:768 +msgid "Print the procps-ng version." +msgstr "gibt die Version von Procps-ng aus." + +#. type: TP +#: ../man/ps.1:762 +#, no-wrap +msgid "B<-V>" +msgstr "B<-V>" + +#. type: TP +#: ../man/ps.1:765 +#, no-wrap +msgid "B<--version>" +msgstr "B<--version>" + +#. type: Plain text +#: ../man/ps.1:777 +msgid "This B works by reading the virtual files in /proc. This B does not need to be setuid kmem or have any privileges to run. Do not give this B any special permissions." +msgstr "Diese Version von B basiert auf dem Auslesen virtueller Dateien in /proc. Diese Version von B muss nicht setuid »kmem« sein oder zur Ausführung über irgendwelche Privilegien verfügen. Geben Sie dieser Version von B keine besonderen Rechte." + +#. type: Plain text +#: ../man/ps.1:783 +msgid "CPU usage is currently expressed as the percentage of time spent running during the entire lifetime of a process. This is not ideal, and\\ it does not conform to the standards that B otherwise conforms to. CPU usage is unlikely to add up to exactly 100%." +msgstr "Die CPU-Nutzung wird derzeit als der Prozentwert der während der gesamten Lebensdauer verwendeten Laufzeit ausgedrückt. Das ist nicht ideal und ist nicht zu den Standards konform, an denen sich B ansonsten orientiert. Es ist unwahrscheinlich, dass die Summe der CPU-Nutzung 100% erreicht." + +#. type: Plain text +#: ../man/ps.1:788 +msgid "The SIZE and RSS fields don't count some parts of a process including the page tables, kernel stack, struct thread_info, and struct task_struct. This is usually at least 20\\ KiB of memory that is always resident. SIZE is the virtual size of the process (code+\\:data+\\:stack)." +msgstr "Die Felder SIZE und RSS zählen einige Teile des Prozesses nicht, wie die Seitentabellen, den Kernel-Stack, die Structs »thread_info« und »task_struct«. Dies ergibt üblicherweise mindestens 20 KiB Speicher, die immer belegt sind. SIZE ist die virtuelle Größe des Prozesses (Code+\\:Daten+\\:Stack)." + +#. type: Plain text +#: ../man/ps.1:794 +msgid "Processes marked EdefunctE are dead processes (so-called \"zombies\") that remain because their parent has not destroyed them properly. These processes will be destroyed by I(8) if the parent process exits." +msgstr "Als EdefunctE markierte Prozesse sind tote Prozesse (sogenannte »Zombies«). Diese sind deswegen noch vorhanden, weil deren Elternprozesse sie nicht sauber beendet haben. Diese Prozesse werden durch I(8) zerstört, sofern der Elternprozess existiert." + +#. type: Plain text +#: ../man/ps.1:798 +msgid "If the length of the username is greater than the width of the display column, the username will be truncated. See the B<-o> and B<-O> formatting options to customize length." +msgstr "Falls der Benutzername länger ist als die Breite der Anzeigespalte, wird der Benutzername gekürzt. Mit den Formatierungsoptionen B<-o> und B<-O> können Sie die Breite anpassen." + +#. type: Plain text +#: ../man/ps.1:810 +msgid "Commands options such as B are not recommended as it is a confusion of two different standards. According to the POSIX and UNIX standards, the above command asks to display all processes with a TTY (generally the commands users are running) plus all processes owned by a user named I. If that user doesn't exist, then B will assume you really meant \"B I\"." +msgstr "Von Befehlszeilenoptionen wie B wird abgeraten, da sie zwei Standards vermischen. Entsprechend den POSIX- und UNIX-Standards bewirkt der vorstehende Befehl die Anzeige aller Prozesse mit einem TTY (im Allgemeinen die Befehle, die Benutzer ausführen) und zusätzlich aller Prozesse, die einem Benutzer namens I gehören. Existiert dieser Benutzer nicht, wird B annehmen, dass Sie eigentlich B I meinten." + +#. type: SH +#: ../man/ps.1:810 +#, no-wrap +msgid "PROCESS FLAGS" +msgstr "PROZESSSCHALTER" + +#. type: Plain text +#: ../man/ps.1:815 +msgid "The sum of these values is displayed in the \"F\" column, which is provided by the B output specifier:" +msgstr "Die Summe dieser Werte wird in der Spalte »F« angezeigt, die durch den Ausgabebezeichner B bereitgestellt wird:" + +#. type: Plain text +#: ../man/ps.1:821 +msgid "forked but didn't exec" +msgstr "mit fork() erstellt, aber nicht ausgeführt" + +#. type: IP +#: ../man/ps.1:821 ../man/ps.1:2088 +#, no-wrap +msgid "4" +msgstr "4" + +#. type: Plain text +#: ../man/ps.1:824 +msgid "used super-user privileges" +msgstr "Superuser-Privilegien verwendet" + +#. type: SH +#: ../man/ps.1:826 +#, no-wrap +msgid "PROCESS STATE CODES" +msgstr "PROZESSZUSTANDSCODES" + +#. type: Plain text +#: ../man/ps.1:831 +msgid "Here are the different values that the B, B and B output specifiers (header \"STAT\" or \"S\") will display to describe the state of a process:" +msgstr "Dies sind die verschiedenen Werte, welche die Ausgabebezeichner B, B und B (Überschrift »STAT« oder »S«) anzeigen, um den Status eines Prozesses zu beschreiben:" + +#. type: TP +#: ../man/ps.1:834 +#, no-wrap +msgid "D" +msgstr "D" + +#. type: Plain text +#: ../man/ps.1:837 +msgid "uninterruptible sleep (usually IO)" +msgstr "Nicht unterbrechbarer Schlafzustand (üblicherweise E/A)" + +#. type: TP +#: ../man/ps.1:837 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../man/ps.1:840 +msgid "Idle kernel thread" +msgstr "Kernel-Thread im Leerlauf" + +#. type: tbl table +#: ../man/ps.1:840 ../man/ps.1:925 +#, no-wrap +msgid "R" +msgstr "R" + +#. type: Plain text +#: ../man/ps.1:843 +msgid "running or runnable (on run queue)" +msgstr "Laufend oder lauffähig (in der Ausführungswarteschlange)" + +#. type: tbl table +#: ../man/ps.1:843 ../man/ps.1:927 ../man/ps.1:1631 ../man/ps.1:1753 +#, no-wrap +msgid "S" +msgstr "S" + +#. type: Plain text +#: ../man/ps.1:846 +msgid "interruptible sleep (waiting for an event to complete)" +msgstr "Unterbrechbarer Schlafzustand (auf den Abschluss eines Ereignisses wartend)" + +#. type: tbl table +#: ../man/ps.1:846 ../man/ps.1:929 +#, no-wrap +msgid "T" +msgstr "T" + +#. type: Plain text +#: ../man/ps.1:849 +msgid "stopped by job control signal" +msgstr "Durch Jobsteuersignal gestoppt" + +#. type: tbl table +#: ../man/ps.1:849 ../man/ps.1:928 +#, no-wrap +msgid "t" +msgstr "t" + +#. type: Plain text +#: ../man/ps.1:852 +msgid "stopped by debugger during the tracing" +msgstr "Durch Debugger während der Verfolgung gestoppt" + +#. type: Plain text +#: ../man/ps.1:855 +msgid "paging (not valid since the 2.6.xx kernel)" +msgstr "Paging (ungültig seit Kernel 2.6.xx)" + +#. type: TP +#: ../man/ps.1:855 +#, no-wrap +msgid "X" +msgstr "X" + +#. type: Plain text +#: ../man/ps.1:858 +msgid "dead (should never be seen)" +msgstr "Tot (sollte niemals angezeigt werden)" + +#. type: TP +#: ../man/ps.1:858 +#, no-wrap +msgid "Z" +msgstr "Z" + +#. type: Plain text +#: ../man/ps.1:861 +msgid "defunct (\"zombie\") process, terminated but not reaped by its parent" +msgstr "Defunktionaler (»Zombie«-) Prozess, beendet, aber durch seinen Elternprozess nicht aufgeräumt" + +#. type: Plain text +#: ../man/ps.1:867 +msgid "For BSD formats and when the B keyword is used, additional characters may be displayed:" +msgstr "Für BSD-Formate und bei Verwendung des Schlüsselworts B können zusätzliche Zeichen angezeigt werden:" + +#. type: TP +#: ../man/ps.1:870 +#, no-wrap +msgid "E" +msgstr "E" + +#. type: Plain text +#: ../man/ps.1:873 +msgid "high-priority (not nice to other users)" +msgstr "Hohe Priorität (nicht »nice« zu anderen Benutzern)" + +#. type: tbl table +#: ../man/ps.1:873 ../man/ps.1:920 +#, no-wrap +msgid "N" +msgstr "N" + +#. type: Plain text +#: ../man/ps.1:876 +msgid "low-priority (nice to other users)" +msgstr "Niedrige Priorität (»nice« zu anderen Benutzern)" + +#. type: TP +#: ../man/ps.1:876 +#, no-wrap +msgid "L" +msgstr "L" + +#. type: Plain text +#: ../man/ps.1:879 +msgid "has pages locked into memory (for real-time and custom IO)" +msgstr "Hat im Speicher gesperrte Seiten (für Echtzeit- und benutzerdefinierte E/A)" + +#. type: Plain text +#: ../man/ps.1:882 +msgid "is a session leader" +msgstr "Ist ein Sitzungsleiter" + +#. type: Plain text +#: ../man/ps.1:885 +msgid "is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)" +msgstr "Ist multi-threaded (mittels CLONE_THREAD, wie es NPTL-Pthreads tun)" + +#. type: TP +#: ../man/ps.1:885 +#, no-wrap +msgid "+" +msgstr "+" + +#. type: Plain text +#: ../man/ps.1:888 +msgid "is in the foreground process group" +msgstr "Ist in der Vordergrund-Prozessgruppe" + +#. type: SH +#: ../man/ps.1:890 +#, no-wrap +msgid "OBSOLETE SORT KEYS" +msgstr "VERALTETE SORTIERSCHLÜSSEL" + +#. type: Plain text +#: ../man/ps.1:906 +msgid "These keys are used by the BSD B option (when it is used for sorting). The GNU B<--sort> option doesn't use these keys, but the specifiers described below in the B section. Note that the values used in sorting are the internal values B uses and not the \"cooked\" values used in some of the output format fields (e.g. sorting on tty will sort into device number, not according to the terminal name displayed). Pipe B output into the B(1) command if you want to sort the cooked values." +msgstr "Diese Schlüssel werden von der BSD-Option B verwendet (wenn diese zur Sortierung verwendet wird). Die GNU-Option B<--sort> verwendet diese Schlüssel nicht, sondern die im nachfolgenden Abschnitt B beschriebenen Schlüssel. Beachten Sie, dass die in der Sortierung verwendeten Werte die internen Werte sind, die B nutzt, und nicht die »verarbeiteten« Werte, die in einigen der Ausgabeformat-Felder verwendet werden (zum Beispiel wird bei der Sortierung nach TTY anhand der Gerätenummern sortiert und nicht anhand des angezeigten Terminalnamens). Leiten Sie die Ausgabe von B an den Befehl B weiter, wenn Sie nach den verarbeiteten Werten sortieren wollen." + +#. type: tbl table +#: ../man/ps.1:908 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: tbl table +#: ../man/ps.1:908 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: tbl table +#: ../man/ps.1:908 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: tbl table +#: ../man/ps.1:909 ../man/ps.1:1161 +#, no-wrap +msgid "cmd" +msgstr "cmd" + +#. type: tbl table +#: ../man/ps.1:909 +#, no-wrap +msgid "simple name of executable" +msgstr "Einfacher Name der ausführbaren Datei" + +#. type: tbl table +#: ../man/ps.1:910 ../man/ps.1:1081 +#, no-wrap +msgid "C" +msgstr "C" + +#. type: tbl table +#: ../man/ps.1:910 ../man/ps.1:952 ../man/ps.1:1481 +#, no-wrap +msgid "pcpu" +msgstr "pcpu" + +#. type: tbl table +#: ../man/ps.1:910 +#, no-wrap +msgid "cpu utilization" +msgstr "CPU-Nutzung" + +#. type: tbl table +#: ../man/ps.1:911 ../man/ps.1:1300 +#, no-wrap +msgid "f" +msgstr "f" + +#. type: tbl table +#: ../man/ps.1:911 ../man/ps.1:1326 +#, no-wrap +msgid "flags" +msgstr "flags" + +#. type: tbl table +#: ../man/ps.1:911 +#, no-wrap +msgid "flags as in long format F field" +msgstr "Schalter, wie im F-Feld im Langformat" + +#. type: tbl table +#: ../man/ps.1:912 +#, no-wrap +msgid "g" +msgstr "g" + +#. type: tbl table +#: ../man/ps.1:912 ../man/ps.1:1508 +#, no-wrap +msgid "pgrp" +msgstr "pgrp" + +#. type: tbl table +#: ../man/ps.1:912 +#, no-wrap +msgid "process group ID" +msgstr "Prozessgruppenkennung" + +#. type: tbl table +#: ../man/ps.1:913 +#, no-wrap +msgid "G" +msgstr "G" + +#. type: tbl table +#: ../man/ps.1:913 ../man/ps.1:1848 +#, no-wrap +msgid "tpgid" +msgstr "tpgid" + +#. type: tbl table +#: ../man/ps.1:913 +#, no-wrap +msgid "controlling tty process group ID" +msgstr "Prozessgruppenkennung des steuernden TTY" + +#. type: tbl table +#: ../man/ps.1:914 +#, no-wrap +msgid "j" +msgstr "j" + +#. type: tbl table +#: ../man/ps.1:914 +#, no-wrap +msgid "cutime" +msgstr "cutime" + +#. type: tbl table +#: ../man/ps.1:914 +#, no-wrap +msgid "cumulative user time" +msgstr "Kumulative Benutzerzeit" + +#. type: tbl table +#: ../man/ps.1:915 +#, no-wrap +msgid "J" +msgstr "J" + +#. type: tbl table +#: ../man/ps.1:915 +#, no-wrap +msgid "cstime" +msgstr "cstime" + +#. type: tbl table +#: ../man/ps.1:915 +#, no-wrap +msgid "cumulative system time" +msgstr "Kumulative Systemzeit" + +#. type: tbl table +#: ../man/ps.1:916 +#, no-wrap +msgid "k" +msgstr "k" + +#. type: tbl table +#: ../man/ps.1:916 +#, no-wrap +msgid "utime" +msgstr "utime" + +#. type: tbl table +#: ../man/ps.1:916 +#, no-wrap +msgid "user time" +msgstr "Benutzerzeit" + +#. type: tbl table +#: ../man/ps.1:917 +#, no-wrap +msgid "m" +msgstr "m" + +#. type: tbl table +#: ../man/ps.1:917 ../man/ps.1:1419 +#, no-wrap +msgid "min_flt" +msgstr "min_flt" + +#. type: tbl table +#: ../man/ps.1:917 +#, no-wrap +msgid "number of minor page faults" +msgstr "Anzahl der geringfügigen Seitenfehlerausnahmebehandlungen" + +#. type: tbl table +#: ../man/ps.1:918 +#, no-wrap +msgid "M" +msgstr "M" + +#. type: tbl table +#: ../man/ps.1:918 ../man/ps.1:1415 +#, no-wrap +msgid "maj_flt" +msgstr "maj_flt" + +#. type: tbl table +#: ../man/ps.1:918 +#, no-wrap +msgid "number of major page faults" +msgstr "Anzahl der großen Seitenfehlerausnahmebehandlungen" + +#. type: tbl table +#: ../man/ps.1:919 +#, no-wrap +msgid "cmin_flt" +msgstr "cmin_flt" + +#. type: tbl table +#: ../man/ps.1:919 +#, no-wrap +msgid "cumulative minor page faults" +msgstr "Kumulierte Anzahl der geringfügigen Seitenfehlerausnahmebehandlungen" + +#. type: tbl table +#: ../man/ps.1:920 +#, no-wrap +msgid "cmaj_flt" +msgstr "cmaj_flt" + +#. type: tbl table +#: ../man/ps.1:920 +#, no-wrap +msgid "cumulative major page faults" +msgstr "Kumulierte Anzahl der großen Seitenfehlerausnahmebehandlungen" + +#. type: tbl table +#: ../man/ps.1:921 +#, no-wrap +msgid "session" +msgstr "session" + +#. type: tbl table +#: ../man/ps.1:921 +#, no-wrap +msgid "session ID" +msgstr "Sitzungskennung" + +#. type: tbl table +#: ../man/ps.1:922 ../man/ps.1:960 ../man/ps.1:1515 +#, no-wrap +msgid "pid" +msgstr "pid" + +#. type: tbl table +#: ../man/ps.1:922 +#, no-wrap +msgid "process ID" +msgstr "Prozesskennung" + +#. type: tbl table +#: ../man/ps.1:923 ../man/ps.1:1657 +#, no-wrap +msgid "P" +msgstr "P" + +#. type: tbl table +#: ../man/ps.1:923 ../man/ps.1:954 ../man/ps.1:1559 +#, no-wrap +msgid "ppid" +msgstr "ppid" + +#. type: tbl table +#: ../man/ps.1:923 +#, no-wrap +msgid "parent process ID" +msgstr "Kennung des Elternprozesses" + +#. type: tbl table +#: ../man/ps.1:924 +#, no-wrap +msgid "r" +msgstr "r" + +#. type: tbl table +#: ../man/ps.1:924 ../man/ps.1:1598 +#, no-wrap +msgid "rss" +msgstr "rss" + +#. type: tbl table +#: ../man/ps.1:924 +#, no-wrap +msgid "resident set size" +msgstr "Hauptspeicherbelegung" + +#. type: tbl table +#: ../man/ps.1:925 +#, no-wrap +msgid "resident" +msgstr "resident" + +#. type: tbl table +#: ../man/ps.1:925 +#, no-wrap +msgid "resident pages" +msgstr "Seiten in der Hauptspeicherbelegung" + +#. type: tbl table +#: ../man/ps.1:926 ../man/ps.1:1707 +#, no-wrap +msgid "size" +msgstr "size" + +#. type: tbl table +#: ../man/ps.1:926 +#, no-wrap +msgid "memory size in kilobytes" +msgstr "Speichergröße in Kilobyte" + +#. type: tbl table +#: ../man/ps.1:927 +#, no-wrap +msgid "share" +msgstr "share" + +#. type: tbl table +#: ../man/ps.1:927 +#, no-wrap +msgid "amount of shared pages" +msgstr "Menge der gemeinsam genutzten Seiten" + +#. type: tbl table +#: ../man/ps.1:928 ../man/ps.1:965 ../man/ps.1:1862 +#, no-wrap +msgid "tty" +msgstr "tty" + +#. type: tbl table +#: ../man/ps.1:928 +#, no-wrap +msgid "the device number of the controlling tty" +msgstr "Die Gerätenummer des steuernden TTY" + +#. type: tbl table +#: ../man/ps.1:929 ../man/ps.1:1736 +#, no-wrap +msgid "start_time" +msgstr "start_time" + +#. type: tbl table +#: ../man/ps.1:929 +#, no-wrap +msgid "time process was started" +msgstr "Zeit, zu der der Prozess gestartet wurde" + +#. type: tbl table +#: ../man/ps.1:930 +#, no-wrap +msgid "U" +msgstr "U" + +#. type: tbl table +#: ../man/ps.1:930 ../man/ps.1:1881 +#, no-wrap +msgid "uid" +msgstr "uid" + +#. type: tbl table +#: ../man/ps.1:930 +#, no-wrap +msgid "user ID number" +msgstr "Benutzerkennung (ID)" + +#. type: tbl table +#: ../man/ps.1:931 ../man/ps.1:955 ../man/ps.1:1900 +#, no-wrap +msgid "user" +msgstr "user" + +#. type: tbl table +#: ../man/ps.1:931 +#, no-wrap +msgid "user name" +msgstr "Benutzername" + +#. type: tbl table +#: ../man/ps.1:932 ../man/ps.1:1929 +#, no-wrap +msgid "vsize" +msgstr "vsize" + +#. type: tbl table +#: ../man/ps.1:932 +#, no-wrap +msgid "total VM size in KiB" +msgstr "Gesamtgröße des virtuellen Speichers in KiB" + +#. type: tbl table +#: ../man/ps.1:933 +#, no-wrap +msgid "y" +msgstr "y" + +#. type: tbl table +#: ../man/ps.1:933 +#, no-wrap +msgid "priority" +msgstr "priority" + +#. type: tbl table +#: ../man/ps.1:933 +#, no-wrap +msgid "kernel scheduling priority" +msgstr "Scheduling-Priorität des Kernels" + +#. type: SH +#: ../man/ps.1:936 +#, no-wrap +msgid "AIX FORMAT DESCRIPTORS" +msgstr "AIX-FORMATDESKRIPTOREN" + +#. type: Plain text +#: ../man/ps.1:949 +msgid "This B supports AIX format descriptors, which work somewhat like the formatting codes of I(1) and I(3). For example, the normal default output can be produced with this: B. The B codes are described in the next section." +msgstr "Diese Version von B unterstützt AIX-Formatdeskriptoren, die ähnlich den Formatierungscodes von I(1) und I(3) funktionieren. Die normale, standardmäßige Ausgabe kann folgendermaßen erzeugt werden: B. Die B-Codes sind im nächsten Abschnitt beschrieben." + +#. type: tbl table +#: ../man/ps.1:951 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: tbl table +#: ../man/ps.1:951 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: tbl table +#: ../man/ps.1:951 +#, no-wrap +msgid "B
" +msgstr "B" + +#. type: tbl table +#: ../man/ps.1:952 +#, no-wrap +msgid "%C" +msgstr "%C" + +#. type: tbl table +#: ../man/ps.1:952 ../man/ps.1:1004 ../man/ps.1:1481 +#, no-wrap +msgid "%CPU" +msgstr "%CPU" + +#. type: tbl table +#: ../man/ps.1:953 +#, no-wrap +msgid "%G" +msgstr "%G" + +#. type: tbl table +#: ../man/ps.1:953 ../man/ps.1:1355 +#, no-wrap +msgid "group" +msgstr "group" + +#. type: tbl table +#: ../man/ps.1:953 ../man/ps.1:1355 +#, no-wrap +msgid "GROUP" +msgstr "GROUP" + +#. type: tbl table +#: ../man/ps.1:954 +#, no-wrap +msgid "%P" +msgstr "%P" + +#. type: tbl table +#: ../man/ps.1:954 ../man/ps.1:1559 +#, no-wrap +msgid "PPID" +msgstr "PPID" + +#. type: tbl table +#: ../man/ps.1:955 +#, no-wrap +msgid "%U" +msgstr "%U" + +#. type: tbl table +#: ../man/ps.1:955 ../man/ps.1:1888 ../man/ps.1:1900 +#, no-wrap +msgid "USER" +msgstr "USER" + +#. type: tbl table +#: ../man/ps.1:956 +#, no-wrap +msgid "%a" +msgstr "%a" + +#. type: tbl table +#: ../man/ps.1:956 ../man/ps.1:1027 +#, no-wrap +msgid "args" +msgstr "args" + +#. type: tbl table +#: ../man/ps.1:956 ../man/ps.1:957 ../man/ps.1:1027 ../man/ps.1:1168 +#: ../man/ps.1:1196 ../man/ps.1:1333 ../man/ps.1:1874 +#, no-wrap +msgid "COMMAND" +msgstr "BEFEHL" + +#. type: tbl table +#: ../man/ps.1:957 +#, no-wrap +msgid "%c" +msgstr "%c" + +#. type: tbl table +#: ../man/ps.1:957 ../man/ps.1:1168 +#, no-wrap +msgid "comm" +msgstr "comm" + +#. type: tbl table +#: ../man/ps.1:958 +#, no-wrap +msgid "%g" +msgstr "%g" + +#. type: tbl table +#: ../man/ps.1:958 ../man/ps.1:1588 +#, no-wrap +msgid "rgroup" +msgstr "rgroup" + +#. type: tbl table +#: ../man/ps.1:958 ../man/ps.1:1588 +#, no-wrap +msgid "RGROUP" +msgstr "RGROUP" + +#. type: tbl table +#: ../man/ps.1:959 +#, no-wrap +msgid "%n" +msgstr "%n" + +#. type: tbl table +#: ../man/ps.1:959 ../man/ps.1:1443 +#, no-wrap +msgid "nice" +msgstr "nice" + +#. type: tbl table +#: ../man/ps.1:959 ../man/ps.1:1435 ../man/ps.1:1443 +#, no-wrap +msgid "NI" +msgstr "NI" + +#. type: tbl table +#: ../man/ps.1:960 +#, no-wrap +msgid "%p" +msgstr "%p" + +#. type: tbl table +#: ../man/ps.1:960 ../man/ps.1:1515 +#, no-wrap +msgid "PID" +msgstr "PID" + +#. type: tbl table +#: ../man/ps.1:961 +#, no-wrap +msgid "%r" +msgstr "%r" + +#. type: tbl table +#: ../man/ps.1:961 ../man/ps.1:1502 +#, no-wrap +msgid "pgid" +msgstr "pgid" + +#. type: tbl table +#: ../man/ps.1:961 ../man/ps.1:1502 +#, no-wrap +msgid "PGID" +msgstr "PGID" + +#. type: tbl table +#: ../man/ps.1:962 +#, no-wrap +msgid "%t" +msgstr "%t" + +#. type: tbl table +#: ../man/ps.1:962 ../man/ps.1:1271 +#, no-wrap +msgid "etime" +msgstr "etime" + +#. type: tbl table +#: ../man/ps.1:962 ../man/ps.1:1271 ../man/ps.1:1275 +#, no-wrap +msgid "ELAPSED" +msgstr "ELAPSED" + +#. type: tbl table +#: ../man/ps.1:963 +#, no-wrap +msgid "%u" +msgstr "%u" + +#. type: tbl table +#: ../man/ps.1:963 ../man/ps.1:1626 +#, no-wrap +msgid "ruser" +msgstr "ruser" + +#. type: tbl table +#: ../man/ps.1:963 ../man/ps.1:1626 +#, no-wrap +msgid "RUSER" +msgstr "RUSER" + +#. type: tbl table +#: ../man/ps.1:964 +#, no-wrap +msgid "%x" +msgstr "%x" + +#. type: tbl table +#: ../man/ps.1:964 ../man/ps.1:1827 +#, no-wrap +msgid "time" +msgstr "time" + +#. type: tbl table +#: ../man/ps.1:964 ../man/ps.1:1075 ../man/ps.1:1208 ../man/ps.1:1213 +#: ../man/ps.1:1827 ../man/ps.1:1838 +#, no-wrap +msgid "TIME" +msgstr "TIME" + +#. type: tbl table +#: ../man/ps.1:965 +#, no-wrap +msgid "%y" +msgstr "%y" + +#. type: tbl table +#: ../man/ps.1:965 ../man/ps.1:1843 +#, no-wrap +msgid "TTY" +msgstr "TTY" + +#. type: tbl table +#: ../man/ps.1:966 +#, no-wrap +msgid "%z" +msgstr "%z" + +#. type: tbl table +#: ../man/ps.1:966 ../man/ps.1:1936 +#, no-wrap +msgid "vsz" +msgstr "vsz" + +#. type: tbl table +#: ../man/ps.1:966 ../man/ps.1:1929 ../man/ps.1:1936 +#, no-wrap +msgid "VSZ" +msgstr "VSZ" + +#. type: SH +#: ../man/ps.1:968 +#, no-wrap +msgid "STANDARD FORMAT SPECIFIERS" +msgstr "STANDARD-FORMATBEZEICHNER" + +#. type: Plain text +#: ../man/ps.1:975 +msgid "Here are the different keywords that may be used to control the output format (e.g., with option B<-o>) or to sort the selected processes with the GNU-style B<--sort> option." +msgstr "Hier sind die verschiedenen Schlüsselwörter, die zum Steuern des Ausgabeformats (zum Beispiel mit der Option B<-o>) oder zum Sortieren der ausgewählten Prozesse mit der GNU-artigen Option B<--sort> verwendet werden können." + +#. type: Plain text +#: ../man/ps.1:978 +msgid "For example: B" +msgstr "Beispiel: B" + +#. type: Plain text +#: ../man/ps.1:983 +msgid "This version of B tries to recognize most of the keywords used in other implementations of B." +msgstr "Diese Version von B versucht, die meisten der in anderen Implementierungen von B verwendeten Schlüsselwörter zu erkennen." + +#. type: Plain text +#: ../man/ps.1:988 +msgid "The following user-defined format specifiers may contain spaces: B, B, B, B, B, B, B, B, B, B." +msgstr "Die folgenden benutzerdefinierten Formatbezeichner dürfen Leerräume enthalten: B, B, B, B, B, B, B, B, B, B." + +#. type: Plain text +#: ../man/ps.1:990 +msgid "Some keywords may not be available for sorting." +msgstr "Einige Schlüsselwörter könnten nicht für die Sortierung verfügbar sein." + +#. type: tbl table +#: ../man/ps.1:1002 +#, no-wrap +msgid "CODE" +msgstr "CODE" + +#. type: tbl table +#: ../man/ps.1:1002 +#, no-wrap +msgid "HEADER" +msgstr "HEADER" + +#. type: tbl table +#: ../man/ps.1:1004 +#, no-wrap +msgid "%cpu" +msgstr "%cpu" + +#. type: tbl table +#: ../man/ps.1:1010 +#, no-wrap +msgid "" +"cpu utilization of the process in \"##.#\" format. Currently, it is the CPU\n" +"time used divided by the time the process has been running (cputime/realtime\n" +"ratio), expressed as a percentage. It will not add up to 100% unless you are\n" +"lucky. (alias\n" +"B)." +msgstr "CPU-Nutzung des Prozesses im Format »##.#«. Gegenwärtig ist es die CPU-Zeit dividiert durch die Zeit, die der Prozess bisher läuft (CPU-Zeit/Echtzeit-Verhältnis), ausgedrückt als Prozentwert. Wenn Sie nicht gerade Glück haben, wird dieser Wert nicht auf 100% aufsummieren (alias B)." + +#. type: tbl table +#: ../man/ps.1:1012 +#, no-wrap +msgid "%mem" +msgstr "%mem" + +#. type: tbl table +#: ../man/ps.1:1012 ../man/ps.1:1526 +#, no-wrap +msgid "%MEM" +msgstr "%MEM" + +#. type: tbl table +#: ../man/ps.1:1016 +#, no-wrap +msgid "" +"ratio of the process's resident set size to the physical memory on the\n" +"machine, expressed as a percentage. (alias\n" +"B)." +msgstr "Prozentuales Verhältnis der Hauptspeicherbelegung des Prozesses (»resident set size«) zur Größe des physischen Speichers der Maschine (alias B)." + +#. type: tbl table +#: ../man/ps.1:1018 +#, no-wrap +msgid "ag_id" +msgstr "ag_id" + +#. type: tbl table +#: ../man/ps.1:1018 +#, no-wrap +msgid "AGID" +msgstr "AGID" + +#. type: tbl table +#: ../man/ps.1:1021 +#, no-wrap +msgid "" +"The autogroup identifier associated with a process which operates in conjunction\n" +"with the CFS scheduler to improve interactive desktop performance." +msgstr "" + +#. type: tbl table +#: ../man/ps.1:1023 +#, no-wrap +msgid "ag_nice" +msgstr "ag_nice" + +#. type: tbl table +#: ../man/ps.1:1023 +#, no-wrap +msgid "AGNI" +msgstr "AGNI" + +#. type: tbl table +#: ../man/ps.1:1025 +#, no-wrap +msgid "The autogroup nice value which affects scheduling of all processes in that group." +msgstr "" + +#. type: tbl table +#: ../man/ps.1:1042 +#, no-wrap +msgid "" +"command with all its arguments as a string. Modifications to the arguments\n" +"may be shown. The output in this column may contain spaces. A process\n" +"marked EdefunctE is partly dead, waiting to be fully destroyed by its parent.\n" +"Sometimes the process args will be unavailable; when this happens,\n" +"B\n" +"will instead print the executable name in brackets. (alias\n" +"B, B).\n" +"See also the\n" +"B\n" +"format keyword, the\n" +"B<-f>\n" +"option, and the\n" +"B\n" +"option.\n" +msgstr "Befehl mit allen seinen Argumenten als Zeichenkette. Modifikationen der Argumente können angezeigt werden. Die Ausgabe in dieser Spalte darf Leerräume enthalten. Ein als EdefunctE markierter Prozess ist teilweise tot und wartet darauf, von seinem Elternprozess endgültig zerstört zu werden. Gelegentlich sind die Argumente des Prozesses nicht verfügbar. Falls die passiert, gibt B stattdessen den Namen der ausführbaren Datei in Klammern aus (alias B, B). Siehe auch das Formatschlüsselwort B sowie die Optionen B<-f> und B.\n" + +#. type: tbl table +#: ../man/ps.1:1042 ../man/ps.1:1116 ../man/ps.1:1118 ../man/ps.1:1120 +#: ../man/ps.1:1122 ../man/ps.1:1124 ../man/ps.1:1126 ../man/ps.1:1128 +#: ../man/ps.1:1130 ../man/ps.1:1142 ../man/ps.1:1144 ../man/ps.1:1146 +#: ../man/ps.1:1148 ../man/ps.1:1150 ../man/ps.1:1152 ../man/ps.1:1154 +#: ../man/ps.1:1156 ../man/ps.1:1180 ../man/ps.1:1540 ../man/ps.1:1542 +#: ../man/ps.1:1544 ../man/ps.1:1546 ../man/ps.1:1548 ../man/ps.1:1550 +#: ../man/ps.1:1552 ../man/ps.1:1554 +#, no-wrap +msgid ".br\n" +msgstr ".br\n" + +#. type: tbl table +#: ../man/ps.1:1058 +#, no-wrap +msgid "" +"When specified last, this column will extend to the edge of the display. If\n" +"B\n" +"can not determine display width, as when output is redirected (piped) into a\n" +"file or another command, the output width is undefined (it may be 80,\n" +"unlimited, determined by the\n" +"B\n" +"variable, and so on). The\n" +"B\n" +"environment variable or\n" +"B<--cols>\n" +"option may be used to exactly determine the width in this case. The\n" +"B\n" +"or\n" +"B<-w>\n" +"option may be also be used to adjust width." +msgstr "Wenn dies als Letztes angegeben wird, dann wird die letzte Spalte bis zum Rand des Bildschirms verbreitert. Falls B die Bildschirmbreite nicht ermitteln kann, wenn die Ausgabe beispielsweise in eine Datei oder an einen anderen Befehl weitergeleitet wird, ist die Ausgabebreite nicht definiert (sie könnte 80, unbegrenzt, durch die Variable B bestimmt usw. sein). Die Umgebungsvariable B oder die Option B<--cols> können dazu verwendet werden, in diesem Fall die Breite genau festzulegen. Die Optionen B oder B<-w> können auch zur Anpassung der Breite verwendet werden." + +#. type: tbl table +#: ../man/ps.1:1060 +#, no-wrap +msgid "blocked" +msgstr "blocked" + +#. type: tbl table +#: ../man/ps.1:1060 ../man/ps.1:1700 +#, no-wrap +msgid "BLOCKED" +msgstr "BLOCKED" + +#. type: tbl table +#: ../man/ps.1:1066 +#, no-wrap +msgid "" +"mask of the blocked signals, see\n" +"I(7).\n" +"According to the width of the field, a 32 or 64-bit mask in hexadecimal\n" +"format is displayed, unless the B<--signames> option is used. (alias\n" +"B, B)." +msgstr "Maske der blockierten Signale, siehe I(7). Entsprechend der Feldbreite wird eine 32- oder 64-Bit-Maske in hexadezimalem Format angezeigt, außer wenn die Option B<--signames> verwendet wird (alias B, B)." + +#. type: tbl table +#: ../man/ps.1:1068 +#, no-wrap +msgid "bsdstart" +msgstr "bsdstart" + +#. type: tbl table +#: ../man/ps.1:1068 ../man/ps.1:1736 +#, no-wrap +msgid "START" +msgstr "START" + +#. type: tbl table +#: ../man/ps.1:1073 +#, no-wrap +msgid "" +"time the command started. If the process was started less than 24 hours ago,\n" +"the output format is \"\\ HH:MM\", else it is \" Mmm:SS\" (where Mmm is the three\n" +"letters of the month). See also\n" +"B,B<\\ start>,B<\\ start_time>, andB<\\ stime>." +msgstr "Zeitpunkt, zu dem der Befehl gestartet wurde. Falls der Prozess vor weniger als 24 Stunden gestartet wurde, ist das Ausgabeformat »\\ HH:MM«, anderenfalls ist es » Mmm:SS« (wobei Mmm die aus drei Buchstaben bestehende Kurzform des Monats ist). Siehe auch B, B, B und B." + +#. type: tbl table +#: ../man/ps.1:1075 +#, no-wrap +msgid "bsdtime" +msgstr "bsdtime" + +#. type: tbl table +#: ../man/ps.1:1079 +#, no-wrap +msgid "" +"accumulated cpu time, user + system. The display format is usually\n" +"\"MMM:SS\", but can be shifted to the right if the process used more than 999\n" +"minutes of cpu time." +msgstr "Kumulierte CPU-Zeit, Benutzer + System. Das Anzeigeformat ist üblicherweise »MMM:SS«, kann aber auch nach rechts verschoben werden, falls der Prozess mehr als 999 Minuten CPU-Zeit verbraucht hat." + +# FIXME Zeilenumbrüche…? +#. type: tbl table +#: ../man/ps.1:1085 +#, no-wrap +msgid "" +"processor utilization. Currently, this is the integer value of the percent\n" +"usage over the lifetime of the process. (see\n" +"B<%cpu>)." +msgstr "Prozessornutzung. Gegenwärtig ist dies der ganzzahlige Wert der prozentualen Nutzung über die gesamte Lebensdauer des Prozesses (siehe B<%cpu>)." + +#. type: tbl table +#: ../man/ps.1:1087 +#, no-wrap +msgid "caught" +msgstr "caught" + +#. type: tbl table +#: ../man/ps.1:1087 ../man/ps.1:1686 +#, no-wrap +msgid "CAUGHT" +msgstr "CAUGHT" + +#. type: tbl table +#: ../man/ps.1:1093 +#, no-wrap +msgid "" +"mask of the caught signals, see\n" +"I(7).\n" +"According to the width of the field, a 32 or 64 bits mask in hexadecimal\n" +"format is displayed, unless the B<--signames> option is used. (alias\n" +"B, B)." +msgstr "Maske der abgefangenen Signale, siehe I(7). Entsprechend der Feldbreite wird eine 32- oder 64-Bit-Maske in hexadezimalem Format angezeigt, außer wenn die Option B<--signames> verwendet wird (alias B,B<\\ sigcatch>)." + +#. type: tbl table +#: ../man/ps.1:1095 +#, no-wrap +msgid "cgname" +msgstr "cgname" + +#. type: tbl table +#: ../man/ps.1:1095 +#, no-wrap +msgid "CGNAME" +msgstr "CGNAME" + +#. type: tbl table +#: ../man/ps.1:1097 +#, no-wrap +msgid "display name of control groups to which the process belongs." +msgstr "zeigt den Namen der Control-Gruppen an, zu denen der Prozess gehört." + +#. type: tbl table +#: ../man/ps.1:1099 +#, no-wrap +msgid "cgroup" +msgstr "cgroup" + +#. type: tbl table +#: ../man/ps.1:1099 +#, no-wrap +msgid "CGROUP" +msgstr "CGROUP" + +#. type: tbl table +#: ../man/ps.1:1101 +#, no-wrap +msgid "display control groups to which the process belongs." +msgstr "zeigt die Control-Gruppen an, zu denen der Prozess gehört." + +#. type: tbl table +#: ../man/ps.1:1103 +#, no-wrap +msgid "cgroupns" +msgstr "cgroupns" + +#. type: tbl table +#: ../man/ps.1:1103 +#, no-wrap +msgid "CGROUPNS" +msgstr "CGROUPNS" + +#. type: tbl table +#: ../man/ps.1:1107 ../man/ps.1:1374 ../man/ps.1:1427 ../man/ps.1:1433 +#: ../man/ps.1:1524 ../man/ps.1:1836 ../man/ps.1:1911 ../man/ps.1:1922 +#, no-wrap +msgid "" +"Unique inode number describing the namespace the process belongs to.\n" +"See\n" +"I(7)." +msgstr "" +"Eindeutige Inode-Nummer, welche den Namennsraum angibt, zu dem der\n" +"Prozess gehört. Siehe I(7)." + +#. type: tbl table +#: ../man/ps.1:1109 +#, no-wrap +msgid "class" +msgstr "class" + +#. type: tbl table +#: ../man/ps.1:1109 ../man/ps.1:1135 +#, no-wrap +msgid "CLS" +msgstr "CLS" + +#. type: tbl table +#: ../man/ps.1:1113 ../man/ps.1:1139 +#, no-wrap +msgid "" +"scheduling class of the process. (alias\n" +"B, B).\n" +"Field's possible values are:\n" +msgstr "Scheduling-Klasse des Prozesses (alias B, B). Mögliche Werte des Feldes sind:\n" + +#. type: tbl table +#: ../man/ps.1:1113 ../man/ps.1:1139 ../man/ps.1:1537 +#, no-wrap +msgid ".sp 1\n" +msgstr ".sp 1\n" + +#. type: tbl table +#: ../man/ps.1:1114 ../man/ps.1:1140 ../man/ps.1:1538 +#, no-wrap +msgid ".in +9n\n" +msgstr ".in +9n\n" + +#. type: tbl table +#: ../man/ps.1:1116 ../man/ps.1:1142 ../man/ps.1:1540 +#, no-wrap +msgid "-\tnot reported\n" +msgstr "-\tnicht berichtet\n" + +#. type: tbl table +#: ../man/ps.1:1118 ../man/ps.1:1144 ../man/ps.1:1542 +#, no-wrap +msgid "TS\tSCHED_OTHER\n" +msgstr "TS\tSCHED_OTHER\n" + +#. type: tbl table +#: ../man/ps.1:1120 ../man/ps.1:1146 ../man/ps.1:1544 +#, no-wrap +msgid "FF\tSCHED_FIFO\n" +msgstr "FF\tSCHED_FIFO\n" + +#. type: tbl table +#: ../man/ps.1:1122 ../man/ps.1:1148 ../man/ps.1:1546 +#, no-wrap +msgid "RR\tSCHED_RR\n" +msgstr "RR\tSCHED_RR\n" + +#. type: tbl table +#: ../man/ps.1:1124 ../man/ps.1:1150 ../man/ps.1:1548 +#, no-wrap +msgid "B\tSCHED_BATCH\n" +msgstr "B\tSCHED_BATCH\n" + +#. type: tbl table +#: ../man/ps.1:1126 ../man/ps.1:1152 ../man/ps.1:1550 +#, no-wrap +msgid "ISO\tSCHED_ISO\n" +msgstr "ISO\tSCHED_ISO\n" + +#. type: tbl table +#: ../man/ps.1:1128 ../man/ps.1:1154 ../man/ps.1:1552 +#, no-wrap +msgid "IDL\tSCHED_IDLE\n" +msgstr "IDL\tSCHED_IDLE\n" + +#. type: tbl table +#: ../man/ps.1:1130 ../man/ps.1:1156 ../man/ps.1:1554 +#, no-wrap +msgid "DLN\tSCHED_DEADLINE\n" +msgstr "DLN\tSCHED_DEADLINE\n" + +#. type: tbl table +#: ../man/ps.1:1132 ../man/ps.1:1158 ../man/ps.1:1556 +#, no-wrap +msgid "?\tunknown value\n" +msgstr "?\tunbekannter Wert\n" + +#. type: tbl table +#: ../man/ps.1:1132 ../man/ps.1:1158 ../man/ps.1:1556 +#, no-wrap +msgid ".in\n" +msgstr ".in\n" + +#. type: tbl table +#: ../man/ps.1:1135 +#, no-wrap +msgid "cls" +msgstr "cls" + +#. type: tbl table +#: ../man/ps.1:1161 ../man/ps.1:1867 +#, no-wrap +msgid "CMD" +msgstr "CMD" + +#. type: tbl table +#: ../man/ps.1:1166 +#, no-wrap +msgid "" +"see\n" +"B.\n" +"(alias\n" +"B, B)." +msgstr "Siehe B (alias B, B)." + +#. type: tbl table +#: ../man/ps.1:1180 +#, fuzzy, no-wrap +#| msgid "" +#| "command with all its arguments as a string.\n" +#| "Modifications to the arguments may be shown.\n" +#| "The output in this column may contain spaces.\n" +#| "A process marked EdefunctE is partly dead,\n" +#| "waiting to be fully destroyed by its parent.\n" +#| "Sometimes the process args will be unavailable; when this happens,\n" +#| "B\n" +#| "will instead print the executable name in brackets. (alias\n" +#| "B, B).\n" +#| "See also the\n" +#| "B\n" +#| "format keyword, the\n" +#| "B<-f>\n" +#| "option, and the\n" +#| "B\n" +#| "option.\n" +msgid "" +"command name (only the executable name). The output in this column may\n" +"contain spaces.\n" +"(alias\n" +"B, B).\n" +"See also the\n" +"B\n" +"format keyword, the\n" +"B<-f>\n" +"option, and the\n" +"B\n" +"option.\n" +msgstr "Befehl mit allen seinen Argumenten als Zeichenkette. Modifikationen der Argumente können angezeigt werden. Die Ausgabe in dieser Spalte darf Leerräume enthalten. Ein als EdefunctE markierter Prozess ist teilweise tot und wartet darauf, von seinem Elternprozess endgültig zerstört zu werden. Gelegentlich sind die Argumente des Prozesses nicht verfügbar. Falls die passiert, gibt B stattdessen den Namen der ausführbaren Datei in Klammern aus (alias B, B). Siehe auch das Formatschlüsselwort B sowie die Optionen B<-f> und B.\n" + +#. type: tbl table +#: ../man/ps.1:1194 +#, no-wrap +msgid "" +"When specified last, this column will extend to the edge of the display. If\n" +"B\n" +"can not determine display width, as when output is redirected (piped) into a\n" +"file or another command, the output width is undefined (it may be 80,\n" +"unlimited, determined by the\n" +"B\n" +"variable, and so on). The\n" +"B\n" +"environment variable or\n" +"B<--cols>\n" +"option may be used to exactly determine the width in this case. The\n" +"B\\ orB<\\ -w>\n" +"option may be also be used to adjust width." +msgstr "Wenn dies als Letztes angegeben wird, dann wird die letzte Spalte bis zum Rand des Bildschirms verbreitert. Falls B die Bildschirmbreite nicht ermitteln kann, wenn die Ausgabe beispielsweise in eine Datei oder an einen anderen Befehl weitergeleitet wird, ist die Ausgabebreite nicht definiert (sie könnte 80, unbegrenzt, durch die Variable B bestimmt usw. sein). Die Umgebungsvariable B oder die Option B<--cols> können dazu verwendet werden, in diesem Fall die Breite genau festzulegen. Die Optionen B oder B<-w> können auch zur Anpassung der Breite verwendet werden." + +#. type: tbl table +#: ../man/ps.1:1196 +#, no-wrap +msgid "command" +msgstr "command" + +#. type: tbl table +#: ../man/ps.1:1201 +#, no-wrap +msgid "" +"See\n" +"B.\n" +"(alias\n" +"B, B)." +msgstr "Siehe B (alias B, B)." + +#. type: tbl table +#: ../man/ps.1:1203 +#, no-wrap +msgid "cp" +msgstr "cp" + +#. type: tbl table +#: ../man/ps.1:1203 +#, no-wrap +msgid "CP" +msgstr "CP" + +#. type: tbl table +#: ../man/ps.1:1206 +#, no-wrap +msgid "" +"per-mill (tenths of a percent) CPU usage. (see\n" +"B<%cpu>)." +msgstr "CPU-Nutzung in Promille (dem Zehntel eines Prozents; siehe B<%cpu>)." + +#. type: tbl table +#: ../man/ps.1:1208 +#, no-wrap +msgid "cputime" +msgstr "cputime" + +#. type: tbl table +#: ../man/ps.1:1211 +#, no-wrap +msgid "" +"cumulative CPU time, \"[DD-]hh:mm:ss\" format. (alias\n" +"B

" +msgstr "" + +#. type: Plain text +#: ../man/top.1:868 +msgid "A number representing the last used processor. In a true SMP environment this will likely change frequently since the kernel intentionally uses weak affinity. Also, the very act of running \\*(We may break this weak affinity and cause more processes to change \\*(PUs more often (because of the extra demand for \\*(Pu time)." +msgstr "" + +#. type: TP +#: ../man/top.1:869 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:878 +msgid "Every process is member of a unique process group which is used for distribution of signals and by terminals to arbitrate requests for their input and output. When a process is created (forked), it becomes a member of the process group of its parent. By convention, this value equals the process ID (\\*(Xa PID) of the first member of a process group, called the process group leader." +msgstr "" + +#. type: TP +#: ../man/top.1:879 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:884 +msgid "The task's unique process ID, which periodically wraps, though never restarting at zero. In kernel terms, it is a dispatchable entity defined by a task_struct." +msgstr "" + +#. type: Plain text +#: ../man/top.1:889 +#, fuzzy +msgid "This value may also be used as: a process group ID (\\*(Xa PGRP); a session ID for the session leader (\\*(Xa SID); a thread group ID for the thread group leader (\\*(Xa TGID); and a TTY process group ID for the process group leader (\\*(Xa TPGID)." +msgstr "Eindeutige Zahl, die eine … repräsentiert (alias B,B<\\ spid>). Dieser Wert kann auch folgendermaßen erscheinen: als Prozesskennung (pid); als Prozessgruppenkennung (pgrp); als Sitzungskennung für den Sitzungsleiter (sid); als Thread-Gruppenkennung für den Thread-Gruppenleiter (tgid); und als TTY-Prozessgruppenkennung für den Prozessgruppenleiter (tpgid)." + +#. type: TP +#: ../man/top.1:890 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:893 +msgid "The process ID (pid) of a task's parent." +msgstr "" + +#. type: TP +#: ../man/top.1:894 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:899 +msgid "The scheduling priority of the task. If you see `rt' in this field, it means the task is running under real time scheduling priority." +msgstr "" + +#. type: Plain text +#: ../man/top.1:903 +msgid "Under linux, real time priority is somewhat misleading since traditionally the operating itself was not preemptible. And while the 2.6 kernel can be made mostly preemptible, it is not always so." +msgstr "" + +#. type: TP +#: ../man/top.1:904 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:909 +msgid "The proportion of this task's share of `RSS' where each page is divided by the number of processes sharing it. It is also the sum of the `PSan', `PSfd' and `PSsh' fields." +msgstr "" + +#. type: Plain text +#: ../man/top.1:912 +msgid "For example, if a process has 1000 resident pages alone and 1000 resident pages shared with another process, its `PSS' would be 1500 (times page size)." +msgstr "" + +#. type: Plain text +#: ../man/top.1:914 ../man/top.1:927 ../man/top.1:951 ../man/top.1:1114 +msgid "\\*(ZX." +msgstr "\\*(ZX." + +#. type: Plain text +#: ../man/top.1:917 +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:919 +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:921 +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:925 +msgid "As was true for `PSS' above (total proportional resident memory), these fields represent the proportion of this task's share of each type of memory divided by the number of processes sharing it." +msgstr "" + +#. type: TP +#: ../man/top.1:929 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:934 +msgid "A subset of the virtual address space (VIRT) representing the non-swapped \\*(MP a task is currently using. It is also the sum of the `RSan', `RSfd' and `RSsh' fields." +msgstr "" + +#. type: Plain text +#: ../man/top.1:938 +msgid "It can include private anonymous pages, private pages mapped to files (including program images and shared libraries) plus shared anonymous pages. All such memory is backed by the \\*(MS represented separately under SWAP." +msgstr "" + +#. type: Plain text +#: ../man/top.1:941 +msgid "Lastly, this field may also include shared file-backed pages which, when modified, act as a dedicated \\*(MS and thus will never impact SWAP." +msgstr "" + +#. type: TP +#: ../man/top.1:944 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:949 +msgid "Another, more precise view of process non-swapped \\*(MP. It is obtained from the `smaps_rollup' file and is generally slightly larger than that shown for `RES'." +msgstr "" + +#. type: TP +#: ../man/top.1:952 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:956 +msgid "A subset of resident memory (RES) representing private pages not mapped to a file." +msgstr "" + +#. type: TP +#: ../man/top.1:957 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:962 +msgid "A subset of resident memory (RES) representing the implicitly shared pages supporting program images and shared libraries. It also includes explicit file mappings, both private and shared." +msgstr "" + +#. type: TP +#: ../man/top.1:963 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:966 +msgid "A subset of resident memory (RES) which cannot be swapped out." +msgstr "" + +#. type: TP +#: ../man/top.1:967 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:971 +msgid "A subset of resident memory (RES) representing the explicitly shared anonymous shm*/mmap pages." +msgstr "" + +#. type: TP +#: ../man/top.1:972 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:975 +#, fuzzy +#| msgid "The next expression is a username." +msgid "TheI< real> user ID." +msgstr "Der nächste Ausdruck ist ein Benutzername." + +#. type: TP +#: ../man/top.1:976 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:979 +#, fuzzy +#| msgid "The next expression is a username." +msgid "TheI< real> user name." +msgstr "Der nächste Ausdruck ist ein Benutzername." + +#. type: TP +#: ../man/top.1:980 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:990 +#, no-wrap +msgid "" +"The status of the task which can be one of:\n" +" B = uninterruptible sleep\n" +" B = idle\n" +" B = running\n" +" B = sleeping\n" +" B = stopped by job control signal\n" +" B = stopped by debugger during trace\n" +" B = zombie\n" +msgstr "" + +#. type: Plain text +#: ../man/top.1:995 +msgid "Tasks shown as running should be more properly thought of as ready to run \\*(Em their task_struct is simply represented on the Linux run-queue. Even without a true SMP machine, you may see numerous tasks in this state depending on \\*(We's delay interval and nice value." +msgstr "" + +#. type: TP +#: ../man/top.1:996 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1002 +msgid "A subset of resident memory (RES) that may be used by other processes. It will include shared anonymous pages and shared file-backed pages. It also includes private pages mapped to files representing program images and shared libraries." +msgstr "" + +#. type: TP +#: ../man/top.1:1005 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1013 +msgid "A session is a collection of process groups (\\*(Xa PGRP), usually established by the login shell. A newly forked process joins the session of its creator. By convention, this value equals the process ID (\\*(Xa PID) of the first member of the session, called the session leader, which is usually the login shell." +msgstr "" + +#. type: TP +#: ../man/top.1:1014 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1018 +msgid "The length of time since system boot when a process started. Thus, the most recently started task will display the largest time interval." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1022 +msgid "The value will be expressed as `MM:SS' (minutes:seconds). But if the interval is too great to fit column width it will be scaled as `HH,MM' (hours,minutes) and possibly beyond." +msgstr "" + +#. type: TP +#: ../man/top.1:1023 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1026 +#, fuzzy +#| msgid "The next expression is a username." +msgid "TheI< saved> user ID." +msgstr "Der nächste Ausdruck ist ein Benutzername." + +#. type: TP +#: ../man/top.1:1027 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1032 +msgid "The IDs of any supplementary group(s) established at login or inherited from a task's parent. They are displayed in a comma delimited list." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1036 +msgid "\\*(NT The SUPGIDS field, unlike most columns, is not fixed-width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum \\*(WX characters)." +msgstr "" + +#. type: TP +#: ../man/top.1:1037 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1042 +msgid "The names of any supplementary group(s) established at login or inherited from a task's parent. They are displayed in a comma delimited list." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1046 +msgid "\\*(NT The SUPGRPS field, unlike most columns, is not fixed-width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum \\*(WX characters)." +msgstr "" + +#. type: TP +#: ../man/top.1:1047 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1050 +#, fuzzy +#| msgid "The next expression is a username." +msgid "TheI< saved> user name." +msgstr "Der nächste Ausdruck ist ein Benutzername." + +#. type: TP +#: ../man/top.1:1051 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1055 +msgid "The formerly resident portion of a task's address space written to the \\*(MS when \\*(MP becomes over committed." +msgstr "" + +#. type: TP +#: ../man/top.1:1058 +#, no-wrap +msgid "B" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1063 +msgid "The ID of the thread group to which a task belongs. It is the PID of the thread group leader. In kernel terms, it represents those tasks that share an mm_struct." +msgstr "" + +#. type: TP +#: ../man/top.1:1064 +#, no-wrap +msgid "B' and `B' keys can be used to cycle through all available windows and the `B' or EBE keys exit Fields Management." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1274 +msgid "The Fields Management screen can also be used to change the \\*(CG in either \\*(FM or \\*(AM. Whatever was targeted when `q' or EEscE was pressed will be made current as you return to the \\*(We display. \\*(XT 5. ALTERNATE-DISPLAY Provisions and the `g' \\*(CI for insight into \\*(CWs and \\*(FGs." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1281 +msgid "\\*(NT Any window that has been scrolledI< horizontally> will be reset if any field changes are made via the Fields Management screen. AnyI< vertical> scrolled position, however, will not be affected. \\*(XT 5c. SCROLLING a Window for additional information regarding vertical and horizontal scrolling." +msgstr "" + +#. ---------------------------------------------------------------------- +#. type: SH +#: ../man/top.1:1283 +#, no-wrap +msgid "4. INTERACTIVE Commands" +msgstr "" + +#. ---------------------------------------------------------------------- +#. type: Plain text +#: ../man/top.1:1288 +msgid "Listed below is a brief index of commands within categories. Some commands appear more than once \\*(Em their meaning or scope may vary depending on the context in which they are issued." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1311 +#, no-wrap +msgid "" +" 4a.I< Global-Commands >\n" +" EEnt/SpE ?, =, 0,\n" +" A, B, d, E, e, g, H, h, I, k, q, r, s, W, X, Y, Z,\n" +" ^G, ^K, ^N, ^P, ^U, ^L, ^R\n" +" 4b.I< Summary-Area-Commands >\n" +" C, l, t, m, 1, 2, 3, 4, 5, !\n" +" 4c.I< Task-Area-Commands >\n" +" Appearance: b, J, j, x, y, z\n" +" Content: c, F, f, O, o, S, U, u, V, v, ^E\n" +" Size: #, i, n\n" +" Sorting: E, E, f, R\n" +" 4d.I< Color-Mapping >\n" +" ERetE, a, B, b, H, M, q, S, T, w, z, 0 - 7\n" +" 5b.I< Commands-for-Windows >\n" +" -, _, =, +, A, a, G, g, w\n" +" 5c.I< Scrolling-a-Window >\n" +" C, Up, Dn, Left, Right, PgUp, PgDn, Home, End\n" +" 5d.I< Searching-in-a-Window >\n" +" L, &\n" +" 5e.I< Filtering-in-a-Window\n" +" O, o, ^O, =, +>\n" +msgstr "" + +#. ...................................................................... +#. type: SS +#: ../man/top.1:1314 +#, no-wrap +msgid "4a. GLOBAL Commands" +msgstr "" + +#. ---------------------------------------------------------------------- +#. type: Plain text +#: ../man/top.1:1319 +msgid "The global \\*(CIs areB< always> available in both \\*(FM and \\*(AM. However, some of these \\*(CIs areB< not available> when running in Secure mode." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1323 +msgid "If you wish to know in advance whether or not your \\*(We has been secured, simply ask for help and view the system summary on the second line." +msgstr "" + +#. type: TP +#: ../man/top.1:1324 +#, no-wrap +msgid "\\ \\ EBE or EBE\\ \\ :I" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1329 +msgid "These commands awaken \\*(We and following receipt of any input the entire display will be repainted. They also force an update of any hotplugged \\*(Pu or \\*(MP changes." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1332 +msgid "Use either of these keys if you have a large delay interval and wish to see current status," +msgstr "" + +#. type: TP +#: ../man/top.1:1333 +#, no-wrap +msgid "\\ \\ \\ B | B\\ \\ :I" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1338 +msgid "There are two help levels available. The first will provide a reminder of all the basic \\*(CIs. If \\*(We isI< secured>, that screen will be abbreviated." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1341 +msgid "Typing `h' or `?' on that help screen will take you to help for those \\*(CIs applicable to \\*(AM." +msgstr "" + +#. type: TP +#: ../man/top.1:1342 +#, no-wrap +msgid "\\ \\ \\ B<=>\\ \\ :I" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1349 +msgid "Removes restrictions on what is shown. This command will reverse any `i' (idle tasks), `n' (max tasks), `v' (hide children) and `F' focus commands that might be active. It also provides for an exit from PID monitoring, User filtering, Other filtering, Locate processing and Combine Cpus mode." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1352 +msgid "Additionally, if the window has been scrolled it will be reset with this command." +msgstr "" + +#. type: TP +#: ../man/top.1:1353 +#, no-wrap +msgid "\\ \\ \\ B<0>\\ \\ :I toggle " +msgstr "" + +#. type: Plain text +#: ../man/top.1:1358 +msgid "This command determines whether zeros are shown or suppressed for many of the fields in a \\*(TW. Fields like UID, GID, NI, PR or P are not affected by this toggle." +msgstr "" + +#. type: TP +#: ../man/top.1:1359 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I toggle " +msgstr "" + +#. type: Plain text +#: ../man/top.1:1364 +msgid "This command will switch between \\*(FM and \\*(AM. \\*(XT 5. ALTERNATE-DISPLAY Provisions and the `g' \\*(CI for insight into \\*(CWs and \\*(FGs." +msgstr "" + +#. type: TP +#: ../man/top.1:1365 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I toggle " +msgstr "" + +#. type: Plain text +#: ../man/top.1:1371 +msgid "This command will influence use of the bold terminfo capability and altersB< both> the \\*(SA and \\*(TA for the \\*(CW. While it is intended primarily for use with dumb terminals, it can be applied anytime." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1376 +msgid "\\*(NT When this toggle is \\*O and \\*(We is operating in monochrome mode, theB< entire display> will appear as normal text. Thus, unless the `x' and/or `y' toggles are using reverse for emphasis, there will be no visual confirmation that they are even on." +msgstr "" + +#. type: TP +#: ../man/top.1:1377 +#, no-wrap +msgid "*\\ \\ B | B\\ \\ :I" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1381 +msgid "You will be prompted to enter the delay time, in seconds, between display updates." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1387 +msgid "Fractional seconds are honored, but a negative number is not allowed. Entering 0 causes (nearly) continuous updates, with an unsatisfactory display as the system and tty driver try to keep up with \\*(We's demands. The delay value is inversely proportional to system loading, so set it with care." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1390 +msgid "If at any time you wish to know the current delay time, simply ask for help and view the system summary on the second line." +msgstr "" + +#. type: TP +#: ../man/top.1:1391 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I in Summary Area" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1396 +msgid "With this command you can cycle through the available \\*(SA memory scaling which ranges from KiB (kibibytes or 1,024 bytes) through EiB (exbibytes or 1,152,921,504,606,846,976 bytes)." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1400 +msgid "If you see a `+' between a displayed number and the following label, it means that \\*(We was forced to truncate some portion of that number. By raising the scaling factor, such truncation can be avoided." +msgstr "" + +#. type: TP +#: ../man/top.1:1401 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I in Task Area" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1406 +msgid "With this command you can cycle through the available \\*(TA memory scaling which ranges from KiB (kibibytes or 1,024 bytes) through PiB (pebibytes or 1,125,899,906,842,624 bytes)." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1413 +msgid "While \\*(We will try to honor the selected target range, additional scaling might still be necessary in order to accommodate current values. If you wish to see a more homogeneous result in the memory columns, raising the scaling range will usually accomplish that goal. Raising it too high, however, is likely to produce an all zero result which cannot be suppressed with the `0' \\*(CI." +msgstr "" + +#. type: TP +#: ../man/top.1:1414 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1420 +msgid "You will be prompted to enter a number between 1 and 4 designating the \\*(FG which should be made the \\*(CW. You will soon grow comfortable with these 4 windows, especially after experimenting with \\*(AM." +msgstr "" + +#. type: TP +#: ../man/top.1:1421 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I toggle " +msgstr "" + +#. type: Plain text +#: ../man/top.1:1426 +msgid "When this toggle is \\*O, individual threads will be displayed for all processes in all visible \\*(TWs. Otherwise, \\*(We displays a summation of all threads in each process." +msgstr "" + +#. type: TP +#: ../man/top.1:1427 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I toggle " +msgstr "" + +#. type: Plain text +#: ../man/top.1:1432 +msgid "When operating in Solaris mode (`I' toggled \\*F), a task's \\*(Pu usage will be divided by the total number of \\*(PUs. After issuing this command, you'll be told the new state of this toggle." +msgstr "" + +#. type: TP +#: ../man/top.1:1433 +#, no-wrap +msgid "*\\ \\ B\\ \\ :I" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1436 +msgid "You will be prompted for a PID and then the signal to send." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1440 ../man/top.1:1462 +msgid "Entering no PID or a negative number will be interpreted as the default shown in the prompt (the first task displayed). A PID value of zero means the \\*(We program itself." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1443 +msgid "The default signal, as reflected in the prompt, is SIGTERM. However, you can send any signal, via number or name." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1446 +msgid "If you wish to abort the kill process, do one of the following depending on your progress:" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1450 +#, no-wrap +msgid "" +" 1) at the pid prompt, type an invalid number\n" +" 2) at the signal prompt, type 0 (or any invalid signal)\n" +" 3) at any prompt, type EEscE\n" +msgstr "" + +#. type: TP +#: ../man/top.1:1452 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I" +msgstr "" + +#. type: TP +#: ../man/top.1:1455 +#, no-wrap +msgid "*\\ \\ B\\ \\ :I" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1458 +msgid "You will be prompted for a PID and then the value to nice it to." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1468 +msgid "A positive nice value will cause a process to lose priority. Conversely, a negative nice value will cause a process to be viewed more favorably by the kernel. As a general rule, ordinary users can only increase the nice value and are prevented from lowering it." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1471 +msgid "If you wish to abort the renice process, do one of the following depending on your progress:" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1475 +#, no-wrap +msgid "" +" 1) at the pid prompt, type an invalid number\n" +" 2) at the nice prompt, type EEnterE with no input\n" +" 3) at any prompt, type EEscE\n" +msgstr "" + +#. type: TP +#: ../man/top.1:1477 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1483 +msgid "This will save all of your options and toggles plus the current display mode and delay time. By issuing this command just before quitting \\*(We, you will be able restart later in exactly that same state." +msgstr "" + +#. type: TP +#: ../man/top.1:1484 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1489 +msgid "Some fields are fixed width and not scalable. As such, they are subject to truncation which would be indicated by a `+' in the last position." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1491 +msgid "This \\*(CI can be used to alter the widths of the following fields:" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1503 +#, no-wrap +msgid "" +" I< field default field default field default >\n" +" GID 5 GROUP 8 WCHAN 10\n" +" LOGID 5 LXC 8 nsCGROUP 10\n" +" RUID 5 RUSER 8 nsIPC 10\n" +" SUID 5 SUSER 8 nsMNT 10\n" +" UID 5 TTY 8 nsNET 10\n" +" USER 8 nsPID 10\n" +" nsTIME 10\n" +" nsUSER 10\n" +" nsUTS 10\n" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1508 +msgid "You will be prompted for the amount to be added to the default widths shown above. Entering zero forces a return to those defaults." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1511 +msgid "If you enter a negative number, \\*(We will automatically increase the column size as needed until there is no more truncated data." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1515 +msgid "\\*(NT Whether explicitly or automatically increased, the widths for these fields are never decreased by \\*(We. To narrow them you must specify a smaller number or restore the defaults." +msgstr "" + +#. type: TP +#: ../man/top.1:1516 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1522 +msgid "After issuing the `Y' \\*(CI, you will be prompted for a target PID. Typing a value or accepting the default results in a separate screen. That screen can be used to view a variety of files or piped command output while the normal \\*(We iterative display is paused." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1526 +msgid "\\*(NT This \\*(CI is only fully realized when supporting entries have been manually added to the end of the \\*(We \\*(CF. For details on creating those entries, \\*(Xt 6b. ADDING INSPECT Entries." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1533 +msgid "Most of the keys used to navigate the Inspect feature are reflected in its header prologue. There are, however, additional keys available once you have selected a particular file or command. They are familiar to anyone who has used the pager `less' and are summarized here for future reference." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1543 +#, no-wrap +msgid "" +" I< key function >\n" +" = alternate status-line, file or pipeline\n" +" / find, equivalent to `L' locate\n" +" n find next, equivalent to `&' locate next\n" +" ESpaceE scroll down, equivalent to EPgDnE\n" +" b scroll up, equivalent to EPgUpE\n" +" g first line, equivalent to EHomeE\n" +" G last line, equivalent to EEndE\n" +msgstr "" + +#. type: TP +#: ../man/top.1:1545 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1550 +msgid "This key will take you to a separate screen where you can change the colors for the \\*(CW, or for all windows. For details regarding this \\*(CI \\*(Xt 4d. COLOR Mapping." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1553 +msgid "\\ \\ B<^G>\\ \\ :I (Ctrl key + `g')" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1555 +msgid "\\ \\ B<^K>\\ \\ :I (Ctrl key + `k')" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1557 +msgid "\\ \\ B<^N>\\ \\ :I (Ctrl key + `n')" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1559 +msgid "\\ \\ B<^P>\\ \\ :I (Ctrl key + `p')" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1561 +msgid "\\ \\ B<^U>\\ \\ :I (Ctrl key + `u')" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1567 +msgid "Applied to the first process displayed, these commands will show that task's full (potentially wrapped) information. Such data will be displayed in a separate window at the bottom of the screen while normal \\*(We monitoring continues." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1572 +msgid "Keying theI< same> `Ctrl' command a second time removes that separate window as does the `=' command. Keying a different `Ctrl' combination, while one is already active, immediately transitions to the new information." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1577 +msgid "Notable among these provisions is the Ctrl+N (environment) command. Its output can be extensive and not easily read when line wrapped. A more readable version can be achieved with an `Inspect' entry in the rcfile like the following." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1580 +#, no-wrap +msgid " pipe ^I Environment ^I cat /proc/%d/environ | tr '\\e0' '\\en'\n" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1584 +msgid "\\*(XC `Y' \\*(CI above and topic 6b. ADDING INSPECT Entries for additional information." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1588 +msgid "As an alternative to `Inspect', and available to all of these `Ctrl' commands, the tab key can be used to highlight individual elements in the bottom window." +msgstr "" + +#. type: TP +#: ../man/top.1:1590 +#, no-wrap +msgid "\\ \\ B<^L>\\ \\ :I (Ctrl key + `l')" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1596 +msgid "The 10 most recent messages are displayed in a separate window at the bottom of the screen while normal \\*(We monitoring continues. Keying `^L' a second time removes that window as does the `=' command. Use the tab key to highlight individual messages." +msgstr "" + +#. type: TP +#: ../man/top.1:1597 +#, no-wrap +msgid "*\\ B<^R>\\ \\ :I (Ctrl key + `r')" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1601 +msgid "You will be prompted for a PID and then the value for its autogroup AGNI." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1604 +msgid "Entering no PID will be interpreted as the default shown in the prompt (the first task displayed)." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1610 +msgid "A positive AGNI value will cause processes in that autogroup to lose priority. Conversely, a negative value causes them to be viewed more favorably by the kernel. Ordinary users are not allowed to set negative AGNI values." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1612 +msgid "If you wish to abort the renice process type EEscE." +msgstr "" + +#. type: IP +#: ../man/top.1:1613 ../man/top.1:2134 +#, no-wrap +msgid "*" +msgstr "*" + +#. type: Plain text +#: ../man/top.1:1616 +msgid "The commands shown with an \\*(AK are not available in Secure mode, nor will they be shown on the level-1 help screen." +msgstr "" + +#. ...................................................................... +#. type: SS +#: ../man/top.1:1618 +#, no-wrap +msgid "4b. SUMMARY AREA Commands" +msgstr "" + +#. ---------------------------------------------------------------------- +#. type: Plain text +#: ../man/top.1:1623 +msgid "The \\*(SA \\*(CIs areB< always available> in both \\*(FM and \\*(AM. They affect the beginning lines of your display and will determine the position of messages and prompts." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1627 +msgid "These commands always impact just the \\*(CG. \\*(XT 5. ALTERNATE-DISPLAY Provisions and the `g' \\*(CI for insight into \\*(CWs and \\*(FGs." +msgstr "" + +#. type: TP +#: ../man/top.1:1628 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I toggle " +msgstr "" + +#. type: Plain text +#: ../man/top.1:1633 +msgid "Toggle an informational message which is displayed whenever the message line is not otherwise being used. For additional information \\*(Xt 5c. SCROLLING a Window." +msgstr "" + +#. type: TP +#: ../man/top.1:1634 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I toggle " +msgstr "" + +#. type: Plain text +#: ../man/top.1:1638 +msgid "This is also the line containing the program name (possibly an alias) when operating in \\*(FM or the \\*(CW name when operating in \\*(AM." +msgstr "" + +#. type: TP +#: ../man/top.1:1639 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I toggle " +msgstr "" + +#. type: Plain text +#: ../man/top.1:1644 +msgid "This command affects from 2 to many \\*(SA lines, depending on the state of the `1', `2' or `3' \\*(CTs and whether or not \\*(We is running under true SMP." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1647 +msgid "This portion of the \\*(SA is also influenced by the `H' \\*(CI toggle, as reflected in the total label which shows either Tasks or Threads." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1649 ../man/top.1:1666 +msgid "This command serves as a 4-way toggle, cycling through these modes:" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1654 +#, no-wrap +msgid "" +" 1. detailed percentages by category\n" +" 2. abbreviated user/system and total % + bar graph\n" +" 3. abbreviated user/system and total % + block graph\n" +" 4. turn off task and cpu states display\n" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1659 +msgid "When operating in either of the graphic modes, the display becomes much more meaningful when individual CPUs or NUMA nodes are also displayed. \\*(XC the `1', `2' and `3' commands below for additional information." +msgstr "" + +#. type: TP +#: ../man/top.1:1660 +#, no-wrap +msgid "\\ \\ \\ B\\ \\ :I toggle " +msgstr "" + +#. type: Plain text +#: ../man/top.1:1664 +msgid "This command affects the two \\*(SA lines dealing with physical and virtual memory." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1671 +#, no-wrap +msgid "" +" 1. detailed percentages by memory type\n" +" 2. abbreviated % used/total available + bar graph\n" +" 3. abbreviated % used/total available + block graph\n" +" 4. turn off memory display\n" +msgstr "" + +#. type: TP +#: ../man/top.1:1673 +#, no-wrap +msgid "\\ \\ \\ B<1>\\ \\ :I toggle " +msgstr "" + +#. type: Plain text +#: ../man/top.1:1678 +msgid "This command affects how the `t' command's Cpu States portion is shown. Although this toggle exists primarily to serve massively-parallel SMP machines, it is not restricted to solely SMP environments." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1683 +msgid "When you see `%Cpu(s):' in the \\*(SA, the `1' toggle is \\*O and all \\*(Pu information is gathered in a single line. Otherwise, each \\*(Pu is displayed separately as: `%Cpu0, %Cpu1, ...' up to available screen height." +msgstr "" + +#. type: TP +#: ../man/top.1:1684 +#, no-wrap +msgid "\\ \\ \\ B<2>\\ \\ :I toggle " +msgstr "" + +#. type: Plain text +#: ../man/top.1:1689 +msgid "This command toggles between the `1' command cpu summary display (only) or a summary display plus the cpu usage statistics for each NUMA Node. It is only available if a system has the requisite NUMA support." +msgstr "" + +#. type: TP +#: ../man/top.1:1690 +#, no-wrap +msgid "\\ \\ \\ B<3>\\ \\ :I" +msgstr "" + +#. type: Plain text +#: ../man/top.1:1696 +msgid "You will be invited to enter a number representing a NUMA Node. Thereafter, a node summary plus the statistics for each cpu in that node will be shown until the `1', `2' or `4' \\*(CT is pressed. This \\*(CI is only available if a system has the requisite NUMA support." +msgstr "" + +#. type: TP +#: ../man/top.1:1697 +#, no-wrap +msgid "\\ \\ \\ B<4>\\ \\ :I toggle " +msgstr "" + +#. type: Plain text +#: ../man/top.1:1703 +msgid "This \\*(CT turns the `1' toggle \\*F and shows multiple \\*(PU and Memory results on each line. Each successive `4' key adds another \\*(PU until again reverting to separate lines for \\*(PU and Memory results." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1709 +msgid "A maximum of 8 \\*(PUs per line can be displayed in this manner. However, data truncation may occur before reaching the maximum. That is definitely true when displaying detailed statistics via the `t' \\*(CT since such data cannot be scaled like the graphic representations." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1712 +msgid "If one wished to quickly exit adjacent mode without cycling all the way to 8, simply use the `1' \\*(CT." +msgstr "" + +#. type: TP +#: ../man/top.1:1713 +#, no-wrap +msgid "\\ \\ \\ B<5>\\ \\ :I toggle " +msgstr "" + +#. type: Plain text +#: ../man/top.1:1719 +msgid "This \\*(CT is only active when the `t' toggle is \\*O and the `1', `2', `3' and `!' toggles are \\*F, thus showing individual \\*(PU results. It assumes a platform has multiple cores of two distinct types, either multi-threaded (P-Core) or single-threaded (E-Core)." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1723 +msgid "While normally each \\*(Pu is displayed as `%Cpu0, %Cpu1, ...', this toggle can be used to identify and/or filter those \\*(Pus by their core type, either P-Core (performance) or E-Core (efficient)." +msgstr "" + +#. type: Plain text +#: ../man/top.1:1730 +msgid "The 1st time `5' is struck, each \\*(PU is displayed as `%CpB